simpified plugins id's

This commit is contained in:
coderaiser 2013-06-03 10:53:51 -04:00
parent 9e105f56bd
commit 962948caa8
65 changed files with 36 additions and 51 deletions

View file

@ -44,6 +44,8 @@ getJSONfromFileTable.
* Moved CloudCmd.KEY object data to prototype of CloudCmd.Key.
* Simpified plugins id's.
2012.04.22, v0.2.0

View file

@ -92,7 +92,7 @@ var Util, DOM, CloudFunc, CloudCmd;
DOM.setCurrentFile(lRootDir);
DOM.scrollIntoViewIfNeeded(lRootDir, true);
}
};
}
/**
* function load modules
@ -133,6 +133,7 @@ var Util, DOM, CloudFunc, CloudCmd;
};
}
}
/** Конструктор CloudClient, который
* выполняет весь функционал по
* инициализации
@ -153,8 +154,6 @@ var Util, DOM, CloudFunc, CloudCmd;
DOM.retJSLoad(lSrc, pCallBack)
);
};
//Util.socketLoad();
Util.ifExec(document.body.scrollIntoViewIfNeeded, lCallBack, lFunc);
};
@ -181,7 +180,7 @@ var Util, DOM, CloudFunc, CloudCmd;
lDoBefore = {
'editor/_codemirror' : lShowLoadFunc,
'viewer' : lShowLoadFunc
'view' : lShowLoadFunc
},
lLoad = function(pName, pPath, pDoBefore){

View file

@ -3,14 +3,13 @@ var CloudCmd, Util, DOM, CodeMirror;
(function(CloudCmd, Util, DOM){
'use strict';
var Key = CloudCmd.Key,
CodeMirrorEditor = {},
var Key = CloudCmd.Key,
Editor = {},
FM,
CodeMirrorElement,
CodeMirrorLoaded = false,
/* indicator says CodeMirror still loads */
Loading = false,
ReadOnly = false,
Element,
CodeMirrorLoaded = false,
Loading = false,
ReadOnly = false,
CallBacks = [
hide,
@ -19,18 +18,10 @@ var CloudCmd, Util, DOM, CodeMirror;
load
];
CloudCmd.Editor = {
get : (function(){
return this.CodeMirror;
})
};
/* private functions */
function setCSS(){
var lPosition = DOM.getPanel().id,
lRet = DOM.cssSet({
id : 'editor',
id : 'editor-css',
inner : '.CodeMirror{' +
'font-family' + ': \'Droid Sans Mono\';' +
'font-size' + ': 15px;' +
@ -38,7 +29,7 @@ var CloudCmd, Util, DOM, CodeMirror;
'.CodeMirror-scroll{' +
'height' + ':' + CloudCmd.HEIGHT + 'px' +
'}' +
'#CodeMirrorEditor{' +
'#editor{' +
'float' + ':' + lPosition +
'}'
});
@ -58,19 +49,18 @@ var CloudCmd, Util, DOM, CodeMirror;
lCurrent = DOM.getCurrentFile(),
lPath = DOM.getCurrentPath( lCurrent );
CodeMirrorElement = DOM.anyload({
Element = DOM.anyload({
name : 'div',
id : 'CodeMirrorEditor',
id : 'editor',
className : 'panel',
parent : FM
});
var lEditor = CodeMirrorEditor.CodeMirror = new CodeMirror(CodeMirrorElement,{
var lEditor = Editor.CodeMirror = new CodeMirror(Element, {
mode : 'javascript',
value : pParams && pParams.data && pParams.data.data,
theme : 'night',
lineNumbers : true,
//переносим длинные строки
lineWrapping: false,
autofocus : true,
extraKeys: {
@ -157,8 +147,8 @@ var CloudCmd, Util, DOM, CodeMirror;
function hide() {
Key.setBind();
if(CodeMirrorElement && FM)
FM.removeChild(CodeMirrorElement);
if(Element && FM)
FM.removeChild(Element);
DOM.showPanel();
}
@ -166,7 +156,7 @@ var CloudCmd, Util, DOM, CodeMirror;
/**
* function calls all CodeMirror editor functions
*/
CodeMirrorEditor.show = function(){
Editor.show = function(){
DOM.Images.showLoad();
Util.loadOnLoad( CallBacks );
};
@ -174,18 +164,18 @@ var CloudCmd, Util, DOM, CodeMirror;
/**
* function hides CodeMirror editor
*/
CodeMirrorEditor.hide = hide;
Editor.hide = hide;
/**
* function bind keys
*/
CloudCmd.Editor.init = function(){
CodeMirrorEditor.show();
Editor.show();
CallBacks.pop();
/* добавляем обработчик клавишь */
DOM.Events.addKey( lListener );
DOM.setButtonKey('f4', CodeMirrorEditor.show);
DOM.Events.addKey(lListener);
DOM.setButtonKey('f4', Editor.show);
function lListener(pEvent){
var lIsBind = Key.isBind();
@ -195,11 +185,11 @@ var CloudCmd, Util, DOM, CodeMirror;
lKey = pEvent.keyCode;
if(lKey === lF4)
CodeMirrorEditor.show();
Editor.show();
}
}
};
CloudCmd.Editor.CodeMirror = CodeMirrorEditor;
CloudCmd.Editor.CodeMirror = Editor;
})(CloudCmd, Util, DOM);

View file

@ -11,8 +11,6 @@ var CloudCmd, Util, DOM, $;
JqueryTerminal = {};
CloudCmd.Terminal = {};
/* PRIVATE FUNCTIONS */
/**
* function loads jquery-terminal
@ -32,24 +30,22 @@ var CloudCmd, Util, DOM, $;
DOM.anyLoadOnLoad([lFiles, lJqueryMigrate], function(){
Util.timeEnd('terminal load');
init();
$(function($, undefined) {
$(function($) {
Term = JqueryTerminal.Term = $('#terminal').terminal(function(command, term){
term.echo('');
CloudCmd.Socket.send(command);
}, {
greetings : '[[;#729FCF;]Cloud Commander Terminal]',
greetings : '[[;#729FCF;]CloudCmd Terminal]',
prompt : '[[;#729FCF;]cloudcmd> ]',
color : '#729FCF;'
});
});
/* removing resize function, no need for us */
Term.resize = function(){};
$(window).unbind('resize');
Util.exec(pCallBack);
}).cssSet({id:'terminalStyle',
inner: '.cloudTerminal{' +
}).cssSet({id:'terminal-css',
inner: '.terminal{' +
'height: 720px;' +
'};'
});
@ -63,13 +59,11 @@ var CloudCmd, Util, DOM, $;
TerminalId = DOM.anyload({
name : 'div',
id : 'terminal',
className : 'panel cloudTerminal',
className : 'panel terminal',
parent : DOM.getFM()
});
}
/* PUBLIC FUNCTIONS */
/**
* functin show jquery-terminal
*/
@ -108,7 +102,7 @@ var CloudCmd, Util, DOM, $;
DOM.jqueryLoad,
]);
DOM.Events.addKey( lListener );
DOM.Events.addKey(lListener);
function lListener(pEvent){
var lRet = true,

View file

@ -15,7 +15,7 @@ var CloudCmd, Util, DOM, CloudFunc, $;
},
afterShow : function(){
var lEditor = DOM.getById('CloudViewer');
var lEditor = DOM.getById('View');
if(lEditor)
lEditor.focus();
},
@ -57,12 +57,12 @@ var CloudCmd, Util, DOM, CloudFunc, $;
Util.timeEnd('fancybox load');
Util.exec( pCallBack );
})
.cssSet({id:'viewer',
inner : '#CloudViewer{' +
.cssSet({id:'view-css',
inner : '#view{' +
'font-size: 16px;' +
'white-space :pre' +
'}' +
'#CloudViewer::selection{' +
'#view::selection{' +
/*
'background: #fe57a1;'
'color: #fff;'
@ -108,7 +108,7 @@ var CloudCmd, Util, DOM, CloudFunc, $;
$.fancybox.open({ href : lPath }, Config);
else
DOM.getCurrentData(function(pParams){
$.fancybox('<div id=CloudViewer tabindex=0>' +
$.fancybox('<div id=view tabindex=0>' +
pParams.data + '</div>', Config);
});

View file

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 43 B

After

Width:  |  Height:  |  Size: 43 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1,003 B

After

Width:  |  Height:  |  Size: 1,003 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before After
Before After