mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-08-03 13:13:10 +00:00
feature(edit) add beautify
This commit is contained in:
parent
7c6d963b6e
commit
3ee321bbce
5 changed files with 38 additions and 10 deletions
|
|
@ -239,6 +239,14 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip, MenuI
|
|||
exec : save
|
||||
});
|
||||
|
||||
Ace.commands.addCommand({
|
||||
name : 'beautify',
|
||||
bindKey : { win: 'Ctrl-B', mac: 'Command-B' },
|
||||
exec : function() {
|
||||
Edit.beautify();
|
||||
}
|
||||
});
|
||||
|
||||
ace.require('ace/ext/language_tools');
|
||||
Modelist = ace.require('ace/ext/modelist');
|
||||
|
||||
|
|
@ -400,6 +408,9 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip, MenuI
|
|||
'Delete Del' : function() {
|
||||
Ace.remove('right');
|
||||
},
|
||||
'Beautify Ctrl+B' : function() {
|
||||
Edit.beautify();
|
||||
},
|
||||
'Close Esc' : Edit.hide
|
||||
};
|
||||
|
||||
|
|
@ -471,7 +482,15 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip, MenuI
|
|||
}
|
||||
}
|
||||
|
||||
function onDrop(event) {
|
||||
Edit.beautify = function() {
|
||||
var path = Info.path;
|
||||
|
||||
RESTful.read(path + '?beautify', function(data) {
|
||||
Ace.setValue(data);
|
||||
});
|
||||
};
|
||||
|
||||
function onDrop(event) {
|
||||
var reader, files,
|
||||
onLoad = function(event) {
|
||||
var data = event.target.result;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue