- md5
- c891da3135c3ac3152983a0d3e72165a
- sha1
- ba9ab29a8ec3a7a03be9f7b0fafb018ed690d938
- sha256
- 865f4744aacb7f8de9c612ebf96d519e98dd94c5cf59261fdb3c6563a871b84f
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
/**
* @version $Id: cookie.js 6138 2007-01-02 03:44:18Z eddiea $
* @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
/**
* Tabs behavior
*
* @package Joomla!
* @subpackage JavaScript
* @since 1.5
*/
var JTabs = new Class({
getOptions: function(){
return {
display: 0,
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');
}
};
},
initialize: function(dlist, options){
this.dlist = $(dlist);
this.setOptions(this.getOptions(), options);
this.titles = this.dlist.getElements('dt');
this.descriptions = this.dlist.getElements('dd');
this.content = new Element('div').injectAfter(this.dlist).addClass('current');
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.injectInside(this.content);
}
if ($chk(this.options.display)) 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]])
}
});
JTabs.implement(new Events);
JTabs.implement(new Options);
The same content is in 11 releases, Joomla 1.5.16 to 1.5.26. See them all, or every version of this file.