PageSourceSearch

https://www.randyduchaine.com/js/js.js

js randyduchaine.com collected 2026-10-07 04:43:08 UTC 18,895 bytes, 444 lines download raw bytes

1			var isOpen = false;
2			var pinterestLoaded = false;
3			var modal = (function(){
4				var 
5				method = {},
6				$modalOverlay,
7				$modal,
8				$content,
9				$close;
10
11				// Center the modal in the viewport
12				
13				
14				method.center = function () {
15					var top, left;
16
17					top = Math.max(jQuery(window).height() - $modal.outerHeight(), 0) / 3;
18					left = Math.max(jQuery(window).width() - $modal.outerWidth(), 0) / 2;
19
20					$modal.css({
21						top:top + jQuery(window).scrollTop(), 
22						left:left + jQuery(window).scrollLeft()
23					});
24				};
25
26				// Open the modal
27				method.open = function (settings) {
28					isOpen = true;
29					
30					$content.empty().append(settings.content);
31
32					$modal.css({
33						width: settings.width || 'auto', 
34						height: settings.height || 'auto'
35					});
36
37					method.center();
38					jQuery(window).bind('resize.modal', method.center);
39					$modal.show();
40					$modalOverlay.show();
41					// added by TMM 2014-05-09 to allow for closing by clicking outside of the dialog
42					jQuery('#modalOverlay').bind( "click",function(e){
43								modal.close();
44					});					
45				};
46
47				// Close the modal
48				method.close = function () {
49					isOpen = false;
50					
51					$modal.hide();
52					$modalOverlay.hide();
53					$content.empty();
54					jQuery(window).unbind('resize.modal');
55				};
56				
57				// added by TMM 2014-05-01 to allow tracking of whether a dialog is open 
58				method.status = (function(){
59					return isOpen;
60				});
61				
62				// Generate the HTML and add it to the document
63				$modalOverlay = jQuery('<div id="modalOverlay"></div>');
64				$modal = jQuery('<div id="modal"></div>');
65				$content = jQuery('<div id="content"></div>');
66				$close = jQuery('<a id="close" href="#">close</a>');
67
68				$modal.hide();
69				$modalOverlay.hide();
70				$modal.append($content, $close);
71
72				jQuery(document).ready(function(){
73					jQuery('body').append($modalOverlay, $modal);						
74				});
75
76				$close.click(function(e){
77					e.preventDefault();
78					method.close();
79				});
80
81				return method;
82			}());
83			
84			
85jQuery(document).keyup(function(e){
86	if ( modal.status() == true){
87    	if(e.keyCode === 27) {
88			modal.close();
89		}		
90	}
91
92});
93
94
95function faceclick(){
96
97	jQuery.get('/site25/socialCode/facebook.html',
98	function(data){
99		modal.open({content: data});
100		FB.XFBML.parse();
101	});
102}
103
104function twitterclick(){
105
106	jQuery.get('/site25/socialCode/twitter.html',
107	function(data){
108		modal.open({content: data});
109	});
110}
111
112function pinterestclick(){
113
114	jQuery.get('/site25/socialCode/pinterest.html',
115	function(data){
116		modal.open({content: data});
117	});
118}
119
120jQuery("#twitterclick").bind( "click", function() {
121	jQuery.get('/site25/socialCode/twitter.html',
122	function(data){
123		modal.open({content: data});
124	});	
125});
126
127
128// js fingerpront
129
130
131/*
132* fingerprintJS 0.5.4 - Fast browser fingerprint library
133* https://github.com/Valve/fingerprintjs
134* Copyright (c) 2013 Valentin Vasilyev ([email protected])
135* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
136*
137* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
138* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
139* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
140* ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
141* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
142* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
143* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
144* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
145* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
146* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
147*/
148
149;(function (name, context, definition) {
150  if (typeof module !== 'undefined' && module.exports) { module.exports = definition(); }
151  else if (typeof define === 'function' && define.amd) { define(definition); }
152  else { context[name] = definition(); }
153})('Fingerprint', this, function () {
154  'use strict';
155
156  var Fingerprint = function (options) {
157    var nativeForEach, nativeMap;
158    nativeForEach = Array.prototype.forEach;
159    nativeMap = Array.prototype.map;
160
161    this.each = function (obj, iterator, context) {
162      if (obj === null) {
163        return;
164      }
165      if (nativeForEach && obj.forEach === nativeForEach) {
166        obj.forEach(iterator, context);
167      } else if (obj.length === +obj.length) {
168        for (var i = 0, l = obj.length; i < l; i++) {
169          if (iterator.call(context, obj[i], i, obj) === {}) return;
170        }
171      } else {
172        for (var key in obj) {
173          if (obj.hasOwnProperty(key)) {
174            if (iterator.call(context, obj[key], key, obj) === {}) return;
175          }
176        }
177      }
178    };
179
180    this.map = function(obj, iterator, context) {
181      var results = [];
182      // Not using strict equality so that this acts as a
183      // shortcut to checking for `null` and `undefined`.
184      if (obj == null) return results;
185      if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
186      this.each(obj, function(value, index, list) {
187        results[results.length] = iterator.call(context, value, index, list);
188      });
189      return results;
190    };
191
192    if (typeof options == 'object'){
193      this.hasher = options.hasher;
194      this.screen_resolution = options.screen_resolution;
195      this.screen_orientation = options.screen_orientation;
196      this.canvas = options.canvas;
197      this.ie_activex = options.ie_activex;
198    } else if(typeof options == 'function'){
199      this.hasher = options;
200    }
201  };
202
203  Fingerprint.prototype = {
204    get: function(){
205      var keys = [];
206      keys.push(navigator.userAgent);
207      keys.push(navigator.language);
208      keys.push(screen.colorDepth);
209      if (this.screen_resolution) {
210        var resolution = this.getScreenResolution();
211        if (typeof resolution !== 'undefined'){ // headless browsers, such as phantomjs
212          keys.push(resolution.join('x'));
213        }
214      }
215      keys.push(new Date().getTimezoneOffset());
216      keys.push(this.hasSessionStorage());
217      keys.push(this.hasLocalStorage());
218      keys.push(!!window.indexedDB);
219      //body might not be defined at this point or removed programmatically
220      if(document.body){
221        keys.push(typeof(document.body.addBehavior));
222      } else {
223        keys.push(typeof undefined);
224      }
225      keys.push(typeof(window.openDatabase));
226      keys.push(navigator.cpuClass);
227      keys.push(navigator.platform);
228      keys.push(navigator.doNotTrack);
229      keys.push(this.getPluginsString());
230      if(this.canvas && this.isCanvasSupported()){
231        keys.push(this.getCanvasFingerprint());
232      }
233      if(this.hasher){
234        return this.hasher(keys.join('###'), 31);
235      } else {
236        return this.murmurhash3_32_gc(keys.join('###'), 31);
237      }
238    },
239
240    /**
241     * JS Implementation of MurmurHash3 (r136) (as of May 20, 2011)
242     *
243     * @author <a href="mailto:[email protected]">Gary Court</a>
244     * @see http://github.com/garycourt/murmurhash-js
245     * @author <a href="mailto:[email protected]">Austin Appleby</a>
246     * @see http://sites.google.com/site/murmurhash/
247     *
248     * @param {string} key ASCII only
249     * @param {number} seed Positive integer only
250     * @return {number} 32-bit positive integer hash
251     */
252
253    murmurhash3_32_gc: function(key, seed) {
254      var remainder, bytes, h1, h1b, c1, c2, k1, i;
255
256      remainder = key.length & 3; // key.length % 4
257      bytes = key.length - remainder;
258      h1 = seed;
259      c1 = 0xcc9e2d51;
260      c2 = 0x1b873593;
261      i = 0;
262
263      while (i < bytes) {
264          k1 =
265            ((key.charCodeAt(i) & 0xff)) |
266            ((key.charCodeAt(++i) & 0xff) << 8) |
267            ((key.charCodeAt(++i) & 0xff) << 16) |
268            ((key.charCodeAt(++i) & 0xff) << 24);
269        ++i;
270
271        k1 = ((((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16))) & 0xffffffff;
272        k1 = (k1 << 15) | (k1 >>> 17);
273        k1 = ((((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16))) & 0xffffffff;
274
275        h1 ^= k1;
276            h1 = (h1 << 13) | (h1 >>> 19);
277        h1b = ((((h1 & 0xffff) * 5) + ((((h1 >>> 16) * 5) & 0xffff) << 16))) & 0xffffffff;
278        h1 = (((h1b & 0xffff) + 0x6b64) + ((((h1b >>> 16) + 0xe654) & 0xffff) << 16));
279      }
280
281      k1 = 0;
282
283      switch (remainder) {
284        case 3: k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16;
285        case 2: k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;
286        case 1: k1 ^= (key.charCodeAt(i) & 0xff);
287
288        k1 = (((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16)) & 0xffffffff;
289        k1 = (k1 << 15) | (k1 >>> 17);
290        k1 = (((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16)) & 0xffffffff;
291        h1 ^= k1;
292      }
293
294      h1 ^= key.length;
295
296      h1 ^= h1 >>> 16;
297      h1 = (((h1 & 0xffff) * 0x85ebca6b) + ((((h1 >>> 16) * 0x85ebca6b) & 0xffff) << 16)) & 0xffffffff;
298      h1 ^= h1 >>> 13;
299      h1 = ((((h1 & 0xffff) * 0xc2b2ae35) + ((((h1 >>> 16) * 0xc2b2ae35) & 0xffff) << 16))) & 0xffffffff;
300      h1 ^= h1 >>> 16;
301
302      return h1 >>> 0;
303    },
304
305    // https://bugzilla.mozilla.org/show_bug.cgi?id=781447
306    hasLocalStorage: function () {
307      try{
308        return !!window.localStorage;
309      } catch(e) {
310        return true; // SecurityError when referencing it means it exists
311      }
312    },
313
314    hasSessionStorage: function () {
315      try{
316        return !!window.sessionStorage;
317      } catch(e) {
318        return true; // SecurityError when referencing it means it exists
319      }
320    },
321
322    isCanvasSupported: function () {
323      var elem = document.createElement('canvas');
324      return !!(elem.getContext && elem.getContext('2d'));
325    },
326
327    isIE: function () {
328      if(navigator.appName === 'Microsoft Internet Explorer') {
329        return true;
330      } else if(navigator.appName === 'Netscape' && /Trident/.test(navigator.userAgent)){// IE 11
331        return true;
332      }
333      return false;
334    },
335
336    getPluginsString: function () {
337      if(this.isIE() && this.ie_activex){
338        return this.getIEPluginsString();
339      } else {
340        return this.getRegularPluginsString();
341      }
342    },
343
344    getRegularPluginsString: function () {
345      return this.map(navigator.plugins, function (p) {
346        var mimeTypes = this.map(p, function(mt){
347          return [mt.type, mt.suffixes].join('~');
348        }).join(',');
349        return [p.name, p.description, mimeTypes].join('::');
350      }, this).join(';');
351    },
352
353    getIEPluginsString: function () {
354      if(window.ActiveXObject){
355        var names = ['ShockwaveFlash.ShockwaveFlash',//flash plugin
356          'AcroPDF.PDF', // Adobe PDF reader 7+
357          'PDF.PdfCtrl', // Adobe PDF reader 6 and earlier, brrr
358          'QuickTime.QuickTime', // QuickTime
359          // 5 versions of real players
360          'rmocx.RealPlayer G2 Control',
361          'rmocx.RealPlayer G2 Control.1',
362          'RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)',
363          'RealVideo.RealVideo(tm) ActiveX Control (32-bit)',
364          'RealPlayer',
365          'SWCtl.SWCtl', // ShockWave player
366          'WMPlayer.OCX', // Windows media player
367          'AgControl.AgControl', // Silverlight
368          'Skype.Detection'];
369
370        // starting to detect plugins in IE
371        return this.map(names, function(name){
372          try{
373            new ActiveXObject(name);
374            return name;
375          } catch(e){
376            return null;
377          }
378        }).join(';');
379      } else {
380        return ""; // behavior prior version 0.5.0, not breaking backwards compat.
381      }
382    },
383
384    getScreenResolution: function () {
385      var resolution;
386       if(this.screen_orientation){
387         resolution = (screen.height > screen.width) ? [screen.height, screen.width] : [screen.width, screen.height];
388       }else{
389         resolution = [screen.height, screen.width];
390       }
391       return resolution;
392    },
393
394    getCanvasFingerprint: function () {
395      var canvas = document.createElement('canvas');
396      var ctx = canvas.getContext('2d');
397      // https://www.browserleaks.com/canvas#how-does-it-work
398      var txt = 'http://www.sitewelder.com';
399      ctx.textBaseline = "top";
400      ctx.font = "14px 'Arial'";
401      ctx.textBaseline = "alphabetic";
402      ctx.fillStyle = "#f60";
403      ctx.fillRect(125,1,62,20);
404      ctx.fillStyle = "#069";
405      ctx.fillText(txt, 2, 15);
406      ctx.fillStyle = "rgba(102, 204, 0, 0.7)";
407      ctx.fillText(txt, 4, 17);
408      return canvas.toDataURL();
409    }
410  };
411
412
413  return Fingerprint;
414
415});
416
417			// end js fingerprint
418
419
420
421
422
423
424/**
425 * StyleFix 1.0.3 & PrefixFree 1.0.7
426 * @author Lea Verou
427 * MIT license
428 */
429 /*
430(function(){function k(a,b){return[].slice.call((b||document).querySelectorAll(a))}if(window.addEventListener){var e=window.StyleFix={link:function(a){var c=a.href||a.getAttribute("data-href");try{if(!c||"stylesheet"!==a.rel||a.hasAttribute("data-noprefix"))return}catch(b){return}var d=c.replace(/[^\/]+$/,""),h=(/^[a-z]{3,10}:/.exec(d)||[""])[0],l=(/^[a-z]{3,10}:\/\/[^\/]+/.exec(d)||[""])[0],g=/^([^?]*)\??/.exec(c)[1],m=a.parentNode,f=new XMLHttpRequest,n;f.onreadystatechange=function(){4===f.readyState&&
431n()};n=function(){var b=f.responseText;if(b&&a.parentNode&&(!f.status||400>f.status||600<f.status)){b=e.fix(b,!0,a);if(d)var b=b.replace(/url\(\s*?((?:"|')?)(.+?)\1\s*?\)/gi,function(b,a,c){return/^([a-z]{3,10}:|#)/i.test(c)?b:/^\/\//.test(c)?'url("'+h+c+'")':/^\//.test(c)?'url("'+l+c+'")':/^\?/.test(c)?'url("'+g+c+'")':'url("'+d+c+'")'}),c=d.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1"),b=b.replace(RegExp("\\b(behavior:\\s*?url\\('?\"?)"+c,"gi"),"$1");c=document.createElement("style");c.textContent=
432b;c.media=a.media;c.disabled=a.disabled;c.setAttribute("data-href",a.getAttribute("href"));m.insertBefore(c,a);m.removeChild(a);c.media=a.media}};try{f.open("GET",c),f.send(null)}
vendor: 4,938 bytes, lines 432-444
432catch(p){"undefined"!=typeof XDomainRequest&&(f=new XDomainRequest,f.onerror=f.onprogress=function(){},f.onload=n,f.open("GET",c),f.send(null))}a.setAttribute("data-inprogress","")},styleElement:function(a){if(!a.hasAttribute("data-noprefix")){var b=a.disabled;a.textContent=e.fix(a.textContent,!0,a);a.disabled=b}},styleAttribute:function(a){var b=
433a.getAttribute("style"),b=e.fix(b,!1,a);a.setAttribute("style",b)},process:function(){k('link[rel="stylesheet"]:not([data-inprogress])').forEach(StyleFix.link);k("style").forEach(StyleFix.styleElement);k("[style]").forEach(StyleFix.styleAttribute)},register:function(a,b){(e.fixers=e.fixers||[]).splice(void 0===b?e.fixers.length:b,0,a)},fix:function(a,b,c){for(var d=0;d<e.fixers.length;d++)a=e.fixers[d](a,b,c)||a;return a},camelCase:function(a){return a.replace(/-([a-z])/g,function(b,a){return a.toUpperCase()}).replace("-",
434"")},deCamelCase:function(a){return a.replace(/[A-Z]/g,function(b){return"-"+b.toLowerCase()})}};(function(){setTimeout(function(){k('link[rel="stylesheet"]').forEach(StyleFix.link)},10);document.addEventListener("DOMContentLoaded",StyleFix.process,!1)})()}})();
435(function(k){function e(b,c,d,h,l){b=a[b];b.length&&(b=RegExp(c+"("+b.join("|")+")"+d,"gi"),l=l.replace(b,h));return l}if(window.StyleFix&&window.getComputedStyle){var a=window.PrefixFree={prefixCSS:function(b,c,d){var h=a.prefix;-1<a.functions.indexOf("linear-gradient")&&(b=b.replace(/(\s|:|,)(repeating-)?linear-gradient\(\s*(-?\d*\.?\d*)deg/ig,function(b,a,c,d){return a+(c||"")+"linear-gradient("+(90-d)+"deg"}));b=e("functions","(\\s|:|,)","\\s*\\(","$1"+h+"$2(",b);b=e("keywords","(\\s|:)","(\\s|;|\\}|$)",
436"$1"+h+"$2$3",b);b=e("properties","(^|\\{|\\s|;)","\\s*:","$1"+h+"$2:",b);if(a.properties.length){var l=RegExp("\\b("+a.properties.join("|")+")(?!:)","gi");b=e("valueProperties","\\b",":(.+?);",function(a){return a.replace(l,h+"$1")},b)}c&&(b=e("selectors","","\\b",a.prefixSelector,b),b=e("atrules","@","\\b","@"+h+"$1",b));b=b.replace(RegExp("-"+h,"g"),"-");return b=b.replace(/-\*-(?=[a-z]+)/gi,a.prefix)},property:function(b){return(0<=a.properties.indexOf(b)?a.prefix:"")+b},value:function(b,c){b=
437e("functions","(^|\\s|,)","\\s*\\(","$1"+a.prefix+"$2(",b);b=e("keywords","(^|\\s)","(\\s|$)","$1"+a.prefix+"$2$3",b);0<=a.valueProperties.indexOf(c)&&(b=e("properties","(^|\\s|,)","($|\\s|,)","$1"+a.prefix+"$2$3",b));return b},prefixSelector:function(b){return b.replace(/^:{1,2}/,function(b){return b+a.prefix})},prefixProperty:function(b,c){var d=a.prefix+b;return c?StyleFix.camelCase(d):d}};(function(){var b={},c=[],d=getComputedStyle(document.documentElement,null),h=document.createElement("div").style,
438l=function(a){if("-"===a.charAt(0)){c.push(a);a=a.split("-");var d=a[1];for(b[d]=++b[d]||1;3<a.length;)a.pop(),d=a.join("-"),StyleFix.camelCase(d)in h&&-1===c.indexOf(d)&&c.push(d)}};if(0<d.length)for(var g=0;g<d.length;g++)l(d[g]);else for(var e in d)l(StyleFix.deCamelCase(e));var g=0,f,k;for(k in b)d=b[k],g<d&&(f=k,g=d);a.prefix="-"+f+"-";a.Prefix=StyleFix.camelCase(a.prefix);a.properties=[];for(g=0;g<c.length;g++)e=c[g],0===e.indexOf(a.prefix)&&(f=e.slice(a.prefix.length),StyleFix.camelCase(f)in
439h||a.properties.push(f));!("Ms"!=a.Prefix||"transform"in h||"MsTransform"in h)&&"msTransform"in h&&a.properties.push("transform","transform-origin");a.properties.sort()})();(function(){function b(a,b){h[b]="";h[b]=a;return!!h[b]}var c={"linear-gradient":{property:"backgroundImage",params:"red, teal"},calc:{property:"width",params:"1px + 5%"},element:{property:"backgroundImage",params:"#foo"},"cross-fade":{property:"backgroundImage",params:"url(a.png), url(b.png), 50%"}};c["repeating-linear-gradient"]=
440c["repeating-radial-gradient"]=c["radial-gradient"]=c["linear-gradient"];var d={initial:"color","zoom-in":"cursor","zoom-out":"cursor",box:"display",flexbox:"display","inline-flexbox":"display",flex:"display","inline-flex":"display",grid:"display","inline-grid":"display","max-content":"width","min-content":"width","fit-content":"width","fill-available":"width"};a.functions=[];a.keywords=[];var h=document.createElement("div").style,e;for(e in c){var g=c[e],k=g.property,g=e+"("+g.params+")";!b(g,k)&&
441b(a.prefix+g,k)&&a.functions.push(e)}for(var f in d)k=d[f],!b(f,k)&&b(a.prefix+f,k)&&a.keywords.push(f)})();(function(){function b(a){e.textContent=a+"{}";return!!e.sheet.cssRules.length}var c={":read-only":null,":read-write":null,":any-link":null,"::selection":null},d={keyframes:"name",viewport:null,document:'regexp(".")'};a.selectors=[];a.atrules=[];var e=k.appendChild(document.createElement("style")),l;for(l in c){var g=l+(c[l]?"("+c[l]+")":"");!b(g)&&b(a.prefixSelector(g))&&a.selectors.push(l)}for(var m in d)g=
442m+" "+(d[m]||""),!b("@"+g)&&b("@"+a.prefix+g)&&a.atrules.push(m);k.removeChild(e)})();a.valueProperties=["transition","transition-property"];k.className+=" "+a.prefix;StyleFix.register(a.prefixCSS)}})(document.documentElement);
443*/
444

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.