PageSourceSearch

https://fatalpulse.com/wordpress/wp-content/plugins/fun-with-sidebar-tabs/js/script.js?ver=0.1

js fatalpulse.com collected 2026-10-07 11:06:44 UTC 4,109 bytes, 120 lines download raw bytes

1// JavaScript Document - Jquery version
2
3
4//use in no conflict mode
5//the timeout is to solve a Safari problem.
6setTimeout(function() {
7					
8jQuery(document).ready(function($){
9       // Do jQuery stuff using $
10      
11		//get all sidebars
12		$("div.fw_tabs_tabdisplay").each(function(i){
13			
14			$(this).attr("id" , $(this).attr("id").replace('_x',''));
15			
16			//get the width of the container
17			totalWidth = $(this).width();
18						
19			/************************************/
20			//this is the extra added to compensate for the plus or minus sign
21			//you can modify this if you need to, to compensate.
22			control_margin = 20;			
23			/************************************/			
24						
25			//the width of tabs
26			cumulativeTabWidth = 0;
27			
28			//previous value rounded up
29			previousRoundedUp = 1;
30			
31			//current tab level
32			currentTabLevel = 1;
33			
34			//get the tabs
35			$("li.tab", $(this)).each(function(ti){
36				//add clickyness to them
37				$(this).find("h3.fwTabTitle").click( fwst_display_tab )
38				
39				//calculate tab levels
40				cumulativeTabWidth += $(this).width(); 
41				
42				widthRatio = ( cumulativeTabWidth + control_margin ) / totalWidth;
43				
44				//if this is the first tab of a new level then we need to start the
45				//cumulative width as the container width not carry on where we left off
46				//so recalculate the width ratio using the dual control margin option
47				if ( widthRatio > previousRoundedUp ) {
48					cumulativeTabWidth = ( totalWidth * previousRoundedUp )  + $(this).width();
49				}
50												
51				//recalculate to account for 2nd control box if level 2 or higher
52				if ( widthRatio > 1 ) { widthRatio = ( cumulativeTabWidth + (control_margin * 2) ) / totalWidth; } 
53						
54				//add tab level class
55				$(this).addClass('fwttl'+Math.ceil( widthRatio ));
56				
57				if ( widthRatio > 1 ){ 
58					//if non-primary layer then hide it	
59					$(this).css("display","none"); 
60				}
61				
62				if ( widthRatio > previousRoundedUp ){ 
63					//if this is the first item in a new layer add controls to the previous layer
64					//to switch to this layer
65					//if not on layer 1 then make hidden
66					if ( previousRoundedUp > 1 ) {
67						$("<li><h3>+</h3></li>").addClass('tab').css("display","none").addClass('fwttl'+previousRoundedUp).click(fwst_display_tab_level).insertBefore($(this));
68					} else {
69						$("<li><h3>+</h3></li>").addClass('tab').addClass('fwttl'+previousRoundedUp).click(fwst_display_tab_level).insertBefore($(this));
70					}
71					//going to need another one for going the other way
72					$("<li><h3>-</h3></li>").addClass('tab').css("display","none").addClass('fwttl'+Math.ceil( widthRatio )).click(fwst_display_tab_level).insertBefore($(this));
73				
74				}
75				
76				previousRoundedUp = Math.ceil( widthRatio );
77								
78			});
79			
80			//make the first tab selected
81			$('li.tab:first h3.fwTabTitle' ,$(this)).click();
82			
83		});
84	  
85		function fwst_display_tab( eventObject ){
86			
87			$(this).parents('ul').children('li').find('h3.fwTabTitle').removeClass('selected');
88			$(this).addClass('selected');
89			$(this).parents('div.fw_tabs_tabdisplay').children('div').fadeOut('fast');
90			$(this).parents('div.fw_tabs_tabdisplay').children('div').queue( function(clicked){
91				$(this).empty();
92				$(this).append($(this).parents('div.fw_tabs_tabdisplay').find('ul li h3.fwTabTitle.selected').siblings('div.tab-content').clone(true));
93				$(this).dequeue();
94				}
95			)
96			$(this).parents('div.fw_tabs_tabdisplay').children('div').fadeIn('fast');
97			
98			
99		}
100		
101		function fwst_display_tab_level ( eventObject ){
102			
103			//hide the old ones
104			$( 'li.fwttl'+ currentTabLevel , $(this).parents('div.fw_tabs_tabdisplay') ).hide();
105
106			//show the new ones
107			if ( $("h3" , $(this)).text() == '+' ){ 
108				$( 'li.fwttl'+ (currentTabLevel+1) , $(this).parents("ul") ).show(); 
109				currentTabLevel++;
110				}
111			if ( $("h3" , $(this)).text() == '-' ){ 
112				$( 'li.fwttl'+ (currentTabLevel-1) , $(this).parents("ul") ).show(); 
113				currentTabLevel--;
114				}
115			
116		}
117	  
118     });
119
120});

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.