# HG changeset patch # User Dan Fuhry # Date 1289866900 18000 # Node ID a228f7e8fb1517e37451677db736873137a54cab # Parent 41ac3758ba799f673c2f76b0281d7180e6eb3d8c Added a new "hide-with-mce" CSS class in Dynano; all elements which have it will be hidden when TinyMCE is activated, and re-shown when it is destroyed. diff -r 41ac3758ba79 -r a228f7e8fb15 includes/clientside/static/dynano.js --- a/includes/clientside/static/dynano.js Mon Nov 15 16:58:05 2010 -0500 +++ b/includes/clientside/static/dynano.js Mon Nov 15 19:21:40 2010 -0500 @@ -119,7 +119,6 @@ enano_tinymce_options.elements = this.object.id; initTinyMCE(); this.object.dnIsMCE = 'yes'; - return true; } else { @@ -127,6 +126,13 @@ tinymce.EditorManager.execCommand("mceAddControl", true, this.object.id); this.object.dnIsMCE = 'yes'; } + // Any elements to hide? + var objs = getElementsByClassName(this.object.parentNode, '*', 'hide-with-mce'); + console.debug(objs); + for ( var i = 0; i < objs.length; i++ ) + { + objs[i].style.display = 'none'; + } return this; } @@ -151,6 +157,12 @@ } } this.object.dnIsMCE = 'no'; + // Any elements to re-show? + var objs = getElementsByClassName(this.object.parentNode, '*', 'hide-with-mce'); + for ( var i = 0; i < objs.length; i++ ) + { + objs[i].style.display = 'block'; + } return this; } diff -r 41ac3758ba79 -r a228f7e8fb15 includes/clientside/static/editor.js --- a/includes/clientside/static/editor.js Mon Nov 15 16:58:05 2010 -0500 +++ b/includes/clientside/static/editor.js Mon Nov 15 19:21:40 2010 -0500 @@ -879,12 +879,19 @@ }, onclick: function() { + console.info('setAjaxLoading'); setAjaxLoading(); - ajaxEditorDestroyModalWindow(); + console.info('editor_open = false'); editor_open = false; + console.info('enableUnload'); enableUnload(); + console.info('destroyMCE'); $dynano('ajaxEditArea').destroyMCE(false); + console.info('destroyModal()'); + ajaxEditorDestroyModalWindow(); + console.info('ajaxReset'); ajaxReset(); + console.info('miniPromptDestroy'); miniPromptDestroy(this); return false; } diff -r 41ac3758ba79 -r a228f7e8fb15 includes/clientside/static/functions.js --- a/includes/clientside/static/functions.js Mon Nov 15 16:58:05 2010 -0500 +++ b/includes/clientside/static/functions.js Mon Nov 15 19:21:40 2010 -0500 @@ -1155,7 +1155,7 @@ function getElementsByClassName(oElm, strTagName, strClassName) { // first it gets all of the specified tags - var arrElements = (strTagName == "*" && document.all) ? document.all : oElm.getElementsByTagName(strTagName); + var arrElements = oElm.getElementsByTagName(strTagName); // then it sets up an array that'll hold the results var arrReturnElements = new Array(); diff -r 41ac3758ba79 -r a228f7e8fb15 includes/clientside/static/template-compiler.js --- a/includes/clientside/static/template-compiler.js Mon Nov 15 16:58:05 2010 -0500 +++ b/includes/clientside/static/template-compiler.js Mon Nov 15 19:21:40 2010 -0500 @@ -4,8 +4,8 @@ window.templateParser = function(text) { this.tpl_code = text; - this.tpl_strings = new Object(); - this.tpl_bool = new Object(); + this.tpl_strings = {}; + this.tpl_bool = {}; this.assign_vars = __tpAssignVars; this.assign_bool = __tpAssignBool; this.fetch_hook = __tpFetchHook;