diff --git a/docs/assets/js/holder.js b/docs/assets/js/holder.js index 85f0441b0e..a684af7fe4 100644 --- a/docs/assets/js/holder.js +++ b/docs/assets/js/holder.js @@ -1,35 +1,44 @@ /* -Holder - 2.2 - client side image placeholders -(c) 2012-2013 Ivan Malopinsky / http://imsky.co +Holder - 2.3 - client side image placeholders +(c) 2012-2014 Ivan Malopinsky / http://imsky.co Provided under the MIT License. Commercial use requires attribution. */ - var Holder = Holder || {}; (function (app, win) { -var preempted = false, -fallback = false, +var system_config = { + use_svg: false, + use_canvas: false, + use_fallback: false +}; +var instance_config = {}; +var preempted = false; canvas = document.createElement('canvas'); var dpr = 1, bsr = 1; var resizable_images = []; if (!canvas.getContext) { - fallback = true; + system_config.use_fallback = true; } else { if (canvas.toDataURL("image/png") .indexOf("data:image/png") < 0) { //Android doesn't support data URI - fallback = true; + system_config.use_fallback = true; } else { var ctx = canvas.getContext("2d"); } } -if(!fallback){ +if(!!document.createElementNS && !!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect){ + system_config.use_svg = true; + system_config.use_canvas = false; +} + +if(!system_config.use_fallback){ dpr = window.devicePixelRatio || 1, bsr = ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1; } @@ -129,46 +138,6 @@ app.flags = { } } -//getElementsByClassName polyfill -document.getElementsByClassName||(document.getElementsByClassName=function(e){var t=document,n,r,i,s=[];if(t.querySelectorAll)return t.querySelectorAll("."+e);if(t.evaluate){r=".//*[contains(concat(' ', @class, ' '), ' "+e+" ')]",n=t.evaluate(r,t,null,0,null);while(i=n.iterateNext())s.push(i)}else{n=t.getElementsByTagName("*"),r=new RegExp("(^|\\s)"+e+"(\\s|$)");for(i=0;i>8-8*(a%1))){if(n=e.charCodeAt(a+=.75),n>255)throw new t("'btoa' failed");o=o<<8|n}return c}),e.atob||(e.atob=function(e){if(e=e.replace(/=+$/,""),1==e.length%4)throw new t("'atob' failed");for(var o,n,a=0,i=0,c="";n=e.charAt(i++);~n&&(o=a%4?64*o+n:n,a++%4)?c+=String.fromCharCode(255&o>>(6&-2*a)):0)n=r.indexOf(n);return c})})(); + +//getElementsByClassName polyfill +document.getElementsByClassName||(document.getElementsByClassName=function(e){var t=document,n,r,i,s=[];if(t.querySelectorAll)return t.querySelectorAll("."+e);if(t.evaluate){r=".//*[contains(concat(' ', @class, ' '), ' "+e+" ')]",n=t.evaluate(r,t,null,0,null);while(i=n.iterateNext())s.push(i)}else{n=t.getElementsByTagName("*"),r=new RegExp("(^|\\s)"+e+"(\\s|$)");for(i=0;i