]> source.dussan.org Git - nextcloud-server.git/commitdiff
use texteditor for search results
authorRobin Appelman <icewind1991@gmail.com>
Wed, 5 Oct 2011 00:44:24 +0000 (02:44 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Wed, 5 Oct 2011 00:44:24 +0000 (02:44 +0200)
apps/files_texteditor/appinfo/info.xml
apps/files_texteditor/js/editor.js

index becfd5e35c83255b76e95a65a1a7addaa8b9627a..9ed9d207f467bfe2ec36da4233e3a35db5838533 100644 (file)
@@ -1,10 +1,10 @@
 <?xml version="1.0"?> 
 <info>
-       <id>files_textviewer</id>
-       <name>Text viewer</name>
+       <id>files_texteditor</id>
+       <name>Text Editor</name>
        <version>0.3</version>
        <licence>AGPL</licence>
-       <author>Robin Appelman</author>
+       <author>Tom Needham</author>
        <require>2</require>
        <default_enable/>
 </info>
index 1168ec06a751522a0a2a336d9cd68f1feb6490d5..4758a5948bdf5aa84350733562c940df4dfa4933 100644 (file)
@@ -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);
+               });
+       }
 });