PageSourceSearch

http://barranquitaspr.net/pueblo/components/com_roksprocket/layouts/tabs/themes/default/tabs.js

js barranquitaspr.net collected 2026-10-03 01:04:19 UTC 5,588 bytes, 34 lines download raw bytes

1/*
2 * @author    RocketTheme http://www.rockettheme.com
3 * @copyright Copyright (C) 2007 - 2012 RocketTheme, LLC
4 * @license   http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
5 */
6((function(){if(typeof this.RokSprocket=="undefined"){this.RokSprocket={};}else{Object.merge(this.RokSprocket,{Tabs:null});}var a=new Class({Implements:[Options,Events],options:{settings:{}},initialize:function(b){this.setOptions(b);
7this.tabs=document.getElements("[data-tabs]");this.settings={};this.timers={};this.statuses={};},attach:function(c,b){c=typeOf(c)=="number"?document.getElements("[data-tabs="+this.getID(c)+"]"):c;
8b=typeOf(b)=="string"?JSON.decode(b):b;var d=(c?new Elements([c]).flatten():this.tabs);d.each(function(e){e.store("roksprocket:tabs:attached",true);this.setSettings(e,b,"restore");
9var g={mouseenter:e.retrieve("roksprocket:tabs:mouseenter",function(h){this.stopTimer.call(this,e);this.pause.call(this,e);}.bind(this)),mouseleave:e.retrieve("roksprocket:tabs:mouseleave",function(h){this.resume.call(this,e);
10this.startTimer.call(this,e);}.bind(this)),navigation:e.retrieve("roksprocket:tabs:relay",function(i,h){this.toTab.call(this,i,e,h);}.bind(this)),next:e.retrieve("roksprocket:tabs:next",function(i,h){this.direction.call(this,i,e,h,"next");
11}.bind(this)),previous:e.retrieve("roksprocket:tabs:previous",function(i,h){this.direction.call(this,i,e,h,"previous");}.bind(this))};["mouseenter","mouseleave"].each(function(h){e.addEvent(h,g[h]);
12});["navigation","next","previous"].each(function(h,j){var k="[data-tabs-"+h+"]";if(j>0){k+=", [data-"+h+"]";}e.addEvent("click:relay("+k+")",g[h]);},this);
13var f=e.getElement("[data-tabs-navigation].active");if(!f){this.toPosition(e,0);}else{if(this.getSettings(e).autoplay&&this.getSettings(e).autoplay.toInt()){this.startTimer(e);
14}}},this);},detach:function(b){b=typeOf(b)=="number"?document.getElements("[data-tabs="+this.getID(b)+"]"):b;var c=(b?new Elements([b]).flatten():this.tabs);
15c.each(function(d){d.store("roksprocket:tabs:attached",false);var e={mouseenter:d.retrieve("roksprocket:tabs:mouseenter"),mouseleave:d.retrieve("roksprocket:tabs:mouseleave"),navigation:d.retrieve("roksprocket:tabs:relay"),next:d.retrieve("roksprocket:tabs:next"),previous:d.retrieve("roksprocket:tabs:previous")};
16["mouseenter","mouseleave"].each(function(f){d.removeEvent(f,e[f]);});["navigation","next","previous"].each(function(f,g){var h="[data-tabs-"+f+"]";if(g>0){h+=", [data-"+f+"]";
17}d.removeEvent("click:relay("+h+")",e[f]);},this);},this);},setSettings:function(b,e,d){var f=this.getID(b),c=Object.clone(this.options.settings);if(!d||!this.settings["id-"+f]){this.settings["id-"+f]=Object.merge(c,e||c);
18}},getSettings:function(b){var c=this.getID(b);return this.settings["id-"+c];},getContainer:function(b){if(!b){b=document.getElements("[data-tabs]");}if(typeOf(b)=="number"){b=document.getElement("[data-tabs="+b+"]");
19}if(typeOf(b)=="string"){b=document.getElement(b);}return b;},getID:function(b){if(typeOf(b)=="number"){b=document.getElement("[data-tabs="+b+"]");}if(typeOf(b)=="string"){b=document.getElement(b);
20}return b.get("data-tabs");},toPosition:function(c,b){c=this.getContainer(c);if(!c.retrieve("roksprocket:tabs:attached")){return;}var e=c.getElements("[data-tabs-navigation]"),d=c.getElements("[data-tabs-panel]"),f=this.getSettings(c);
21if(e[b].hasClass("active")){return;}if(b>e.length-1){b=0;}if(b<0){b=e.length-1;}e.removeClass("active");d.removeClass("active");e[b].addClass("active");
22d[b].addClass("active");if(f.autoplay&&f.autoplay.toInt()){this.startTimer(c);}},toTab:function(g,c,f){if(g){g.preventDefault();}c=this.getContainer(c);
23if(!c.retrieve("roksprocket:tabs:attached")){return;}var e=c.getElements("[data-tabs-navigation]"),d=c.getElements("[data-tabs-panel]"),b=e.indexOf(f);
24if(b==-1){throw new Error('RokSprocket Tabs: Instance ID "'+c.get("data-tabs")+'", index not found.');}this.toPosition(c,b);},direction:function(e,b,d,c){if(e){e.preventDefault();
25}c=c||"next";this[c](b,d);},next:function(c,e){c=this.getContainer(c);if(!c.retrieve("roksprocket:tabs:attached")){return;}if(typeOf(c)=="elements"){return this.nextAll(c,e);
26}var d=c.getElements("[data-tabs-navigation]"),g=d.filter(function(h){return h.hasClass("active");}),b=d.indexOf(g.length?g[0]:"")||0,f=b+1;if(f>d.length-1){f=0;
27}this.toPosition(c,f);},nextAll:function(c,b){c=this.getContainer(c);if(typeOf(c)=="element"){return this.next(c,b);}c.each(function(d){this.next(d,b);
28},this);},previous:function(c,e){c=this.getContainer(c);if(!c.retrieve("roksprocket:tabs:attached")){return;}if(typeOf(c)=="elements"){return this.nextAll(c,e);
29}var d=c.getElements("[data-tabs-navigation]"),g=d.filter(function(h){return h.hasClass("active");}),b=d.indexOf(g.length?g[0]:"")||0,f=b-1;if(f<0){f=d.length-1;
30}this.toPosition(c,f);},previousAll:function(c,b){c=this.getContainer(c);if(typeOf(c)=="element"){return this.previous(c,b);}c.each(function(d){this.previous(d,b);
31},this);},startTimer:function(c){c=this.getContainer(c);if(!c.retrieve("roksprocket:tabs:attached")){return;}var e=this.getSettings(c),g=this.getID(c),b=this.statuses["id-"+g],f=e.autoplay.toInt(),d=(e.delay.toInt())*1000;
32clearTimeout(this.timers["id-"+g]);if(f&&b!="pause"){this.timers["id-"+g]=this.next.delay(d,this,c);}},stopTimer:function(b){b=this.getContainer(b);var c=this.getID(b);
33clearTimeout(this.timers["id-"+c]);},pause:function(b){b=this.getContainer(b);var c=this.getID(b);this.statuses["id-"+c]="pause";},resume:function(b){b=this.getContainer(b);
34var c=this.getID(b);this.statuses["id-"+c]="play";}});this.RokSprocket.Tabs=a;})());

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.