mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-24 03:05:41 +00:00
feature(edit) set emmet only for html, not for css
This commit is contained in:
parent
9e811db06f
commit
351ceac00e
1 changed files with 20 additions and 9 deletions
|
|
@ -13,6 +13,7 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch;
|
|||
Value,
|
||||
Edit = this,
|
||||
Diff,
|
||||
Emmet,
|
||||
Ace,
|
||||
Session,
|
||||
Modelist,
|
||||
|
|
@ -32,7 +33,7 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch;
|
|||
}
|
||||
|
||||
this.show = function(pValue) {
|
||||
var lMode, htmlMode, cssMode,
|
||||
var lMode, htmlMode, cssMode, url,
|
||||
lName = Info.name,
|
||||
isDir = Info.isDir,
|
||||
lExt = Info.ext;
|
||||
|
|
@ -64,13 +65,24 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch;
|
|||
|
||||
Session.setMode(lMode);
|
||||
|
||||
if (lMode === htmlMode || lMode === cssMode)
|
||||
DOM.jsload(DIR + 'emmet.js', function() {
|
||||
var Emmet = ace.require("ace/ext/emmet");
|
||||
if (lMode === htmlMode) {
|
||||
if (Emmet)
|
||||
Ace.setOption('enableEmmet', true);
|
||||
else {
|
||||
url = CloudFunc.getJoinURL([
|
||||
DIR + 'emmet.js',
|
||||
DIR + 'ext-emmet.js'
|
||||
]);
|
||||
|
||||
Emmet.setCore(window.emmet);
|
||||
Ace.setOption("enableEmmet", true);
|
||||
});
|
||||
DOM.jsload(url, function() {
|
||||
Emmet = ace.require('ace/ext/emmet');
|
||||
Emmet.setCore(window.emmet);
|
||||
Ace.setOption('enableEmmet', true);
|
||||
});
|
||||
}
|
||||
} else if (Emmet) {
|
||||
Ace.setOption('enableEmmet', false);
|
||||
}
|
||||
|
||||
if (Util.isString(pValue)) {
|
||||
Ace.setValue(pValue);
|
||||
|
|
@ -226,8 +238,7 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch;
|
|||
DIR + 'theme-tomorrow_night_blue.js',
|
||||
DIR + 'ext-language_tools.js',
|
||||
DIR + 'ext-searchbox.js',
|
||||
DIR + 'ext-modelist.js',
|
||||
DIR + 'ext-emmet.js'
|
||||
DIR + 'ext-modelist.js'
|
||||
],
|
||||
|
||||
ace = DIR + 'ace.js',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue