PageSourceSearch

https://www.landscape.ac.uk/SiteElements/Javascript/global.js

js landscape.ac.uk collected 2026-09-26 08:38:04 UTC 2,618 bytes, 78 lines download raw bytes

1window.$ = jQuery;
2
3$.fn.hoverClass = function(c) {
4	return this.each(function(){
5		$(this).hover( 
6			function() { $(this).addClass(c);  },
7			function() { $(this).removeClass(c); }
8		);
9	});
10};
11
12$(document).ready(function() {
13
14	// add class to body to show we have javascript
15	$("body").addClass("js");
16
17	// first/last item fixes (for IE)
18	$("#header .sys_left ul li:last-child, #homepage #spotlights .sys_spotlight ul li:last-child, #internal #internalNav ul li:last-child, #internal #main #pageTools ul li:last-child, #footer ul li:last-child").addClass("sys_last");
19	$("#internal #internalNav ul li:first-child, #internal #content .sys_relatedRight h2:first-child, #internal #content .sys_relatedRight ul li:first-child").addClass("sys_first");
20
21	// rollover fix (for IE6)
22	$("#menu ul li:not(li li), #peopleLookUp tr").hoverClass("sys_active");
23
24	// clear default text from search boxes
25	$("#header .sys_right fieldset input, #internal #main #pageTools fieldset input, #internal #main input#jobSearch, .sys_pressanykey input").focus(function (i) {
26		if($(this).attr("value") == "keyword(s)") {
27			$(this).attr("value", "");
28		};
29	}).blur(function (i) {
30		if($(this).attr("value") == "") {
31			$(this).attr("value", "keyword(s)");
32		};
33	});
34	
35  	// Job search clear text from input
36  
37  	$('#jobSearch').val("");
38  
39	// onfocus for general forms
40	$(".sys_genForm :input[type=text], .sys_genForm textarea").focus(function() {
41		$(this).addClass("sys_active");
42		if(this.value == this.defaultValue) {
43			this.value = "";
44		};
45	}).blur(function() {
46		$(this).removeClass("sys_active");
47		if(this.value == "") {
48			this.value = this.defaultValue;
49		};
50	});
51
52	
53
54	// advanced search
55	$(".sys_advancedSearchBox").css("display","none");							
56		$("#advancedSearch").click(function(){	
57			if($(".sys_advancedSearchBox").css("display") == "none") {
58					$(".sys_advancedSearchBox").css("display", "block");
59					$(".sys_searchBox").css("display", "none");
60					$("#advancedSearch a").text("Simple Search");
61					}
62			else if($(".sys_advancedSearchBox").css("display") == "block") {
63						$(".sys_advancedSearchBox").css("display", "none");
64						$(".sys_searchBox").css("display", "block");
65						$("#advancedSearch a").text("Advanced Search");
66					};
67	});
68
69	// A to Z list of letters
70	$(".sys_atoz-control ul").each(function (i) {
71		$(this).find("a").wrapInner('<span><span></span></span>');
72		$(this).find("li.sys_noresults span").wrap('<a href="#"><span></span></a>');
73	});
74	
75	// A to Z Current Letter
76	$(".sys_atoz-control-currentletter big").wrapInner('<span><span><span><span></span></span></span></span>');
77	
78});

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.