From a4332663cfcdb53b352c8646f78855ae3436cfec Mon Sep 17 00:00:00 2001 From: estadtherr Date: Thu, 14 Sep 2006 03:49:28 +0000 Subject: Initial TinyMCE editor support (still need to work on spellcheck and skins) git-svn-id: https://svn.roundcube.net/trunk@344 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/js/tiny_mce/utils/mctabs.js | 76 +++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 roundcubemail/program/js/tiny_mce/utils/mctabs.js (limited to 'roundcubemail/program/js/tiny_mce/utils/mctabs.js') diff --git a/roundcubemail/program/js/tiny_mce/utils/mctabs.js b/roundcubemail/program/js/tiny_mce/utils/mctabs.js new file mode 100644 index 000000000..c159360c0 --- /dev/null +++ b/roundcubemail/program/js/tiny_mce/utils/mctabs.js @@ -0,0 +1,76 @@ +/** + * $RCSfile: mctabs.js,v $ + * $Revision: 1.2 $ + * $Date: 2006/02/06 20:11:09 $ + * + * Moxiecode DHTML Tabs script. + * + * @author Moxiecode + * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. + */ + +function MCTabs() { + this.settings = new Array(); +}; + +MCTabs.prototype.init = function(settings) { + this.settings = settings; +}; + +MCTabs.prototype.getParam = function(name, default_value) { + var value = null; + + value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name]; + + // Fix bool values + if (value == "true" || value == "false") + return (value == "true"); + + return value; +}; + +MCTabs.prototype.displayTab = function(tab_id, panel_id) { + var panelElm = document.getElementById(panel_id); + var panelContainerElm = panelElm ? panelElm.parentNode : null; + var tabElm = document.getElementById(tab_id); + var tabContainerElm = tabElm ? tabElm.parentNode : null; + var selectionClass = this.getParam('selection_class', 'current'); + + if (tabElm && tabContainerElm) { + var nodes = tabContainerElm.childNodes; + + // Hide all other tabs + for (var i=0; i