mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-28 18:23:35 +00:00
refactored
This commit is contained in:
parent
d64a58692f
commit
778fb8ebbb
5 changed files with 57 additions and 52 deletions
|
|
@ -21,22 +21,22 @@ var CloudCommander, Util, DOM, CloudFunc, CodeMirror;
|
|||
/* private functions */
|
||||
|
||||
function setCSS(){
|
||||
return DOM.cssSet({
|
||||
var lPosition = DOM.getPanel().id,
|
||||
lRet = DOM.cssSet({
|
||||
id : 'editor',
|
||||
inner : '.CodeMirror{' +
|
||||
'font-family' + ': \'Droid Sans Mono\';' +
|
||||
'font-size' + ': 15px;' +
|
||||
/* codemirror v3 */
|
||||
//'height : ' + cloudcmd.HEIGHT + 'px' +
|
||||
'}' +
|
||||
'.CodeMirror-scroll{' +
|
||||
'height' + ':' + cloudcmd.HEIGHT + 'px' +
|
||||
'}' +
|
||||
'#CodeMirrorEditor{' +
|
||||
'float' + ':' + DOM.getPanel().id +
|
||||
// 'padding :20px 20px 20px 20px;' +
|
||||
'float' + ':' + lPosition +
|
||||
'}'
|
||||
});
|
||||
|
||||
return lRet;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -83,27 +83,26 @@ var CloudCommander, Util, DOM, CloudFunc, CodeMirror;
|
|||
*/
|
||||
function load(pCallBack){
|
||||
console.time('codemirror load');
|
||||
var lDir = cloudcmd.LIBDIRCLIENT + 'editor/codemirror/';
|
||||
|
||||
DOM.anyLoadOnLoad(
|
||||
[
|
||||
var lDir = cloudcmd.LIBDIRCLIENT + 'editor/codemirror/',
|
||||
lFiles =
|
||||
[
|
||||
lDir + 'codemirror.css',
|
||||
lDir + 'theme/night.css',
|
||||
lDir + 'mode/javascript.js',
|
||||
],
|
||||
|
||||
lDir + 'codemirror.js'
|
||||
],
|
||||
|
||||
function(){
|
||||
console.timeEnd('codemirror load');
|
||||
CodeMirrorLoaded = true;
|
||||
Util.exec(pCallBack);
|
||||
});
|
||||
|
||||
}
|
||||
[
|
||||
lDir + 'codemirror.css',
|
||||
lDir + 'theme/night.css',
|
||||
lDir + 'mode/javascript.js',
|
||||
],
|
||||
|
||||
lDir + 'codemirror.js'
|
||||
];
|
||||
|
||||
DOM.anyLoadOnLoad(lFiles, function(){
|
||||
console.timeEnd('codemirror load');
|
||||
CodeMirrorLoaded = true;
|
||||
Util.exec(pCallBack);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* function shows CodeMirror editor
|
||||
*/
|
||||
|
|
@ -235,9 +234,8 @@ var CloudCommander, Util, DOM, CloudFunc, CodeMirror;
|
|||
};
|
||||
|
||||
/* добавляем обработчик клавишь */
|
||||
DOM.addKeyListener( lKeyListener );
|
||||
|
||||
DOM.setButtonKey('f4', lEditor);
|
||||
DOM.addKeyListener( lKeyListener )
|
||||
.setButtonKey('f4', lEditor);
|
||||
};
|
||||
|
||||
cloudcmd.Editor.CodeMirror = CodeMirrorEditor;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue