From 0da117af05099a75afa0b6e462fc08e91cfa0c35 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 22 Jan 2013 09:21:19 -0500 Subject: [PATCH] minor changes --- html/index.html | 1 + lib/client.js | 1 - lib/client/dom.js | 16 ++++++++-------- lib/client/ie.js | 24 +++++++++++++++++++++--- lib/client/terminal.js | 8 +++++--- lib/server/main.js | 4 ++-- 6 files changed, 37 insertions(+), 17 deletions(-) diff --git a/html/index.html b/html/index.html index 6bba869f..51033780 100644 --- a/html/index.html +++ b/html/index.html @@ -40,6 +40,7 @@ + diff --git a/lib/client.js b/lib/client.js index 55e45545..1f5887ae 100644 --- a/lib/client.js +++ b/lib/client.js @@ -536,7 +536,6 @@ CloudCmd._changeLinks = function(pPanelID){ DOM.addListener('touchend', CloudCmd._loadDir(link), - false, lLi ); } diff --git a/lib/client/dom.js b/lib/client/dom.js index a5b97984..5a5df352 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -92,7 +92,7 @@ var CloudCommander, Util, * @param pUseCapture * @param pElement {document by default} */ - DOM.addListener = function(pType, pListener, pUseCapture, pElement){ + DOM.addListener = function(pType, pListener, pElement, pUseCapture){ var lRet = this; (pElement || window).addEventListener( @@ -111,12 +111,12 @@ var CloudCommander, Util, * @param pUseCapture * @param pElement {document by default} */ - DOM.addOneTimeListener = function(pType, pListener, pUseCapture, pElement){ + DOM.addOneTimeListener = function(pType, pListener, pElement, pUseCapture){ var lRet = this; DOM.addListener(pType, function oneTime(pEvent){ - DOM.removeListener(pType, oneTime, pUseCapture, pElement); + DOM.removeListener(pType, oneTime, pElement, pUseCapture); pListener(pEvent); }, pUseCapture, pElement); @@ -131,7 +131,7 @@ var CloudCommander, Util, * @param pUseCapture * @param pElement {document by default} */ - DOM.removeListener = function(pType, pListener, pUseCapture, pElement){ + DOM.removeListener = function(pType, pListener, pElement, pUseCapture){ var lRet = this; (pElement || window).removeEventListener( @@ -149,8 +149,8 @@ var CloudCommander, Util, * @param pListener * @param pUseCapture */ - DOM.addKeyListener = function(pListener, pUseCapture){ - return DOM.addListener('keydown', pListener, pUseCapture); + DOM.addKeyListener = function(pListener, pElement, pUseCapture){ + return DOM.addListener('keydown', pListener, pElement, pUseCapture); }; /** @@ -537,8 +537,8 @@ var CloudCommander, Util, Util.exec(lOnError); }; - DOM.addListener('load', lLoad, false, lElement); - DOM.addListener('error', lError, false, lElement); + DOM.addListener('load', lLoad, lElement); + DOM.addListener('error', lError,lElement); if(lStyle) lElement.style.cssText = lStyle; diff --git a/lib/client/ie.js b/lib/client/ie.js index f943a0cc..25df0b02 100644 --- a/lib/client/ie.js +++ b/lib/client/ie.js @@ -32,7 +32,11 @@ /* setting function context (this) */ Util.bind = function(pFunction, pContext){ - return $.proxy(pFunction, pContext); + var lRet; + + lRet = $.proxy(pFunction, pContext); + + return lRet; }; /* @@ -49,12 +53,26 @@ * @param pListener */ DOM.addListener = function(pType, pListener, pCapture, pElement){ - return $(pElement || window).bind(pType, null, pListener); + var lRet; + + if(!pElement) + pElement = window; + + lRet = $(pElement).bind(pType, null, pListener); + + return lRet; }; if(!document.removeEventListener){ DOM.removeListener = function(pType, pListener, pCapture, pElement){ - return $(pElement || window).unbind(pType, pListener); + var lRet; + + if(!pElement) + pElement = window; + + $(pElement).unbind(pType, pListener); + + return lRet; }; } diff --git a/lib/client/terminal.js b/lib/client/terminal.js index d5b99c38..bc05c261 100644 --- a/lib/client/terminal.js +++ b/lib/client/terminal.js @@ -19,15 +19,17 @@ var CloudCommander, Util, DOM, $; */ function load(pCallBack){ console.time('terminal load'); - + var lDir = '/lib/client/terminal/jquery-terminal/jquery.', lFiles = [ lDir + 'terminal.js', lDir + 'mousewheel.js', lDir + 'terminal.css' - ]; + ], + lJqueryMigrate = '//code.jquery.com/jquery-migrate-1.0.0.js'; + /* //github.com/jquery/jquery-migrate/ */ - DOM.anyLoadOnLoad([lFiles], function(){ + DOM.anyLoadOnLoad([lFiles, lJqueryMigrate], function(){ console.timeEnd('terminal load'); init(); $(function($, undefined) { diff --git a/lib/server/main.js b/lib/server/main.js index ee49127a..381b9aaa 100644 --- a/lib/server/main.js +++ b/lib/server/main.js @@ -186,8 +186,8 @@ lReq = pParams.request, lRes = pParams.response, - lEnc = lReq.headers['accept-encoding'] || '', - lGzip = lEnc.match(/\bgzip\b/), + lEnc = lReq.headers['accept-encoding'] || '', + lGzip = lEnc.match(/\bgzip\b/), lReadStream = fs.createReadStream(lName, { 'bufferSize': 4 * 1024