]> git.donarmstrong.com Git - roundcube.git/blobdiff - program/js/tiny_mce/utils/mctabs.js
Imported Upstream version 0.1
[roundcube.git] / program / js / tiny_mce / utils / mctabs.js
index fae038d6af82d1341aaba18b469e4f8445020a88..d6434028340f9ec652dc856b1728f8aa828e33f2 100644 (file)
@@ -1,74 +1,74 @@
-/**\r
- * $Id: mctabs.js 162 2007-01-03 16:16:52Z spocke $\r
- *\r
- * Moxiecode DHTML Tabs script.\r
- *\r
- * @author Moxiecode\r
- * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.\r
- */\r
-\r
-function MCTabs() {\r
-       this.settings = new Array();\r
-};\r
-\r
-MCTabs.prototype.init = function(settings) {\r
-       this.settings = settings;\r
-};\r
-\r
-MCTabs.prototype.getParam = function(name, default_value) {\r
-       var value = null;\r
-\r
-       value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];\r
-\r
-       // Fix bool values\r
-       if (value == "true" || value == "false")\r
-               return (value == "true");\r
-\r
-       return value;\r
-};\r
-\r
-MCTabs.prototype.displayTab = function(tab_id, panel_id) {\r
-       var panelElm = document.getElementById(panel_id);\r
-       var panelContainerElm = panelElm ? panelElm.parentNode : null;\r
-       var tabElm = document.getElementById(tab_id);\r
-       var tabContainerElm = tabElm ? tabElm.parentNode : null;\r
-       var selectionClass = this.getParam('selection_class', 'current');\r
-\r
-       if (tabElm && tabContainerElm) {\r
-               var nodes = tabContainerElm.childNodes;\r
-\r
-               // Hide all other tabs\r
-               for (var i=0; i<nodes.length; i++) {\r
-                       if (nodes[i].nodeName == "LI")\r
-                               nodes[i].className = '';\r
-               }\r
-\r
-               // Show selected tab\r
-               tabElm.className = 'current';\r
-       }\r
-\r
-       if (panelElm && panelContainerElm) {\r
-               var nodes = panelContainerElm.childNodes;\r
-\r
-               // Hide all other panels\r
-               for (var i=0; i<nodes.length; i++) {\r
-                       if (nodes[i].nodeName == "DIV")\r
-                               nodes[i].className = 'panel';\r
-               }\r
-\r
-               // Show selected panel\r
-               panelElm.className = 'current';\r
-       }\r
-};\r
-\r
-MCTabs.prototype.getAnchor = function() {\r
-       var pos, url = document.location.href;\r
-\r
-       if ((pos = url.lastIndexOf('#')) != -1)\r
-               return url.substring(pos + 1);\r
-\r
-       return "";\r
-};\r
-\r
-// Global instance\r
-var mcTabs = new MCTabs();\r
+/**
+ * $Id: mctabs.js 162 2007-01-03 16:16:52Z spocke $
+ *
+ * Moxiecode DHTML Tabs script.
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2007, 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<nodes.length; i++) {
+                       if (nodes[i].nodeName == "LI")
+                               nodes[i].className = '';
+               }
+
+               // Show selected tab
+               tabElm.className = 'current';
+       }
+
+       if (panelElm && panelContainerElm) {
+               var nodes = panelContainerElm.childNodes;
+
+               // Hide all other panels
+               for (var i=0; i<nodes.length; i++) {
+                       if (nodes[i].nodeName == "DIV")
+                               nodes[i].className = 'panel';
+               }
+
+               // Show selected panel
+               panelElm.className = 'current';
+       }
+};
+
+MCTabs.prototype.getAnchor = function() {
+       var pos, url = document.location.href;
+
+       if ((pos = url.lastIndexOf('#')) != -1)
+               return url.substring(pos + 1);
+
+       return "";
+};
+
+// Global instance
+var mcTabs = new MCTabs();