minor changes

This commit is contained in:
coderaiser 2012-07-30 10:43:48 -04:00
parent a6afafe2e4
commit 1038e1a028

View file

@ -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(){