diff --git a/ChangeLog b/ChangeLog index 812a1317..2136ace2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/client.js b/client.js index e4894d26..7191b9b5 100644 --- a/client.js +++ b/client.js @@ -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]; diff --git a/lib/client/menu.js b/lib/client/menu.js index 9585bcdf..297ada83 100644 --- a/lib/client/menu.js +++ b/lib/client/menu.js @@ -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){ /* если клавиши можно обрабатывать */ diff --git a/lib/client/storage/_github.js b/lib/client/storage/_github.js index c4c59b3f..b76aedb6 100644 --- a/lib/client/storage/_github.js +++ b/lib/client/storage/_github.js @@ -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; })(); diff --git a/server.js b/server.js index 0ed31905..092cd45f 100644 --- a/server.js +++ b/server.js @@ -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 ); });