PageSourceSearch

https://restorativejustice.org.uk/sites/default/files/js/js_wEWAQQEa306v_1HhD_lEizlK3GkS4DRDmVds5ECeFI8.js

js restorativejustice.org.uk collected 2026-10-02 03:29:15 UTC 13,481 bytes, 368 lines download raw bytes

1(function ($) {
2	$(document).bind('ready', function() {
3		/*
4		 * Secretly get screen widths and store them as variables for
5		 * later use. First load the elements, then grab and store the
6		 * widths, and finally remove so we don't have stray ghost
7		 * elements in our DOM.
8		*/		
9		var devicePhonePortrait = $('<span class="devicePhonePortrait"></span>').hide().appendTo('body');
10		var devicePhoneLandscape = $('<span class="devicePhoneLandscape"></span>').hide().appendTo('body');
11		var deviceTabletPortrait = $('<span class="deviceTabletPortrait"></span>').hide().appendTo('body');
12		var deviceTabletLandscape = $('<span class="deviceTabletLandscape"></span>').hide().appendTo('body');
13		var deviceDesktopWidescreen = $('<span class="deviceDesktopWidescreen"></span>').hide().appendTo('body');
14    
15    var devicePhonePortraitWidth = parseInt(devicePhonePortrait.css('width'), 10);
16    var devicePhoneLandscapeWidth = parseInt(devicePhoneLandscape.css('width'), 10);
17    var deviceTabletPortraitWidth = parseInt(deviceTabletPortrait.css('width'), 10);
18    var deviceTabletLandscapeWidth = parseInt(deviceTabletLandscape.css('width'), 10);
19    var deviceDesktopWidescreenWidth = parseInt(deviceDesktopWidescreen.css('width'), 10);
20    
21    devicePhonePortrait.remove();
22    devicePhoneLandscape.remove();
23    deviceTabletPortrait.remove();
24    deviceTabletLandscape.remove();
25    deviceDesktopWidescreen.remove();
26    
27    /*
28	   * Check the menu position and add container element
29	   * if required.
30	  */
31    var menuPosition = Drupal.settings.wfmThemeSetSettings.menuPosition;
32    var sideMenu = false;
33
34    if (menuPosition == 'menu_side') {
35			$('<div class="side-menu"></div>').prependTo('#page');
36			var sideMenuWidth = $('.side-menu').outerWidth();
37			var sideMenu = true;
38			var menuOpen = false;
39		}
40		
41		/*
42		 * Button to control the display of our
43		 * mobile menu.
44		*/
45		$('.menu-toggle').click(function() {
46			$('body').toggleClass('open');
47			if($('body').hasClass('open') && sideMenu == true) {
48				$('#wrapper').height($(window).height() + 'px');
49				menuOpen = true;
50			} else if ($('body').hasClass('open')) {
51				menuOpen = true;
52			} else {
53				$('#wrapper').height('auto');
54				menuOpen = false;
55			}
56		});
57		
58		/*
59		 * Check to see whether Masonry is active
60		 * and then load the scripts if need be
61		*/
62		if ( $.isFunction($.fn.masonry) ) {
63			var $container = $('.masonry-cols');
64			
65			$container.masonry({
66			  itemSelector: '.views-row',
67			  columnWidth: 2
68			});
69		}
70		
71		/*
72		 * Check that the form validator plugin is active before
73		 * calling any functions.
74		*/
75		if ($.isFunction($.validate)) {
76			$('.webform-client-form input.form-text').attr({
77				'data-validation': 'alphanumeric',
78				'data-validation-allowing': '- ',
79				'data-validation-optional': 'true',
80				'data-validation-error-msg': 'This field only accepts alphanumeric characters (A-Z, 0-9).'
81			});
82			$('.webform-client-form input.email').attr({
83				'data-validation': 'email',
84				'data-validation-optional': 'true',
85				'data-validation-error-msg': 'Please enter a valid email address.'
86			});
87			$('.webform-client-form textarea').attr({
88				'data-validation': 'custom',
89				'data-validation-regexp': '^[a-zA-Z0-9?$@#()\'!,+\-=_:.&€£*%\s]+$',
90				'data-validation-optional': 'true',
91				'data-validation-error-msg': 'Please enter your message.'
92			});
93			/*
94			 * Remove optional validation for forms that require
95			 * an input.
96			*/
97			$('.webform-client-form .required').removeAttr('data-validation-optional');
98			/*
99			 * Apply validation rules to select forms.
100			*/
101			$.validate({
102			  form : '.webform-client-form'
103			});
104		}
105	
106		$(window).bind('resize', function(){
107			var currentWindowWidth = $(window).width();
108			var currentWindowHeight = $(window).height();
109			var menuHeight = $('.side-menu').innerHeight();
110			if (currentWindowWidth <= devicePhoneLandscapeWidth && sideMenu == true) {
111				var mobileMenuWidth = parseInt($('.region-header').outerWidth(), 10);
112				if(!$('body').hasClass('open') && menuOpen == true) {
113					$('body').addClass('open');
114				}
115				/*
116				 * Set widths
117				*/
118				$('#wrapper, #regions').width(currentWindowWidth + 'px');
119				$('#page').width(parseInt(currentWindowWidth, 10) + parseInt(sideMenuWidth, 10) + 'px');
120				/*
121				 * Set heights
122				*/
123				if($('body').hasClass('open')) {
124					$('#wrapper').height($(window).height() + 'px');
125				} else {
126					$('#wrapper').height('auto');
127				}
128				$('.side-menu').height($(window).height() + 'px');
129
130				/*
131				 * Move the header
132				*/
133				$('.region-header').detach().prependTo('.side-menu');
134			}	else {
135				if($('body').hasClass('open') && sideMenu == true) {
136					$('body').removeClass('open');
137				}
138				$('.region-header').detach().appendTo('#header .holder');
139				$('#wrapper, #regions, #page').width('auto');
140			}
141		}).trigger('resize');
142	});
143})(jQuery);;
144(function($) {
145	function panelUI() {
146		$('.views-field-field-question').slice(1).addClass('closed');
147		$('.closed').next('.views-field-field-answer').hide();
148		$('.views-field-field-question').click(function() {
149			var el = $(this);
150			if(el.hasClass('closed')) {
151				el.removeClass('closed');
152			} else {
153				el.addClass('closed');
154			}
155			el.next('.views-field-field-answer').slideToggle('250', 'easeInOutCirc');
156			return false;
157		});
158	}
159	
160	$(document).ready(function() {
161		panelUI();
162	});	
163})(jQuery);;
164/*
165 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
166 *
167 * Uses the built in easing capabilities added In jQuery 1.1
168 * to offer multiple easing options
169 *
170 * TERMS OF USE - jQuery Easing
171 * 
172 * Open source under the BSD License. 
173 * 
174 * Copyright © 2008 George McGinley Smith
175 * All rights reserved.
176 * 
177 * Redistribution and use in source and binary forms, with or without modification, 
178 * are permitted provided that the following conditions are met:
179 * 
180 * Redistributions of source code must retain the above copyright notice, this list of 
181 * conditions and the following disclaimer.
182 * Redistributions in binary form must reproduce the above copyright notice, this list 
183 * of conditions and the following disclaimer in the documentation and/or other materials 
184 * provided with the distribution.
185 * 
186 * Neither the name of the author nor the names of contributors may be used to endorse 
187 * or promote products derived from this software without specific prior written permission.
188 * 
189 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
190 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
191 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
192 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
vendor: 5,091 bytes, lines 193-338
193 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
194 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
195 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
196 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
197 * OF THE POSSIBILITY OF SUCH DAMAGE. 
198 *
199*/
200
201// t: current time, b: begInnIng value, c: change In value, d: duration
202jQuery.easing['jswing'] = jQuery.easing['swing'];
203
204jQuery.extend( jQuery.easing,
205{
206	def: 'easeOutQuad',
207	swing: function (x, t, b, c, d) {
208		//alert(jQuery.easing.default);
209		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
210	},
211	easeInQuad: function (x, t, b, c, d) {
212		return c*(t/=d)*t + b;
213	},
214	easeOutQuad: function (x, t, b, c, d) {
215		return -c *(t/=d)*(t-2) + b;
216	},
217	easeInOutQuad: function (x, t, b, c, d) {
218		if ((t/=d/2) < 1) return c/2*t*t + b;
219		return -c/2 * ((--t)*(t-2) - 1) + b;
220	},
221	easeInCubic: function (x, t, b, c, d) {
222		return c*(t/=d)*t*t + b;
223	},
224	easeOutCubic: function (x, t, b, c, d) {
225		return c*((t=t/d-1)*t*t + 1) + b;
226	},
227	easeInOutCubic: function (x, t, b, c, d) {
228		if ((t/=d/2) < 1) return c/2*t*t*t + b;
229		return c/2*((t-=2)*t*t + 2) + b;
230	},
231	easeInQuart: function (x, t, b, c, d) {
232		return c*(t/=d)*t*t*t + b;
233	},
234	easeOutQuart: function (x, t, b, c, d) {
235		return -c * ((t=t/d-1)*t*t*t - 1) + b;
236	},
237	easeInOutQuart: function (x, t, b, c, d) {
238		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
239		return -c/2 * ((t-=2)*t*t*t - 2) + b;
240	},
241	easeInQuint: function (x, t, b, c, d) {
242		return c*(t/=d)*t*t*t*t + b;
243	},
244	easeOutQuint: function (x, t, b, c, d) {
245		return c*((t=t/d-1)*t*t*t*t + 1) + b;
246	},
247	easeInOutQuint: function (x, t, b, c, d) {
248		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
249		return c/2*((t-=2)*t*t*t*t + 2) + b;
250	},
251	easeInSine: function (x, t, b, c, d) {
252		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
253	},
254	easeOutSine: function (x, t, b, c, d) {
255		return c * Math.sin(t/d * (Math.PI/2)) + b;
256	},
257	easeInOutSine: function (x, t, b, c, d) {
258		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
259	},
260	easeInExpo: function (x, t, b, c, d) {
261		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
262	},
263	easeOutExpo: function (x, t, b, c, d) {
264		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
265	},
266	easeInOutExpo: function (x, t, b, c, d) {
267		if (t==0) return b;
268		if (t==d) return b+c;
269		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
270		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
271	},
272	easeInCirc: function (x, t, b, c, d) {
273		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
274	},
275	easeOutCirc: function (x, t, b, c, d) {
276		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
277	},
278	easeInOutCirc: function (x, t, b, c, d) {
279		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
280		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
281	},
282	easeInElastic: function (x, t, b, c, d) {
283		var s=1.70158;var p=0;var a=c;
284		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
285		if (a < Math.abs(c)) { a=c; var s=p/4; }
286		else var s = p/(2*Math.PI) * Math.asin (c/a);
287		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
288	},
289	easeOutElastic: function (x, t, b, c, d) {
290		var s=1.70158;var p=0;var a=c;
291		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
292		if (a < Math.abs(c)) { a=c; var s=p/4; }
293		else var s = p/(2*Math.PI) * Math.asin (c/a);
294		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
295	},
296	easeInOutElastic: function (x, t, b, c, d) {
297		var s=1.70158;var p=0;var a=c;
298		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
299		if (a < Math.abs(c)) { a=c; var s=p/4; }
300		else var s = p/(2*Math.PI) * Math.asin (c/a);
301		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
302		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
303	},
304	easeInBack: function (x, t, b, c, d, s) {
305		if (s == undefined) s = 1.70158;
306		return c*(t/=d)*t*((s+1)*t - s) + b;
307	},
308	easeOutBack: function (x, t, b, c, d, s) {
309		if (s == undefined) s = 1.70158;
310		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
311	},
312	easeInOutBack: function (x, t, b, c, d, s) {
313		if (s == undefined) s = 1.70158; 
314		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
315		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
316	},
317	easeInBounce: function (x, t, b, c, d) {
318		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
319	},
320	easeOutBounce: function (x, t, b, c, d) {
321		if ((t/=d) < (1/2.75)) {
322			return c*(7.5625*t*t) + b;
323		} else if (t < (2/2.75)) {
324			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
325		} else if (t < (2.5/2.75)) {
326			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
327		} else {
328			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
329		}
330	},
331	easeInOutBounce: function (x, t, b, c, d) {
332		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
333		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
334	}
335});
336
337/*
338 *
339 * TERMS OF USE - EASING EQUATIONS
340 * 
341 * Open source under the BSD License. 
342 * 
343 * Copyright © 2001 Robert Penner
344 * All rights reserved.
345 * 
346 * Redistribution and use in source and binary forms, with or without modification, 
347 * are permitted provided that the following conditions are met:
348 * 
349 * Redistributions of source code must retain the above copyright notice, this list of 
350 * conditions and the following disclaimer.
351 * Redistributions in binary form must reproduce the above copyright notice, this list 
352 * of conditions and the following disclaimer in the documentation and/or other materials 
353 * provided with the distribution.
354 * 
355 * Neither the name of the author nor the names of contributors may be used to endorse 
356 * or promote products derived from this software without specific prior written permission.
357 * 
358 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
359 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
360 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
361 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
362 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
363 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
364 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
365 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
366 * OF THE POSSIBILITY OF SUCH DAMAGE. 
367 *
368 */;

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.