DLSupportJS.Tab

Sub class of DLSupportJS providing support for the tabs.

Summary
DLSupportJS.TabSub class of DLSupportJS providing support for the tabs.
Variables
Contents(array) An array of contents.
ContentWrapper(object) The wrapper element for the contents.
CurrentlyOpenTab(object) The currently opened tab.
Tabs(array) An array of tabs.
TabWrapper(object) The wrapper element for the tabs.
Functions
initializeInitialize the script.
addEventsAdd events to the given tab.
addTabAdd in a new tab with the given ID.
getIdGet the true ID of the given data.
loadPageLoad the page of the given object.
removeTabRemove the given tab and its contents.
showTabShow the given tab while hiding all the other tabs.

Variables

Contents

(array) An array of contents.

ContentWrapper

(object) The wrapper element for the contents.

CurrentlyOpenTab

(object) The currently opened tab.

Tabs

(array) An array of tabs.

TabWrapper

(object) The wrapper element for the tabs.

Functions

initialize

initialize: function(tab,
tabs,
contents)

Initialize the script.

Parameters

tab(string) The ID or the object that should be the currently opened tab.  Note that this should not include the wrapper ID.
tabs(mixed) The ID or the object that is the wrapper for the tabs.
contents(mixed) The ID or the object that is the wrapper for the contents.

addEvents

addEvents: function(tab)

Add events to the given tab.

Parameters

tab(object) The tab that will observe various events.

addTab

addTab: function(id,
name,
data)

Add in a new tab with the given ID.  If the ID already exist, this will just show that tab.

Parameters

id(string) The ID of the tab.
name(string) The title of the tab.
data(string) The data for the content of the tab.
options(object) An object containing various options used by this method.  Defaults to an empty object.

options Attributes

link(boolean) If this is true, then the given “data” should be the URL for which the content should be retrieved.  Defaults to false.
once(boolean) If this is true and if link is true, then the content will only be fetched one time.  Defaults to false.

getId

getId: function(data)

Get the true ID of the given data.

Parameters

data(mixed) The current ID or the object with the ID.
type(string) The type of ID to get.  Possible values are “tab” and “content”.  This is optional and defaults to “tab”.

Returns

(string) The ID.

loadPage

loadPage: function(obj)

Load the page of the given object.

Parameters

obj(object) The object for which the page is to be loaded.

removeTab

removeTab: function(tab)

Remove the given tab and its contents.

Note that if the tab to be removed is the currently opened tab, the new currently opened tab will be the first tab in the tabs list.

Parameters

tab(string) The ID of the tab to remove.  Note that this should not include the wrapper ID.

showTab

showTab: function(tab)

Show the given tab while hiding all the other tabs.

Parameters

tab(object) The tab to show.
JavaScript framework using Prototype (http://www.prototypejs.org), Scriptaculous (http://script.aculo.us), and JS.Class (http://jsclass.jcoglan.com).
initialize: function(tab,
tabs,
contents)
Initialize the script.
addEvents: function(tab)
Add events to the given tab.
addTab: function(id,
name,
data)
Add in a new tab with the given ID.
getId: function(data)
Get the true ID of the given data.
loadPage: function(obj)
Load the page of the given object.
removeTab: function(tab)
Remove the given tab and its contents.
showTab: function(tab)
Show the given tab while hiding all the other tabs.