PageSourceSearch

https://twinlakesbrewingcompany.com/brew/js/thickbox_huh.js

js twinlakesbrewingcompany.com collected 2026-09-27 02:21:36 UTC 13,035 bytes, 335 lines download raw bytes

1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
2let window = _____WB$wombat$assign$function_____("window");
3let self = _____WB$wombat$assign$function_____("self");
4let document = _____WB$wombat$assign$function_____("document");
5let location = _____WB$wombat$assign$function_____("location");
6let top = _____WB$wombat$assign$function_____("top");
7let parent = _____WB$wombat$assign$function_____("parent");
8let frames = _____WB$wombat$assign$function_____("frames");
9let opens = _____WB$wombat$assign$function_____("opens");
10/*
11 * Thickbox 3.1 - One Box To Rule Them All.
12 * By Cody Lindley (http://www.codylindley.com)
13 * Copyright (c) 2007 cody lindley
14 * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
15*/
16
17if ( typeof tb_pathToImage != 'string' ) {
18	var tb_pathToImage = "../wp-includes/js/thickbox/loadingAnimation.gif";
19}
20if ( typeof tb_closeImage != 'string' ) {
21	var tb_closeImage = "../wp-includes/js/thickbox/tb-close.png";
22}
23
24/*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/
25
26//on page load call tb_init
27jQuery(document).ready(function(){
28	tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
29	imgLoader = new Image();// preload image
30	imgLoader.src = tb_pathToImage;
31});
32
33//add thickbox to href & area elements that have a class of .thickbox
34function tb_init(domChunk){
35	jQuery(domChunk).live('click', tb_click);
36}
37
38function tb_click(){
39	var t = this.title || this.name || null;
40	var a = this.href || this.alt;
41	var g = this.rel || false;
42	tb_show(t,a,g);
43	this.blur();
44	return false;
45}
46
47function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link
48
49	try {
50		if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
51			jQuery("body","html").css({height: "100%", width: "100%"});
52			jQuery("html").css("overflow","hidden");
53			if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
54				jQuery("body").append("<iframe id='TB_HideSelect'>"+thickboxL10n.noiframes+"</iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
55				jQuery("#TB_overlay").click(tb_remove);
56			}
57		}else{//all others
58			if(document.getElementById("TB_overlay") === null){
59				jQuery("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");
60				jQuery("#TB_overlay").click(tb_remove);
61			}
62		}
63
64		if(tb_detectMacXFF()){
65			jQuery("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash
66		}else{
67			jQuery("#TB_overlay").addClass("TB_overlayBG");//use background and opacity
68		}
69
70		if(caption===null){caption="";}
71		jQuery("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");//add loader to the page
72		jQuery('#TB_load').show();//show loader
73
74		var baseURL;
75	   if(url.indexOf("?")!==-1){ //ff there is a query string involved
76			baseURL = url.substr(0, url.indexOf("?"));
77	   }else{
78	   		baseURL = url;
79	   }
80
81	   var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
82	   var urlType = baseURL.toLowerCase().match(urlString);
83
84		if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to show images
85
86			TB_PrevCaption = "";
87			TB_PrevURL = "";
88			TB_PrevHTML = "";
89			TB_NextCaption = "";
90			TB_NextURL = "";
91			TB_NextHTML = "";
92			TB_imageCount = "";
93			TB_FoundURL = false;
94			if(imageGroup){
95				TB_TempArray = jQuery("a[rel="+imageGroup+"]").get();
96				for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) {
97					var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);
98						if (!(TB_TempArray[TB_Counter].href == url)) {
99							if (TB_FoundURL) {
100								TB_NextCaption = TB_TempArray[TB_Counter].title;
101								TB_NextURL = TB_TempArray[TB_Counter].href;
102								TB_NextHTML = "<span id='TB_next'>&nbsp;&nbsp;<a href='#'>"+thickboxL10n.next+"</a></span>";
103							} else {
104								TB_PrevCaption = TB_TempArray[TB_Counter].title;
105								TB_PrevURL = TB_TempArray[TB_Counter].href;
106								TB_PrevHTML = "<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>"+thickboxL10n.prev+"</a></span>";
107							}
108						} else {
109							TB_FoundURL = true;
110							TB_imageCount = thickboxL10n.image + ' ' + (TB_Counter + 1) + ' ' + thickboxL10n.of + ' ' + (TB_TempArray.length);
111						}
112				}
113			}
114
115			imgPreloader = new Image();
116			imgPreloader.onload = function(){
117			imgPreloader.onload = null;
118
119			// Resizing large images - orginal by Christian Montoya edited by me.
120			var pagesize = tb_getPageSize();
121			var x = pagesize[0] - 150;
122			var y = pagesize[1] - 150;
123			var imageWidth = imgPreloader.width;
124			var imageHeight = imgPreloader.height;
125			if (imageWidth > x) {
126				imageHeight = imageHeight * (x / imageWidth);
127				imageWidth = x;
128				if (imageHeight > y) {
129					imageWidth = imageWidth * (y / imageHeight);
130					imageHeight = y;
131				}
132			} else if (imageHeight > y) {
133				imageWidth = imageWidth * (y / imageHeight);
134				imageHeight = y;
135				if (imageWidth > x) {
136					imageHeight = imageHeight * (x / imageWidth);
137					imageWidth = x;
138				}
139			}
140			// End Resizing
141
142			TB_WIDTH = imageWidth + 30;
143			TB_HEIGHT = imageHeight + 60;
144			jQuery("#TB_window").append("<a href='' id='TB_ImageOff' title='"+thickboxL10n.close+"'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='"+thickboxL10n.close+"'><img src='" + tb_closeImage + "' /></a></div>");
145
146			jQuery("#TB_closeWindowButton").click(tb_remove);
147
148			if (!(TB_PrevHTML === "")) {
149				function goPrev(){
150					if(jQuery(document).unbind("click",goPrev)){jQuery(document).unbind("click",goPrev);}
151					jQuery("#TB_window").remove();
152					jQuery("body").append("<div id='TB_window'></div>");
153					tb_show(TB_PrevCaption, TB_PrevURL, imageGroup);
154					return false;
155				}
156				jQuery("#TB_prev").click(goPrev);
157			}
158
159			if (!(TB_NextHTML === "")) {
160				function goNext(){
161					jQuery("#TB_window").remove();
162					jQuery("body").append("<div id='TB_window'></div>");
163					tb_show(TB_NextCaption, TB_NextURL, imageGroup);
164					return false;
165				}
166				jQuery("#TB_next").click(goNext);
167
168			}
169
170			document.onkeydown = function(e){
171				if (e == null) { // ie
172					keycode = event.keyCode;
173				} else { // mozilla
174					keycode = e.which;
175				}
176				if(keycode == 27){ // close
177					tb_remove();
178				} else if(keycode == 190){ // display previous image
179					if(!(TB_NextHTML == "")){
180						document.onkeydown = "";
181						goNext();
182					}
183				} else if(keycode == 188){ // display next image
184					if(!(TB_PrevHTML == "")){
185						document.onkeydown = "";
186						goPrev();
187					}
188				}
189			};
190
191			tb_position();
192			jQuery("#TB_load").remove();
193			jQuery("#TB_ImageOff").click(tb_remove);
194			jQuery("#TB_window").css({display:"block"}); //for safari using css instead of show
195			};
196
197			imgPreloader.src = url;
198		}else{//code to show html
199
200			var queryString = url.replace(/^[^\?]+\??/,'');
201			var params = tb_parseQuery( queryString );
202
203			TB_WIDTH = (params['width']*1) + 30 || 630; //defaults to 630 if no paramaters were added to URL
204			TB_HEIGHT = (params['height']*1) + 40 || 440; //defaults to 440 if no paramaters were added to URL
205			ajaxContentW = TB_WIDTH - 30;
206			ajaxContentH = TB_HEIGHT - 45;
207
208			if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window
209					urlNoQuery = url.split('TB_');
210					jQuery("#TB_iframeContent").remove();
211					if(params['modal'] != "true"){//iframe no modal
212						jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='"+thickboxL10n.close+"'><img src='" + tb_closeImage + "' /></a></div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' >"+thickboxL10n.noiframes+"</iframe>");
213					}else{//iframe modal
214					jQuery("#TB_overlay").unbind();
215						jQuery("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;'>"+thickboxL10n.noiframes+"</iframe>");
216					}
217			}else{// not an iframe, ajax
218					if(jQuery("#TB_window").css("display") != "block"){
219						if(params['modal'] != "true"){//ajax no modal
220						jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'><img src='" + tb_closeImage + "' /></a></div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>");
221						}else{//ajax modal
222						jQuery("#TB_overlay").unbind();
223						jQuery("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");
224						}
225					}else{//this means the window is already up, we are just loading new content via ajax
226						jQuery("#TB_ajaxContent")[0].style.width = ajaxContentW +"px";
227						jQuery("#TB_ajaxContent")[0].style.height = ajaxContentH +"px";
228						jQuery("#TB_ajaxContent")[0].scrollTop = 0;
229						jQuery("#TB_ajaxWindowTitle").html(caption);
230					}
231			}
232
233			jQuery("#TB_closeWindowButton").click(tb_remove);
234
235				if(url.indexOf('TB_inline') != -1){
236					jQuery("#TB_ajaxContent").append(jQuery('#' + params['inlineId']).children());
237					jQuery("#TB_window").unload(function () {
238						jQuery('#' + params['inlineId']).append( jQuery("#TB_ajaxContent").children() ); // move elements back when you're finished
239					});
240					tb_position();
241					jQuery("#TB_load").remove();
242					jQuery("#TB_window").css({display:"block"});
243				}else if(url.indexOf('TB_iframe') != -1){
244					tb_position();
245					if(jQuery.browser.safari){//safari needs help because it will not fire iframe onload
246						jQuery("#TB_load").remove();
247						jQuery("#TB_window").css({display:"block"});
248					}
249				}else{
250					jQuery("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()),function(){//to do a post change this load method
251						tb_position();
252						jQuery("#TB_load").remove();
253						tb_init("#TB_ajaxContent a.thickbox");
254						jQuery("#TB_window").css({display:"block"});
255					});
256				}
257
258		}
259
260		if(!params['modal']){
261			document.onkeyup = function(e){
262				if (e == null) { // ie
263					keycode = event.keyCode;
264				} else { // mozilla
265					keycode = e.which;
266				}
267				if(keycode == 27){ // close
268					tb_remove();
269				}
270			};
271		}
272
273	} catch(e) {
274		//nothing here
275	}
276}
277
278//helper functions below
279function tb_showIframe(){
280	jQuery("#TB_load").remove();
281	jQuery("#TB_window").css({display:"block"});
282}
283
284function tb_remove() {
285 	jQuery("#TB_imageOff").unbind("click");
286	jQuery("#TB_closeWindowButton").unbind("click");
287	jQuery("#TB_window").fadeOut("fast",function(){jQuery('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();});
288	jQuery("#TB_load").remove();
289	if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
290		jQuery("body","html").css({height: "auto", width: "auto"});
291		jQuery("html").css("overflow","");
292	}
293	document.onkeydown = "";
294	document.onkeyup = "";
295	return false;
296}
297
298function tb_position() {
299var isIE6 = typeof document.body.style.maxHeight === "undefined";
300jQuery("#TB_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'});
301	if ( ! isIE6 ) { // take away IE6
302		jQuery("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'});
303	}
304}
305
306function tb_parseQuery ( query ) {
307   var Params = {};
308   if ( ! query ) {return Params;}// return empty object
309   var Pairs = query.split(/[;&]/);
310   for ( var i = 0; i < Pairs.length; i++ ) {
311      var KeyVal = Pairs[i].split('=');
312      if ( ! KeyVal || KeyVal.length != 2 ) {continue;}
313      var key = unescape( KeyVal[0] );
314      var val = unescape( KeyVal[1] );
315      val = val.replace(/\+/g, ' ');
316      Params[key] = val;
317   }
318   return Params;
319}
320
321function tb_getPageSize(){
322	var de = document.documentElement;
323	var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
324	var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
325	arrayPageSize = [w,h];
326	return arrayPageSize;
327}
328
329function tb_detectMacXFF() {
330  var userAgent = navigator.userAgent.toLowerCase();
331  if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox')!=-1) {
332    return true;
333  }
334}// JavaScript Document
335}

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.