mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 09:24:51 +00:00
feature(edit) add setUserOfWorker
This commit is contained in:
parent
655d695907
commit
db7075dcd3
1 changed files with 13 additions and 0 deletions
|
|
@ -81,6 +81,7 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip;
|
|||
isJS = mode === jsMode;
|
||||
|
||||
Session.setMode(mode);
|
||||
setUseOfWorker(mode);
|
||||
|
||||
Util.ifExec(Emmet, function() {
|
||||
if (Emmet)
|
||||
|
|
@ -141,6 +142,18 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip;
|
|||
Ace.gotoLine(number);
|
||||
};
|
||||
|
||||
function setUseOfWorker(mode) {
|
||||
var isMatch,
|
||||
isStr = Util.isString(mode),
|
||||
regStr = 'coffee/css/html/javascript/json/lua/php/xquery',
|
||||
regExp = new RegExp(regStr);
|
||||
|
||||
if (isStr)
|
||||
isMatch = mode.match(regExp);
|
||||
|
||||
Session.setUseWorker(isMatch);
|
||||
}
|
||||
|
||||
function initAce() {
|
||||
Ace = ace.edit(Element);
|
||||
Session = Ace.getSession();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue