vendor: 4,928 bytes, lines 1-5
1/*! Picturefill - v3.0.1 - 2015-09-30 2 * http://scottjehl.github.io/picturefill 3 * Copyright (c) 2015 https://github.com/scottjehl/picturefill/blob/master/Authors.txt; Licensed MIT 4 */ 5!function(a){var b=navigator.userAgent;a.HTMLPictureElement&&/ecko/.test(b)&&b.match(/rv\:(\d+)/)&&RegExp.$1<41&&addEventListener("resize",function(){var b,c=document.createElement("source"),d=function(a){var b,d,e=a.parentNode;"PICTURE"===e.nodeName.toUpperCase()?(b=c.cloneNode(),e.insertBefore(b,e.firstElementChild),setTimeout(function(){e.removeChild(b)})):(!a._pfLastSize||a.offsetWidth>a._pfLastSize)&&(a._pfLastSize=a.offsetWidth,d=a.sizes,a.sizes+=",100vw",setTimeout(function(){a.sizes=d}))},e=function(){var a,b=document.querySelectorAll("picture > img, img[srcset][sizes]");for(a=0;a<b.length;a++)d(b[a])},f=function(){clearTimeout(b),b=setTimeout(e,99)},g=a.matchMedia&&matchMedia("(orientation: landscape)"),h=function(){f(),g&&g.addListener&&g.addListener(f)};return c.srcset="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",/^[c|i]|d$/.test(document.readyState||"")?h():document.addEventListener("DOMContentLoaded",h),f}())}(window),function(a,b,c){"use strict";function d(a){return" "===a||" "===a||"\n"===a||"\f"===a||"\r"===a}function e(b,c){var d=new a.Image;return d.onerror=function(){z[b]=!1,aa()},d.onload=function(){z[b]=1===d.width,aa()},d.src=c,"pending"}function f(){L=!1,O=a.devicePixelRatio,M={},N={},s.DPR=O||1,P.width=Math.max(a.innerWidth||0,y.clientWidth),P.height=Math.max(a.innerHeight||0,y.clientHeight),P.vw=P.width/100,P.vh=P.height/100,r=[P.height,P.width,O].join("-"),P.em=s.getEmValue(),P.rem=P.em}function g(a,b,c,d){var e,f,g,h;return"saveData"===A.algorithm?a>2.7?h=c+1:(f=b-c,e=Math.pow(a-.6,1.5),g=f*e,d&&(g+=.1*e),h=a+g):h=c>1?Math.sqrt(a*b):a,h>c}function h(a){var b,c=s.getSet(a),d=!1;"pending"!==c&&(d=r,c&&(b=s.setRes(c),s.applySetCandidate(b,a))),a[s.ns].evaled=d}function i(a,b){return a.res-b.res}function j(a,b,c){var d;return!c&&b&&(c=a[s.ns].sets,c=c&&c[c.length-1]),d=k(b,c),d&&(b=s.makeUrl(b),a[s.ns].curSrc=b,a[s.ns].curCan=d,d.res||_(d,d.set.sizes)),d}function k(a,b){var c,d,e;if(a&&b)for(e=s.parseSet(b),a=s.makeUrl(a),c=0;c<e.length;c++)if(a===s.makeUrl(e[c].url)){d=e[c];break}return d}function l(a,b){var c,d,e,f,g=a.getElementsByTagName("source");for(c=0,d=g.length;d>c;c++)e=g[c],e[s.ns]=!0,f=e.getAttribute("srcset"),f&&b.push({srcset:f,media:e.getAttribute("media"),type:e.getAttribute("type"),sizes:e.getAttribute("sizes")})}function m(a,b){function c(b){var c,d=b.exec(a.substring(m));return d?(c=d[0],m+=c.length,c):void 0}function e(){var a,c,d,e,f,i,j,k,l,m=!1,o={};for(e=0;e<h.length;e++)f=h[e],i=f[f.length-1],j=f.substring(0,f.length-1),k=parseInt(j,10),l=parseFloat(j),W.test(j)&&"w"===i?((a||c)&&(m=!0),0===k?m=!0:a=k):X.test(j)&&"x"===i?((a||c||d)&&(m=!0),0>l?m=!0:c=l):W.test(j)&&"h"===i?((d||c)&&(m=!0),0===k?m=!0:d=k):m=!0;m||(o.url=g,a&&(o.w=a),c&&(o.d=c),d&&(o.h=d),d||c||a||(o.d=1),1===o.d&&(b.has1x=!0),o.set=b,n.push(o))}function f(){for(c(S),i="",j="in descriptor";;){if(k=a.charAt(m),"in descriptor"===j)if(d(k))i&&(h.push(i),i="",j="after descriptor");else{if(","===k)return m+=1,i&&h.push(i),void e();if("("===k)i+=k,j="in parens";else{if(""===k)return i&&h.push(i),void e();i+=k}}else if("in parens"===j)if(")"===k)i+=k,j="in descriptor";else{if(""===k)return h.push(i),void e();i+=k}else if("after descriptor"===j)if(d(k));else{if(""===k)return void e();j="in descriptor",m-=1}m+=1}}for(var g,h,i,j,k,l=a.length,m=0,n=[];;){if(c(T),m>=l)return n;g=c(U),h=[],","===g.slice(-1)?(g=g.replace(V,""),e()):f()}}function n(a){function b(a){function b(){f&&(g.push(f),f="")}function c(){g[0]&&(h.push(g),g=[])}for(var e,f="",g=[],h=[],i=0,j=0,k=!1;;){if(e=a.charAt(j),""===e)return b(),c(),h;if(k){if("*"===e&&"/"===a[j+1]){k=!1,j+=2,b();continue}j+=1}else{if(d(e)){if(a.charAt(j-1)&&d(a.charAt(j-1))||!f){j+=1;continue}if(0===i){b(),j+=1;continue}e=" "}else if("("===e)i+=1;else if(")"===e)i-=1;else{if(","===e){b(),c(),j+=1;continue}if("/"===e&&"*"===a.charAt(j+1)){k=!0,j+=2;continue}}f+=e,j+=1}}}function c(a){return k.test(a)&&parseFloat(a)>=0?!0:l.test(a)?!0:"0"===a||"-0"===a||"+0"===a?!0:!1}var e,f,g,h,i,j,k=/^(?:[+-]?[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?(?:ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmin|vmax|vw)$/i,l=/^calc\((?:[0-9a-z \.\+\-\*\/\(\)]+)\)$/i;for(f=b(a),g=f.length,e=0;g>e;e++)if(h=f[e],i=h[h.length-1],c(i)){if(j=i,h.pop(),0===h.length)return j;if(h=h.join(" "),s.matchesMedia(h))return j}return"100vw"}b.createElement("picture");var o,p,q,r,s={},t=function(){},u=b.createElement("img"),v=u.getAttribute,w=u.setAttribute,x=u.removeAttribute,y=b.documentElement,z={},A={algorithm:""},B="data-pfsrc",C=B+"set",D=navigator.userAgent,E=/rident/.test(D)||/ecko/.test(D)&&D.match(/rv\:(\d+)/)&&RegExp.$1>35,F="currentSrc",G=/\s+\+?\d+(e\d+)?w/,H=/(\([^)]+\))?\s*(.+)/,I=a.picturefillCFG,J="position:absolute;
5left:0;visibility:hidden;display:block;padding:0;border:none;font-size:1em;width:1em;overflow:hidden;clip:rect(0px, 0px, 0px, 0px)",K="font-size:100%!important;",L=!0,M={},N={},O=a.devicePixelRatio,P={px:1,"in":96},Q=b.createElement("a"),R=!1,S=/^[ \t\n\r\u000c]+/,T=/^[, \t\n\r\u000c]+/,U=/^[^ \t\n\r\u000c]+/,V=/[,]+$/,W=/^\d+$/,X=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,Y=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d||!1):a.attachEvent&&a.attachEvent("on"+b,c)},Z=function(a){var b={};return function(c){return c in b||(b[c]=a(c)),b[c]}},$=function(){var a=/^([\d\.]+)(em|vw|px)$/,b=function(){for(var a=arguments,b=0,c=a[0];++b in a;)c=c.replace(a[b],a[++b]);return c},c=Z(function(a){return"return "+b((a||"").toLowerCase(),/\band\b/g,"&&",/,/g,"||",/min-([a-z-\s]+):/g,"e.$1>=",/max-([a-z-\s]+):/g,"e.$1<=",/calc([^)]+)/g,"($1)",/(\d+[\.]*[\d]*)([a-z]+)/g,"($1 * e.$2)",/^(?!(e.[a-z]|[0-9\.&=|><\+\-\*\(\)\/])).*/gi,"")+";"});return function(b,d){var e;if(!(b in M))if(M[b]=!1,d&&(e=b.match(a)))M[b]=e[1]*P[e[2]];else try{M[b]=new Function("e",c(b))(P)}catch(f){}return M[b]}}(),_=function(a,b){return a.w?(a.cWidth=s.calcListLength(b||"100vw"),a.res=a.w/a.cWidth):a.res=a.d,a},aa=function(a){var c,d,e,f=a||{};if(f.elements&&1===f.elements.nodeType&&("IMG"===f.elements.nodeName.toUpperCase()?f.elements=[f.elements]:(f.context=f.elements,f.elements=null)),c=f.elements||s.qsa(f.context||b,f.reevaluate||f.reselect?s.sel:s.selShort),e=c.length){for(s.setupRun(f),R=!0,d=0;e>d;d++)s.fillImg(c[d],f);s.teardownRun(f)}};o=a.console&&console.warn?function(a){console.warn(a)}:t,F in u||(F="src"),z["image/jpeg"]=!0,z["image/gif"]=!0,z["image/png"]=!0,z["image/svg+xml"]=b.implementation.hasFeature("http://wwwindow.w3.org/TR/SVG11/feature#Image","1.1"),s.ns=("pf"+(new Date).getTime()).substr(0,9),s.supSrcset="srcset"in u,s.supSizes="sizes"in u,s.supPicture=!!a.HTMLPictureElement,s.supSrcset&&s.supPicture&&!s.supSizes&&!function(a){u.srcset="data:,a",a.src="data:,a",s.supSrcset=u.complete===a.complete,s.supPicture=s.supSrcset&&s.supPicture}(b.createElement("img")),s.selShort="picture>img,img[srcset]",s.sel=s.selShort,s.cfg=A,s.supSrcset&&(s.sel+=",img["+C+"]"),s.DPR=O||1,s.u=P,s.types=z,q=s.supSrcset&&!s.supSizes,s.setSize=t,s.makeUrl=Z(function(a){return Q.href=a,Q.href}),s.qsa=function(a,b){return a.querySelectorAll(b)},s.matchesMedia=function(){return a.matchMedia&&(matchMedia("(min-width: 0.1em)")||{}).matches?s.matchesMedia=function(a){return!a||matchMedia(a).matches}:s.matchesMedia=s.mMQ,s.matchesMedia.apply(this,arguments)},s.mMQ=function(a){return a?$(a):!0},s.calcLength=function(a){var b=$(a,!0)||!1;return 0>b&&(b=!1),b},s.supportsType=function(a){return a?z[a]:!0},s.parseSize=Z(function(a){var b=(a||"").match(H);return{media:b&&b[1],length:b&&b[2]}}),s.parseSet=function(a){return a.cands||(a.cands=m(a.srcset,a)),a.cands},s.getEmValue=function(){var a;if(!p&&(a=b.body)){var c=b.createElement("div"),d=y.style.cssText,e=a.style.cssText;c.style.cssText=J,y.style.cssText=K,a.style.cssText=K,a.appendChild(c),p=c.offsetWidth,a.removeChild(c),p=parseFloat(p,10),y.style.cssText=d,a.style.cssText=e}return p||16},s.calcListLength=function(a){if(!(a in N)||A.uT){var b=s.calcLength(n(a));N[a]=b?b:P.width}return N[a]},s.setRes=function(a){var b;if(a){b=s.parseSet(a);for(var c=0,d=b.length;d>c;c++)_(b[c],a.sizes)}return b},s.setRes.res=_,s.applySetCandidate=function(a,b){if(a.length){var c,d,e,f,h,k,l,m,n,o=b[s.ns],p=s.DPR;if(k=o.curSrc||b[F],l=o.curCan||j(b,k,a[0].set),l&&l.set===a[0].set&&(n=E&&!b.complete&&l.res-.1>p,n||(l.cached=!0,l.res>=p&&(h=l))),!h)for(a.sort(i),f=a.length,h=a[f-1],d=0;f>d;d++)if(c=a[d],c.res>=p){e=d-1,h=a[e]&&(n||k!==s.makeUrl(c.url))&&g(a[e].res,c.res,p,a[e].cached)?a[e]:c;break}h&&(m=s.makeUrl(h.url),o.curSrc=m,o.curCan=h,m!==k&&s.setSrc(b,h),s.setSize(b))}},s.setSrc=function(a,b){var c;a.src=b.url,"image/svg+xml"===b.set.type&&(c=a.style.width,a.style.width=a.offsetWidth+1+"px",a.offsetWidth+1&&(a.style.width=c))},s.getSet=function(a){var b,c,d,e=!1,f=a[s.ns].sets;for(b=0;b<f.length&&!e;b++)if(c=f[b],c.srcset&&s.matchesMedia(c.media)&&(d=s.supportsType(c.type))){"pending"===d&&(c=d),e=c;break}return e},s.parseSets=function(a,b,d){var e,f,g,h,i=b&&"PICTURE"===b.nodeName.toUpperCase(),j=a[s.ns];(j.src===c||d.src)&&(j.src=v.call(a,"src"),j.src?w.call(a,B,j.src):x.call(a,B)),(j.srcset===c||d.srcset||!s.supSrcset||a.srcset)&&(e=v.call(a,"srcset"),j.srcset=e,h=!0),j.sets=[],i&&(j.pic=!0,l(b,j.set
5s)),j.srcset?(f={srcset:j.srcset,sizes:v.call(a,"sizes")},j.sets.push(f),g=(q||j.src)&&G.test(j.srcset||""),g||!j.src||k(j.src,f)||f.has1x||(f.srcset+=", "+j.src,f.cands.push({url:j.src,d:1,set:f}))):j.src&&j.sets.push({srcset:j.src,sizes:null}),j.curCan=null,j.curSrc=c,j.supported=!(i||f&&!s.supSrcset||g),h&&s.supSrcset&&!j.supported&&(e?(w.call(a,C,e),a.srcset=""):x.call(a,C)),j.supported&&!j.srcset&&(!j.src&&a.src||a.src!==s.makeUrl(j.src))&&(null===j.src?a.removeAttribute("src"):a.src=j.src),j.parsed=!0},s.fillImg=function(a,b){var c,d=b.reselect||b.reevaluate;a[s.ns]||(a[s.ns]={}),c=a[s.ns],(d||c.evaled!==r)&&((!c.parsed||b.reevaluate)&&s.parseSets(a,a.parentNode,b),c.supported?c.evaled=r:h(a))},s.setupRun=function(){(!R||L||O!==a.devicePixelRatio)&&f()},s.supPicture?(aa=t,s.fillImg=t):!function(){var c,d=a.attachEvent?/d$|^c/:/d$|^c|^i/,e=function(){var a=b.readyState||"";f=setTimeout(e,"loading"===a?200:999),b.body&&(s.fillImgs(),c=c||d.test(a),c&&clearTimeout(f))},f=setTimeout(e,b.body?9:99),g=function(a,b){var c,d,e=function(){var f=new Date-d;b>f?c=setTimeout(e,b-f):(c=null,a())};return function(){d=new Date,c||(c=setTimeout(e,b))}},h=y.clientHeight,i=function(){L=Math.max(a.innerWidth||0,y.clientWidth)!==P.width||y.clientHeight!==h,h=y.clientHeight,L&&s.fillImgs()};Y(a,"resize",g(i,99)),Y(b,"readystatechange",e)}(),s.picturefill=aa,s.fillImgs=aa,s.teardownRun=t,aa._=s,a.picturefillCFG={pf:s,push:function(a){var b=a.shift();"function"==typeof s[b]?s[b].apply(s,a):(A[b]=a[0],R&&s.fillImgs({reselect:!0}))}};for(;I&&I.length;)a.picturefillCFG.push(I.shift());a.picturefill=aa,"object"==typeof module&&"object"==typeof module.exports?module.exports=aa:"function"==typeof define&&define.amd&&define("picturefill",function(){return aa}),s.supPicture||(z["image/webp"]=e("image/webp","data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA=="))}(window,document);; 6if(typeof Drupal!=="undefined"&&typeof jQuery!=="undefined"){(function(e){Drupal.behaviors.picture={attach:function(t){if(!("HTMLPictureElement"in window)){var n=e(t).find("img");if(n.length){window.picturefill({elements:n.get()})}}if(t==="#cboxLoadedContent"&&e(t).find("picture").length){e.colorbox.resize();e("img",t).once("colorbox-lazy-load",function(){e(this).load(function(){this.style.maxHeight=e(window).height()+"px";this.style.maxWidth=e(window).width()+"px";e.colorbox.resize({innerHeight:this.height,innerWidth:this.width});this.style.maxHeight=null;this.style.maxWidth=null})})}}}})(jQuery)} 7; 8(function ($) { 9 10// Checks if a given element resides in default extra leaving container page. 11function isInExtraLeavingContainer(element) { 12 return $(element).closest('div.extlink-extra-leaving').length > 0; 13} 14 15Drupal.settings.extlink_extra.colorboxSettings = Drupal.settings.extlink_extra.colorboxSettings || { 16 href: Drupal.settings.extlink_extra.extlink_alert_url + ' .extlink-extra-leaving', 17 height: '50%', 18 width: '50%', 19 initialWidth: '50%', 20 initialHeight: '50%', 21 className: 'extlink-extra-leaving-colorbox', 22 onComplete: function () { // Note - drupal colorbox module automatically attaches drupal behaviors to loaded content. 23 // Allow our cancel link to close the colorbox. 24 jQuery('div.extlink-extra-back-action a').click(function(e) {jQuery.colorbox.close(); return false;}) 25 extlink_extra_timer(); 26 }, 27 onClosed: extlink_stop_timer 28}; 29 30Drupal.behaviors.extlink_extra = { 31 // Function mostly duplicated from extlink.js. 32 // Returns an array of DOM elements of all external links. 33 extlinkAttach: function(context) { 34 var settings = Drupal.settings; 35 36 if (!settings.hasOwnProperty('extlink')) { 37 return; 38 } 39 40 // Strip the host name down, removing ports, subdomains, or www. 41 var pattern = /^(([^\/:]+?\.)*)([^\.:]{4,})((\.[a-z]{1,4})*)(:[0-9]{1,5})?$/; 42 var host = window.location.host.replace(pattern, '$3$4'); 43 var subdomain = window.location.host.replace(pattern, '$1'); 44 45 // Determine what subdomains are considered internal. 46 var subdomains; 47 if (settings.extlink.extSubdomains) { 48 subdomains = "([^/]*\\.)?"; 49 } 50 else if (subdomain == 'www.' || subdomain == '') { 51 subdomains = "(www\\.)?"; 52 } 53 else { 54 subdomains = subdomain.replace(".", "\\."); 55 } 56 57 // Build regular expressions that define an internal link. 58 var internal_link = new RegExp("^https?://" + subdomains + host, "i"); 59 60 // Extra internal link matching. 61 var extInclude = false;
62 if (settings.extlink.extInclude) { 63 extInclude = new RegExp(settings.extlink.extInclude.replace(/\\/, '\\'), "i"); 64 } 65 66 // Extra external link matching. 67 var extExclude = false; 68 if (settings.extlink.extExclude) { 69 extExclude = new RegExp(settings.extlink.extExclude.replace(/\\/, '\\'), "i"); 70 } 71 72 // Extra external link CSS selector exclusion. 73 var extCssExclude = false; 74 if (settings.extlink.extCssExclude) { 75 extCssExclude = settings.extlink.extCssExclude; 76 } 77 78 // Extra external link CSS selector explicit. 79 var extCssExplicit = false; 80 if (settings.extlink.extCssExplicit) { 81 extCssExplicit = settings.extlink.extCssExplicit; 82 } 83 84 // Find all links which are NOT internal and begin with http as opposed 85 // to ftp://, javascript:, etc. other kinds of links. 86 // When operating on the 'this' variable, the host has been appended to 87 // all links by the browser, even local ones. 88 // In jQuery 1.1 and higher, we'd use a filter method here, but it is not 89 // available in jQuery 1.0 (Drupal 5 default). 90 var external_links = new Array(); 91 var mailto_links = new Array(); 92 $("a, area", context).each(function(el) { 93 try { 94 var url = this.href.toLowerCase(); 95 if (url.indexOf('http') == 0 96 && (!url.match(internal_link) && !(extExclude && url.match(extExclude))) 97 || (extInclude && url.match(extInclude)) 98 && !(extCssExclude && $(this).parents(extCssExclude).length > 0) 99 && !(extCssExplicit && $(this).parents(extCssExplicit).length < 1)) { 100 101 // Add a class of 'extlink' to all external links except those within 102 // the 'now leaving' area. 103 if (!isInExtraLeavingContainer(this)) { 104 $(this).addClass('extlink'); 105 } 106 107 external_links.push(this); 108 } 109 // Do not include area tags with begin with mailto: (this prohibits 110 // icons from being added to image-maps). 111 else if (this.tagName != 'AREA' 112 && url.indexOf('mailto:') == 0 113 && !(extCssExclude && $(this).parents(extCssExclude).length > 0) 114 && !(extCssExplicit && $(this).parents(extCssExplicit).length < 1)) { 115 mailto_links.push(this); 116 } 117 } 118 // IE7 throws errors often when dealing with irregular links, such as: 119 // <a href="node/10"></a> Empty tags. 120 // <a href="http://user:[email protected]">example</a> User:pass syntax. 121 catch (error) { 122 return false; 123 } 124 }); 125 126 return external_links; 127 }, 128 129 // Our click handler for external links. 130 clickReaction: function(e) { 131 // Allow the default behavior for link if it's within the warning area. 132 // This keeps us from firing an infinite loop of reactions. 133 if (isInExtraLeavingContainer(this)) { 134 return true; 135 } 136 137 var external_url = jQuery(this).attr('href'); 138 var back_url = window.location.href; 139 var alerturl = Drupal.settings.extlink_extra.extlink_alert_url; 140 141 // "Don't warn" pattern matching. 142 var extlink_exclude_warning = false; 143 if (Drupal.settings.extlink_extra.extlink_exclude_warning) { 144 extlink_exclude_warning = new RegExp(Drupal.settings.extlink_extra.extlink_exclude_warning.replace(/\\/, '\\')); 145 } 146 // Don't do any warnings if the href matches the "don't warn" pattern. 147 if (extlink_exclude_warning) { 148 var url = external_url.toLowerCase(); 149 if (url.match(extlink_exclude_warning)) { 150 return true; 151 } 152 } 153 154 // This is what extlink does by default (except 155 if (Drupal.settings.extlink_extra.extlink_alert_type == 'confirm') { 156 var text = Drupal.settings.extlink.extAlertText.value; 157 text = text.replace(/\[extlink:external\-url\]/gi, external_url); 158 text = text.replace(/\[extlink:back-url\]/gi, back_url); 159 return confirm(text); 160 } 161 162 // Set cookies that the modal or page can read to determine the 'go to' and 'back' links. 163 $.cookie("external_url", external_url, { path: '/' }); 164 $.cookie("back_url", back_url, { path: '/' }); 165 166 if (Drupal.settings.extlink_extra.extlink_alert_type == 'colorbox') { 167 jQuery.colorbox(Drupal.settings.extlink_extra.colorboxSett
167ings); 168 return false; 169 } 170 171 if (Drupal.settings.extlink_extra.extlink_alert_type == 'page') { 172 // If we're here, alert text is on but pop-up is off; we should redirect to an intermediate confirm page. 173 window.location = alerturl; 174 return false; 175 } 176 }, 177 178 attach: function(context){ 179 // Build an array of external_links exactly like extlink does. 180 var external_links = this.extlinkAttach(context); 181 182 // Unbind the click handlers added by extlink and replace with our own 183 // This whole section of code that does the finding, unbinding, and rebinding 184 // could be made a lot less redundant and more efficient if this issue could be resolved: http://drupal.org/node/1715520 185 $(external_links).unbind('click').not('.ext-override, .extlink-extra-leaving a').click(this.clickReaction); 186 187 $(document).ready(function() { 188 if (Drupal.settings.extlink_extra.extlink_url_override == 1) { 189 if (Drupal.settings.extlink_extra.extlink_url_params.external_url) { 190 $.cookie("external_url", Drupal.settings.extlink_extra.extlink_url_params.external_url, { path: '/' }); 191 } 192 if (Drupal.settings.extlink_extra.extlink_url_params.back_url) { 193 $.cookie("back_url", Drupal.settings.extlink_extra.extlink_url_params.back_url, { path: '/' }); 194 } 195 } 196 }); 197 198 // Dynamically replace hrefs of back and external links on page load. This 199 // is to compensate for aggressive caching situations where the now-leaving 200 // is returning cached results. 201 if (Drupal.settings.extlink_extra.extlink_cache_fix == 1) { 202 if (jQuery('.extlink-extra-leaving').length > 0) { 203 // grab our cookies 204 var external_url = $.cookie("external_url"); 205 var back_url = $.cookie("back_url"); 206 207 // First, find any links within the .extlink-extra-leaving area that use our placeholder text and set their HREFs. 208 // Using jquery's attr function here (rather than text replace) is important because IE7 or (IE10+ in 209 // compatibility mode, possibly others) will have already turned link HREFs with a value of 210 // "external-url-placeholder" into a fully qualified link that has protocol and domain prepended, so we need to 211 // replace the whole thing. 212 $goLinks = jQuery('.extlink-extra-leaving a[href*=external-url-placeholder]').attr('href', external_url); 213 $backLinks = jQuery('.extlink-extra-leaving a[href*=back-url-placeholder]').attr('href', back_url); 214 215 // Respect the 'Open external links in a new window' in our modal/page with aggressive caching. Use of the text 216 // placeholder means that extlink's attach function doesn't catch these. 217 if (Drupal.settings.extlink.extTarget) { 218 // Apply the 'target' attribute to the 'go' links. 219 $goLinks.attr('target', Drupal.settings.extlink.extTarget); 220 } 221 222 // Next find any other places within text or whatever that have the placeholder text. 223 var html = jQuery('.extlink-extra-leaving').html(); 224 html = html.replace(/external-url-placeholder/gi, external_url); 225 html = html.replace(/back-url-placeholder/gi, back_url); 226 jQuery('.extlink-extra-leaving').html(html); 227 } 228 } 229 230 // If the timer is configured, we'll call it for the intermediate page. 231 if (Drupal.settings.extlink_extra.extlink_alert_type == 'page') { 232 if (jQuery('.extlink-extra-leaving').length > 0) { 233 extlink_extra_timer(); 234 } 235 } 236 237 // Apply 508 fix - extlink module makes empty <spans> to show the external link icon, screen readers 238 // have trouble with this. 239 if (Drupal.settings.extlink_extra.extlink_508_fix == 1) { 240 // Go through each <a> tag with an 'ext' class, 241 $.each($("a.ext"), function(index, value) { 242 // find a <span> next to it with 'ext' class, 243 var nextSpan = $(this).next('span.ext'); 244 if (nextSpan.length) { 245 // if found add the text 'External Link' to the empty <span> (or whatever is configured by the user) 246 nextSpan.html(Drupal.settings.extlink_extra.extlink_508_text); 247 248 // and move the span inside the <a> tag (at the end). 249 $(this).append(nextSpan); 250 } 251 }); 252 } 253 } 254} 255 256})(jQuery); 257 258// Global var that will be our JS interval. 259var extlink_int; 260 261function extlink_extra_timer() { 262 if (Drupal.settings.extlink_extra.extlink_alert_timer == 0 || Drupal.settings.extlink_extra.extlink_alert_timer == null) { 263 return; 264 } 265 extlink_int = setInterval(function () { 266 var container = jQuery('.automatic-redirect-countdown'); 267 var count = container.attr('rel'); 268 if (count == null) { 269 count = Drupal.settings.extlink_extra.extlink_alert_timer; 270 } 271 if (count >= 0) { 272 container.html('<span class="extlink-timer-text">Automatically redirecting in: </span><span class="extlink-count">' + count + '</span><span class="extlink-timer-text"> seconds.</span>'); 273 container.attr('rel', --count); 274 } 275 else { 276 extlink_stop_timer(); 277 container.remove(); 278 window.location = jQuery('div.extlink-extra-go-action a').attr('href'); 279 } 280 }, 1000); 281} 282 283function extlink_stop_timer() { 284 clearInterval(extlink_int); 285} 286;
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.