From 612f162ab9fc810fdbc542c008cab381bedc4148 Mon Sep 17 00:00:00 2001 From: Shawn Jansepar Date: Sun, 1 Dec 2013 20:35:58 -0800 Subject: [PATCH 1/5] Update code to use both `picture` and `span[data-picture]` --- build/mobify.js | 85 ++++++------------- build/mobify.min.js | 2 +- examples/capturing-picturepolyfill/index.html | 14 +-- .../resizeImages-picture-element/index.html | 6 +- src/external/picturefill.js | 85 ++++++------------- 5 files changed, 61 insertions(+), 131 deletions(-) diff --git a/build/mobify.js b/build/mobify.js index 492809b2..c395155b 100644 --- a/build/mobify.js +++ b/build/mobify.js @@ -2207,7 +2207,7 @@ if (capturing) { Capture.prototype.renderCapturedDoc = function(options) { // Change attribute of any img element inside a picture element // so it does not load post-flood - var imgsInPicture = this.capturedDoc.querySelectorAll('picture img'); + var imgsInPicture = this.capturedDoc.querySelectorAll('picture img, span[data-picture] img'); for (var i = 0, len = imgsInPicture.length; i < len; i++) { var disableImg = imgsInPicture[i]; var srcAttr = window.Mobify && window.Mobify.prefix + 'src'; @@ -2222,38 +2222,24 @@ if (capturing) { window.matchMedia = window.matchMedia || Utils.matchMedia(document); -/* https://github.com/Wilto/picturefill-proposal */ -/*! Picturefill - Author: Scott Jehl, 2012 | License: MIT/GPLv2 */ -/* - Picturefill: A polyfill for proposed behavior of the picture element, which does not yet exist, but should. :) - * Notes: - * For active discussion of the picture element, see http://www.w3.org/community/respimg/ - * While this code does work, it is intended to be used only for example purposes until either: - A) A W3C Candidate Recommendation for is released - B) A major browser implements -*/ +/*! Picturefill - Responsive Images that work today. (and mimic the proposed Picture element with span elements). Author: Scott Jehl, Filament Group, 2012 | License: MIT/GPLv2 */ + (function( w ){ + // Enable strict mode - // User preference for HD content when available - var prefHD = false || w.localStorage && w.localStorage[ "picturefill-prefHD" ] === "true", - hasHD; - // Test if `` is supported natively, if so, exit - no polyfill needed. if ( !!( w.document.createElement( "picture" ) && w.document.createElement( "source" ) && w.HTMLPictureElement ) ){ return; } w.picturefill = function() { - var ps = w.document.getElementsByTagName( "picture" ); - + var ps = w.document.querySelectorAll( "picture, span[data-picture]" ); // Loop the pictures for( var i = 0, il = ps.length; i < il; i++ ){ - var sources = ps[ i ].getElementsByTagName( "source" ), - picImg = null, + var sources = ps[ i ].querySelectorAll( "span, source" ), matches = []; - // If no sources are found, they're likely erased from the DOM. Try finding them inside comments. if( !sources.length ){ var picText = ps[ i ].innerHTML, @@ -2265,9 +2251,9 @@ window.matchMedia = window.matchMedia || Utils.matchMedia(document); sources = frag.getElementsByTagName( "div" ); } - // See which sources match + // See if which sources match for( var j = 0, jl = sources.length; j < jl; j++ ){ - var media = sources[ j ].getAttribute( "media" ); + var media = sources[ j ].getAttribute( "data-media" ) || sources[ j ].getAttribute( "media" ); // if there's no media specified, OR w.matchMedia is supported if( !media || ( w.matchMedia && w.matchMedia( media ).matches ) ){ matches.push( sources[ j ] ); @@ -2275,48 +2261,26 @@ window.matchMedia = window.matchMedia || Utils.matchMedia(document); } // Find any existing img element in the picture element - picImg = ps[ i ].getElementsByTagName( "img" )[ 0 ]; + var picImg = ps[ i ].getElementsByTagName( "img" )[ 0 ]; if( matches.length ){ - // Grab the most appropriate (last) match. - var match = matches.pop(), - srcset = match.getAttribute( "srcset" ); - - if( !picImg ){ + var matchedEl = matches.pop(); + if( !picImg || picImg.parentNode.nodeName === "NOSCRIPT" ){ picImg = w.document.createElement( "img" ); - picImg.alt = ps[ i ].getAttribute( "alt" ); - ps[ i ].appendChild( picImg ); + picImg.alt = ps[ i ].getAttribute( "data-alt" ); } - - if( srcset ) { - var screenRes = ( prefHD && w.devicePixelRatio ) || 1, // Is it worth looping through reasonable matchMedia values here? - sources = srcset.split(","); // Split comma-separated `srcset` sources into an array. - - hasHD = w.devicePixelRatio > 1; - - for( var res = sources.length, r = res - 1; r >= 0; r-- ) { // Loop through each source/resolution in `srcset`. - var source = sources[ r ].replace(/^\s*/, '').replace(/\s*$/, '').split(" "), // Remove any leading whitespace, then split on spaces. - resMatch = parseFloat( source[1], 10 ); // Parse out the resolution for each source in `srcset`. - - if( screenRes >= resMatch ) { - if( picImg.getAttribute( "src" ) !== source[0] ) { - var newImg = document.createElement("img"); - - newImg.src = source[0]; - // When the image is loaded, set a width equal to that of the original’s intrinsic width divided by the screen resolution: - newImg.onload = function() { - // Clone the original image into memory so the width is unaffected by page styles: - this.width = ( this.cloneNode( true ).width / resMatch ); - } - picImg.parentNode.replaceChild( newImg, picImg ); - } - break; // We’ve matched, so bail out of the loop here. - } - } - } else { - // No `srcset` in play, so just use the `src` value: - picImg.src = match.getAttribute( "src" ); + else if( matchedEl === picImg.parentNode ){ + // Skip further actions if the correct image is already in place + continue; } + + picImg.src = matchedEl.getAttribute( "data-src" ) || matchedEl.getAttribute("src"); + matchedEl.appendChild( picImg ); + picImg.removeAttribute("width"); + picImg.removeAttribute("height"); + } + else if( picImg ){ + picImg.parentNode.removeChild( picImg ); } } }; @@ -2334,7 +2298,8 @@ window.matchMedia = window.matchMedia || Utils.matchMedia(document); else if( w.attachEvent ){ w.attachEvent( "onload", w.picturefill ); } -})( this ); + +}( this )); return; diff --git a/build/mobify.min.js b/build/mobify.min.js index bf8d0298..5272b9ba 100644 --- a/build/mobify.min.js +++ b/build/mobify.min.js @@ -1 +1 @@ -!function(){var a,b,c;!function(d){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m=b&&b.split("/"),n=s.map,o=n&&n["*"]||{};if(a&&"."===a.charAt(0))if(b){for(m=m.slice(0,m.length-1),a=m.concat(a.split("/")),j=0;j0&&(a.splice(j-1,2),j-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((m||o)&&n){for(c=a.split("/"),j=c.length;j>0;j-=1){if(d=c.slice(0,j).join("/"),m)for(k=m.length;k>0;k-=1)if(e=n[m.slice(0,k).join("/")],e&&(e=e[d])){f=e,g=j;break}if(f)break;!h&&o&&o[d]&&(h=o[d],i=j)}!f&&h&&(f=h,g=i),f&&(c.splice(0,g,f),a=c.join("/"))}return a}function g(a,b){return function(){return n.apply(d,v.call(arguments,0).concat([a,b]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var b=r[a];delete r[a],t[a]=!0,m.apply(d,b)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,b,c,f){var h,k,l,m,n,s,u=[];if(f=f||a,"function"==typeof c){for(b=!b.length&&c.length?["require","exports","module"]:b,n=0;n":""},a.removeBySelector=function(b,c){c=c||document;var d=c.querySelectorAll(b);return a.removeElements(d,c)},a.removeElements=function(a,b){b=b||document;for(var c=0,d=a.length;d>c;c++){var e=a[c];e.parentNode.removeChild(e)}return a};var d;return a.supportsLocalStorage=function(){if(void 0!==d)return d;var a="modernizr";try{localStorage.setItem(a,a),localStorage.removeItem(a),d=!0}catch(b){d=!1}return d},a.matchMedia=function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}},a.domIsReady=function(a){var a=a||document;return a.attachEvent?"complete"===a.readyState:"loading"!==a.readyState},a.getPhysicalScreenSize=function(a){function b(b){var c=a||window.devicePixelRatio||1;return b.width=Math.round(b.width*c),b.height=Math.round(b.height*c),b}var c=navigator.userAgent.match(/ip(hone|od|ad)/i),d=(navigator.userAgent.match(/android (\d)/i)||{})[1],e={width:window.outerWidth,height:window.outerHeight};if(!c)return d>3?b(e):e;var f=window.orientation%180;return f?(e.height=screen.width,e.width=screen.height):(e.width=screen.width,e.height=screen.height),b(e)},a}),c("mobifyjs/capture",["mobifyjs/utils"],function(a){function b(a){return a.nodeName.toLowerCase()}function c(a){return a.replace('"',""")}function d(c){return c?[].map.call(c.childNodes,function(c){var d=b(c);return"#comment"==d?"":"plaintext"==d?c.textContent:"script"==d&&(/mobify/.test(c.src)||/mobify/i.test(c.textContent))?"":c.outerHTML||c.nodeValue||a.outerHTML(c)}).join(""):""}window.Mobify&&!window.Mobify.capturing&&document.getElementsByTagName("plaintext").length&&(window.Mobify.capturing=!0);var e=/()/gi,f={style:' media="mobify-media"',script:' type="text/mobify-script"'},g=new RegExp(a.values(f).join("|"),"g"),h={img:["src"],source:["src"],iframe:["src"],script:["src","type"],link:["href"],style:["media"]},i=new RegExp("<("+a.keys(h).join("|")+")([\\s\\S]*?)>","gi"),j={},k={};for(var l in h)if(h.hasOwnProperty(l)){var m=h[l];m.forEach(function(a){k[a]=!0}),j[l]=new RegExp("\\s+((?:"+m.join("|")+")\\s*=\\s*(?:('|\")[\\s\\S]+?\\2))","gi")}var n=document.createElement("div"),o=function(a,b){this.sourceDoc=a,this.prefix=b||"x-",window.Mobify&&(window.Mobify.prefix=this.prefix)};return o.init=o.initCapture=function(b,c,d){var c=c||document,e=function(b,c,d){var e=new o(c,d),f=e.createDocumentFragmentsStrings();a.extend(e,f);var g=e.createDocumentFragments();a.extend(e,g),b(e)};if(a.domIsReady(c))e(b,c,d);else{var f=!1,g=function(){f||(f=!0,h&&clearInterval(h),e(b,c,d))},h=setInterval(function(){a.domIsReady(c)&&g()},100);c.addEventListener("readystatechange",g,!1)}},o.removeClosingTagsAtEndOfString=function(a){var b=a.match(/((<\/[^>]+>)+)$/);return b?a.substring(0,a.length-b[0].length):a},o.removeTargetSelf=function(a){return a.replace(/target=("_self"|\'_self\')/gi,"")},o.cloneAttributes=function(a,b){var c=a.match(/^<(\w+)([\s\S]*)$/i);return n.innerHTML=""}}(),d=/()|(?=<\/script)/i,g=a.split(d),h=g.map(function(a){var b;return a?/^|(<\/head\s*>|'"]*|'[^']*?'|"[^"]*?")*>)([\s\S]*)$/.exec(captured.bodyContent);j&&(captured.bodyOpenTag=j[1],captured.bodyContent=j[2]);break}captured.headContent=h.slice(0,i.index),captured.bodyContent=h.slice(i.index+i[1].length)}return captured},o.prototype.restore=function(){var b=this,c=b.sourceDoc,d=function(){c.removeEventListener("readystatechange",d,!1),setTimeout(function(){c.open(),c.write(b.all()),c.close()},15)};a.domIsReady(c)?d():c.addEventListener("readystatechange",d,!1)},o.prototype.setElementContentFromString=function(a,b){for(n.innerHTML=b;n.firstChild;a.appendChild(n.firstChild));},o.prototype.createDocumentFragments=function(){var a={},b=a.capturedDoc=document.implementation.createHTMLDocument(""),c=a.htmlEl=b.documentElement,d=a.headEl=c.firstChild,e=a.bodyEl=c.lastChild;o.cloneAttributes(this.htmlOpenTag,c),o.cloneAttributes(this.headOpenTag,d),o.cloneAttributes(this.bodyOpenTag,e),e.innerHTML=o.disable(this.bodyContent,this.prefix);var f=o.disable(this.headContent,this.prefix);try{d.innerHTML=f}catch(g){var h=d.getElementsByTagName("title")[0];h&&d.removeChild(h),this.setElementContentFromString(d,f)}return c.appendChild(d),c.appendChild(e),a},o.prototype.escapedHTMLString=function(){var b=this.capturedDoc,c=o.enable(a.outerHTML(b.documentElement),this.prefix),d=this.doctype+c;return d},o.prototype.render=function(a){var b;b=a?o.enable(a):this.escapedHTMLString();var c=this.sourceDoc;window.Mobify&&(window.Mobify.capturing=!1),setTimeout(function(){c.open("text/html","replace"),c.write(b),c.close()})},o.prototype.getCapturedDoc=function(){return this.capturedDoc},o.getMobifyLibrary=function(a){var a=a||document,b=a.getElementById("mobify-js");return b||(b=a.getElementsByTagName("script")[0],b.id="mobify-js",b.setAttribute("class","mobify")),b},o.getMain=function(a){var a=a||document,b=void 0;return window.Mobify&&window.Mobify.mainExecutable?(b=document.createElement("script"),b.innerHTML="var main = "+window.Mobify.mainExecutable.toString()+"; main();",b.id="main-executable",b.setAttribute("class","mobify")):b=a.getElementById("main-executable"),b},o.insertMobifyScripts=function(a,b){var c=o.getMobifyLibrary(a),d=b.head,e=o.getMain(a);if(e){var f=b.importNode(e,!1);e.src||(f.innerHTML=e.innerHTML),d.insertBefore(f,d.firstChild)}var g=b.importNode(c,!1);d.insertBefore(g,d.firstChild)},o.prototype.renderCapturedDoc=function(){if(o.insertMobifyScripts(this.sourceDoc,this.capturedDoc),window.Mobify&&window.Mobify.points){var a=this.bodyEl,b=this.capturedDoc.createElement("div");b.id="mobify-point",b.setAttribute("style","display: none;"),b.innerHTML=window.Mobify.points[0],a.insertBefore(b,a.firstChild)}this.render()},o}),c("mobifyjs/resizeImages",["mobifyjs/utils"],function(a){function b(b){if(a.supportsLocalStorage()){var c={supported:b,date:Date.now()};localStorage.setItem(d,JSON.stringify(c))}}var c=window.ResizeImages={},d="Mobify-Webp-Support-v2";c.userAgentWebpDetect=function(a){var b=/(Android\s|Chrome\/|Opera9.8*Version\/..\.|Opera..\.)/i,c=new RegExp("(Android\\s(0|1|2|3|(4(?!.*Chrome)))\\.)|(Chrome\\/[0-8]\\.)|(Chrome\\/9\\.0\\.)|(Chrome\\/1[4-6]\\.)|(Android\\sChrome\\/1.\\.)|(Android\\sChrome\\/20\\.)|(Chrome\\/(1.|20|21|22)\\.)|(Opera.*(Version/|Opera\\s)(10|11)\\.)","i");return b.test(a)?c.test(a)?!1:!0:!1},c.dataUriWebpDetect=function(a){var c=new Image;c.onload=function(){var d=1===c.width?!0:!1;b(d),a&&a(d)},c.src="data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQABgBwlpAADcAD+/gbQAA=="},c.supportsWebp=function(e){if(a.supportsLocalStorage()){var f,g=localStorage.getItem(d);if(g&&(f=JSON.parse(g)),f&&Date.now()-f.date<6048e5)return f.supported}c.dataUriWebpDetect(e);var h=c.userAgentWebpDetect(navigator.userAgent);return b(h),h},c.getImageURL=function(a,b){var d=b;d||(d=c.processOptions());var e=[d.proto+d.host];if(d.projectName){var f="project-"+d.projectName;e.push(f)}return d.cacheHours&&e.push("c"+d.cacheHours),d.format&&e.push(d.format+(d.quality||"")),d.maxWidth&&(e.push(d.maxWidth),d.maxHeight&&e.push(d.maxHeight)),e.push(a),e.join("/")},c._rewriteSrcAttribute=function(b,d,e){if(e=b.getAttribute(d.sourceAttribute)||e){var g=a.absolutify(e);a.httpUrl(g)&&(d.onerror&&b.setAttribute("onerror",d.onerror),b.setAttribute(d.targetAttribute,c.getImageURL(g,d)),b.setAttribute("data-orig-src",e),f||d.sourceAttribute==d.targetAttribute||b.removeAttribute(d.sourceAttribute))}},c._resizeSourceElement=function(b,d,e){var f=b.getAttribute("data-width"),g=d;f&&(g=a.clone(d),g.maxWidth=f),c._rewriteSrcAttribute(b,g,e)},c._crawlPictureElement=function(a,b){var d=a.getElementsByTagName("source");if(0!==d.length&&!a.hasAttribute("mobify-optimized")){a.setAttribute("mobify-optimized","");for(var e=a.getAttribute("data-src"),f=0,g=d.length;g>f;f++)c._resizeSourceElement(d[f],b,e)}};var e=[320,640,768,1080,1536,2048,4e3];c._getBinnedDimension=function(a){for(var b=0,c=0,d=e.length;d>c&&(b=e[c],!(b>=a));c++);return b},c.processOptions=function(b){var d=a.clone(c.defaults);b&&a.extend(d,b);var e=d.devicePixelRatio||window.devicePixelRatio,f=a.getPhysicalScreenSize(e),g=d.maxWidth||c._getBinnedDimension(f.width),h=d.maxHeight||void 0;return e&&d.maxWidth&&(g*=e,d.maxHeight&&(h*=e)),d.maxWidth=Math.ceil(g),d.maxHeight&&h&&(d.maxHeight=Math.ceil(h)),!d.format&&d.webp&&(d.format="webp"),d},c.resize=function(a,b){for(var d=c.processOptions(b),e=0;ek?!1:c&&(g=c.overrideTime)&&l?k>l+1e3*60*g:j&&l?(j=b.utils.ccParse(j),!j["max-age"]||j["no-store"]||j["no-cache"]?!0:k>l+1e3*j["max-age"]):i.expires&&(d=Date.parse(i.expires))?k>d:m&&(m=Date.parse(m))&&l&&(f=l-m,e=k-l,.1*f>e&&h>e)?!1:!0};var g=window.Jazzcat={httpCache:b,write:document.write};g.isIncompatibleBrowser=function(b){var c=/(firefox)[\/\s](\d+)|(opera[\s\S]*version[\/\s](11|12))/i.exec(b||navigator.userAgent);return c&&c[1]&&+c[2]<12||c&&c[3]||!a.supportsLocalStorage()||!window.JSON?!0:!1},g.cacheLoaderInserted=!1,g.optimizeScripts=function(c,d){if(d&&void 0!==d.cacheOverrideTime&&a.extend(b.options,{overrideTime:d.cacheOverrideTime}),c=Array.prototype.slice.call(c),!c.length||g.isIncompatibleBrowser())return c;d=a.extend({},g.defaults,d||{});for(var e,f="jsonp"===d.responseType,h=d.concat,i=function(a,b){if(a){var c=g.getLoaderScript(b,d);a.parentNode.insertBefore(c,a)}},j={head:{firstScript:void 0,urls:[]},body:{firstScript:void 0,urls:[]}},k=0,l=c.length;l>k;k++){var m=c[k];if(!(m.hasAttribute("mobify-optimized")||m.hasAttribute("skip-optimize")||/mobify/i.test(m.className))&&(e=m.getAttribute(d.attribute),e&&(e=a.absolutify(e),a.httpUrl(e)))){if(f&&!g.cacheLoaderInserted){b.load(b.options);var n=g.getHttpCacheLoaderScript();m.parentNode.insertBefore(n,m),g.cacheLoaderInserted=!0}var o="HEAD"===m.parentNode.nodeName?"head":"body";if(f){if(b.get(e)||(h?(void 0===j[o].firstScript&&(j[o].firstScript=m),j[o].urls.push(e)):i(m,[e])),m.type="text/mobify-script",m.hasAttribute("onload")){var p=m.getAttribute("onload");m.innerHTML=d.execCallback+"('"+e+"', '"+p.replace(/'/g,"\\'")+"');",m.removeAttribute("onload")}else m.innerHTML=d.execCallback+"('"+e+"');";m.removeAttribute(d.attribute)}else if(h)void 0===j[o].firstScript&&(j[o].firstScript=m),j[o].urls.push(e);else{var q=g.getURL([e],d);m.setAttribute(d.attribute,q)}}}if(h&&(i(j.head.firstScript,j.head.urls),i(j.body.firstScript,j.body.urls)),!f&&h)for(var k=0,l=c.length;l>k;k++){var m=c[k];m.getAttribute(d.attribute)&&m.parentNode.removeChild(m)}return c},g.getHttpCacheLoaderScript=function(){var a=document.createElement("script");return a.type="text/mobify-script",a.innerHTML=b.options.overrideTime?"Jazzcat.httpCache.load("+JSON.stringify(b.options)+");":"Jazzcat.httpCache.load();",a},g.getLoaderScript=function(a,b){var c;return a&&a.length&&(c=document.createElement("script"),c.setAttribute("mobify-optimized",""),c.setAttribute(b.attribute,g.getURL(a,b))),c},g.getURL=function(b,c){var c=a.extend({},g.defaults,c||{});return c.base+(c.projectName?"/project-"+c.projectName:"")+"/"+c.responseType+("jsonp"===c.responseType?"/"+c.loadCallback:"")+"/"+encodeURIComponent(JSON.stringify(b.slice().sort()))};var h=/(<\/scr)(ipt\s*>)/gi;return g.exec=function(a,c){var d,e=b.get(a,!0),f="";c?(c=";"+c+";",f=' onload="'+c+'"'):c="",e?(d='data-orig-src="'+a+'"',d+=">"+e.body.replace(h,"$1\\$2")+c):d='src="'+a+'"'+f+">",g.write.call(document,"")},g.load=function(a){var c,d=0,e=!1;if(a){for(;c=a[d++];)"ready"==c.status&&c.statusCode>=200&&c.statusCode<300&&(e=!0,b.set(encodeURI(c.url),c));e&&b.save()}},g.defaults={selector:"script",attribute:"x-src",base:"//jazzcat.mobify.com",responseType:"jsonp",execCallback:"Jazzcat.exec",loadCallback:"Jazzcat.load",concat:!1,projectName:""},g}),c("mobifyjs/unblockify",["mobifyjs/utils","mobifyjs/capture"],function(a,b){var c={};return c.moveScripts=function(b,c){a.removeElements(b,c);for(var d=0,e=b.length;e>d;d++){var f=b[d];c.body.appendChild(f)}},c.unblock=function(a){var d=b.prototype.insertMobifyScripts;b.prototype.insertMobifyScripts=function(){d.call(this);var b=this.capturedDoc;c.moveScripts(a,b)}},c}),c("mobifyjs/cssOptimize",["mobifyjs/utils"],function(a){var b=window.cssOptimize={};b.getCssUrl=function(b,d){var e=a.extend({},c,d),f=[e.protoAndHost];return e.projectName&&f.push("project-"+e.projectName),f.push(e.endpoint),f.push(b),f.join("/")},b._rewriteHref=function(c,d){var e,f=c.getAttribute(d.targetAttribute);f&&(e=a.absolutify(f),a.httpUrl(e)&&(c.setAttribute("data-orig-href",f),c.setAttribute(d.targetAttribute,b.getCssUrl(e,d)),d.onerror&&c.setAttribute("onerror",d.onerror)))},b.optimize=function(d,e){for(var f,g=a.extend({},c,e),h=0,i=d.length;i>h;h++)f=d[h],"LINK"===f.nodeName&&"stylesheet"===f.getAttribute("rel")&&f.getAttribute(g.targetAttribute)&&!f.hasAttribute("mobify-optimized")&&(f.setAttribute("mobify-optimized",""),b._rewriteHref(f,g))},b.restoreOriginalHref=function(a){var b;a.target.removeAttribute("onerror"),(b=a.target.getAttribute("data-orig-href"))&&a.target.setAttribute("href",b)};var c=b._defaults={protoAndHost:"//jazzcat.mobify.com",endpoint:"cssoptimizer",projectName:"oss-"+location.hostname.replace(/[^\w]/g,"-"),targetAttribute:"x-href",onerror:"Mobify.CssOptimize.restoreOriginalHref(event);"};return b}),c("mobifyjs/external/picturefill",["mobifyjs/utils","mobifyjs/capture"],function(a,b){var c=window.Mobify&&window.Mobify.capturing||!1;if(c){var d=b.prototype.renderCapturedDoc;return b.prototype.renderCapturedDoc=function(){for(var a=this.capturedDoc.querySelectorAll("picture img, span[data-picture] img"),b=0,c=a.length;c>b;b++){var e=a[b],f=window.Mobify&&window.Mobify.prefix+"src";e.setAttribute("data-orig-src",e.getAttribute(f)),e.removeAttribute(f)}d.apply(this,arguments)},void 0}window.matchMedia=window.matchMedia||a.matchMedia(document),function(a){a.document.createElement("picture")&&a.document.createElement("source")&&a.HTMLPictureElement||(a.picturefill=function(){for(var b=a.document.querySelectorAll("picture, span[data-picture]"),c=0,d=b.length;d>c;c++){var e=b[c].querySelectorAll("span, source"),f=[];if(!e.length){var g=b[c].innerHTML,h=a.document.createElement("div"),i=g.replace(/(<)source([^>]+>)/gim,"$1div$2").match(/]+>/gim);h.innerHTML=i.join(""),e=h.getElementsByTagName("div")}for(var j=0,k=e.length;k>j;j++){var l=e[j].getAttribute("data-media")||e[j].getAttribute("media");(!l||a.matchMedia&&a.matchMedia(l).matches)&&f.push(e[j])}var m=b[c].getElementsByTagName("img")[0];if(f.length){var n=f.pop();if(m&&"NOSCRIPT"!==m.parentNode.nodeName){if(n===m.parentNode)continue}else m=a.document.createElement("img"),m.alt=b[c].getAttribute("data-alt");m.src=n.getAttribute("data-src")||n.getAttribute("src"),n.appendChild(m),m.removeAttribute("width"),m.removeAttribute("height")}else m&&m.parentNode.removeChild(m)}},a.addEventListener?(a.addEventListener("resize",a.picturefill,!1),a.addEventListener("DOMContentLoaded",function(){a.picturefill(),a.removeEventListener("load",a.picturefill,!1)},!1),a.addEventListener("load",a.picturefill,!1)):a.attachEvent&&a.attachEvent("onload",a.picturefill))}(this)}),b(["mobifyjs/utils","mobifyjs/capture","mobifyjs/resizeImages","mobifyjs/jazzcat","mobifyjs/unblockify","mobifyjs/cssOptimize","mobifyjs/external/picturefill"],function(a,b,c,d,e,f){var g=window.Mobify=window.Mobify||{};return g.Utils=a,g.Capture=b,g.ResizeImages=c,g.Jazzcat=d,g.CssOptimize=f,g.Unblockify=e,g.api="2.0",g},void 0,!0),c("mobify-library",function(){})}(); \ No newline at end of file diff --git a/examples/capturing-picturepolyfill/index.html b/examples/capturing-picturepolyfill/index.html index 486dc7d5..334662a0 100644 --- a/examples/capturing-picturepolyfill/index.html +++ b/examples/capturing-picturepolyfill/index.html @@ -4,7 +4,7 @@ ")},g.load=function(a){var c,d=0,e=!1;if(a){for(;c=a[d++];)"ready"==c.status&&c.statusCode>=200&&c.statusCode<300&&(e=!0,b.set(encodeURI(c.url),c));e&&b.save()}},g.defaults={selector:"script",attribute:"x-src",base:"//jazzcat.mobify.com",responseType:"jsonp",execCallback:"Jazzcat.exec",loadCallback:"Jazzcat.load",concat:!1,projectName:""},g}),c("mobifyjs/unblockify",["mobifyjs/utils","mobifyjs/capture"],function(a,b){var c={};return c.moveScripts=function(b,c){a.removeElements(b,c);for(var d=0,e=b.length;e>d;d++){var f=b[d];c.body.appendChild(f)}},c.unblock=function(a){var d=b.prototype.insertMobifyScripts;b.prototype.insertMobifyScripts=function(){d.call(this);var b=this.capturedDoc;c.moveScripts(a,b)}},c}),c("mobifyjs/cssOptimize",["mobifyjs/utils"],function(a){var b=window.cssOptimize={};b.getCssUrl=function(b,d){var e=a.extend({},c,d),f=[e.protoAndHost];return e.projectName&&f.push("project-"+e.projectName),f.push(e.endpoint),f.push(b),f.join("/")},b._rewriteHref=function(c,d){var e,f=c.getAttribute(d.targetAttribute);f&&(e=a.absolutify(f),a.httpUrl(e)&&(c.setAttribute("data-orig-href",f),c.setAttribute(d.targetAttribute,b.getCssUrl(e,d)),d.onerror&&c.setAttribute("onerror",d.onerror)))},b.optimize=function(d,e){for(var f,g=a.extend({},c,e),h=0,i=d.length;i>h;h++)f=d[h],"LINK"===f.nodeName&&"stylesheet"===f.getAttribute("rel")&&f.getAttribute(g.targetAttribute)&&!f.hasAttribute("mobify-optimized")&&(f.setAttribute("mobify-optimized",""),b._rewriteHref(f,g))},b.restoreOriginalHref=function(a){var b;a.target.removeAttribute("onerror"),(b=a.target.getAttribute("data-orig-href"))&&a.target.setAttribute("href",b)};var c=b._defaults={protoAndHost:"//jazzcat.mobify.com",endpoint:"cssoptimizer",projectName:"oss-"+location.hostname.replace(/[^\w]/g,"-"),targetAttribute:"x-href",onerror:"Mobify.CssOptimize.restoreOriginalHref(event);"};return b}),c("mobifyjs/external/picturefill",["mobifyjs/utils","mobifyjs/capture"],function(a,b){var c=window.Mobify&&window.Mobify.capturing||!1;if(c){var d=b.prototype.renderCapturedDoc;return b.prototype.renderCapturedDoc=function(){for(var a=this.capturedDoc.querySelectorAll("picture img, span[data-picture] img"),b=0,c=a.length;c>b;b++){var e=a[b],f=window.Mobify&&window.Mobify.prefix+"src";e.setAttribute("data-orig-src",e.getAttribute(f)),e.removeAttribute(f)}d.apply(this,arguments)},void 0}window.matchMedia=window.matchMedia||a.matchMedia(document),function(a){a.document.createElement("picture")&&a.document.createElement("source")&&a.HTMLPictureElement||(a.picturefill=function(){for(var b=a.document.querySelectorAll("picture, span[data-picture]"),c=0,d=b.length;d>c;c++){var e=b[c].querySelectorAll("span, source"),f=[];if(!e.length){var g=b[c].innerHTML,h=a.document.createElement("div"),i=g.replace(/(<)source([^>]+>)/gim,"$1div$2").match(/]+>/gim);h.innerHTML=i.join(""),e=h.getElementsByTagName("div")}for(var j=0,k=e.length;k>j;j++){var l=e[j].getAttribute("data-media")||e[j].getAttribute("media");(!l||a.matchMedia&&a.matchMedia(l).matches)&&f.push(e[j])}var m=b[c].getElementsByTagName("img")[0];if(f.length){var n=f.pop();if(m&&"NOSCRIPT"!==m.parentNode.nodeName){if(n===m.parentNode)continue}else m=a.document.createElement("img"),m.alt=b[c].getAttribute("data-alt");m.src=n.getAttribute("data-src")||n.getAttribute("src"),n.appendChild(m),m.removeAttribute("width"),m.removeAttribute("height")}else m&&m.parentNode.removeChild(m)}},a.addEventListener?(a.addEventListener("resize",a.picturefill,!1),a.addEventListener("DOMContentLoaded",function(){a.picturefill(),a.removeEventListener("load",a.picturefill,!1)},!1),a.addEventListener("load",a.picturefill,!1)):a.attachEvent&&a.attachEvent("onload",a.picturefill))}(this)}),b(["mobifyjs/utils","mobifyjs/capture","mobifyjs/resizeImages","mobifyjs/jazzcat","mobifyjs/unblockify","mobifyjs/cssOptimize","mobifyjs/external/picturefill"],function(a,b,c,d,e,f){var g=window.Mobify=window.Mobify||{};return g.Utils=a,g.Capture=b,g.ResizeImages=c,g.Jazzcat=d,g.CssOptimize=f,g.Unblockify=e,g.api="2.0",g},void 0,!0),c("mobify-library",function(){})}(); \ No newline at end of file +!function(){var a,b,c;!function(d){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m=b&&b.split("/"),n=s.map,o=n&&n["*"]||{};if(a&&"."===a.charAt(0))if(b){for(m=m.slice(0,m.length-1),a=m.concat(a.split("/")),j=0;j0&&(a.splice(j-1,2),j-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((m||o)&&n){for(c=a.split("/"),j=c.length;j>0;j-=1){if(d=c.slice(0,j).join("/"),m)for(k=m.length;k>0;k-=1)if(e=n[m.slice(0,k).join("/")],e&&(e=e[d])){f=e,g=j;break}if(f)break;!h&&o&&o[d]&&(h=o[d],i=j)}!f&&h&&(f=h,g=i),f&&(c.splice(0,g,f),a=c.join("/"))}return a}function g(a,b){return function(){return n.apply(d,v.call(arguments,0).concat([a,b]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var b=r[a];delete r[a],t[a]=!0,m.apply(d,b)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,b,c,f){var h,k,l,m,n,s,u=[];if(f=f||a,"function"==typeof c){for(b=!b.length&&c.length?["require","exports","module"]:b,n=0;n":""},a.removeBySelector=function(b,c){c=c||document;var d=c.querySelectorAll(b);return a.removeElements(d,c)},a.removeElements=function(a,b){b=b||document;for(var c=0,d=a.length;d>c;c++){var e=a[c];e.parentNode.removeChild(e)}return a};var d;return a.supportsLocalStorage=function(){if(void 0!==d)return d;var a="modernizr";try{localStorage.setItem(a,a),localStorage.removeItem(a),d=!0}catch(b){d=!1}return d},a.matchMedia=function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}},a.domIsReady=function(a){var a=a||document;return a.attachEvent?"complete"===a.readyState:"loading"!==a.readyState},a.getPhysicalScreenSize=function(a){function b(b){var c=a||window.devicePixelRatio||1;return b.width=Math.round(b.width*c),b.height=Math.round(b.height*c),b}var c=navigator.userAgent.match(/ip(hone|od|ad)/i),d=(navigator.userAgent.match(/android (\d)/i)||{})[1],e={width:window.outerWidth,height:window.outerHeight};if(!c)return d>3?b(e):e;var f=window.orientation%180;return f?(e.height=screen.width,e.width=screen.height):(e.width=screen.width,e.height=screen.height),b(e)},a}),c("mobifyjs/capture",["mobifyjs/utils"],function(a){function b(a){return a.nodeName.toLowerCase()}function c(a){return a.replace('"',""")}function d(c){return c?[].map.call(c.childNodes,function(c){var d=b(c);return"#comment"==d?"":"plaintext"==d?c.textContent:"script"==d&&(/mobify/.test(c.src)||/mobify/i.test(c.textContent))?"":c.outerHTML||c.nodeValue||a.outerHTML(c)}).join(""):""}window.Mobify&&!window.Mobify.capturing&&document.getElementsByTagName("plaintext").length&&(window.Mobify.capturing=!0);var e=/()/gi,f={style:' media="mobify-media"',script:' type="text/mobify-script"'},g=new RegExp(a.values(f).join("|"),"g"),h={img:["src"],source:["src"],iframe:["src"],script:["src","type"],link:["href"],style:["media"]},i=new RegExp("<("+a.keys(h).join("|")+")([\\s\\S]*?)>","gi"),j={},k={};for(var l in h)if(h.hasOwnProperty(l)){var m=h[l];m.forEach(function(a){k[a]=!0}),j[l]=new RegExp("\\s+((?:"+m.join("|")+")\\s*=\\s*(?:('|\")[\\s\\S]+?\\2))","gi")}var n=document.createElement("div"),o=function(a,b){this.sourceDoc=a,this.prefix=b||"x-",window.Mobify&&(window.Mobify.prefix=this.prefix)};return o.init=o.initCapture=function(b,c,d){var c=c||document,e=function(b,c,d){var e=new o(c,d),f=e.createDocumentFragmentsStrings();a.extend(e,f);var g=e.createDocumentFragments();a.extend(e,g),b(e)};if(a.domIsReady(c))e(b,c,d);else{var f=!1,g=function(){f||(f=!0,h&&clearInterval(h),e(b,c,d))},h=setInterval(function(){a.domIsReady(c)&&g()},100);c.addEventListener("readystatechange",g,!1)}},o.removeClosingTagsAtEndOfString=function(a){var b=a.match(/((<\/[^>]+>)+)$/);return b?a.substring(0,a.length-b[0].length):a},o.removeTargetSelf=function(a){return a.replace(/target=("_self"|\'_self\')/gi,"")},o.cloneAttributes=function(a,b){var c=a.match(/^<(\w+)([\s\S]*)$/i);return n.innerHTML=""}}(),d=/()|(?=<\/script)/i,g=a.split(d),h=g.map(function(a){var b;return a?/^|(<\/head\s*>|'"]*|'[^']*?'|"[^"]*?")*>)([\s\S]*)$/.exec(captured.bodyContent);j&&(captured.bodyOpenTag=j[1],captured.bodyContent=j[2]);break}captured.headContent=h.slice(0,i.index),captured.bodyContent=h.slice(i.index+i[1].length)}return captured},o.prototype.restore=function(){var b=this,c=b.sourceDoc,d=function(){c.removeEventListener("readystatechange",d,!1),setTimeout(function(){c.open(),c.write(b.all()),c.close()},15)};a.domIsReady(c)?d():c.addEventListener("readystatechange",d,!1)},o.prototype.setElementContentFromString=function(a,b){for(n.innerHTML=b;n.firstChild;a.appendChild(n.firstChild));},o.prototype.createDocumentFragments=function(){var a={},b=a.capturedDoc=document.implementation.createHTMLDocument(""),c=a.htmlEl=b.documentElement,d=a.headEl=c.firstChild,e=a.bodyEl=c.lastChild;o.cloneAttributes(this.htmlOpenTag,c),o.cloneAttributes(this.headOpenTag,d),o.cloneAttributes(this.bodyOpenTag,e),e.innerHTML=o.disable(this.bodyContent,this.prefix);var f=o.disable(this.headContent,this.prefix);try{d.innerHTML=f}catch(g){var h=d.getElementsByTagName("title")[0];h&&d.removeChild(h),this.setElementContentFromString(d,f)}return c.appendChild(d),c.appendChild(e),a},o.prototype.escapedHTMLString=function(){var b=this.capturedDoc,c=o.enable(a.outerHTML(b.documentElement),this.prefix),d=this.doctype+c;return d},o.prototype.render=function(a){var b;b=a?o.enable(a):this.escapedHTMLString();var c=this.sourceDoc;window.Mobify&&(window.Mobify.capturing=!1),setTimeout(function(){c.open("text/html","replace"),c.write(b),c.close()})},o.prototype.getCapturedDoc=function(){return this.capturedDoc},o.getMobifyLibrary=function(a){var a=a||document,b=a.getElementById("mobify-js");return b||(b=a.getElementsByTagName("script")[0],b.id="mobify-js",b.setAttribute("class","mobify")),b},o.getMain=function(a){var a=a||document,b=void 0;return window.Mobify&&window.Mobify.mainExecutable?(b=document.createElement("script"),b.innerHTML="var main = "+window.Mobify.mainExecutable.toString()+"; main();",b.id="main-executable",b.setAttribute("class","mobify")):b=a.getElementById("main-executable"),b},o.insertMobifyScripts=function(a,b){var c=o.getMobifyLibrary(a),d=b.head,e=o.getMain(a);if(e){var f=b.importNode(e,!1);e.src||(f.innerHTML=e.innerHTML),d.insertBefore(f,d.firstChild)}var g=b.importNode(c,!1);d.insertBefore(g,d.firstChild)},o.prototype.renderCapturedDoc=function(){if(o.insertMobifyScripts(this.sourceDoc,this.capturedDoc),window.Mobify&&window.Mobify.points){var a=this.bodyEl,b=this.capturedDoc.createElement("div");b.id="mobify-point",b.setAttribute("style","display: none;"),b.innerHTML=window.Mobify.points[0],a.insertBefore(b,a.firstChild)}this.render()},o}),c("mobifyjs/resizeImages",["mobifyjs/utils"],function(a){function b(b){if(a.supportsLocalStorage()){var c={supported:b,date:Date.now()};localStorage.setItem(d,JSON.stringify(c))}}var c=window.ResizeImages={},d="Mobify-Webp-Support-v2";c.userAgentWebpDetect=function(a){var b=/(Android\s|Chrome\/|Opera9.8*Version\/..\.|Opera..\.)/i,c=new RegExp("(Android\\s(0|1|2|3|(4(?!.*Chrome)))\\.)|(Chrome\\/[0-8]\\.)|(Chrome\\/9\\.0\\.)|(Chrome\\/1[4-6]\\.)|(Android\\sChrome\\/1.\\.)|(Android\\sChrome\\/20\\.)|(Chrome\\/(1.|20|21|22)\\.)|(Opera.*(Version/|Opera\\s)(10|11)\\.)","i");return b.test(a)?c.test(a)?!1:!0:!1},c.dataUriWebpDetect=function(a){var c=new Image;c.onload=function(){var d=1===c.width?!0:!1;b(d),a&&a(d)},c.src="data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQABgBwlpAADcAD+/gbQAA=="},c.supportsWebp=function(e){if(a.supportsLocalStorage()){var f,g=localStorage.getItem(d);if(g&&(f=JSON.parse(g)),f&&Date.now()-f.date<6048e5)return f.supported}c.dataUriWebpDetect(e);var h=c.userAgentWebpDetect(navigator.userAgent);return b(h),h},c.getImageURL=function(a,b){var d=b;d||(d=c.processOptions());var e=[d.proto+d.host];if(d.projectName){var f="project-"+d.projectName;e.push(f)}return d.cacheHours&&e.push("c"+d.cacheHours),d.format&&e.push(d.format+(d.quality||"")),d.maxWidth&&(e.push(d.maxWidth),d.maxHeight&&e.push(d.maxHeight)),e.push(a),e.join("/")},c._rewriteSrcAttribute=function(b,d,e){if(e=b.getAttribute(d.sourceAttribute)||e){var g=a.absolutify(e);a.httpUrl(g)&&(d.onerror&&b.setAttribute("onerror",d.onerror),b.setAttribute(d.targetAttribute,c.getImageURL(g,d)),b.setAttribute("data-orig-src",e),f||d.sourceAttribute==d.targetAttribute||b.removeAttribute(d.sourceAttribute))}},c._resizeSourceElement=function(b,d,e){var f=b.getAttribute("data-width"),g=d;f&&(g=a.clone(d),g.maxWidth=f),c._rewriteSrcAttribute(b,g,e)},c._crawlPictureElement=function(a,b){var d=a.getElementsByTagName("span")||a.getElementsByTagName("source");if(0!==d.length&&!a.hasAttribute("mobify-optimized")){a.setAttribute("mobify-optimized","");for(var e=a.getAttribute("data-src"),f=0,g=d.length;g>f;f++)c._resizeSourceElement(d[f],b,e)}};var e=[320,640,768,1080,1536,2048,4e3];c._getBinnedDimension=function(a){for(var b=0,c=0,d=e.length;d>c&&(b=e[c],!(b>=a));c++);return b},c.processOptions=function(b){var d=a.clone(c.defaults);b&&a.extend(d,b);var e=d.devicePixelRatio||window.devicePixelRatio,f=a.getPhysicalScreenSize(e),g=d.maxWidth||c._getBinnedDimension(f.width),h=d.maxHeight||void 0;return e&&d.maxWidth&&(g*=e,d.maxHeight&&(h*=e)),d.maxWidth=Math.ceil(g),d.maxHeight&&h&&(d.maxHeight=Math.ceil(h)),!d.format&&d.webp&&(d.format="webp"),d},c.resize=function(a,b){for(var d=c.processOptions(b),e=0;ek?!1:c&&(g=c.overrideTime)&&l?k>l+1e3*60*g:j&&l?(j=b.utils.ccParse(j),!j["max-age"]||j["no-store"]||j["no-cache"]?!0:k>l+1e3*j["max-age"]):i.expires&&(d=Date.parse(i.expires))?k>d:m&&(m=Date.parse(m))&&l&&(f=l-m,e=k-l,.1*f>e&&h>e)?!1:!0};var g=window.Jazzcat={httpCache:b,write:document.write};g.isIncompatibleBrowser=function(b){var c=/(firefox)[\/\s](\d+)|(opera[\s\S]*version[\/\s](11|12))/i.exec(b||navigator.userAgent);return c&&c[1]&&+c[2]<12||c&&c[3]||!a.supportsLocalStorage()||!window.JSON?!0:!1},g.cacheLoaderInserted=!1,g.optimizeScripts=function(c,d){if(d&&void 0!==d.cacheOverrideTime&&a.extend(b.options,{overrideTime:d.cacheOverrideTime}),c=Array.prototype.slice.call(c),!c.length||g.isIncompatibleBrowser())return c;d=a.extend({},g.defaults,d||{});for(var e,f="jsonp"===d.responseType,h=d.concat,i=function(a,b){if(a){var c=g.getLoaderScript(b,d);a.parentNode.insertBefore(c,a)}},j={head:{firstScript:void 0,urls:[]},body:{firstScript:void 0,urls:[]}},k=0,l=c.length;l>k;k++){var m=c[k];if(!(m.hasAttribute("mobify-optimized")||m.hasAttribute("skip-optimize")||/mobify/i.test(m.className))&&(e=m.getAttribute(d.attribute),e&&(e=a.absolutify(e),a.httpUrl(e)))){if(f&&!g.cacheLoaderInserted){b.load(b.options);var n=g.getHttpCacheLoaderScript();m.parentNode.insertBefore(n,m),g.cacheLoaderInserted=!0}var o="HEAD"===m.parentNode.nodeName?"head":"body";if(f){if(b.get(e)||(h?(void 0===j[o].firstScript&&(j[o].firstScript=m),j[o].urls.push(e)):i(m,[e])),m.type="text/mobify-script",m.hasAttribute("onload")){var p=m.getAttribute("onload");m.innerHTML=d.execCallback+"('"+e+"', '"+p.replace(/'/g,"\\'")+"');",m.removeAttribute("onload")}else m.innerHTML=d.execCallback+"('"+e+"');";m.removeAttribute(d.attribute)}else if(h)void 0===j[o].firstScript&&(j[o].firstScript=m),j[o].urls.push(e);else{var q=g.getURL([e],d);m.setAttribute(d.attribute,q)}}}if(h&&(i(j.head.firstScript,j.head.urls),i(j.body.firstScript,j.body.urls)),!f&&h)for(var k=0,l=c.length;l>k;k++){var m=c[k];m.getAttribute(d.attribute)&&m.parentNode.removeChild(m)}return c},g.getHttpCacheLoaderScript=function(){var a=document.createElement("script");return a.type="text/mobify-script",a.innerHTML=b.options.overrideTime?"Jazzcat.httpCache.load("+JSON.stringify(b.options)+");":"Jazzcat.httpCache.load();",a},g.getLoaderScript=function(a,b){var c;return a&&a.length&&(c=document.createElement("script"),c.setAttribute("mobify-optimized",""),c.setAttribute(b.attribute,g.getURL(a,b))),c},g.getURL=function(b,c){var c=a.extend({},g.defaults,c||{});return c.base+(c.projectName?"/project-"+c.projectName:"")+"/"+c.responseType+("jsonp"===c.responseType?"/"+c.loadCallback:"")+"/"+encodeURIComponent(JSON.stringify(b.slice().sort()))};var h=/(<\/scr)(ipt\s*>)/gi;return g.exec=function(a,c){var d,e=b.get(a,!0),f="";c?(c=";"+c+";",f=' onload="'+c+'"'):c="",e?(d='data-orig-src="'+a+'"',d+=">"+e.body.replace(h,"$1\\$2")+c):d='src="'+a+'"'+f+">",g.write.call(document,"")},g.load=function(a){var c,d=0,e=!1;if(a){for(;c=a[d++];)"ready"==c.status&&c.statusCode>=200&&c.statusCode<300&&(e=!0,b.set(encodeURI(c.url),c));e&&b.save()}},g.defaults={selector:"script",attribute:"x-src",base:"//jazzcat.mobify.com",responseType:"jsonp",execCallback:"Jazzcat.exec",loadCallback:"Jazzcat.load",concat:!1,projectName:""},g}),c("mobifyjs/unblockify",["mobifyjs/utils","mobifyjs/capture"],function(a,b){var c={};return c.moveScripts=function(b,c){a.removeElements(b,c);for(var d=0,e=b.length;e>d;d++){var f=b[d];c.body.appendChild(f)}},c.unblock=function(a){var d=b.prototype.insertMobifyScripts;b.prototype.insertMobifyScripts=function(){d.call(this);var b=this.capturedDoc;c.moveScripts(a,b)}},c}),c("mobifyjs/cssOptimize",["mobifyjs/utils"],function(a){var b=window.cssOptimize={};b.getCssUrl=function(b,d){var e=a.extend({},c,d),f=[e.protoAndHost];return e.projectName&&f.push("project-"+e.projectName),f.push(e.endpoint),f.push(b),f.join("/")},b._rewriteHref=function(c,d){var e,f=c.getAttribute(d.targetAttribute);f&&(e=a.absolutify(f),a.httpUrl(e)&&(c.setAttribute("data-orig-href",f),c.setAttribute(d.targetAttribute,b.getCssUrl(e,d)),d.onerror&&c.setAttribute("onerror",d.onerror)))},b.optimize=function(d,e){for(var f,g=a.extend({},c,e),h=0,i=d.length;i>h;h++)f=d[h],"LINK"===f.nodeName&&"stylesheet"===f.getAttribute("rel")&&f.getAttribute(g.targetAttribute)&&!f.hasAttribute("mobify-optimized")&&(f.setAttribute("mobify-optimized",""),b._rewriteHref(f,g))},b.restoreOriginalHref=function(a){var b;a.target.removeAttribute("onerror"),(b=a.target.getAttribute("data-orig-href"))&&a.target.setAttribute("href",b)};var c=b._defaults={protoAndHost:"//jazzcat.mobify.com",endpoint:"cssoptimizer",projectName:"oss-"+location.hostname.replace(/[^\w]/g,"-"),targetAttribute:"x-href",onerror:"Mobify.CssOptimize.restoreOriginalHref(event);"};return b}),c("mobifyjs/external/picturefill",["mobifyjs/utils","mobifyjs/capture"],function(a,b){var c=window.Mobify&&window.Mobify.capturing||!1;if(c){var d=b.prototype.renderCapturedDoc;return b.prototype.renderCapturedDoc=function(){for(var a=this.capturedDoc.querySelectorAll("picture img, span[data-picture] img"),b=0,c=a.length;c>b;b++){var e=a[b],f=window.Mobify&&window.Mobify.prefix+"src";e.setAttribute("data-orig-src",e.getAttribute(f)),e.removeAttribute(f)}d.apply(this,arguments)},void 0}window.matchMedia=window.matchMedia||a.matchMedia(document),function(a){a.document.createElement("picture")&&a.document.createElement("source")&&a.HTMLPictureElement||(a.picturefill=function(){for(var b=a.document.querySelectorAll("picture, span[data-picture]"),c=0,d=b.length;d>c;c++){var e=b[c].querySelectorAll("span, source"),f=[];if(!e.length){var g=b[c].innerHTML,h=a.document.createElement("div"),i=g.replace(/(<)source([^>]+>)/gim,"$1div$2").match(/]+>/gim);h.innerHTML=i.join(""),e=h.getElementsByTagName("div")}for(var j=0,k=e.length;k>j;j++){var l=e[j].getAttribute("data-media")||e[j].getAttribute("media");(!l||a.matchMedia&&a.matchMedia(l).matches)&&f.push(e[j])}var m=b[c].getElementsByTagName("img")[0];if(f.length){var n=f.pop();if(m&&"NOSCRIPT"!==m.parentNode.nodeName){if(n===m.parentNode)continue}else m=a.document.createElement("img"),m.alt=b[c].getAttribute("data-alt");m.src=n.getAttribute("data-src")||n.getAttribute("src"),n.parentNode.appendChild(m),m.removeAttribute("width"),m.removeAttribute("height")}else m&&m.parentNode.removeChild(m)}},a.addEventListener?(a.addEventListener("resize",a.picturefill,!1),a.addEventListener("DOMContentLoaded",function(){a.picturefill(),a.removeEventListener("load",a.picturefill,!1)},!1),a.addEventListener("load",a.picturefill,!1)):a.attachEvent&&a.attachEvent("onload",a.picturefill))}(this)}),b(["mobifyjs/utils","mobifyjs/capture","mobifyjs/resizeImages","mobifyjs/jazzcat","mobifyjs/unblockify","mobifyjs/cssOptimize","mobifyjs/external/picturefill"],function(a,b,c,d,e,f){var g=window.Mobify=window.Mobify||{};return g.Utils=a,g.Capture=b,g.ResizeImages=c,g.Jazzcat=d,g.CssOptimize=f,g.Unblockify=e,g.api="2.0",g},void 0,!0),c("mobify-library",function(){})}(); \ No newline at end of file +!function(){var a,b,c;!function(d){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m=b&&b.split("/"),n=s.map,o=n&&n["*"]||{};if(a&&"."===a.charAt(0))if(b){for(m=m.slice(0,m.length-1),a=m.concat(a.split("/")),j=0;j0&&(a.splice(j-1,2),j-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((m||o)&&n){for(c=a.split("/"),j=c.length;j>0;j-=1){if(d=c.slice(0,j).join("/"),m)for(k=m.length;k>0;k-=1)if(e=n[m.slice(0,k).join("/")],e&&(e=e[d])){f=e,g=j;break}if(f)break;!h&&o&&o[d]&&(h=o[d],i=j)}!f&&h&&(f=h,g=i),f&&(c.splice(0,g,f),a=c.join("/"))}return a}function g(a,b){return function(){return n.apply(d,v.call(arguments,0).concat([a,b]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var b=r[a];delete r[a],t[a]=!0,m.apply(d,b)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,b,c,f){var h,k,l,m,n,s,u=[];if(f=f||a,"function"==typeof c){for(b=!b.length&&c.length?["require","exports","module"]:b,n=0;n":""},a.removeBySelector=function(b,c){c=c||document;var d=c.querySelectorAll(b);return a.removeElements(d,c)},a.removeElements=function(a,b){b=b||document;for(var c=0,d=a.length;d>c;c++){var e=a[c];e.parentNode.removeChild(e)}return a};var d;return a.supportsLocalStorage=function(){if(void 0!==d)return d;var a="modernizr";try{localStorage.setItem(a,a),localStorage.removeItem(a),d=!0}catch(b){d=!1}return d},a.matchMedia=function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}},a.domIsReady=function(a){var a=a||document;return a.attachEvent?"complete"===a.readyState:"loading"!==a.readyState},a.getPhysicalScreenSize=function(a){function b(b){var c=a||window.devicePixelRatio||1;return b.width=Math.round(b.width*c),b.height=Math.round(b.height*c),b}var c=navigator.userAgent.match(/ip(hone|od|ad)/i),d=(navigator.userAgent.match(/android (\d)/i)||{})[1],e={width:window.outerWidth,height:window.outerHeight};if(!c)return d>3?b(e):e;var f=window.orientation%180;return f?(e.height=screen.width,e.width=screen.height):(e.width=screen.width,e.height=screen.height),b(e)},a}),c("mobifyjs/capture",["mobifyjs/utils"],function(a){function b(a){return a.nodeName.toLowerCase()}function c(a){return a.replace('"',""")}function d(c){return c?[].map.call(c.childNodes,function(c){var d=b(c);return"#comment"==d?"":"plaintext"==d?c.textContent:"script"==d&&(/mobify/.test(c.src)||/mobify/i.test(c.textContent))?"":c.outerHTML||c.nodeValue||a.outerHTML(c)}).join(""):""}window.Mobify&&!window.Mobify.capturing&&document.getElementsByTagName("plaintext").length&&(window.Mobify.capturing=!0);var e=/()/gi,f={style:' media="mobify-media"',script:' type="text/mobify-script"'},g=new RegExp(a.values(f).join("|"),"g"),h={img:["src"],source:["src"],iframe:["src"],script:["src","type"],link:["href"],style:["media"]},i=new RegExp("<("+a.keys(h).join("|")+")([\\s\\S]*?)>","gi"),j={},k={};for(var l in h)if(h.hasOwnProperty(l)){var m=h[l];m.forEach(function(a){k[a]=!0}),j[l]=new RegExp("\\s+((?:"+m.join("|")+")\\s*=\\s*(?:('|\")[\\s\\S]+?\\2))","gi")}var n=document.createElement("div"),o=function(a,b){this.sourceDoc=a,this.prefix=b||"x-",window.Mobify&&(window.Mobify.prefix=this.prefix)};return o.init=o.initCapture=function(b,c,d){var c=c||document,e=function(b,c,d){var e=new o(c,d),f=e.createDocumentFragmentsStrings();a.extend(e,f);var g=e.createDocumentFragments();a.extend(e,g),b(e)};if(a.domIsReady(c))e(b,c,d);else{var f=!1,g=function(){f||(f=!0,h&&clearInterval(h),e(b,c,d))},h=setInterval(function(){a.domIsReady(c)&&g()},100);c.addEventListener("readystatechange",g,!1)}},o.removeClosingTagsAtEndOfString=function(a){var b=a.match(/((<\/[^>]+>)+)$/);return b?a.substring(0,a.length-b[0].length):a},o.removeTargetSelf=function(a){return a.replace(/target=("_self"|\'_self\')/gi,"")},o.cloneAttributes=function(a,b){var c=a.match(/^<(\w+)([\s\S]*)$/i);return n.innerHTML=""}}(),d=/()|(?=<\/script)/i,g=a.split(d),h=g.map(function(a){var b;return a?/^|(<\/head\s*>|'"]*|'[^']*?'|"[^"]*?")*>)([\s\S]*)$/.exec(captured.bodyContent);j&&(captured.bodyOpenTag=j[1],captured.bodyContent=j[2]);break}captured.headContent=h.slice(0,i.index),captured.bodyContent=h.slice(i.index+i[1].length)}return captured},o.prototype.restore=function(){var b=this,c=b.sourceDoc,d=function(){c.removeEventListener("readystatechange",d,!1),setTimeout(function(){c.open(),c.write(b.all()),c.close()},15)};a.domIsReady(c)?d():c.addEventListener("readystatechange",d,!1)},o.prototype.setElementContentFromString=function(a,b){for(n.innerHTML=b;n.firstChild;a.appendChild(n.firstChild));},o.prototype.createDocumentFragments=function(){var a={},b=a.capturedDoc=document.implementation.createHTMLDocument(""),c=a.htmlEl=b.documentElement,d=a.headEl=c.firstChild,e=a.bodyEl=c.lastChild;o.cloneAttributes(this.htmlOpenTag,c),o.cloneAttributes(this.headOpenTag,d),o.cloneAttributes(this.bodyOpenTag,e),e.innerHTML=o.disable(this.bodyContent,this.prefix);var f=o.disable(this.headContent,this.prefix);try{d.innerHTML=f}catch(g){var h=d.getElementsByTagName("title")[0];h&&d.removeChild(h),this.setElementContentFromString(d,f)}return c.appendChild(d),c.appendChild(e),a},o.prototype.escapedHTMLString=function(){var b=this.capturedDoc,c=o.enable(a.outerHTML(b.documentElement),this.prefix),d=this.doctype+c;return d},o.prototype.render=function(a){var b;b=a?o.enable(a):this.escapedHTMLString();var c=this.sourceDoc;window.Mobify&&(window.Mobify.capturing=!1),setTimeout(function(){c.open("text/html","replace"),c.write(b),c.close()})},o.prototype.getCapturedDoc=function(){return this.capturedDoc},o.getMobifyLibrary=function(a){var a=a||document,b=a.getElementById("mobify-js");return b||(b=a.getElementsByTagName("script")[0],b.id="mobify-js",b.setAttribute("class","mobify")),b},o.getMain=function(a){var a=a||document,b=void 0;return window.Mobify&&window.Mobify.mainExecutable?(b=document.createElement("script"),b.innerHTML="var main = "+window.Mobify.mainExecutable.toString()+"; main();",b.id="main-executable",b.setAttribute("class","mobify")):b=a.getElementById("main-executable"),b},o.insertMobifyScripts=function(a,b){var c=o.getMobifyLibrary(a),d=b.head,e=o.getMain(a);if(e){var f=b.importNode(e,!1);e.src||(f.innerHTML=e.innerHTML),d.insertBefore(f,d.firstChild)}var g=b.importNode(c,!1);d.insertBefore(g,d.firstChild)},o.prototype.renderCapturedDoc=function(){if(o.insertMobifyScripts(this.sourceDoc,this.capturedDoc),window.Mobify&&window.Mobify.points){var a=this.bodyEl,b=this.capturedDoc.createElement("div");b.id="mobify-point",b.setAttribute("style","display: none;"),b.innerHTML=window.Mobify.points[0],a.insertBefore(b,a.firstChild)}this.render()},o}),c("mobifyjs/resizeImages",["mobifyjs/utils"],function(a){function b(b){if(a.supportsLocalStorage()){var c={supported:b,date:Date.now()};localStorage.setItem(d,JSON.stringify(c))}}var c=window.ResizeImages={},d="Mobify-Webp-Support-v2";c.userAgentWebpDetect=function(a){var b=/(Android\s|Chrome\/|Opera9.8*Version\/..\.|Opera..\.)/i,c=new RegExp("(Android\\s(0|1|2|3|(4(?!.*Chrome)))\\.)|(Chrome\\/[0-8]\\.)|(Chrome\\/9\\.0\\.)|(Chrome\\/1[4-6]\\.)|(Android\\sChrome\\/1.\\.)|(Android\\sChrome\\/20\\.)|(Chrome\\/(1.|20|21|22)\\.)|(Opera.*(Version/|Opera\\s)(10|11)\\.)","i");return b.test(a)?c.test(a)?!1:!0:!1},c.dataUriWebpDetect=function(a){var c=new Image;c.onload=function(){var d=1===c.width?!0:!1;b(d),a&&a(d)},c.src="data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQABgBwlpAADcAD+/gbQAA=="},c.supportsWebp=function(e){if(a.supportsLocalStorage()){var f,g=localStorage.getItem(d);if(g&&(f=JSON.parse(g)),f&&Date.now()-f.date<6048e5)return f.supported}c.dataUriWebpDetect(e);var h=c.userAgentWebpDetect(navigator.userAgent);return b(h),h},c.getImageURL=function(a,b){var d=b;d||(d=c.processOptions());var e=[d.proto+d.host];if(d.projectName){var f="project-"+d.projectName;e.push(f)}return d.cacheHours&&e.push("c"+d.cacheHours),d.format&&e.push(d.format+(d.quality||"")),d.maxWidth&&(e.push(d.maxWidth),d.maxHeight&&e.push(d.maxHeight)),e.push(a),e.join("/")},c._rewriteSrcAttribute=function(b,d,e){if(e=b.getAttribute(d.sourceAttribute)||e){var g=a.absolutify(e);a.httpUrl(g)&&(d.onerror&&b.setAttribute("onerror",d.onerror),b.setAttribute(d.targetAttribute,c.getImageURL(g,d)),b.setAttribute("data-orig-src",e),f||d.sourceAttribute==d.targetAttribute||b.removeAttribute(d.sourceAttribute))}},c._resizeSourceElement=function(b,d,e){var f=b.getAttribute("data-width"),g=d;f&&(g=a.clone(d),g.maxWidth=f),c._rewriteSrcAttribute(b,g,e)},c._crawlPictureElement=function(a,b){var d;if((d=a.getElementsByTagName("span")).length||(d=a.getElementsByTagName("source")),0!==d.length&&!a.hasAttribute("mobify-optimized")){a.setAttribute("mobify-optimized","");for(var e=a.getAttribute("data-src"),f=0,g=d.length;g>f;f++)c._resizeSourceElement(d[f],b,e)}};var e=[320,640,768,1080,1536,2048,4e3];c._getBinnedDimension=function(a){for(var b=0,c=0,d=e.length;d>c&&(b=e[c],!(b>=a));c++);return b},c.processOptions=function(b){var d=a.clone(c.defaults);b&&a.extend(d,b);var e=d.devicePixelRatio||window.devicePixelRatio,f=a.getPhysicalScreenSize(e),g=d.maxWidth||c._getBinnedDimension(f.width),h=d.maxHeight||void 0;return e&&d.maxWidth&&(g*=e,d.maxHeight&&(h*=e)),d.maxWidth=Math.ceil(g),d.maxHeight&&h&&(d.maxHeight=Math.ceil(h)),!d.format&&d.webp&&(d.format="webp"),d},c.resize=function(a,b){for(var d=c.processOptions(b),e=0;ek?!1:c&&(g=c.overrideTime)&&l?k>l+1e3*60*g:j&&l?(j=b.utils.ccParse(j),!j["max-age"]||j["no-store"]||j["no-cache"]?!0:k>l+1e3*j["max-age"]):i.expires&&(d=Date.parse(i.expires))?k>d:m&&(m=Date.parse(m))&&l&&(f=l-m,e=k-l,.1*f>e&&h>e)?!1:!0};var g=window.Jazzcat={httpCache:b,write:document.write};g.isIncompatibleBrowser=function(b){var c=/(firefox)[\/\s](\d+)|(opera[\s\S]*version[\/\s](11|12))/i.exec(b||navigator.userAgent);return c&&c[1]&&+c[2]<12||c&&c[3]||!a.supportsLocalStorage()||!window.JSON?!0:!1},g.cacheLoaderInserted=!1,g.optimizeScripts=function(c,d){if(d&&void 0!==d.cacheOverrideTime&&a.extend(b.options,{overrideTime:d.cacheOverrideTime}),c=Array.prototype.slice.call(c),!c.length||g.isIncompatibleBrowser())return c;d=a.extend({},g.defaults,d||{});for(var e,f="jsonp"===d.responseType,h=d.concat,i=function(a,b){if(a){var c=g.getLoaderScript(b,d);a.parentNode.insertBefore(c,a)}},j={head:{firstScript:void 0,urls:[]},body:{firstScript:void 0,urls:[]}},k=0,l=c.length;l>k;k++){var m=c[k];if(!(m.hasAttribute("mobify-optimized")||m.hasAttribute("skip-optimize")||/mobify/i.test(m.className))&&(e=m.getAttribute(d.attribute),e&&(e=a.absolutify(e),a.httpUrl(e)))){if(f&&!g.cacheLoaderInserted){b.load(b.options);var n=g.getHttpCacheLoaderScript();m.parentNode.insertBefore(n,m),g.cacheLoaderInserted=!0}var o="HEAD"===m.parentNode.nodeName?"head":"body";if(f){if(b.get(e)||(h?(void 0===j[o].firstScript&&(j[o].firstScript=m),j[o].urls.push(e)):i(m,[e])),m.type="text/mobify-script",m.hasAttribute("onload")){var p=m.getAttribute("onload");m.innerHTML=d.execCallback+"('"+e+"', '"+p.replace(/'/g,"\\'")+"');",m.removeAttribute("onload")}else m.innerHTML=d.execCallback+"('"+e+"');";m.removeAttribute(d.attribute)}else if(h)void 0===j[o].firstScript&&(j[o].firstScript=m),j[o].urls.push(e);else{var q=g.getURL([e],d);m.setAttribute(d.attribute,q)}}}if(h&&(i(j.head.firstScript,j.head.urls),i(j.body.firstScript,j.body.urls)),!f&&h)for(var k=0,l=c.length;l>k;k++){var m=c[k];m.getAttribute(d.attribute)&&m.parentNode.removeChild(m)}return c},g.getHttpCacheLoaderScript=function(){var a=document.createElement("script");return a.type="text/mobify-script",a.innerHTML=b.options.overrideTime?"Jazzcat.httpCache.load("+JSON.stringify(b.options)+");":"Jazzcat.httpCache.load();",a},g.getLoaderScript=function(a,b){var c;return a&&a.length&&(c=document.createElement("script"),c.setAttribute("mobify-optimized",""),c.setAttribute(b.attribute,g.getURL(a,b))),c},g.getURL=function(b,c){var c=a.extend({},g.defaults,c||{});return c.base+(c.projectName?"/project-"+c.projectName:"")+"/"+c.responseType+("jsonp"===c.responseType?"/"+c.loadCallback:"")+"/"+encodeURIComponent(JSON.stringify(b.slice().sort()))};var h=/(<\/scr)(ipt\s*>)/gi;return g.exec=function(a,c){var d,e=b.get(a,!0),f="";c?(c=";"+c+";",f=' onload="'+c+'"'):c="",e?(d='data-orig-src="'+a+'"',d+=">"+e.body.replace(h,"$1\\$2")+c):d='src="'+a+'"'+f+">",g.write.call(document," +