mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
feature(edit) update ace
This commit is contained in:
parent
570a117d93
commit
d64c7a0a3d
3 changed files with 802 additions and 392 deletions
|
|
@ -13,6 +13,7 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch;
|
|||
Edit = this,
|
||||
Diff,
|
||||
Ace,
|
||||
Session,
|
||||
Modelist,
|
||||
Msg,
|
||||
Dialog = DOM.Dialog,
|
||||
|
|
@ -42,8 +43,7 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch;
|
|||
this.show = function(pValue) {
|
||||
var lMode,
|
||||
lName = DOM.getCurrentName(),
|
||||
lExt = Util.getExtension(lName),
|
||||
lUseWorker = Util.strCmp(lExt, ['.js', '.json']);
|
||||
lExt = Util.getExtension(lName);
|
||||
|
||||
if (!Loading) {
|
||||
Images.showLoad();
|
||||
|
|
@ -62,18 +62,16 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch;
|
|||
initAce();
|
||||
}
|
||||
|
||||
Ace.setOptions({
|
||||
useWorker : lUseWorker,
|
||||
enableBasicAutocompletion : true,
|
||||
enableSnippets : true
|
||||
});
|
||||
|
||||
|
||||
if (!Modelist)
|
||||
Modelist = ace.require('ace/ext/modelist');
|
||||
|
||||
lMode = Modelist.getModeForPath(lName).mode;
|
||||
Ace.session.setMode(lMode);
|
||||
Session.setMode(lMode);
|
||||
|
||||
Ace.setOptions({
|
||||
enableBasicAutocompletion : true,
|
||||
enableSnippets : true
|
||||
});
|
||||
|
||||
if (Util.isString(pValue)) {
|
||||
Ace.setValue(pValue);
|
||||
|
|
@ -119,16 +117,14 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch;
|
|||
}
|
||||
|
||||
function initAce() {
|
||||
var lSession;
|
||||
|
||||
Ace = ace.edit(Element);
|
||||
lSession = Ace.getSession();
|
||||
Ace = ace.edit(Element);
|
||||
Session = Ace.getSession();
|
||||
|
||||
Ace.setTheme('ace/theme/tomorrow_night_blue');
|
||||
|
||||
Ace.setShowPrintMargin(false);
|
||||
Ace.setShowInvisibles(true);
|
||||
lSession.setUseSoftTabs(true);
|
||||
Session.setUseSoftTabs(true);
|
||||
|
||||
Ace.commands.addCommand({
|
||||
name : 'hide',
|
||||
|
|
@ -212,8 +208,6 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch;
|
|||
DIR + 'ext-language_tools.js',
|
||||
DIR + 'ext-searchbox.js',
|
||||
DIR + 'ext-modelist.js',
|
||||
DIR + 'snippets/javascript.js',
|
||||
DIR + 'mode-javascript.js',
|
||||
],
|
||||
lAce = DIR + 'ace.js',
|
||||
lURL = CloudFunc.getCombineURL(lFiles);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -48,11 +48,7 @@ color: #FFFFFF\
|
|||
color: #FFFFFF\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_cursor {\
|
||||
border-left: 2px solid #FFFFFF\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_overwrite-cursors .ace_cursor {\
|
||||
border-left: 0px;\
|
||||
border-bottom: 1px solid #FFFFFF\
|
||||
color: #FFFFFF\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_marker-layer .ace_selection {\
|
||||
background: #003F8E\
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue