fixed bug with context menu. Now it disabled before load menu module to

This commit is contained in:
coderaiser 2012-11-18 05:09:07 -05:00
parent 5b64662696
commit d1597239c7
5 changed files with 35 additions and 40 deletions

View file

@ -90,12 +90,16 @@ dom.js and util.js.
* Fixed bug with keys panel and fm bottom margin,
when CodeMirror is open on the right panel.
* Fixed bug with positioning of CodeMirror on the right panel.
* Fixed bug with positioning of CodeMirror on the
right panel.
* Function generateHeaders moved to main module.
* Setted up auth on GitHub thru rest.
* Fixed bug with context menu. Now it disabled
before load menu module to.
2012.10.01, Version 0.1.7

View file

@ -7,7 +7,7 @@ var Util, DOM, CloudCommander = (function(){
"use strict";
/* Клиентский обьект, содержащий функциональную часть*/
var CloudClient = {
var CloudClient = {
/* Конструктор CloudClient, который выполняет
* весь функционал по инициализации
*/
@ -109,7 +109,7 @@ var loadModule = function(pParams){
};
};
/*
/**
* Обьект для работы с кэшем
* в него будут включены функции для
* работы с LocalStorage, webdb,
@ -298,7 +298,8 @@ CloudClient._editFileName = function(pParent){
}
};
/* Функция устанавливает текущим файлом, тот
/**
* Функция устанавливает текущим файлом, тот
* на который кликнули единожды
*/
CloudClient._setCurrent = function(){
@ -419,12 +420,23 @@ function initModules(pCallBack){
DOM.ajax({
url:'/modules.json',
success: function(pModules){
var lFunc = Util.retFunc( DOM.Images.showLoad ),
lDoBefore = {
'viewer' : lFunc,
"editor/_codemirror" : lFunc
var lShowLoadFunc = Util.retFunc( DOM.Images.showLoad ),
lDisableMenuFunc = function(){
var lFunc = document.oncontextmenu;
document.oncontextmenu = function(){
Util.exec(lFunc);
return cloudcmd.Menu.ENABLED || false;
};
},
lDoBefore = {
'viewer' : lShowLoadFunc,
'editor/_codemirror' : lShowLoadFunc,
'menu' : lDisableMenuFunc
};
lDisableMenuFunc();
if( Util.isArray(pModules) )
for(var i = 0, n = pModules.length; i < n ; i++){
var lModule = pModules[i];

View file

@ -11,10 +11,10 @@ var CloudCommander, Util, DOM, CloudFunc, $;
Menu = {},
Position;
Menu.dir = './lib/client/menu/';
Menu.dir = './lib/client/menu/';
/* enable and disable menu constant */
Menu.ENABLED = false;
Menu.ENABLED = false;
/* PRIVATE FUNCTIONS */
@ -204,13 +204,6 @@ var CloudCommander, Util, DOM, CloudFunc, $;
Menu.show,
load
]));
var lFunc = document.oncontextmenu;
document.oncontextmenu = function(){
Util.exec(lFunc);
return Menu.ENABLED;
};
var key_event = (function(pEvent){
/* если клавиши можно обрабатывать */

View file

@ -6,8 +6,8 @@ var CloudCommander, Util, DOM, $, Github;
var cloudcmd = CloudCommander,
CLIENT_ID, // = '891c251b925e4e967fa9',
CLIENT_SECRET,// = 'afe9bed1e810c5dc44c4c2a953fc6efb1e5b0545',
CLIENT_ID,
CLIENT_SECRET,
GithubStore = {};
cloudcmd.Storage = {};
@ -83,21 +83,7 @@ var CloudCommander, Util, DOM, $, Github;
}
}
});
/*
$.post("https://github.com/login/oauth/access_token",{
client_id : CLIENT_ID,
client_secret : CLIENT_SECRET,
code : lCode,
state : ''
},
function(pDate){
//GithubStore.Login(lToken);
console.log(pDate);
}, "json");
*/
}
}
else
cloudcmd.Auth();
}
@ -134,5 +120,5 @@ var CloudCommander, Util, DOM, $, Github;
]));
};
cloudcmd.Storage.Github = GithubStore;
cloudcmd.Storage.GithubStore = GithubStore;
})();

View file

@ -105,10 +105,10 @@ CloudServer.Socket = main.socket;
/* базовая инициализация */
CloudServer.init = (function(pAppCachProcessing){
var lConfig = this.Config,
lMinify = this.Minify,
lCache = this.Cache,
lAppCache = this.AppCache;
var lConfig = this.Config,
lMinify = this.Minify,
lCache = this.Cache,
lAppCache = this.AppCache;
/* Переменная в которой храниться кэш*/
lCache.setAllowed(lConfig.cache.allowed);
@ -121,7 +121,7 @@ CloudServer.init = (function(pAppCachProcessing){
/* Если нужно минимизируем скрипты */
lMinify._allowed = lMinify.doit();
/* создаём файл app cache */
/* создаём файл app cache */
if( lConfig.appcache && lAppCache && lConfig.server )
Util.exec( pAppCachProcessing );
});