/**
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
Object.append(Browser.Features, {
localstorage: (function() {
return ('localStorage' in window) && window.localStorage !== null;
})()
});
/**
* Tabs behavior
*
* @package Joomla!
* @subpackage JavaScript
* @since 1.5
*/
var JTabs = new Class({
Implements: [Options, Events],
options : {
display: 0,
useStorage: true,
onActive: function(title, description) {
description.setStyle('display', 'block');
title.addClass('open').removeClass('closed');
},
onBackground: function(title, description){
description.setStyle('display', 'none');
title.addClass('closed').removeClass('open');
},
titleSelector: 'dt',
descriptionSelector: 'dd'
},
initialize: function(dlist, options){
this.setOptions(options);
this.dlist = document.id(dlist);
this.titles = this.dlist.getChildren(this.options.titleSelector);
this.descriptions = this.dlist.getChildren(this.options.descriptionSelector);
this.content = new Element('div').inject(this.dlist, 'after').addClass('current');
this.storageName = 'jpanetabs_'+this.dlist.id;
if (this.options.useStorage) {
if (Browser.Features.localstorage) {
this.options.display = localStorage[this.storageName];
} else {
this.options.display = Cookie.read(this.storageName);
}
}
if (this.options.display === null || this.options.display === undefined) {
this.options.display = 0;
}
this.options.display = this.options.display.toInt().limit(0, this.titles.length-1);
for (var i = 0, l = this.titles.length; i < l; i++)
{
var title = this.titles[i];
var description = this.descriptions[i];
title.setStyle('cursor', 'pointer');
title.addEvent('click', this.display.bind(this, i));
description.inject(this.content);
}
this.display(this.options.display);
if (this.options.initialize) this.options.initialize.call(this);
},
hideAllBut: function(but) {
for (var i = 0, l = this.titles.length; i < l; i++)
{
if (i != but) this.fireEvent('onBackground', [this.titles[i], this.descriptions[i]]);
}
},
display: function(i) {
this.hideAllBut(i);
this.fireEvent('onActive', [this.titles[i], this.descriptions[i]]);
if (this.options.useStorage) {
if (Browser.Features.localstorage) {
localStorage[this.storageName] = i;
} else {
Cookie.write(this.storageName, i);
}
}
}
});
| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| calendar-setup-uncompressed.js | 2013-02-26 20:18 | 8.75 KB | 76129f60960:kunden | -xw-x----- | |
| calendar-setup.js | 2013-02-26 20:18 | 3.02 KB | 76129f60960:kunden | -xw-x----- | |
| calendar-uncompressed.js | 2013-02-26 20:18 | 48.07 KB | 76129f60960:kunden | -xw-x----- | |
| calendar.js | 2013-02-26 20:18 | 29.6 KB | 76129f60960:kunden | -xw-x----- | |
| caption-uncompressed.js | 2013-02-26 20:18 | 1.47 KB | 76129f60960:kunden | -xw-x----- | |
| caption.js | 2013-02-26 20:18 | 729 B | 76129f60960:kunden | -xw-x----- | |
| combobox-uncompressed.js | 2013-02-26 20:18 | 4.76 KB | 76129f60960:kunden | -xw-x----- | |
| combobox.js | 2013-02-26 20:18 | 1.84 KB | 76129f60960:kunden | -xw-x----- | |
| core-uncompressed.js | 2013-02-26 20:18 | 13.16 KB | 76129f60960:kunden | -xw-x----- | |
| core.js | 2013-02-26 20:18 | 4.67 KB | 76129f60960:kunden | -xw-x----- | |
| highlighter-uncompressed.js | 2013-02-26 20:18 | 2.87 KB | 76129f60960:kunden | -xw-x----- | |
| highlighter.js | 2013-02-26 20:18 | 1.77 KB | 76129f60960:kunden | -xw-x----- | |
| index.html | 2013-02-26 20:18 | 30 B | 76129f60960:kunden | -xw-x----- | |
| modal-uncompressed.js | 2013-02-26 20:18 | 12.83 KB | 76129f60960:kunden | -xw-x----- | |
| modal.js | 2013-02-26 20:18 | 9.5 KB | 76129f60960:kunden | -xw-x----- | |
| mooRainbow-uncompressed.js | 2013-02-26 20:18 | 18.84 KB | 76129f60960:kunden | -xw-x----- | |
| mooRainbow.js | 2013-02-26 20:18 | 13.35 KB | 76129f60960:kunden | -xw-x----- | |
| mootools-core-uncompressed.js | 2013-02-26 20:18 | 156.73 KB | 76129f60960:kunden | -xw-x----- | |
| mootools-core.js | 2013-02-26 20:18 | 94.1 KB | 76129f60960:kunden | -xw-x----- | |
| mootools-more-uncompressed.js | 2013-02-26 20:18 | 343.17 KB | 76129f60960:kunden | -xw-x----- | |
| mootools-more.js | 2013-02-26 20:18 | 232.75 KB | 76129f60960:kunden | -xw-x----- | |
| mootree-uncompressed.js | 2013-02-26 20:18 | 21.39 KB | 76129f60960:kunden | -xw-x----- | |
| mootree.js | 2013-02-26 20:18 | 5.95 KB | 76129f60960:kunden | -xw-x----- | |
| multiselect.js | 2013-02-26 20:18 | 1.08 KB | 76129f60960:kunden | -xw-x----- | |
| passwordstrength.js | 2013-02-26 20:18 | 2.36 KB | 76129f60960:kunden | -xw-x----- | |
| progressbar-uncompressed.js | 2013-02-26 20:18 | 2.3 KB | 76129f60960:kunden | -xw-x----- | |
| progressbar.js | 2013-02-26 20:18 | 1.44 KB | 76129f60960:kunden | -xw-x----- | |
| swf-uncompressed.js | 2013-02-26 20:18 | 11.09 KB | 76129f60960:kunden | -xw-x----- | |
| swf.js | 2013-02-26 20:18 | 7.06 KB | 76129f60960:kunden | -xw-x----- | |
| switcher-uncompressed.js | 2013-02-26 20:18 | 1.92 KB | 76129f60960:kunden | -xw-x----- | |
| switcher.js | 2013-02-26 20:18 | 1.29 KB | 76129f60960:kunden | -xw-x----- | |
| tabs.js | 2013-02-26 20:18 | 2.45 KB | 76129f60960:kunden | -xw-x----- | |
| uploader-uncompressed.js | 2013-02-26 20:18 | 6.13 KB | 76129f60960:kunden | -xw-x----- | |
| uploader.js | 2013-02-26 20:18 | 4.91 KB | 76129f60960:kunden | -xw-x----- | |
| validate-uncompressed.js | 2013-02-26 20:18 | 5.03 KB | 76129f60960:kunden | -xw-x----- | |
| validate.js | 2013-02-26 20:18 | 2.85 KB | 76129f60960:kunden | -xw-x----- | |