From: Robin Appelman Date: Wed, 5 Oct 2011 00:44:24 +0000 (+0200) Subject: use texteditor for search results X-Git-Tag: v3.0~106 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=15e5bd16ab8e812f0997171431a9d8e050df899e;p=nextcloud-server.git use texteditor for search results --- diff --git a/apps/files_texteditor/appinfo/info.xml b/apps/files_texteditor/appinfo/info.xml index becfd5e35c8..9ed9d207f46 100644 --- a/apps/files_texteditor/appinfo/info.xml +++ b/apps/files_texteditor/appinfo/info.xml @@ -1,10 +1,10 @@ - files_textviewer - Text viewer + files_texteditor + Text Editor 0.3 AGPL - Robin Appelman + Tom Needham 2 diff --git a/apps/files_texteditor/js/editor.js b/apps/files_texteditor/js/editor.js index 1168ec06a75..4758a5948bd 100644 --- a/apps/files_texteditor/js/editor.js +++ b/apps/files_texteditor/js/editor.js @@ -195,4 +195,15 @@ $(document).ready(function(){ }); FileActions.setDefault('application/xml','Edit'); } + OC.search.customResults.Text=function(row,item){ + var text=item.link.substr(item.link.indexOf('file=')+5); + var a=row.find('a'); + a.data('file',text); + a.attr('href','#'); + a.click(function(){ + var file=text.split('/').pop(); + var dir=text.substr(0,text.length-file.length-1); + showFileEditor(dir,file); + }); + } });