1/*!-------------------------------------------------------------------- 2 JAVASCRIPT "Outdated Browser" 3 Version: 1.1.2 - 2015 4 author: Burocratik 5 website: http://www.burocratik.com 6 * @preserve 7 -----------------------------------------------------------------------*/ 8var outdatedBrowser = function(options) { 9 10 //Variable definition (before ajax) 11 var outdated = document.getElementById("outdated"); 12 13 // Default settings 14 this.defaultOpts = { 15 bgColor: '#f25648', 16 color: '#ffffff', 17 lowerThan: 'transform', 18 languagePath: '../outdatedbrowser/lang/en.html' 19 } 20 21 if (options) { 22 //assign css3 property to IE browser version 23 if (options.lowerThan == 'IE8' || options.lowerThan == 'borderSpacing') { 24 options.lowerThan = 'borderSpacing'; 25 } else if (options.lowerThan == 'IE9' || options.lowerThan == 'boxShadow') { 26 options.lowerThan = 'boxShadow'; 27 } else if (options.lowerThan == 'IE10' || options.lowerThan == 'transform' || options.lowerThan == '' || typeof options.lowerThan === "undefined") { 28 options.lowerThan = 'transform'; 29 } else if (options.lowerThan == 'IE11' || options.lowerThan == 'borderImage') { 30 options.lowerThan = 'borderImage'; 31 } 32 //all properties 33 this.defaultOpts.bgColor = options.bgColor; 34 this.defaultOpts.color = options.color; 35 this.defaultOpts.lowerThan = options.lowerThan; 36 this.defaultOpts.languagePath = options.languagePath; 37 38 bkgColor = this.defaultOpts.bgColor; 39 txtColor = this.defaultOpts.color; 40 cssProp = this.defaultOpts.lowerThan; 41 languagePath = this.defaultOpts.languagePath; 42 } else { 43 bkgColor = this.defaultOpts.bgColor; 44 txtColor = this.defaultOpts.color; 45 cssProp = this.defaultOpts.lowerThan; 46 languagePath = this.defaultOpts.languagePath; 47 } //end if options 48 49 50 //Define opacity and fadeIn/fadeOut functions 51 var done = true; 52 53 function function_opacity(opacity_value) { 54 outdated.style.opacity = opacity_value / 100; 55 outdated.style.filter = 'alpha(opacity=' + opacity_value + ')'; 56 } 57 58 // function function_fade_out(opacity_value) { 59 // function_opacity(opacity_value); 60 // if (opacity_value == 1) { 61 // outdated.style.display = 'none'; 62 // done = true; 63 // } 64 // } 65 66 function function_fade_in(opacity_value) { 67 function_opacity(opacity_value); 68 if (opacity_value == 1) { 69 outdated.style.display = 'block'; 70 } 71 if (opacity_value == 100) { 72 done = true; 73 } 74 } 75 76 //check if element has a particular class 77 // function hasClass(element, cls) { 78 // return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1; 79 // } 80 81 var supports = ( function() { 82 var div = document.createElement('div'); 83 var vendors = 'Khtml Ms O Moz Webkit'.split(' '); 84 var len = vendors.length; 85 86 return function(prop) { 87 if (prop in div.style) return true; 88 89 prop = prop.replace(/^[a-z]/, function(val) { 90 return val.toUpperCase(); 91 }); 92 93 while (len--) { 94 if (vendors[len] + prop in div.style) { 95 return true; 96 } 97 } 98 return false; 99 }; 100 } )(); 101 102 //if browser does not supports css3 property (transform=default), if does > exit all this 103 if (!supports('' + cssProp + '')) { 104 if (done && outdated.style.opacity !== '1') { 105 done = false; 106 for (var i = 1; i <= 100; i++) { 107 setTimeout(( function(x) { 108 return function() { 109 function_fade_in(x); 110 }; 111 } )(i), i * 8); 112 } 113 } 114 } else { 115 return; 116 } //end if 117 118 //Check AJAX Options: if languagePath == '' > use no Ajax way, html is needed inside <div id="outdated"> 119 if (languagePath === ' ' || languagePath.length == 0) { 120 startStylesAndEvents(); 121 } else {
122 grabFile(languagePath); 123 } 124 125 //events and colors 126 function startStylesAndEvents() { 127 var btnClose = document.getElementById("btnCloseUpdateBrowser"); 128 var btnUpdate = document.getElementById("btnUpdateBrowser"); 129 130 //check settings attributes 131 outdated.style.backgroundColor = bkgColor; 132 //way too hard to put !important on IE6 133 outdated.style.color = txtColor; 134 outdated.children[0].style.color = txtColor; 135 outdated.children[1].style.color = txtColor; 136 137 //check settings attributes 138 btnUpdate.style.color = txtColor; 139 // btnUpdate.style.borderColor = txtColor; 140 if (btnUpdate.style.borderColor) { 141 btnUpdate.style.borderColor = txtColor; 142 } 143 btnClose.style.color = txtColor; 144 145 //close button 146 btnClose.onmousedown = function() { 147 outdated.style.display = 'none'; 148 return false; 149 }; 150 151 //Override the update button color to match the background color 152 btnUpdate.onmouseover = function() { 153 this.style.color = bkgColor; 154 this.style.backgroundColor = txtColor; 155 }; 156 btnUpdate.onmouseout = function() { 157 this.style.color = txtColor; 158 this.style.backgroundColor = bkgColor; 159 }; 160 } //end styles and events 161 162 163 // IF AJAX with request ERROR > insert english default 164 var ajaxEnglishDefault = '<h6>Your browser is out-of-date!</h6>' 165 + '<p>Update your browser to view this website correctly. <a id="btnUpdateBrowser" href="http://outdatedbrowser.com/">Update my browser now </a></p>' 166 + '<p class="last"><a href="#" id="btnCloseUpdateBrowser" title="Close">×</a></p>'; 167 168 169 //** AJAX FUNCTIONS - Bulletproof Ajax by Jeremy Keith ** 170 function getHTTPObject() { 171 var xhr = false; 172 if (window.XMLHttpRequest) { 173 xhr = new XMLHttpRequest(); 174 } else if (window.ActiveXObject) { 175 try { 176 xhr = new ActiveXObject("Msxml2.XMLHTTP"); 177 } catch ( e ) { 178 try { 179 xhr = new ActiveXObject("Microsoft.XMLHTTP"); 180 } catch ( e ) { 181 xhr = false; 182 } 183 } 184 } 185 return xhr; 186 }//end function 187 188 function grabFile(file) { 189 var request = getHTTPObject(); 190 if (request) { 191 request.onreadystatechange = function() { 192 displayResponse(request); 193 }; 194 request.open("GET", file, true); 195 request.send(null); 196 } 197 return false; 198 } //end grabFile 199 200 function displayResponse(request) { 201 var insertContentHere = document.getElementById("outdated"); 202 if (request.readyState == 4) { 203 if (request.status == 200 || request.status == 304) { 204 insertContentHere.innerHTML = request.responseText; 205 } else { 206 insertContentHere.innerHTML = ajaxEnglishDefault; 207 } 208 startStylesAndEvents(); 209 } 210 return false; 211 }
211//end displayResponse 212 213////////END of outdatedBrowser function 214}; 215/* Placeholders.js v4.0.1 */ 216/*! 217 * The MIT License 218 * 219 * Copyright (c) 2012 James Allardice 220 * 221 * Permission is hereby granted, free of charge, to any person obtaining a copy 222 * of this software and associated documentation files (the "Software"), to 223 * deal in the Software without restriction, including without limitation the 224 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 225 * sell copies of the Software, and to permit persons to whom the Software is 226 * furnished to do so, subject to the following conditions: 227 * 228 * The above copyright notice and this permission notice shall be included in 229 * all copies or substantial portions of the Software. 230 * 231 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 232 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 233 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 234 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 235 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 236 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 237 * IN THE SOFTWARE. 238 */ 239!function(a){"use strict";function b(){}function c(){try{return document.activeElement}catch(a){}}function d(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return!0;return!1}function e(a,b,c){return a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):void 0}function f(a,b){var c;a.createTextRange?(c=a.createTextRange(),c.move("character",b),c.select()):a.selectionStart&&(a.focus(),a.setSelectionRange(b,b))}function g(a,b){try{return a.type=b,!0}catch(c){return!1}}function h(a,b){if(a&&a.getAttribute(B))b(a);else for(var c,d=a?a.getElementsByTagName("input"):N,e=a?a.getElementsByTagName("textarea"):O,f=d?d.length:0,g=e?e.length:0,h=f+g,i=0;h>i;i++)c=f>i?d[i]:e[i-f],b(c)}function i(a){h(a,k)}function j(a){h(a,l)}function k(a,b){var c=!!b&&a.value!==b,d=a.value===a.getAttribute(B);if((c||d)&&"true"===a.getAttribute(C)){a.removeAttribute(C),a.value=a.value.replace(a.getAttribute(B),""),a.className=a.className.replace(A,"");var e=a.getAttribute(I);parseInt(e,10)>=0&&(a.setAttribute("maxLength",e),a.removeAttribute(I));var f=a.getAttribute(D);return f&&(a.type=f),!0}return!1}function l(a){var b=a.getAttribute(B);if(""===a.value&&b){a.setAttribute(C,"true"),a.value=b,a.className+=" "+z;var c=a.getAttribute(I);c||(a.setAttribute(I,a.maxLength),a.removeAttribute("maxLength"));var d=a.getAttribute(D);return d?a.type="text":"password"===a.type&&g(a,"text")&&a.setAttribute(D,"password"),!0}return!1}function m(a){return function(){P&&a.value===a.getAttribute(B)&&"true"===a.getAttribute(C)?f(a,0):k(a)}}function n(a){return function(){l(a)}}function o(a){return function(){i(a)}}function p(a){return function(b){return v=a.value,"true"===a.getAttribute(C)&&v===a.getAttribute(B)&&d(x,b.keyCode)?(b.preventDefault&&b.preventDefault(),!1):void 0}}function q(a){return function(){k(a,v),""===a.value&&(a.blur(),f(a,0))}}function r(a){return function(){a===c()&&a.value===a.getAttribute(B)&&"true"===a.getAttribute(C)&&f(a,0)}}function s(a){var b=a.form;b&&"string"==typeof b&&(b=document.getElementById(b),b.getAttribute(E)||(e(b,"submit",o(b)),b.setAttribute(E,"true"))),e(a,"focus",m(a)),e(a,"blur",n(a)),P&&(e(a,"keydown",p(a)),e(a,"keyup",q(a)),e(a,"click",r(a))),a.setAttribute(F,"true"),a.setAttribute(B,T),(P||a!==c())&&l(a)}var t=document.createElement("input"),u=void 0!==t.placeholder;if(a.Placeholders={nativeSupport:u,disable:u?b:i,enable:u?b:j},!u){var v,w=["text","search","url","tel","email","password","number","textarea"],x=[27,33,34,35,36,37,38,39,40,8,46],y="#ccc",z="placeholdersjs",A=new RegExp("(?:^|\\s)"+z+"(?!\\S)"),B="data-placeholder-value",C="data-placeholder-active",D="data-placeholder-type",E="data-placeholder-submit",F="data-placeholder-bound",G="data-placeholder-focus",H="data-placeholder-live",I="data-placeholder-maxlength",J=100,K=document.getElementsByTagName("head")[0],L=document.documentElement,M=a.Placeholders,N=document.getElementsByTagName("input"),O=
239document.getElementsByTagName("textarea"),P="false"===L.getAttribute(G),Q="false"!==L.getAttribute(H),R=document.createElement("style");R.type="text/css";var S=document.createTextNode("."+z+" {color:"+y+";}");R.styleSheet?R.styleSheet.cssText=S.nodeValue:R.appendChild(S),K.insertBefore(R,K.firstChild);for(var T,U,V=0,W=N.length+O.length;W>V;V++)U=V<N.length?N[V]:O[V-N.length],T=U.attributes.placeholder,T&&(T=T.nodeValue,T&&d(w,U.type)&&s(U));var X=setInterval(function(){for(var a=0,b=N.length+O.length;b>a;a++)U=a<N.length?N[a]:O[a-N.length],T=U.attributes.placeholder,T?(T=T.nodeValue,T&&d(w,U.type)&&(U.getAttribute(F)||s(U),(T!==U.getAttribute(B)||"password"===U.type&&!U.getAttribute(D))&&("password"===U.type&&!U.getAttribute(D)&&g(U,"text")&&U.setAttribute(D,"password"),U.value===U.getAttribute(B)&&(U.value=T),U.setAttribute(B,T)))):U.getAttribute(C)&&(k(U),U.removeAttribute(B));Q||clearInterval(X)},J);e(a,"beforeunload",function(){M.disable()})}}(this);
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.