aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2011-09-28 21:25:25 +0100
committerTom Needham <needham.thomas@gmail.com>2011-09-28 21:25:25 +0100
commitbc7289bb284db0fe100be9e354fb4bcbc2d5b5b3 (patch)
tree204fdc3282fa6260eba837eb42a588d627eadfcf
parent4fe993a55dd998146c36c6cc2aa190cbac82abde (diff)
downloadnextcloud-server-bc7289bb284db0fe100be9e354fb4bcbc2d5b5b3.tar.gz
nextcloud-server-bc7289bb284db0fe100be9e354fb4bcbc2d5b5b3.zip
Changed theme. Editing is now default action for all supported types. Fixed static url.
-rw-r--r--apps/editor/index.php3
-rw-r--r--apps/editor/js/editor.js16
-rw-r--r--apps/files_textviewer/js/textviewer.js2
-rw-r--r--files/js/fileactions.js17
4 files changed, 19 insertions, 19 deletions
diff --git a/apps/editor/index.php b/apps/editor/index.php
index 701104f0a81..b4a15c5d208 100644
--- a/apps/editor/index.php
+++ b/apps/editor/index.php
@@ -45,6 +45,7 @@ if(substr_count($file,'.')!=0){
$plaintypes = array('txt','doc','rtf');
$filetype = 'plain';
if(!in_array($parts[1],$plaintypes)){
+ // TODO ADD THESE
$types = array('php' => 'php',
'js' => 'javascript',
'html' => 'html');
@@ -58,7 +59,7 @@ if(substr_count($file,'.')!=0){
}
// Add theme
-OC_UTIL::addScript('editor','aceeditor/theme-cobalt');
+OC_UTIL::addScript('editor','aceeditor/theme-clouds');
OC_App::setActiveNavigationEntry( 'editor_index' );
diff --git a/apps/editor/js/editor.js b/apps/editor/js/editor.js
index 324666110d8..8c7ae5856de 100644
--- a/apps/editor/js/editor.js
+++ b/apps/editor/js/editor.js
@@ -1,5 +1,7 @@
$(document).ready(function(){
+
+
// Set the editor size.
doEditorResize();
@@ -15,7 +17,7 @@ $(document).ready(function(){
}
// Set the theme
- aceEditor.setTheme("ace/theme/cobalt");
+ aceEditor.setTheme("ace/theme/clouds");
// Process the save button click event
$('#editor_save').click(function(){
@@ -53,18 +55,6 @@ $(document).ready(function(){
// TODO give focus back to the editor
// window.aceEditor.focus();
});
-
- /*
- // Process the gotoline button click event
- $('#editor_goToLine').click(function(){
- var html = '<div id="dropdown" class="drop"><input type="text" id="editot_goToLine_line" size="20"><input type="button" id="editor_goToLine_gp" value="<?php echo $l->t(\'Go\'); ?>"></div>';
- $(html).appendTo($('#editor_goToLine'));
- $('#dropdown').show('blind');
-
- //window.aceEditor.gotoLine(100);
- //TODO GIVE FOCUS BACK
- });
- */
// Process the window resize event
$(window).resize(function() {
diff --git a/apps/files_textviewer/js/textviewer.js b/apps/files_textviewer/js/textviewer.js
index 143c97c9d47..0bc56db8da1 100644
--- a/apps/files_textviewer/js/textviewer.js
+++ b/apps/files_textviewer/js/textviewer.js
@@ -106,6 +106,7 @@ TextViewer.loadHighlighter=function(ready){
}
$(document).ready(function() {
+ /*
if(typeof FileActions!=='undefined'){
FileActions.register('text','View','',function(filename){
TextViewer.showText($('#dir').val(),filename);
@@ -116,6 +117,7 @@ $(document).ready(function() {
});
FileActions.setDefault('application/xml','View');
}
+ */
OC.search.customResults.Text=function(row,item){
var text=item.link.substr(item.link.indexOf('file=')+5);
var a=row.find('a');
diff --git a/files/js/fileactions.js b/files/js/fileactions.js
index 5d31af40376..d688973e53c 100644
--- a/files/js/fileactions.js
+++ b/files/js/fileactions.js
@@ -135,14 +135,21 @@ FileActions.register('all','Delete',function(){return OC.imagePath('core','actio
FileActions.register('all','Rename',function(){return OC.imagePath('core','actions/rename')},function(filename){
FileList.rename(filename);
});
-FileActions.register('text','Edit',function(){return OC.imagePath('core','actions/rename')},function(filename){
- window.location='/apps/editor/index.php?file='+filename+'&dir='+$('#dir').val();
-});
-
-//FileActions.setDefault('all','Download');
FileActions.register('dir','Open','',function(filename){
window.location='index.php?dir='+$('#dir').val()+'/'+filename;
});
FileActions.setDefault('dir','Open');
+
+FileActions.register('text','Edit','',function(filename){
+ window.location=OC.linkTo('editor', 'index.php')+'?file='+filename+'&dir='+$('#dir').val();
+});
+
+FileActions.setDefault('text','Edit');
+
+FileActions.register('application/xml','Edit','',function(filename){
+ window.location=OC.linkTo('editor', 'index.php')+'?file='+filename+'&dir='+$('#dir').val();
+});
+
+FileActions.setDefault('application/xml','Edit');