mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 17:05:17 +00:00
minor changes
This commit is contained in:
parent
a6afafe2e4
commit
1038e1a028
1 changed files with 31 additions and 16 deletions
|
|
@ -65,10 +65,27 @@ CloudCommander.Editor.CodeMirror = {
|
|||
/* removing keyBinding if set */
|
||||
CloudCommander.keyBinded = false;
|
||||
|
||||
var initCodeMirror_f = function(pValue){
|
||||
CodeMirror(lCloudEditor,{
|
||||
mode : 'xml',
|
||||
value : pValue,
|
||||
theme : 'night',
|
||||
lineNumbers : true,
|
||||
//переносим длинные строки
|
||||
lineWrapping: true,
|
||||
autofocus : true,
|
||||
extraKeys: {
|
||||
//Сохранение
|
||||
"Esc": this.hide(this)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var lLeft = this.getById('left');
|
||||
var lCloudEditor = this.getById('CloudEditor');
|
||||
var lCURRENTFILE = CloudCommander.CURRENT_FILE;
|
||||
|
||||
|
||||
var lCurrent = this.getByClass(lCURRENTFILE);
|
||||
var lA;
|
||||
if(lCurrent.length)
|
||||
|
|
@ -76,27 +93,25 @@ CloudCommander.Editor.CodeMirror = {
|
|||
|
||||
if(lA.length)
|
||||
lA = lA[0].href;
|
||||
|
||||
/* reading data from current file */
|
||||
var lValue = $.ajax({
|
||||
url:lA,
|
||||
|
||||
var lValue = $.ajax(lA);
|
||||
error: function(jqXHR, textStatus, errorThrown){
|
||||
console.log(textStatus+' : '+errorThrown);
|
||||
initCodeMirror_f('');
|
||||
},
|
||||
|
||||
success:function(data, textStatus, jqXHR){
|
||||
initCodeMirror_f(data);
|
||||
}
|
||||
});
|
||||
if(lValue.responseText)
|
||||
lValue = lValue.responseText;
|
||||
|
||||
lLeft &&
|
||||
(lLeft.className = 'panel hidden');
|
||||
|
||||
CodeMirror(lCloudEditor,{
|
||||
mode : 'xml',
|
||||
value : lValue,
|
||||
theme : 'night',
|
||||
lineNumbers : true,
|
||||
//переносим длинные строки
|
||||
lineWrapping: true,
|
||||
autofocus : true,
|
||||
extraKeys: {
|
||||
//Сохранение
|
||||
"Esc": this.hide(this)
|
||||
}
|
||||
});
|
||||
(lLeft.className = 'panel hidden');
|
||||
}),
|
||||
hide : (function(pParent) {
|
||||
return function(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue