mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
add plugin terminal
This commit is contained in:
parent
ad820abe41
commit
d2c6f28896
5 changed files with 27 additions and 20 deletions
|
|
@ -56,6 +56,8 @@ Start file is - cloudcmd.js
|
|||
* From now right panel would be always shown no matter js enabled or
|
||||
disabled in browsers.
|
||||
|
||||
* Added plagin terminal ( ` button under TAB).
|
||||
|
||||
|
||||
2012.08.24, Version 0.1.6
|
||||
|
||||
|
|
|
|||
10
client.js
10
client.js
|
|
@ -1020,18 +1020,18 @@ CloudClient._setCurrent=(function(){
|
|||
if(lCurrentFile){
|
||||
if (Util.isCurrentFile(this) &&
|
||||
typeof pFromEnter !== 'boolean'){
|
||||
var lParent = this;
|
||||
//var lParent = this;
|
||||
|
||||
setTimeout(function(){
|
||||
//setTimeout(function(){
|
||||
/* waiting a few seconds
|
||||
* and if classes still equal
|
||||
* make file name editable
|
||||
* in other case
|
||||
* double click event happend
|
||||
*/
|
||||
if(Util.getCurrentFile() === lParent)
|
||||
CloudClient._editFileName(lParent);
|
||||
},1000);
|
||||
// if(Util.getCurrentFile() === lParent)
|
||||
// CloudClient._editFileName(lParent);
|
||||
// },1000);
|
||||
}
|
||||
else{
|
||||
/* устанавливаем курсор на файл,
|
||||
|
|
|
|||
|
|
@ -33,7 +33,9 @@ var CloudCommander;
|
|||
F2 : 113,
|
||||
F3 : 114,
|
||||
F4 : 115,
|
||||
F10 : 121
|
||||
F10 : 121,
|
||||
|
||||
TRA : 192 /* Typewritten Reverse Apostrophe (`) */
|
||||
};
|
||||
|
||||
var KEY = cloudcmd.KEY;
|
||||
|
|
@ -147,7 +149,7 @@ var CloudCommander;
|
|||
event.preventDefault();//запрет на дальнейшее действие
|
||||
}
|
||||
|
||||
else if (event.keyCode === KEY.T && event.altKey){
|
||||
else if (event.keyCode === KEY.TRA){
|
||||
if(typeof cloudcmd.Terminal === 'function')
|
||||
cloudcmd.Terminal();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,18 +4,20 @@ var CloudCommander, jqconsole;
|
|||
(function(){
|
||||
var cloudcmd = CloudCommander;
|
||||
var Util = CloudCommander.Util;
|
||||
var KeyBinding = CloudCommander.KeyBinding;
|
||||
|
||||
cloudcmd.Terminal = {};
|
||||
|
||||
jqconsole = {};
|
||||
|
||||
jqconsole.load = (function(pParent){
|
||||
jqconsole.load = (function(){
|
||||
Util.cssLoad({
|
||||
src : 'lib/client/terminal/ansi.css'
|
||||
});
|
||||
|
||||
|
||||
Util.jsload('lib/client/terminal/jqconsole-2.7.min.js', function(){
|
||||
pParent.init();
|
||||
jqconsole.init();
|
||||
jqconsole.show();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -35,7 +37,9 @@ var CloudCommander, jqconsole;
|
|||
console.log('Error. Something went wrong FM not found');
|
||||
});
|
||||
|
||||
jqconsole.show = function(){
|
||||
jqconsole.show = function(){
|
||||
Util.hidePanel();
|
||||
|
||||
$(function () {
|
||||
var jqconsole = $('#terminal').jqconsole('Hi\n', '>>>');
|
||||
var startPrompt = function () {
|
||||
|
|
@ -48,24 +52,24 @@ var CloudCommander, jqconsole;
|
|||
});
|
||||
};
|
||||
startPrompt();
|
||||
})();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
cloudcmd.Terminal.Keys = (function(){
|
||||
"use strict";
|
||||
|
||||
/* loading js and css of CodeMirror */
|
||||
jqconsole.load(jqconsole);
|
||||
/* loading js and css*/
|
||||
Util.jqueryLoad( jqconsole.load );
|
||||
|
||||
var key_event=function(event){
|
||||
var key_event = function(event){
|
||||
|
||||
/* если клавиши можно обрабатывать */
|
||||
if(cloudcmd.keyBinded){
|
||||
if( KeyBinding.get() ){
|
||||
/* if f4 pressed */
|
||||
if(event.keyCode===114 &&
|
||||
event.altKey){
|
||||
jqconsole.show();
|
||||
if(event.keyCode === cloudcmd.KEY.TRA){
|
||||
KeyBinding.unSet();
|
||||
jqconsole.show();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -208,7 +208,6 @@ var CloudCommander, CloudFunc, $;
|
|||
var key_event = (function(pEvent){
|
||||
/* если клавиши можно обрабатывать */
|
||||
if( KeyBinding.get() )
|
||||
/* if f3 pressed */
|
||||
if(pEvent.keyCode === cloudcmd.KEY.F3 &&
|
||||
pEvent.shiftKey){
|
||||
var lCurrentFile = Util.getCurrentFile();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue