diff --git a/dist/rasterizeHTML.allinone.js b/dist/rasterizeHTML.allinone.js index dc5f2cbc..498d08c3 100644 --- a/dist/rasterizeHTML.allinone.js +++ b/dist/rasterizeHTML.allinone.js @@ -1,4 +1,4 @@ -/*! rasterizeHTML.js - v0.9.0 - 2014-06-06 +/*! rasterizeHTML.js - v0.9.1 - 2014-06-06 * http://www.github.com/cburgmer/rasterizeHTML.js * Copyright (c) 2014 Christoph Burgmer; Licensed MIT */ /* Integrated dependencies: diff --git a/dist/rasterizeHTML.js b/dist/rasterizeHTML.js index a052d5f9..92204e6e 100644 --- a/dist/rasterizeHTML.js +++ b/dist/rasterizeHTML.js @@ -1,4 +1,4 @@ -/*! rasterizeHTML.js - v0.9.0 - 2014-06-06 +/*! rasterizeHTML.js - v0.9.1 - 2014-06-06 * http://www.github.com/cburgmer/rasterizeHTML.js * Copyright (c) 2014 Christoph Burgmer; Licensed MIT */ (function(root, factory) { diff --git a/dist/rasterizeHTML.min.js b/dist/rasterizeHTML.min.js index 6a5d485e..490686f5 100644 --- a/dist/rasterizeHTML.min.js +++ b/dist/rasterizeHTML.min.js @@ -1,4 +1,4 @@ -/*! rasterizeHTML.js - v0.9.0 - 2014-06-06 +/*! rasterizeHTML.js - v0.9.1 - 2014-06-06 * http://www.github.com/cburgmer/rasterizeHTML.js * Copyright (c) 2014 Christoph Burgmer; Licensed MIT */ !function(a,b){"object"==typeof exports?module.exports=b(require("url"),require("xmlserializer"),require("ayepromise"),require("inlineresources")):"function"==typeof define&&define.amd?define(["url","xmlserializer","ayepromise","inlineresources"],b):a.rasterizeHTML=b(a.url,a.xmlserializer,a.ayepromise,a.inlineresources)}(this,function(a,b,c,d){var e=function(a){"use strict";var b={},c=[];b.joinUrl=function(b,c){return b?a.resolve(b,c):c},b.getConstantUniqueIdFor=function(a){return c.indexOf(a)<0&&c.push(a),c.indexOf(a)},b.clone=function(a){var b,c={};for(b in a)a.hasOwnProperty(b)&&(c[b]=a[b]);return c};var d=function(a){return"object"==typeof a&&null!==a},e=function(a){return d(a)&&Object.prototype.toString.apply(a).match(/\[object (Canvas|HTMLCanvasElement)\]/i)},f=function(a){return"function"==typeof a};return b.parseOptionalParameters=function(a){var c={canvas:null,options:{},callback:null};return f(a[0])?c.callback=a[0]:null==a[0]||e(a[0])?(c.canvas=a[0]||null,f(a[1])?c.callback=a[1]:(c.options=b.clone(a[1]),c.callback=a[2]||null)):(c.options=b.clone(a[0]),c.callback=a[1]||null),c},b}(a),f=function(a,b){var c={};return c.baseUrlRespecting=function(b,c){var d=function(){var d=new b,e=d.open;return d.open=function(){var b=Array.prototype.slice.call(arguments),d=b.shift(),f=b.shift(),g=a.joinUrl(c,f);return e.apply(this,[d,g].concat(b))},d};return d},c.finishNotifying=function(a){var c=0,d=0,e=!1,f=b.defer(),g=function(){var a=c-d;0>=a&&e&&f.resolve({totalCount:c})},h=function(){var b=new a,e=b.send;return b.send=function(){return c+=1,e.apply(this,arguments)},b.addEventListener("load",function(){d+=1,g()}),b};return h.waitForRequestsToFinish=function(){return e=!0,g(),f.promise},h},c}(e,c),g=function(){"use strict";var a={},b=function(a){return Array.prototype.slice.call(a)};a.addClassNameRecursively=function(b,c){b.className+=" "+c,b.parentNode!==b.ownerDocument&&a.addClassNameRecursively(b.parentNode,c)};var c=function(a,c){var d=a.parentStyleSheet,e=b(d.cssRules).indexOf(a);d.insertRule(c,e+1),d.deleteRule(e)},d=function(a,b){var d=a.cssText.replace(/^[^\{]+/,""),e=b+" "+d;c(a,e)},e=function(a){return b(a).reduce(function(a,b){return a+b.cssText},"")},f=function(a){a.textContent=e(a.sheet.cssRules)};return a.rewriteStyleRuleSelector=function(a,c,e){var g=c+"(?=\\W|$)";b(a.querySelectorAll("style")).forEach(function(a){var c=b(a.sheet.cssRules).filter(function(a){return a.selectorText&&new RegExp(g).test(a.selectorText)});c.length&&(c.forEach(function(a){var b=a.selectorText.replace(new RegExp(g,"g"),e);d(a,b)}),f(a))})},a}(),h=function(a){"use strict";var b={},c=function(a){return Array.prototype.slice.call(a)};return b.fakeHover=function(b,c){var d=b.querySelector(c),e="rasterizehtmlhover";d&&(a.addClassNameRecursively(d,e),a.rewriteStyleRuleSelector(b,":hover","."+e))},b.fakeActive=function(b,c){var d=b.querySelector(c),e="rasterizehtmlactive";d&&(a.addClassNameRecursively(d,e),a.rewriteStyleRuleSelector(b,":active","."+e))},b.persistInputValues=function(a){var b=a.querySelectorAll("input"),d=a.querySelectorAll("textarea"),e=function(a){return"checkbox"===a.type||"radio"===a.type};c(b).filter(e).forEach(function(a){a.checked?a.setAttribute("checked",""):a.removeAttribute("checked")}),c(b).filter(function(a){return!e(a)}).forEach(function(a){a.setAttribute("value",a.value)}),c(d).forEach(function(a){a.textContent=a.value})},b}(g),i=function(a,b,c,d){"use strict";var e={},f=function(a,b){var c=a.createElement(b);return c.style.visibility="hidden",c.style.width="0px",c.style.height="0px",c.style.position="absolute",c.style.top="-10000px",c.style.left="-10000px",a.getElementsByTagName("body")[0].appendChild(c),c};e.executeJavascript=function(a,e,g){var h=f(d.document,"iframe"),i=a.documentElement.outerHTML,j=[],k=c.defer(),l=function(){var a=h.contentDocument;d.document.getElementsByTagName("body")[0].removeChild(h),k.resolve({document:a,errors:j})},m=function(){var a=c.defer();return g>0?setTimeout(a.resolve,g):a.resolve(),a.promise};h.onload=function(){m().then(o.waitForRequestsToFinish).then(l)};var n=h.contentWindow.XMLHttpRequest,o=b.finishNotifying(n),p=b.baseUrlRespecting(o,e);return h.contentDocument.open(),h.contentWindow.XMLHttpRequest=p,h.contentWindow.onerror=function(a){j.push({resourceType:"scriptExecution",msg:a})},h.contentDocument.write(i),h.contentDocument.close(),k.promise};var g=function(a,b,c){var d=a.createElement("iframe");return d.style.width=b+"px",d.style.height=c+"px",d.style.visibility="hidden",d.style.position="absolute",d.style.top=-1e4-c+"px",d.style.left=-1e4-b+"px",d.sandbox="allow-same-origin",a.getElementsByTagName("body")[0].appendChild(d),d};e.calculateDocumentContentSize=function(a,b,e){var f=a.documentElement.outerHTML,h=g(d.document,b,e),i=c.defer();return h.onload=function(){var a=h.contentDocument,b=Math.max(a.documentElement.scrollWidth,a.body.clientWidth),c=Math.max(a.documentElement.scrollHeight,a.body.scrollHeight,a.body.clientHeight);d.document.getElementsByTagName("body")[0].removeChild(h),i.resolve({width:b,height:c})},h.contentDocument.open(),h.contentDocument.write(f),h.contentDocument.close(),i.promise};var h=function(a,b){var c,e,f,g,h=/]*)?)>/im.exec(b),i=d.document.implementation.createHTMLDocument("");if(h)for(c="
",i.documentElement.innerHTML=c,f=i.querySelector("div"),e=0;e