add plugin terminal

This commit is contained in:
coderaiser 2012-09-19 05:53:49 -04:00
parent ad820abe41
commit d2c6f28896
5 changed files with 27 additions and 20 deletions

View file

@ -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

View file

@ -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{
/* устанавливаем курсор на файл,

View file

@ -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();
}

View file

@ -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();
}
}
};

View file

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