summaryrefslogtreecommitdiffstats
path: root/apps/files_texteditor/js/editor.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_texteditor/js/editor.js')
-rw-r--r--apps/files_texteditor/js/editor.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/apps/files_texteditor/js/editor.js b/apps/files_texteditor/js/editor.js
index 70bb74a9101..3784ea1032f 100644
--- a/apps/files_texteditor/js/editor.js
+++ b/apps/files_texteditor/js/editor.js
@@ -222,9 +222,17 @@ function showFileEditor(dir,filename){
}
});
// Add the ctrl+s event
- window.aceEditor.commands.addCommand({ name: "save", bindKey: { win: "Ctrl-S", mac: "Command-S", sender: "editor" }, exec: function(){
+ window.aceEditor.commands.addCommand({
+ name: "save",
+ bindKey: {
+ win: "Ctrl-S",
+ mac: "Command-S",
+ sender: "editor"
+ },
+ exec: function(){
doFileSave();
- } });
+ }
+ });
});
} else {
// Failed to get the file.
@@ -297,11 +305,11 @@ $(window).resize(function() {
var is_editor_shown = false;
$(document).ready(function(){
if(typeof FileActions!=='undefined'){
- FileActions.register('text','Edit','',function(filename){
+ FileActions.register('text','Edit', FileActions.PERMISSION_READ, '',function(filename){
showFileEditor($('#dir').val(),filename);
});
FileActions.setDefault('text','Edit');
- FileActions.register('application/xml','Edit','',function(filename){
+ FileActions.register('application/xml','Edit', FileActions.PERMISSION_READ, '',function(filename){
showFileEditor($('#dir').val(),filename);
});
FileActions.setDefault('application/xml','Edit');