From 3002819ef387c11b9263144de9373a503366e503 Mon Sep 17 00:00:00 2001 From: coderaiaser Date: Wed, 12 Jun 2013 08:07:58 -0700 Subject: [PATCH] moved out showHelp function from view to help --- lib/client/help.js | 2 +- lib/client/view.js | 41 ++++------------------------------------- 2 files changed, 5 insertions(+), 38 deletions(-) diff --git a/lib/client/help.js b/lib/client/help.js index 438c087a..f26a7001 100644 --- a/lib/client/help.js +++ b/lib/client/help.js @@ -33,7 +33,7 @@ var CloudCmd, Util, DOM; data : Util.stringifyJSON(lData), success:function(pResult){ Images.hideLoad(); - CloudCmd.View.Show(pResult); + CloudCmd.View.show(pResult); }, error: Images.showError diff --git a/lib/client/view.js b/lib/client/view.js index 0d35e08b..da1af750 100644 --- a/lib/client/view.js +++ b/lib/client/view.js @@ -36,9 +36,8 @@ var CloudCmd, Util, DOM, CloudFunc, $; }; this.init = function(pCallBack){ - debugger; Util.loadOnLoad([ - pCallBack || View.show, + pCallBack || Util.retExec(View.show, null), load, DOM.jqueryLoad ]); @@ -49,29 +48,6 @@ var CloudCmd, Util, DOM, CloudFunc, $; delete View.init; }; - this.showHelp = function(){ - Images.showLoad(); - DOM.ajax({ - url: '/README.md', - success: function (pData){ - var lData = {text: pData}; - DOM.ajax({ - method : 'post', - url : 'https://api.github.com/markdown', - data : Util.stringifyJSON(lData), - success:function(pResult){ - Images.hideLoad(); - $.fancybox(pResult, Config); - }, - - error: Images.showError - }); - }, - - error:Images.showError - }); - }; - /** * function shows FancyBox */ @@ -139,22 +115,13 @@ var CloudCmd, Util, DOM, CloudFunc, $; function listener(pEvent){ var lF3 = Key.F3, - lF1 = Key.F1, lIsBind = Key.isBind(), lKey = pEvent.keyCode; /* если клавиши можно обрабатывать */ - if (lIsBind) { - switch(lKey){ - case lF3: - view(); - DOM.preventDefault(pEvent); - break; - - case lF1: - View.showHelp(); - break; - } + if (lIsBind && lKey === lF3) { + view(); + DOM.preventDefault(pEvent); } } }