-
+ 7D7AF9FC4981BB5DF4A134FD242AB17478F6BD4E40AB79B642598A92B1378CAB16D3A1C9483DEEDCCA8C9793E510219286E660E58461BC89803C46CFF98B8237
mp-wp/wp-includes/js/tinymce/utils/mctabs.js
(0 . 0)(1 . 75)
132116 /**
132117 * $Id: mctabs.js 758 2008-03-30 13:53:29Z spocke $
132118 *
132119 * Moxiecode DHTML Tabs script.
132120 *
132121 * @author Moxiecode
132122 */
132123
132124 function MCTabs() {
132125 this.settings = [];
132126 };
132127
132128 MCTabs.prototype.init = function(settings) {
132129 this.settings = settings;
132130 };
132131
132132 MCTabs.prototype.getParam = function(name, default_value) {
132133 var value = null;
132134
132135 value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];
132136
132137 // Fix bool values
132138 if (value == "true" || value == "false")
132139 return (value == "true");
132140
132141 return value;
132142 };
132143
132144 MCTabs.prototype.displayTab = function(tab_id, panel_id) {
132145 var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i;
132146
132147 panelElm= document.getElementById(panel_id);
132148 panelContainerElm = panelElm ? panelElm.parentNode : null;
132149 tabElm = document.getElementById(tab_id);
132150 tabContainerElm = tabElm ? tabElm.parentNode : null;
132151 selectionClass = this.getParam('selection_class', 'current');
132152
132153 if (tabElm && tabContainerElm) {
132154 nodes = tabContainerElm.childNodes;
132155
132156 // Hide all other tabs
132157 for (i = 0; i < nodes.length; i++) {
132158 if (nodes[i].nodeName == "LI")
132159 nodes[i].className = '';
132160 }
132161
132162 // Show selected tab
132163 tabElm.className = 'current';
132164 }
132165
132166 if (panelElm && panelContainerElm) {
132167 nodes = panelContainerElm.childNodes;
132168
132169 // Hide all other panels
132170 for (i = 0; i < nodes.length; i++) {
132171 if (nodes[i].nodeName == "DIV")
132172 nodes[i].className = 'panel';
132173 }
132174
132175 // Show selected panel
132176 panelElm.className = 'current';
132177 }
132178 };
132179
132180 MCTabs.prototype.getAnchor = function() {
132181 var pos, url = document.location.href;
132182
132183 if ((pos = url.lastIndexOf('#')) != -1)
132184 return url.substring(pos + 1);
132185
132186 return "";
132187 };
132188
132189 // Global instance
132190 var mcTabs = new MCTabs();