From 80e20f22b4e79e79a5bb7d65f602f6642522ca3e Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 8 Oct 2012 20:20:07 +0200 Subject: JS: Fix TinyMCE init --- chimere/static/chimere/js/textareas.js | 22 ++++++++++++---------- chimere/static/chimere/js/textareas_admin.js | 22 ++++++++++++---------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/chimere/static/chimere/js/textareas.js b/chimere/static/chimere/js/textareas.js index 048718d..22b68c8 100644 --- a/chimere/static/chimere/js/textareas.js +++ b/chimere/static/chimere/js/textareas.js @@ -16,13 +16,15 @@ along with this program. If not, see . See the file COPYING for details. */ - -tinyMCE.init({ - mode : "textareas", - theme : "advanced", - editor_selector : "mceEditor", - relative_urls : false, - theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,bullist,numlist,separator,hr,separator,link", - theme_advanced_buttons2 : "", - theme_advanced_buttons3 : "" -}); +if (!window.tinymce_init){ + window.tinymce_init = true; + tinyMCE.init({ + mode : "textareas", + theme : "advanced", + editor_selector : "mceEditor", + relative_urls : false, + theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,bullist,numlist,separator,hr,separator,link", + theme_advanced_buttons2 : "", + theme_advanced_buttons3 : "" + }) +}; diff --git a/chimere/static/chimere/js/textareas_admin.js b/chimere/static/chimere/js/textareas_admin.js index e15e7f2..7acec97 100644 --- a/chimere/static/chimere/js/textareas_admin.js +++ b/chimere/static/chimere/js/textareas_admin.js @@ -16,13 +16,15 @@ along with this program. If not, see . See the file COPYING for details. */ - -tinyMCE.init({ - mode : "textareas", - theme : "advanced", - editor_selector : "mceEditor", - relative_urls : false, - theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,bullist,numlist,separator,hr,separator,link,image", - theme_advanced_buttons2 : "", - theme_advanced_buttons3 : "" -}); +if (!window.tinymce_init){ + window.tinymce_init = true; + tinyMCE.init({ + mode : "textareas", + theme : "advanced", + editor_selector : "mceEditor", + relative_urls : false, + theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,bullist,numlist,separator,hr,separator,link,image", + theme_advanced_buttons2 : "", + theme_advanced_buttons3 : "" + }); +}; -- cgit v1.2.3