mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
added ability to read files in CodeMirror
This commit is contained in:
parent
9544c66633
commit
e6a997776b
1 changed files with 15 additions and 2 deletions
|
|
@ -54,7 +54,8 @@ CloudCommander.Editor.CodeMirror = {
|
|||
};
|
||||
|
||||
/* load CodeMirror main module */
|
||||
CloudCommander.jsload('lib/client/editor/codemirror/pack/codemirror.pack.js', loadAll(this));
|
||||
CloudCommander.jsload('lib/client/editor/codemirror/pack/codemirror.pack.js',
|
||||
loadAll(this));
|
||||
}),
|
||||
|
||||
show : (function(){ /* function shows CodeMirror editor */
|
||||
|
|
@ -67,12 +68,24 @@ CloudCommander.Editor.CodeMirror = {
|
|||
var lLeft = this.getById('left');
|
||||
var lCloudEditor = this.getById('CloudEditor');
|
||||
|
||||
var lCurrent = this.getById(CloudCommander.CURRENCURRENT_FILE);
|
||||
var lA;
|
||||
if(lCurrent.length)
|
||||
lA = lCurrent.getElementsByTagName('a');
|
||||
|
||||
if(lA.length)
|
||||
lA = lA[0].href;
|
||||
|
||||
var lValue = $.ajax(lA);
|
||||
if(lValue.responseText)
|
||||
lValue = lValue.responseText;
|
||||
|
||||
lLeft &&
|
||||
(lLeft.className = 'panel hidden');
|
||||
|
||||
CodeMirror(lCloudEditor,{
|
||||
mode : 'xml',
|
||||
value : '',
|
||||
value : lValue,
|
||||
theme : 'night',
|
||||
lineNumbers : true,
|
||||
//переносим длинные строки
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue