X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Ftiny_mce%2Futils%2Fmctabs.js;h=458ec86da60a46b3831ac23f9fe981b06bff2089;hb=b05f4eef4014db3885787ef15107cba93c932ac9;hp=9554f8f08ab39e64e9b6f0a12311f1d59478433f;hpb=3cedf3f420a1c9316773aa7423689a4f501a3bf8;p=citadel.git diff --git a/webcit/tiny_mce/utils/mctabs.js b/webcit/tiny_mce/utils/mctabs.js index 9554f8f08..458ec86da 100644 --- a/webcit/tiny_mce/utils/mctabs.js +++ b/webcit/tiny_mce/utils/mctabs.js @@ -1,16 +1,16 @@ /** - * $RCSfile: mctabs.js,v $ - * $Revision: 1.1 $ - * $Date: 2005/08/01 18:36:35 $ + * mctabs.js * - * Moxiecode DHTML Tabs script. + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. * - * @author Moxiecode - * @copyright Copyright © 2004, Moxiecode Systems AB, All rights reserved. + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing */ function MCTabs() { - this.settings = new Array(); + this.settings = []; + this.onChange = tinyMCEPopup.editor.windowManager.createInstance('tinymce.util.Dispatcher'); }; MCTabs.prototype.init = function(settings) { @@ -29,37 +29,79 @@ MCTabs.prototype.getParam = function(name, default_value) { 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'); +MCTabs.prototype.showTab =function(tab){ + tab.className = 'current'; + tab.setAttribute("aria-selected", true); + tab.setAttribute("aria-expanded", true); + tab.tabIndex = 0; +}; + +MCTabs.prototype.hideTab =function(tab){ + var t=this; + + tab.className = ''; + tab.setAttribute("aria-selected", false); + tab.setAttribute("aria-expanded", false); + tab.tabIndex = -1; +}; + +MCTabs.prototype.showPanel = function(panel) { + panel.className = 'current'; + panel.setAttribute("aria-hidden", false); +}; + +MCTabs.prototype.hidePanel = function(panel) { + panel.className = 'panel'; + panel.setAttribute("aria-hidden", true); +}; + +MCTabs.prototype.getPanelForTab = function(tabElm) { + return tinyMCEPopup.dom.getAttrib(tabElm, "aria-controls"); +}; + +MCTabs.prototype.displayTab = function(tab_id, panel_id, avoid_focus) { + var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i, t = this; + + tabElm = document.getElementById(tab_id); + + if (panel_id === undefined) { + panel_id = t.getPanelForTab(tabElm); + } + + panelElm= document.getElementById(panel_id); + panelContainerElm = panelElm ? panelElm.parentNode : null; + tabContainerElm = tabElm ? tabElm.parentNode : null; + selectionClass = t.getParam('selection_class', 'current'); if (tabElm && tabContainerElm) { - var nodes = tabContainerElm.childNodes; + nodes = tabContainerElm.childNodes; // Hide all other tabs - for (var i=0; i