mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
added ability to pass checkExtension function array of extensions
This commit is contained in:
parent
a4e13bc5c8
commit
352cdcf8af
2 changed files with 38 additions and 2 deletions
|
|
@ -62,7 +62,8 @@ CloudCommander.Editor.CodeMirror = {
|
|||
'}'
|
||||
});
|
||||
|
||||
CloudCommander.jsload('http://codemirror.net/mode/xml/xml.js', showEditor(pParent));
|
||||
CloudCommander.jsload('http://codemirror.net/mode/xml/xml.js',
|
||||
showEditor(pParent));
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ CloudCommander.Viewer.FuncyBox = {
|
|||
|
||||
},
|
||||
set: function(){
|
||||
if(this.getByClass('fancybox').length)
|
||||
return;
|
||||
try{
|
||||
/* get current panel (left or right) */
|
||||
var lPanel = this.getByClass('current-file');
|
||||
|
|
@ -46,4 +48,37 @@ CloudCommander.Viewer.FuncyBox = {
|
|||
getByClass : function(pClass){
|
||||
return document.getElementsByClassName(pClass);
|
||||
}
|
||||
};
|
||||
};
|
||||
CloudCommander.Viewer.Keys = (function(){
|
||||
"use strict";
|
||||
|
||||
/* loading js and css of CodeMirror */
|
||||
CloudCommander.Editor.CodeMirror.load();
|
||||
|
||||
var key_event=function(event){
|
||||
|
||||
/* если клавиши можно обрабатывать */
|
||||
if(CloudCommander.keyBinded){
|
||||
/* if f4 pressed */
|
||||
if(event.keyCode===114){
|
||||
CloudCommander.Viewer.FuncyBox.set();
|
||||
var lCurrent = this.getByClass('current-file');
|
||||
lCurrent.length &&
|
||||
(lCurrent = lCurrent[0]);
|
||||
|
||||
lCurrent.getElementsByClassName('fancybox') &&
|
||||
lCurrent.click();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/* добавляем обработчик клавишь */
|
||||
if (document.addEventListener)
|
||||
document.addEventListener('keydown', key_event,false);
|
||||
|
||||
else
|
||||
document.onkeypress=key_event;
|
||||
|
||||
/* клавиши назначены*/
|
||||
CloudCommander.keyBinded=true;
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue