moved out showHelp function from view to help

This commit is contained in:
coderaiaser 2013-06-12 08:07:58 -07:00
parent 53d7a0cb7b
commit 3002819ef3
2 changed files with 5 additions and 38 deletions

View file

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

View file

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