From dc1c8337795556e60b2b117daa85013a266b1a07 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 24 Aug 2012 10:53:03 -0400 Subject: [PATCH] fixed bug with open CodeMirror view from menu --- config.json | 4 ++-- lib/client/editor.js | 7 +++---- lib/client/menu.js | 7 +++++-- lib/server/object.js | 16 ++++++++++++++-- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/config.json b/config.json index 0de340e3..d58f0b2d 100644 --- a/config.json +++ b/config.json @@ -1,7 +1,7 @@ { - "cache" : {"allowed" : true}, + "cache" : {"allowed" : false}, "minification" : { - "js" : true, + "js" : false, "css" : true, "html" : true, "img" : true diff --git a/lib/client/editor.js b/lib/client/editor.js index c3a1eaa0..bc79d9cd 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -70,7 +70,8 @@ var CloudCommander, CloudFunc, CodeMirror; /* function shows CodeMirror editor */ CloudCommander.Editor.CodeMirror.show = (function(pCurrentFile, pIsReadOnly){ /* if CloudEditor is not loaded - loading him */ - if(!Util.getById('CloudEditor')) + var lCloudEditor = Util.getById('CloudEditor'); + if(!lCloudEditor) return this.load(pCurrentFile, pIsReadOnly); /* if CodeMirror function show already @@ -104,9 +105,7 @@ var CloudCommander, CloudFunc, CodeMirror; readOnly : lReadOnly }); }; - - var lCloudEditor = Util.getById('CloudEditor'); - + var lA; /* getting link */ diff --git a/lib/client/menu.js b/lib/client/menu.js index 6b22020d..264e56c3 100644 --- a/lib/client/menu.js +++ b/lib/client/menu.js @@ -51,8 +51,11 @@ var CloudCommander, $; CloudCommander.Editor(); else{ var lEditor = CloudCommander.Editor.get(); - if(lEditor && lEditor.show) - lEditor.show(); + if(lEditor && lEditor.show){ + var lCurrent = Util.getCurrentFile(); + if(lCurrent) + lEditor.show(); + } } }}, diff --git a/lib/server/object.js b/lib/server/object.js index 61d0cc82..4188d2cd 100644 --- a/lib/server/object.js +++ b/lib/server/object.js @@ -64,7 +64,7 @@ exports.Cache = { */ exports.Minify = { /* pathes to directories */ - INDEX :'index.html', + INDEX :'index.html', /* приватный переключатель минимизации */ _allowed :{ css:true, @@ -106,7 +106,18 @@ exports.Minify = { 'without minify module\n' + 'npm i minify'); } - + + /* + * temporary changed dir path, + * becouse directory lib is write + * protected by others by default + * so if node process is started + * from other user (root for example + * in nodester) we can not write + * minified versions + */ + this.MinFolder = '/' + lMinify.MinFolder; + var lOptimizeParams = []; if (this._allowed.js) { lOptimizeParams.push('client.js'); @@ -157,5 +168,6 @@ exports.Minify = { }, /* minification folder name */ + MinFolder : '', Cache : {} }; \ No newline at end of file