PageSourceSearch

https://pastplace.org/js/default.js

js pastplace.org collected 2026-09-30 13:11:06 UTC 8,306 bytes, 240 lines download raw bytes

1//=============================================================================
2/* 
3
4	v1.0
5	2009/06/16
6
7	Headscape
8	Written by Ed Merritt ([email protected])
9
10
11*/
12//=============================================================================
13// Adds a class to the body tag so any elements on the page can be styled differently if the browser supports JS
14
15$(document).ready(function() {
16	$("body").addClass("fullyFeatured");
17});
18
19//=============================================================================
20// Adds a class to the first and last <li> of every list
21
22$(document).ready(function() {
23	$("ul li:first-child").addClass("firstLi");
24	$("ul li:last-child").addClass("lastLi");
25	$("ol li:first-child").addClass("firstLi");
26	$("ol li:last-child").addClass("lastLi");
27});
28
29
30
31//=============================================================================
32//tabs
33
34$(document).ready(function(){
35	$('.tabGroup .tab').hide(); // Hide all divs
36	$('.tabGroup .tab:first').show(); // Show the first div
37	$('.tabGroup .tabs li:first').addClass('current'); // Set the class of the first link to active
38	$('.tabGroup .tabs li a').click(function(){ //When any link is clicked
39		$('.tabGroup .tabs li').removeClass('current'); // Remove active class from all links
40		$(this).parent().addClass('current'); // Set clicked link class to active
41		var currentTab = $(this).attr('href'); // Set variable currentTab to value of href attribute of clicked link
42		$('.tabGroup .tab').hide(); // Hide all divs
43		$(currentTab).show(); // Show div with id equal to variable currentTab
44		return false;
45	});
46	if($(window.location.hash).is('.tabGroup .tab')) {
47		$(window.location.hash).parents('.tabGroup').find('.tabs li a[href="'+window.location.hash+'"]').triggerHandler('click');
48	}
49});
50
51
52//=============================================================================
53// timeline
54/*
55$(document).ready(function(){
56  $(".tlDecade h2").wrapInner("<span></span>");
57  $('.tlTabs').append($('.tlDecade h2').clone());
58	$('.tlTabs h2 span a').click(function(){ //When any link is clicked
59		$('span').removeClass('tlCurrent');
60		$(this).parent().addClass('tlCurrent');
61		var currentTimeline = $(this).attr('href'); // Set variable currentTab to value of href attribute of clicked link
62		$('.tlInfo').hide(); // Hide all divs
63		$(currentTimeline.substring(currentTimeline.indexOf('#'))).show(); // Show div with id equal to variable currentTab
64		return false;
65	});
66  $(".tlTabs h2:odd").addClass("tlAlt");
67});
68*/
69
70//=============================================================================
71// sub navigation
72/*
73$(document).ready(function() {
74	$('#subNavigation li.current').prev('li').children('a').css('border', '0');
75});
76*/
77
78//=============================================================================
79// read more on body content
80
81$(document).ready(function() {
82	$('.readMoreColumns2').parent().addClass('hideable2');
83	$('.readMoreColumns2').parent().before('<div class="textColumns2 textColumns2New "></div>');	
84	$('.readMoreColumns2').prevAll().appendTo(".textColumns2New");
85	$('.readMoreColumns2').remove();
86	$('.textColumns2New').after('<hr class="readMoreColumns2" /><a class="readMoreLink2"><span class="readMoreLinkA">Show further information...</span><span class="readMoreLinkB">Hide further information...</span></a>');
87	$(".hideable2").css({'display' : 'none'});
88});
89
90$(document).ready(function(){
91	$(".readMoreLink2").click(function(){
92	  $(".hideable2").toggle("fast");
93		$(this).toggleClass("readMoreActive2");
94	});
95});
96
97
98//=============================================================================
99// read more on body content
100
101$(document).ready(function() {
102	$('.readMoreColumns1').parent().addClass('hideable1');
103	$('.readMoreColumns1').parent().before('<div class="textColumns1 textColumns1New "></div>');	
104	$('.readMoreColumns1').prevAll().appendTo(".textColumns1New");
105	$('.readMoreColumns1').remove();
106	$('.textColumns1New').after('<hr class="readMoreColumns1" /><a class="readMoreLink1"><span class="readMoreLinkA">Show further information...</span><span class="readMoreLinkB">Hide further information...</span></a>');
107	$(".hideable1").css({'display' : 'none'});
108});
109
110$(document).ready(function(){
111	$(".readMoreLink1").click(function(){
112	  $(".hideable1").toggle("fast");
113		$(this).toggleClass("readMoreActive1");
114	});
115});
116
117
118//=============================================================================
119// travel writing block links
120
121$(document).ready(function(){
122	$(".travelBlock .cols6").click(function(){
123	  window.location=$(this).find("a").attr("href"); return false;
124	});
125});
126$(document).ready(function(){
127	$(".statsBlock .cols6").click(function(){
128	  window.location=$(this).find("a").attr("href"); return false;
129	});
130});
131
132
133
134
135
136//=============================================================================
137// column margins
138
139$(document).ready(function(){
140	$(".cols5 + .cols13").css('margin-right', '0');
141	$(".cols13 + .cols13").css('padding-top', '0');
142	$(".cols18 + .cols10").css('padding-top', '0');
143	$(".cols18 + .cols10 + .cols8").css('padding-top', '0');
144	$(".cols13 + hr + .cols13").css('padding-top', '0');
145	$(".cols13 .cols8 + .cols5").css('margin-right', '0');
146	$(".cols13 + .cols5").css('margin-right', '0');
147	$(".cols10 + .cols8").css('margin-right', '0');
148	$(".cols9 + .cols9").css('margin-right', '0');
149	$(".cols6_5 + .cols6_5").css('margin-right', '0');
150	$(".cols8 + .cols5 + .cols5").css('margin-right', '0');
151	
152	// All below has been modified by jw
153//	$('.travelBlock .cols6').css('width', '290px');	
154//	$('.travelBlock .cols6:nth-child(n)').css('margin-right', '25px');
155//	$('.travelBlock .cols6:nth-child(3n)').css('margin-right', '0');
156
157//	$('.cols5bkg .travelBlock .cols6').css('width', '322px');	
158//	$('.cols5bkg .travelBlock .cols6:nth-child(2n)').css('margin-right', '0');
159//	$('.cols5bkg .travelBlock .cols6:nth-child(4n)').css('margin-right', '35px');	
160	
161	// Statistical Atlas page uses inline styles instead
162//	$('.statsBlock .cols6:nth-child(3n)').css('margin-right', '0');
163	
164	// Unit home page statsBlock
165//	$('.cols5bkg .statsBlock .cols6').css('width', '310px');
166//	$('.cols5bkg .statsBlock .cols6:nth-child(n)').css('margin-right', '25px');	
167//	$('.cols5bkg .statsBlock .cols6:nth-child(2n)').css('margin-right', '0');
168});
169
170
171//=============================================================================
172// map position fixed
173
174$(document).ready(function(){
175	if (jQuery(window).height() > 750) {
176		$('.tPlaces .map').css('position', 'fixed');
177	}
178});
179
180
181//=============================================================================
182// alt table rows
183
184$(document).ready(function(){
185  $("table.stripe tbody tr:nth-child(even)").addClass("alternate");
186});
187
188$(document).ready(function(){
189  $("table.stripe-multi-tbody tbody:nth-child(odd)").addClass("alternate");
190});
191
192$(document).ready(function(){
193  $("table.stripe-no-thead tr:nth-child(odd)").addClass("alternate");
194});
195
196
197//=============================================================================
198// empty table cells
199
200$(document).ready(function(){
201  $("table td:empty").text(' ');
202});
203
204
205
206//=============================================================================
207// map size. Disabled because now using alternative code
208/*
209$(document).ready(function(){
210if (!jQuery.browser.msie || parseInt(jQuery.browser.version)>6) {
211  $(".mapSize").live("click",function(){
212		$(this).parent().toggleClass("colsPercent100");
213		$(this).addClass("mapSizeSmaller").removeClass("mapSize");
214	});
215}
216});
217	
218$(document).ready(function(){
219if (!jQuery.browser.msie || parseInt(jQuery.browser.version)>6) {
220  $(".mapSizeSmaller").live("click",function(){
221		$(this).parent().toggleClass("colsPercent100");
222		$(this).removeClass("mapSizeSmaller").addClass("mapSize");
223	});
224}
225});
226*/
227
228
229
230//=============================================================================
231// empty table cells
232
233$(document).ready(function(){
234  $(".mapLanding #tab01 .colRight").clone().insertBefore("#tab02 .cols8");
235  $(".mapLanding #tab01 .colRight").clone().insertBefore("#tab03 .cols8");
236});
237
238
239
240

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.