Skip to content
This repository
Browse code

updated website

  • Loading branch information...
commit e706730f55a1c231ed9fb21c93080e904bd8455d 1 parent e7bee29
Niklas von Hertzen authored January 30, 2013
1  CNAME
... ...
@@ -0,0 +1 @@
  1
+html2canvas.hertzen.com
2  build/html2canvas.min.js
@@ -4,4 +4,4 @@
4 4
 
5 5
   Released under MIT License
6 6
 */
7  
-(function(e,t,n){"use strict";function u(t){r.logging&&e.console&&e.console.log&&e.console.log(t)}function a(e,t,n,i,s,o){var u=r.Util.getCSS(t,e,s),a,f,l,c;u.length===1&&(c=u[0],u=[],u[0]=c,u[1]=c);if(u[0].toString().indexOf("%")!==-1)l=parseFloat(u[0])/100,f=n.width*l,e!=="backgroundSize"&&(f-=(o||i).width*l);else if(e==="backgroundSize")if(u[0]==="auto")f=i.width;else if(u[0].match(/contain|cover/)){var h=r.Util.resizeBounds(i.width,i.height,n.width,n.height,u[0]);f=h.width,a=h.height}else f=parseInt(u[0],10);else f=parseInt(u[0],10);return u[1]==="auto"?a=f/i.width*i.height:u[1].toString().indexOf("%")!==-1?(l=parseFloat(u[1])/100,a=n.height*l,e!=="backgroundSize"&&(a-=(o||i).height*l)):a=parseInt(u[1],10),[f,a]}function f(e){return{zindex:e,children:[]}}function l(e,t){var n=[];return{storage:n,width:e,height:t,clip:function(){n.push({type:"function",name:"clip",arguments:arguments})},translate:function(){n.push({type:"function",name:"translate",arguments:arguments})},fill:function(){n.push({type:"function",name:"fill",arguments:arguments})},save:function(){n.push({type:"function",name:"save",arguments:arguments})},restore:function(){n.push({type:"function",name:"restore",arguments:arguments})},fillRect:function(){n.push({type:"function",name:"fillRect",arguments:arguments})},createPattern:function(){n.push({type:"function",name:"createPattern",arguments:arguments})},drawShape:function(){var e=[];return n.push({type:"function",name:"drawShape",arguments:e}),{moveTo:function(){e.push({name:"moveTo",arguments:arguments})},lineTo:function(){e.push({name:"lineTo",arguments:arguments})},arcTo:function(){e.push({name:"arcTo",arguments:arguments})},bezierCurveTo:function(){e.push({name:"bezierCurveTo",arguments:arguments})},quadraticCurveTo:function(){e.push({name:"quadraticCurveTo",arguments:arguments})}}},drawImage:function(){n.push({type:"function",name:"drawImage",arguments:arguments})},fillText:function(){n.push({type:"function",name:"fillText",arguments:arguments})},setVariable:function(e,t){n.push({type:"variable",name:e,arguments:t})}}}var r={},i,s,o;r.Util={},r.Util.trimText=function(e){return function(t){return e?e.apply(t):((t||"")+"").replace(/^\s+|\s+$/g,"")}}(String.prototype.trim),r.Util.parseBackgroundImage=function(e){var t=" \r\n	",n,r,i,s,o,u=[],a,f=0,l=0,c,h,p=function(){n&&(r.substr(0,1)==='"'&&(r=r.substr(1,r.length-2)),r&&h.push(r),n.substr(0,1)==="-"&&(s=n.indexOf("-",1)+1)>0&&(i=n.substr(0,s),n=n.substr(s)),u.push({prefix:i,method:n.toLowerCase(),value:o,args:h})),h=[],n=i=r=o=""};p();for(var d=0,v=e.length;d<v;d++){a=e[d];if(f===0&&t.indexOf(a)>-1)continue;switch(a){case'"':c?c===a&&(c=null):c=a;break;case"(":if(c)break;if(f===0){f=1,o+=a;continue}l++;break;case")":if(c)break;if(f===1){if(l===0){f=0,o+=a,p();continue}l--}break;case",":if(c)break;if(f===0){p();continue}if(f===1&&l===0&&!n.match(/^url$/i)){h.push(r),r="",o+=a;continue}}o+=a,f===0?n+=a:r+=a}return p(),u},r.Util.Bounds=function(t){var n,r={};if(t.getBoundingClientRect)return n=t.getBoundingClientRect(),r.top=n.top,r.bottom=n.bottom||n.top+n.height,r.left=n.left,r.width=n.width||n.right-n.left,r.height=n.height||n.bottom-n.top,r},r.Util.getCSS=function(e,o,u){function l(t,n){var r=e.runtimeStyle&&e.runtimeStyle[t],i,s=e.style;return!/^-?[0-9]+\.?[0-9]*(?:px)?$/i.test(n)&&/^-?\d/.test(n)&&(i=s.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":n||0,n=s.pixelLeft+"px",s.left=i,r&&(e.runtimeStyle.left=r)),/^(thin|medium|thick)$/i.test(n)?n:Math.round(parseFloat(n))+"px"}var a,f=o.match(/^background(Size|Position)$/);i!==e&&(s=t.defaultView.getComputedStyle(e,null)),a=s[o];if(f){a=(a||"").split(","),a=a[u||0]||a[0]||"auto",a=r.Util.trimText(a).split(" ");if(o!=="backgroundSize"||!!a[0]&&!a[0].match(/cover|contain|auto/)){a[0]=a[0].indexOf("%")===-1?l(o+"X",a[0]):a[0];if(a[1]===n){if(o==="backgroundSize")return a[1]="auto",a;a[1]=a[0]}a[1]=a[1].indexOf("%")===-1?l(o+"Y",a[1]):a[1]}}else if(/border(Top|Bottom)(Left|Right)Radius/.test(o)){var c=a.split(" ");c.length<=1&&(c[1]=c[0]),c[0]=parseInt(c[0],10),c[1]=parseInt(c[1],10),a=c}return a},r.Util.resizeBounds=function(e,t,n,r,i){var s=n/r,o=e/t,u,a;return!i||i==="auto"?(u=n,a=r):s<o^i==="contain"?(a=r,u=r*o):(u=n,a=n/o),{width:u,height:a}},r.Util.BackgroundPosition=function(e,t,n,r,i){var s=a("backgroundPosition",e,t,n,r,i);return{left:s[0],top:s[1]}},r.Util.BackgroundSize=function(e,t,n,r){var i=a("backgroundSize",e,t,n,r);return{width:i[0],height:i[1]}},r.Util.Extend=function(e,t){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},r.Util.Children=function(e){var t;try{t=e.nodeName&&e.nodeName.toUpperCase()==="IFRAME"?e.contentDocument||e.contentWindow.document:function(e){var t=[];return e!==null&&function(e,t){var r=e.length,i=0;if(typeof t.length=="number")for(var s=t.length;i<s;i++)e[r++]=t[i];else while(t[i]!==n)e[r++]=t[i++];return e.length=r,e}(t,e),t}(e.childNodes)}catch(r){u("html2canvas.Util.Children failed with exception: "+r.message),t=[]}return t},r.Util.Font=function(){var e={};return function(t,r,i){if(e[t+"-"+r]!==n)return e[t+"-"+r];var s=i.createElement("div"),o=i.createElement("img"),u=i.createElement("span"),a="Hidden Text",f,l,c;return s.style.visibility="hidden",s.style.fontFamily=t,s.style.fontSize=r,s.style.margin=0,s.style.padding=0,i.body.appendChild(s),o.src="data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=",o.width=1,o.height=1,o.style.margin=0,o.style.padding=0,o.style.verticalAlign="baseline",u.style.fontFamily=t,u.style.fontSize=r,u.style.margin=0,u.style.padding=0,u.appendChild(i.createTextNode(a)),s.appendChild(u),s.appendChild(o),f=o.offsetTop-u.offsetTop+1,s.removeChild(u),s.appendChild(i.createTextNode(a)),s.style.lineHeight="normal",o.style.verticalAlign="super",l=o.offsetTop-s.offsetTop+1,c={baseline:f,lineWidth:1,middle:l},e[t+"-"+r]=c,i.body.removeChild(s),c}}(),function(){r.Generate={};var e=[/^(-webkit-linear-gradient)\(([a-z\s]+)([\w\d\.\s,%\(\)]+)\)$/,/^(-o-linear-gradient)\(([a-z\s]+)([\w\d\.\s,%\(\)]+)\)$/,/^(-webkit-gradient)\((linear|radial),\s((?:\d{1,3}%?)\s(?:\d{1,3}%?),\s(?:\d{1,3}%?)\s(?:\d{1,3}%?))([\w\d\.\s,%\(\)\-]+)\)$/,/^(-moz-linear-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?))([\w\d\.\s,%\(\)]+)\)$/,/^(-webkit-radial-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?)),\s(\w+)\s([a-z\-]+)([\w\d\.\s,%\(\)]+)\)$/,/^(-moz-radial-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?)),\s(\w+)\s?([a-z\-]*)([\w\d\.\s,%\(\)]+)\)$/,/^(-o-radial-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?)),\s(\w+)\s([a-z\-]+)([\w\d\.\s,%\(\)]+)\)$/];r.Generate.parseGradient=function(t,n){var r,i,s=e.length,o,u,a,f,l,c,h,p,d,v;for(i=0;i<s;i+=1){o=t.match(e[i]);if(o)break}if(o)switch(o[1]){case"-webkit-linear-gradient":case"-o-linear-gradient":r={type:"linear",x0:null,y0:null,x1:null,y1:null,colorStops:[]},a=o[2].match(/\w+/g);if(a){f=a.length;for(i=0;i<f;i+=1)switch(a[i]){case"top":r.y0=0,r.y1=n.height;break;case"right":r.x0=n.width,r.x1=0;break;case"bottom":r.y0=n.height,r.y1=0;break;case"left":r.x0=0,r.x1=n.width}}r.x0===null&&r.x1===null&&(r.x0=r.x1=n.width/2),r.y0===null&&r.y1===null&&(r.y0=r.y1=n.height/2),a=o[3].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)(?:\s\d{1,3}(?:%|px))?)+/g);if(a){f=a.length,l=1/Math.max(f-1,1);for(i=0;i<f;i+=1)c=a[i].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%|px)?/),c[2]?(u=parseFloat(c[2]),c[3]==="%"?u/=100:u/=n.width):u=i*l,r.colorStops.push({color:c[1],stop:u})}break;case"-webkit-gradient":r={type:o[2]==="radial"?"circle":o[2],x0:0,y0:0,x1:0,y1:0,colorStops:[]},a=o[3].match(/(\d{1,3})%?\s(\d{1,3})%?,\s(\d{1,3})%?\s(\d{1,3})%?/),a&&(r.x0=a[1]*n.width/100,r.y0=a[2]*n.height/100,r.x1=a[3]*n.width/100,r.y1=a[4]*n.height/100),a=o[4].match(/((?:from|to|color-stop)\((?:[0-9\.]+,\s)?(?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)\))+/g);if(a){f=a.length;for(i=0;i<f;i+=1)c=a[i].match(/(from|to|color-stop)\(([0-9\.]+)?(?:,\s)?((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\)/),u=parseFloat(c[2]),c[1]==="from"&&(u=0),c[1]==="to"&&(u=1),r.colorStops.push({color:c[3],stop:u})}break;case"-moz-linear-gradient":r={type:"linear",x0:0,y0:0,x1:0,y1:0,colorStops:[]},a=o[2].match(/(\d{1,3})%?\s(\d{1,3})%?/),a&&(r.x0=a[1]*n.width/100,r.y0=a[2]*n.height/100,r.x1=n.width-r.x0,r.y1=n.height-r.y0),a=o[3].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)(?:\s\d{1,3}%)?)+/g);if(a){f=a.length,l=1/Math.max(f-1,1);for(i=0;i<f;i+=1)c=a[i].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%)?/),c[2]?(u=parseFloat(c[2]),c[3]&&(u/=100)):u=i*l,r.colorStops.push({color:c[1],stop:u})}break;case"-webkit-radial-gradient":case"-moz-radial-gradient":case"-o-radial-gradient":r={type:"circle",x0:0,y0:0,x1:n.width,y1:n.height,cx:0,cy:0,rx:0,ry:0,colorStops:[]},a=o[2].match(/(\d{1,3})%?\s(\d{1,3})%?/),a&&(r.cx=a[1]*n.width/100,r.cy=a[2]*n.height/100),a=o[3].match(/\w+/),c=o[4].match(/[a-z\-]*/);if(a&&c)switch(c[0]){case"farthest-corner":case"cover":case"":h=Math.sqrt(Math.pow(r.cx,2)+Math.pow(r.cy,2)),p=Math.sqrt(Math.pow(r.cx,2)+Math.pow(r.y1-r.cy,2)),d=Math.sqrt(Math.pow(r.x1-r.cx,2)+Math.pow(r.y1-r.cy,2)),v=Math.sqrt(Math.pow(r.x1-r.cx,2)+Math.pow(r.cy,2)),r.rx=r.ry=Math.max(h,p,d,v);break;case"closest-corner":h=Math.sqrt(Math.pow(r.cx,2)+Math.pow(r.cy,2)),p=Math.sqrt(Math.pow(r.cx,2)+Math.pow(r.y1-r.cy,2)),d=Math.sqrt(Math.pow(r.x1-r.cx,2)+Math.pow(r.y1-r.cy,2)),v=Math.sqrt(Math.pow(r.x1-r.cx,2)+Math.pow(r.cy,2)),r.rx=r.ry=Math.min(h,p,d,v);break;case"farthest-side":a[0]==="circle"?r.rx=r.ry=Math.max(r.cx,r.cy,r.x1-r.cx,r.y1-r.cy):(r.type=a[0],r.rx=Math.max(r.cx,r.x1-r.cx),r.ry=Math.max(r.cy,r.y1-r.cy));break;case"closest-side":case"contain":a[0]==="circle"?r.rx=r.ry=Math.min(r.cx,r.cy,r.x1-r.cx,r.y1-r.cy):(r.type=a[0],r.rx=Math.min(r.cx,r.x1-r.cx),r.ry=Math.min(r.cy,r.y1-r.cy))}a=o[5].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)(?:\s\d{1,3}(?:%|px))?)+/g);if(a){f=a.length,l=1/Math.max(f-1,1);for(i=0;i<f;i+=1)c=a[i].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%|px)?/),c[2]?(u=parseFloat(c[2]),c[3]==="%"?u/=100:u/=n.width):u=i*l,r.colorStops.push({color:c[1],stop:u})}}return r},r.Generate.Gradient=function(e,n){if(n.width===0||n.height===0)return;var i=t.createElement("canvas"),s=i.getContext("2d"),o,a,f,l;i.width=n.width,i.height=n.height,o=r.Generate.parseGradient(e,n);if(o)if(o.type==="linear"){a=s.createLinearGradient(o.x0,o.y0,o.x1,o.y1);for(f=0,l=o.colorStops.length;f<l;f+=1)try{a.addColorStop(o.colorStops[f].stop,o.colorStops[f].color)}catch(c){u(["failed to add color stop: ",c,"; tried to add: ",o.colorStops[f],"; stop: ",f,"; in: ",e])}s.fillStyle=a,s.fillRect(0,0,n.width,n.height)}else if(o.type==="circle"){a=s.createRadialGradient(o.cx,o.cy,0,o.cx,o.cy,o.rx);for(f=0,l=o.colorStops.length;f<l;f+=1)try{a.addColorStop(o.colorStops[f].stop,o.colorStops[f].color)}catch(c){u(["failed to add color stop: ",c,"; tried to add: ",o.colorStops[f],"; stop: ",f,"; in: ",e])}s.fillStyle=a,s.fillRect(0,0,n.width,n.height)}else if(o.type==="ellipse"){var h=t.createElement("canvas"),p=h.getContext("2d"),d=Math.max(o.rx,o.ry),v=d*2,m;h.width=h.height=v,a=p.createRadialGradient(o.rx,o.ry,0,o.rx,o.ry,d);for(f=0,l=o.colorStops.length;f<l;f+=1)try{a.addColorStop(o.colorStops[f].stop,o.colorStops[f].color)}catch(c){u(["failed to add color stop: ",c,"; tried to add: ",o.colorStops[f],"; stop: ",f,"; in: ",e])}p.fillStyle=a,p.fillRect(0,0,v,v),s.fillStyle=o.colorStops[f-1].color,s.fillRect(0,0,i.width,i.height),s.drawImage(h,o.cx-o.rx,o.cy-o.ry,2*o.rx,2*o.ry)}return i},r.Generate.ListAlpha=function(e){var t="",n;do n=e%26,t=String.fromCharCode(n+64)+t,e/=26;while(e*26>26);return t},r.Generate.ListRoman=function(e){var t=["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"],n=[1e3,900,500,400,100,90,50,40,10,9,5,4,1],r="",i,s=t.length;if(e<=0||e>=4e3)return e;for(i=0;i<s;i+=1)while(e>=n[i])e-=n[i],r+=t[i];return r}}(),r.Parse=function(i,s){function y(){return Math.max(Math.max(c.body.scrollWidth,c.documentElement.scrollWidth),Math.max(c.body.offsetWidth,c.documentElement.offsetWidth),Math.max(c.body.clientWidth,c.documentElement.clientWidth))}function b(){return Math.max(Math.max(c.body.scrollHeight,c.documentElement.scrollHeight),Math.max(c.body.offsetHeight,c.documentElement.offsetHeight),Math.max(c.body.clientHeight,c.documentElement.clientHeight))}function w(e,t){var n=parseInt(v(e,t),10);return isNaN(n)?0:n}function E(e,t,n,r,i,s){s!=="transparent"&&(e.setVariable("fillStyle",s),e.fillRect(t,n,r,i),a+=1)}function S(e,t){switch(t){case"lowercase":return e.toLowerCase();case"capitalize":return e.replace(/(^|\s|:|-|\(|\))([a-z])/g,function(e,t,n){if(e.length>0)return t+n.toUpperCase()});case"uppercase":return e.toUpperCase();default:return e}}function x(e){return/^(normal|none|0px)$/.test(e)}function T(e,t,n,i){e!==null&&r.Util.trimText(e).length>0&&(i.fillText(e,t,n),a+=1)}function N(e,t,n,i){var s=!1,o=v(t,"fontWeight"),u=v(t,"fontFamily"),a=v(t,"fontSize");switch(parseInt(o,10)){case 401:o="bold";break;case 400:o="normal"}e.setVariable("fillStyle",i),e.setVariable("font",[v(t,"fontStyle"),v(t,"fontVariant"),o,a,u].join(" ")),e.setVariable("textAlign",s?"right":"left");if(n!=="none")return r.Util.Font(u,a,c)}function C(e,t,n,r,i){switch(t){case"underline":E(e,n.left,Math.round(n.top+r.baseline+r.lineWidth),n.width,1,i);break;case"overline":E(e,n.left,Math.round(n.top),n.width,1,i);break;case"line-through":E(e,n.left,Math.ceil(n.top+r.middle+r.lineWidth),n.width,1,i)}}function k(e,t,n,i){var s;if(h.rangeBounds){if(n!=="none"||r.Util.trimText(t).length!==0)s=L(t,e.node,e.textOffset);e.textOffset+=t.length}else if(e.node&&typeof e.node.nodeValue=="string"){var o=i?e.node.splitText(t.length):null;s=A(e.node),e.node=o}return s}function L(e,t,n){var r=c.createRange();return r.setStart(t,n),r.setEnd(t,n+e.length),r.getBoundingClientRect()}function A(e){var t=e.parentNode,n=c.createElement("wrapper"),i=e.cloneNode(!0);n.appendChild(e.cloneNode(!0)),t.replaceChild(n,e);var s=r.Util.Bounds(n);return t.replaceChild(i,n),s}function O(e,t,n){var i=n.ctx,o=v(e,"color"),u=v(e,"textDecoration"),a=v(e,"textAlign"),f,l,c={node:t,textOffset:0};r.Util.trimText(t.nodeValue).length>0&&(t.nodeValue=S(t.nodeValue,v(e,"textTransform")),a=a.replace(["-webkit-auto"],["auto"]),l=!s.letterRendering&&/^(left|right|justify|auto)$/.test(a)&&x(v(e,"letterSpacing"))?t.nodeValue.split(/(\b| )/):t.nodeValue.split(""),f=N(i,e,u,o),s.chinese&&l.forEach(function(e,t){/.*[\u4E00-\u9FA5].*$/.test(e)&&(e=e.split(""),e.unshift(t,1),l.splice.apply(l,e))}),l.forEach(function(e,t){var n=k(c,e,u,t<l.length-1);n&&(T(e,n.left,n.bottom,i),C(i,u,n,f,o))}))}function M(e,t){var n=c.createElement("boundelement"),i,s;return n.style.display="inline",i=e.style.listStyleType,e.style.listStyleType="none",n.appendChild(c.createTextNode(t)),e.insertBefore(n,e.firstChild),s=r.Util.Bounds(n),e.removeChild(n),e.style.listStyleType=i,s}function _(e){var t=-1,n=1,r=e.parentNode.childNodes;if(e.parentNode){while(r[++t]!==e)r[t].nodeType===1&&n++;return n}return-1}function D(e,t){var n=_(e),i;switch(t){case"decimal":i=n;break;case"decimal-leading-zero":i=n.toString().length===1?n="0"+n.toString():n.toString();break;case"upper-roman":i=r.Generate.ListRoman(n);break;case"lower-roman":i=r.Generate.ListRoman(n).toLowerCase();break;case"lower-alpha":i=r.Generate.ListAlpha(n).toLowerCase();break;case"upper-alpha":i=r.Generate.ListAlpha(n)}return i+=". ",i}function P(e,t,n){var r,i,s=t.ctx,o=v(e,"listStyleType"),u;if(/^(decimal|decimal-leading-zero|upper-alpha|upper-latin|upper-roman|lower-alpha|lower-greek|lower-latin|lower-roman)$/i.test(o)){i=D(e,o),u=M(e,i),N(s,e,"none",v(e,"color"));if(v(e,"listStylePosition")!=="inside")return;s.setVariable("textAlign","left"),r=n.left,T(i,r,u.bottom,s)}}function H(e){var t=i[e];return t&&t.succeeded===!0?t.img:!1}function B(e,t){var n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.left+e.width,t.left+t.width),s=Math.min(e.top+e.height,t.top+t.height);return{left:n,top:r,width:i-n,height:s-r}}function j(e,t){var n;return t?e!=="auto"?(n=f(e),t.children.push(n),n):t:(n=f(0),n)}function F(e,t,n,r,i){var s=w(t,"paddingLeft"),o=w(t,"paddingTop"),u=w(t,"paddingRight"),a=w(t,"paddingBottom");G(e,n,0,0,n.width,n.height,r.left+s+i[3].width,r.top+o+i[0].width,r.width-(i[1].width+i[3].width+s+u),r.height-(i[0].width+i[2].width+o+a))}function I(e){return["Top","Right","Bottom","Left"].map(function(t){return{width:w(e,"border"+t+"Width"),color:v(e,"border"+t+"Color")}})}function q(e){return["TopLeft","TopRight","BottomRight","BottomLeft"].map(function(t){return v(e,"border"+t+"Radius")})}function U(e,t,n,r){var i=function(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}};return{start:e,startControl:t,endControl:n,end:r,subdivide:function(s){var o=i(e,t,s),u=i(t,n,s),a=i(n,r,s),f=i(o,u,s),l=i(u,a,s),c=i(f,l,s);return[U(e,o,f,c),U(c,l,a,r)]},curveTo:function(e){e.push(["bezierCurve",t.x,t.y,n.x,n.y,r.x,r.y])},curveToReversed:function(r){r.push(["bezierCurve",n.x,n.y,t.x,t.y,e.x,e.y])}}}function z(e,t,n,r,i,s,o){t[0]>0||t[1]>0?(e.push(["line",r[0].start.x,r[0].start.y]),r[0].curveTo(e),r[1].curveTo(e)):e.push(["line",s,o]),(n[0]>0||n[1]>0)&&e.push(["line",i[0].start.x,i[0].start.y])}function W(e,t,n,r,i,s,o){var u=[];return t[0]>0||t[1]>0?(u.push(["line",r[1].start.x,r[1].start.y]),r[1].curveTo(u)):u.push(["line",e.c1[0],e.c1[1]]),n[0]>0||n[1]>0?(u.push(["line",s[0].start.x,s[0].start.y]),s[0].curveTo(u),u.push(["line",o[0].end.x,o[0].end.y]),o[0].curveToReversed(u)):(u.push(["line",e.c2[0],e.c2[1]]),u.push(["line",e.c3[0],e.c3[1]])),t[0]>0||t[1]>0?(u.push(["line",i[1].end.x,i[1].end.y]),i[1].curveToReversed(u)):u.push(["line",e.c4[0],e.c4[1]]),u}function X(e,t,n){var r=e.left,i=e.top,s=e.width,o=e.height,u=t[0][0],a=t[0][1],f=t[1][0],l=t[1][1],c=t[2][0],h=t[2][1],p=t[3][0],d=t[3][1],v=s-f,m=o-c,g=s-h,y=o-d;return{topLeftOuter:R(r,i,u,a).topLeft.subdivide(.5),topLeftInner:R(r+n[3].width,i+n[0].width,Math.max(0,u-n[3].width),Math.max(0,a-n[0].width)).topLeft.subdivide(.5),topRightOuter:R(r+v,i,f,l).topRight.subdivide(.5),topRightInner:R(r+Math.min(v,s+n[3].width),i+n[0].width,v>s+n[3].width?0:f-n[3].width,l-n[0].width).topRight.subdivide(.5),bottomRightOuter:R(r+g,i+m,h,c).bottomRight.subdivide(.5),bottomRightInner:R(r+Math.min(g,s+n[3].width),i+Math.min(m,o+n[0].width),Math.max(0,h-n[1].width),Math.max(0,c-n[2].width)).bottomRight.subdivide(.5),bottomLeftOuter:R(r,i+y,p,d).bottomLeft.subdivide(.5),bottomLeftInner:R(r+n[3].width,i+y,Math.max(0,p-n[3].width),Math.max(0,d-n[2].width)).bottomLeft.subdivide(.5)}}function V(e,t,n,r,i){var s=v(e,"backgroundClip"),o=[];switch(s){case"content-box":case"padding-box":z(o,r[0],r[1],t.topLeftInner,t.topRightInner,i.left+n[3].width,i.top+n[0].width),z(o,r[1],r[2],t.topRightInner,t.bottomRightInner,i.left+i.width-n[1].width,i.top+n[0].width),z(o,r[2],r[3],t.bottomRightInner,t.bottomLeftInner,i.left+i.width-n[1].width,i.top+i.height-n[2].width),z(o,r[3],r[0],t.bottomLeftInner,t.topLeftInner,i.left+n[3].width,i.top+i.height-n[2].width);break;default:z(o,r[0],r[1],t.topLeftOuter,t.topRightOuter,i.left,i.top),z(o,r[1],r[2],t.topRightOuter,t.bottomRightOuter,i.left+i.width,i.top),z(o,r[2],r[3],t.bottomRightOuter,t.bottomLeftOuter,i.left+i.width,i.top+i.height),z(o,r[3],r[0],t.bottomLeftOuter,t.topLeftOuter,i.left,i.top+i.height)}return o}function $(e,t,n){var r=t.left,i=t.top,s=t.width,o=t.height,u,a,f,l,c,h,p=q(e),d=X(t,p,n),v={clip:V(e,d,n,p,t),borders:[]};for(u=0;u<4;u++)if(n[u].width>0){a=r,f=i,l=s,c=o-n[2].width;switch(u){case 0:c=n[0].width,h=W({c1:[a,f],c2:[a+l,f],c3:[a+l-n[1].width,f+c],c4:[a+n[3].width,f+c]},p[0],p[1],d.topLeftOuter,d.topLeftInner,d.topRightOuter,d.topRightInner);break;case 1:a=r+s-n[1].width,l=n[1].width,h=W({c1:[a+l,f],c2:[a+l,f+c+n[2].width],c3:[a,f+c],c4:[a,f+n[0].width]},p[1],p[2],d.topRightOuter,d.topRightInner,d.bottomRightOuter,d.bottomRightInner);break;case 2:f=f+o-n[2].width,c=n[2].width,h=W({c1:[a+l,f+c],c2:[a,f+c],c3:[a+n[3].width,f],c4:[a+l-n[2].width,f]},p[2],p[3],d.bottomRightOuter,d.bottomRightInner,d.bottomLeftOuter,d.bottomLeftInner);break;case 3:l=n[3].width,h=W({c1:[a,f+c+n[2].width],c2:[a,f],c3:[a+l,f+n[0].width],c4:[a+l,f+c]},p[3],p[0],d.bottomLeftOuter,d.bottomLeftInner,d.topLeftOuter,d.topLeftInner)}v.borders.push({args:h,color:n[u].color})}return v}function J(e,t){var n=e.drawShape();return t.forEach(function(e,t){n[t===0?"moveTo":e[0]+"To"].apply(null,e.slice(1))}),n}function K(e,t,n){n!=="transparent"&&(e.setVariable("fillStyle",n),J(e,t),e.fill(),a+=1)}function Q(e,t,n){var r=c.createElement("valuewrap"),i=["lineHeight","textAlign","fontFamily","color","fontSize","paddingLeft","paddingTop","width","height","border","borderLeftWidth","borderTopWidth"],s,o;i.forEach(function(t){try{r.style[t]=v(e,t)}catch(n){u("html2canvas: Parse: Exception caught in renderFormValue: "+n.message)}}),r.style.borderColor="black",r.style.borderStyle="solid",r.style.display="block",r.style.position="absolute";if(/^(submit|reset|button|text|password)$/.test(e.type)||e.nodeName==="SELECT")r.style.lineHeight=v(e,"height");r.style.top=t.top+"px",r.style.left=t.left+"px",s=e.nodeName==="SELECT"?(e.options[e.selectedIndex]||0).text:e.value,s||(s=e.placeholder),o=c.createTextNode(s),r.appendChild(o),d.appendChild(r),O(e,o,n),d.removeChild(r)}function G(e){e.drawImage.apply(e,Array.prototype.slice.call(arguments,1)),a+=1}function Y(n,i){var s=e.getComputedStyle(n,i);if(!s||!s.content||s.content==="none"||s.content==="-moz-alt-content")return;var o=s.content+"",u=o.substr(0,1);u===o.substr(o.length-1)&&u.match(/'|"/)&&(o=o.substr(1,o.length-2));var a=o.substr(0,3)==="url",f=t.createElement(a?"img":"span");return f.className=m+"-before "+m+"-after",Object.keys(s).filter(Z).forEach(function(e){f.style[e]=s[e]}),a?f.src=r.Util.parseBackgroundImage(o)[0].args[0]:f.innerHTML=o,f}function Z(t){return isNaN(e.parseInt(t,10))}function et(e,t){var n=Y(e,":before"),r=Y(e,":after");if(!n&&!r)return;n&&(e.className+=" "+m+"-before",e.parentNode.insertBefore(n,e),ht(n,t,!0),e.parentNode.removeChild(n),e.className=e.className.replace(m+"-before","").trim()),r&&(e.className+=" "+m+"-after",e.appendChild(r),ht(r,t,!0),e.removeChild(r),e.className=e.className.replace(m+"-after","").trim())}function tt(e,t,n,r){var i=Math.round(r.left+n.left),s=Math.round(r.top+n.top);e.createPattern(t),e.translate(i,s),e.fill(),e.translate(-i,-s)}function nt(e,t,n,r,i,s,o,u){var a=[];a.push(["line",Math.round(i),Math.round(s)]),a.push(["line",Math.round(i+o),Math.round(s)]),a.push(["line",Math.round(i+o),Math.round(u+s)]),a.push(["line",Math.round(i),Math.round(u+s)]),J(e,a),e.save(),e.clip(),tt(e,t,n,r),e.restore()}function rt(e,t,n){E(e,t.left,t.top,t.width,t.height,n)}function it(e,t,n,i,s){var o=r.Util.BackgroundSize(e,t,i,s),u=r.Util.BackgroundPosition(e,t,i,s,o),a=v(e,"backgroundRepeat").split(",").map(function(e){return e.trim()});i=ot(i,o),a=a[s]||a[0];switch(a){case"repeat-x":nt(n,i,u,t,t.left,t.top+u.top,99999,i.height);break;case"repeat-y":nt(n,i,u,t,t.left+u.left,t.top,i.width,99999);break;case"no-repeat":nt(n,i,u,t,t.left+u.left,t.top+u.top,i.width,i.height);break;default:tt(n,i,u,{top:t.top,left:t.left,width:i.width,height:i.height})}}function st(e,t,n){var i=v(e,"backgroundImage"),s=r.Util.parseBackgroundImage(i),o,a=s.length;while(a--){i=s[a];if(!i.args||i.args.length===0)continue;var f=i.method==="url"?i.args[0]:i.value;o=H(f),o?it(e,t,n,o,a):u("html2canvas: Error loading background:",i)}}function ot(e,t){if(e.width===t.width&&e.height===t.height)return e;var n,r=c.createElement("canvas");return r.width=t.width,r.height=t.height,n=r.getContext("2d"),G(n,e,0,0,e.width,e.height,0,0,t.width,t.height),r}function ut(e,t,n){var r=v(t,"opacity")*(n?n.opacity:1);return e.setVariable("globalAlpha",r),r}function at(e,t,n){var i=l(t?n.width:y(),t?n.height:b()),o={ctx:i,zIndex:j(v(e,"zIndex"),t?t.zIndex:null),opacity:ut(i,e,t),cssPosition:v(e,"position"),borders:I(e),clip:t&&t.clip?r.Util.Extend({},t.clip):null};return s.useOverflow===!0&&/(hidden|scroll|auto)/.test(v(e,"overflow"))===!0&&/(BODY)/i.test(e.nodeName)===!1&&(o.clip=o.clip?B(o.clip,n):n),o.zIndex.children.push(o),o}function ft(e,t,n){var r={left:t.left+e[3].width,top:t.top+e[0].width,width:t.width-(e[1].width+e[3].width),height:t.height-(e[0].width+e[2].width)};return n&&(r=B(r,n)),r}function lt(e,t,n){var i=r.Util.Bounds(e),s,o=p.test(e.nodeName)?"#efefef":v(e,"backgroundColor"),a=at(e,t,i),f=a.borders,l=a.ctx,c=ft(f,i,a.clip),h=$(e,i,f);J(l,h.clip),l.save(),l.clip(),c.height>0&&c.width>0&&(rt(l,i,o),st(e,c,l)),l.restore(),h.borders.forEach(function(e){K(l,e.args,e.color)}),n||et(e,a);switch(e.nodeName){case"IMG":(s=H(e.getAttribute("src")))?F(l,e,s,i,f):u("html2canvas: Error loading <img>:"+e.getAttribute("src"));break;case"INPUT":/^(text|url|email|submit|button|reset)$/.test(e.type)&&(e.value||e.placeholder).length>0&&Q(e,i,a);break;case"TEXTAREA":(e.value||e.placeholder||"").length>0&&Q(e,i,a);break;case"SELECT":(e.options||e.placeholder||"").length>0&&Q(e,i,a);break;case"LI":P(e,a,c);break;case"CANVAS":F(l,e,e,i,f)}return a}function ct(e){return v(e,"display")!=="none"&&v(e,"visibility")!=="hidden"&&!e.hasAttribute("data-html2canvas-ignore")}function ht(e,t,n){ct(e)&&(t=lt(e,t,n)||t,p.test(e.nodeName)||r.Util.Children(e).forEach(function(r){r.nodeType===1?ht(r,t,n):r.nodeType===3&&O(e,r,t)}))}function pt(e,t){function u(e){var t=r.Util.Children(e),n=t.length,i,s,a,f,l;for(l=0;l<n;l+=1){f=t[l];if(f.nodeType===3)o+=f.nodeValue.replace(/</g,"&lt;").replace(/>/g,"&gt;");else if(f.nodeType===1&&!/^(script|meta|title)$/.test(f.nodeName.toLowerCase())){o+="<"+f.nodeName.toLowerCase();if(f.hasAttributes()){i=f.attributes,a=i.length;for(s=0;s<a;s+=1)o+=" "+i[s].name+'="'+i[s].value+'"'}o+=">",u(f),o+="</"+f.nodeName.toLowerCase()+">"}}}var n=new Image,i=y(),s=b(),o="";u(e),n.src=["data:image/svg+xml,","<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='"+i+"' height='"+s+"'>","<foreignObject width='"+i+"' height='"+s+"'>","<html xmlns='http://www.w3.org/1999/xhtml' style='margin:0;'>",o.replace(/\#/g,"%23"),"</html>","</foreignObject>","</svg>"].join(""),n.onload=function(){t.svgRender=n}}function dt(){var e=lt(o,null);return h.svgRendering&&pt(t.documentElement,e),Array.prototype.slice.call(o.children,0).forEach(function(t){ht(t,e)}),e.backgroundColor=v(t.documentElement,"backgroundColor"),d.removeChild(g),e}e.scroll(0,0);var o=s.elements===n?t.body:s.elements[0],a=0,c=o.ownerDocument,h=r.Util.Support(s,c),p=new RegExp("("+s.ignoreElements+")"),d=c.body,v=r.Util.getCSS,m="___html2canvas___pseudoelement",g=c.createElement("style");g.innerHTML="."+m+'-before:before { content: "" !important; display: none !important; }'+"."+m+'-after:after { content: "" !important; display: none !important; }',d.appendChild(g),i=i||{};var R=function(e){return function(t,n,r,i){var s=r*e,o=i*e,u=t+r,a=n+i;return{topLeft:U({x:t,y:a},{x:t,y:a-o},{x:u-s,y:n},{x:u,y:n}),topRight:U({x:t,y:n},{x:t+s,y:n},{x:u,y:a-o},{x:u,y:a}),bottomRight:U({x:u,y:n},{x:u,y:n+o},{x:t+s,y:a},{x:t,y:a}),bottomLeft:U({x:u,y:a},{x:u-s,y:a},{x:t,y:n+o},{x:t,y:n})}}}(4*((Math.sqrt(2)-1)/3));return dt()},r.Preload=function(i){function y(e){v.href=e,v.href=v.href;var t=v.protocol+v.host;return t===o}function b(){u("html2canvas: start: images: "+s.numLoaded+" / "+s.numTotal+" (failed: "+s.numFailed+")"),!s.firstRun&&s.numLoaded>=s.numTotal&&(u("Finished loading images: # "+s.numTotal+" (failed: "+s.numFailed+")"),typeof i.complete=="function"&&i.complete(s))}function w(t,r,o){var u,a=i.proxy,f;v.href=t,t=v.href,u="html2canvas_"+l++,o.callbackname=u,a.indexOf("?")>-1?a+="&":a+="?",a+="url="+encodeURIComponent(t)+"&callback="+u,f=h.createElement("script"),e[u]=function(t){t.substring(0,6)==="error:"?(o.succeeded=!1,s.numLoaded++,s.numFailed++,b()):(k(r,o),r.src=t),e[u]=n;try{delete e[u]}catch(i){}f.parentNode.removeChild(f),f=null,delete o.script,delete o.callbackname},f.setAttribute("type","text/javascript"),f.setAttribute("src",a),o.script=f,e.document.body.appendChild(f)}function E(t,n){var i=e.getComputedStyle(t,n),s=i.content;s.substr(0,3)==="url"&&a.loadImage(r.Util.parseBackgroundImage(s)[0].args[0]),N(i.backgroundImage,t)}function S(e){E(e,":before"),E(e,":after")}function x(e,t){var i=r.Generate.Gradient(e,t);i!==n&&(s[e]={img:i,succeeded:!0},s.numTotal++,s.numLoaded++,b())}function T(e){return e&&e.method&&e.args&&e.args.length>0}function N(e,t){var i;r.Util.parseBackgroundImage(e).filter(T).forEach(function(e){e.method==="url"?a.loadImage(e.args[0]):e.method.match(/\-?gradient$/)&&(i===n&&(i=r.Util.Bounds(t)),x(e.value,i))})}function C(e){var t=!1;try{r.Util.Children(e).forEach(function(e){C(e)})}catch(i){}try{t=e.nodeType}catch(s){t=!1,u("html2canvas: failed to access some element's nodeType - Exception: "+s.message)}if(t===1||t===n){S(e);try{N(r.Util.getCSS(e,"backgroundImage"),e)}catch(i){u("html2canvas: failed to get background-image - Exception: "+i.message)}N(e)}}function k(t,r){t.onload=function(){r.timer!==n&&e.clearTimeout(r.timer),s.numLoaded++,r.succeeded=!0,t.onerror=t.onload=null,b()},t.onerror=function(){if(t.crossOrigin==="anonymous"){e.clearTimeout(r.timer);if(i.proxy){var n=t.src;t=new Image,r.img=t,t.src=n,w(t.src,t,r);return}}s.numLoaded++,s.numFailed++,r.succeeded=!1,t.onerror=t.onload=null,b()}}var s={numLoaded:0,numFailed:0,numTotal:0,cleanupDone:!1},o,a,f,l=0,c=i.elements[0]||t.body,h=c.ownerDocument,p=h.images,d=p.length,v=h.createElement("a"),m=function(e){return e.crossOrigin!==n}(new Image),g;v.href=e.location.href,o=v.protocol+v.host,a={loadImage:function(t){var r,o;t&&s[t]===n&&(r=new Image,t.match(/data:image\/.*;base64,/i)?(r.src=t.replace(/url\(['"]{0,}|['"]{0,}\)$/ig,""),o=s[t]={img:r},s.numTotal++,k(r,o)):y(t)||i.allowTaint===!0?(o=s[t]={img:r},s.numTotal++,k(r,o),r.src=t):m&&!i.allowTaint&&i.useCORS?(r.crossOrigin="anonymous",o=s[t]={img:r},s.numTotal++,k(r,o),r.src=t,r.customComplete=function(){this.img.complete?this.img.onerror():this.timer=e.setTimeout(this.img.customComplete,100)}.bind(o),r.customComplete()):i.proxy&&(o=s[t]={img:r},s.numTotal++,w(t,r,o)))},cleanupDOM:function(r){var o,a;if(!s.cleanupDone){r&&typeof r=="string"?u("html2canvas: Cleanup because: "+r):u("html2canvas: Cleanup after timeout: "+i.timeout+" ms.");for(a in s)if(s.hasOwnProperty(a)){o=s[a];if(typeof o=="object"&&o.callbackname&&o.succeeded===n){e[o.callbackname]=n;try{delete e[o.callbackname]}catch(f){}o.script&&o.script.parentNode&&(o.script.setAttribute("src","about:blank"),o.script.parentNode.removeChild(o.script)),s.numLoaded++,s.numFailed++,u("html2canvas: Cleaned up failed img: '"+a+"' Steps: "+s.numLoaded+" / "+s.numTotal)}}e.stop!==n?e.stop():t.execCommand!==n&&t.execCommand("Stop",!1),t.close!==n&&t.close(),s.cleanupDone=!0,(!r||typeof r!="string")&&b()}},renderingDone:function(){g&&e.clearTimeout(g)}},i.timeout>0&&(g=e.setTimeout(a.cleanupDOM,i.timeout)),u("html2canvas: Preload starts: finding background-images"),s.firstRun=!0,C(c),u("html2canvas: Preload: Finding images");for(f=0;f<d;f+=1)a.loadImage(p[f].getAttribute("src"));return s.firstRun=!1,u("html2canvas: Preload: Done."),s.numTotal===s.numLoaded&&b(),a},r.Renderer=function(e,i){function s(e){var t=[],n=function(e){var r=[],i=[];e.children.forEach(function(e){e.children&&e.children.length>0?(r.push(e),i.push(e.zindex)):t.push(e)}),i.sort(function(e,t){return e-t}),i.forEach(function(e){var t;r.some(function(n,r){return t=r,n.zindex===e}),n(r.splice(t,1)[0])})};return n(e.zIndex),t}function o(e){var t;if(typeof i.renderer=="string"&&r.Renderer[e]!==n)t=r.Renderer[e](i);else{if(typeof e!="function")throw new Error("Unknown renderer");t=e(i)}if(typeof t!="function")throw new Error("Invalid renderer defined");return t}return o(i.renderer)(e,i,t,s(e),r)},r.Util.Support=function(e,t){function r(){var e=new Image,r=t.createElement("canvas"),i=r.getContext===n?!1:r.getContext("2d");if(i===!1)return!1;r.width=r.height=10,e.src=["data:image/svg+xml,","<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10'>","<foreignObject width='10' height='10'>","<div xmlns='http://www.w3.org/1999/xhtml' style='width:10;height:10;'>","sup","</div>","</foreignObject>","</svg>"].join("");try{i.drawImage(e,0,0),r.toDataURL()}catch(s){return!1}return u("html2canvas: Parse: SVG powered rendering available"),!0}function i(){var e,n,r,i,s=!1;return t.createRange&&(e=t.createRange(),e.getBoundingClientRect&&(n=t.createElement("boundtest"),n.style.height="123px",n.style.display="block",t.body.appendChild(n),e.selectNode(n),r=e.getBoundingClientRect(),i=r.height,i===123&&(s=!0),t.body.removeChild(n))),s}return{rangeBounds:i(),svgRendering:e.svgRendering&&r()}},e.html2canvas=function(t,n){var i,s,o={logging:!1,elements:t,background:"#fff",proxy:null,timeout:0,useCORS:!1,allowTaint:!1,svgRendering:!1,ignoreElements:"IFRAME|OBJECT|PARAM",useOverflow:!0,letterRendering:!1,chinese:!1,width:null,height:null,taintTest:!0,renderer:"Canvas"};return o=r.Util.Extend(n,o),r.logging=o.logging,o.complete=function(e){if(typeof o.onpreloaded=="function"&&o.onpreloaded(e)===!1)return;i=r.Parse(e,o);if(typeof o.onparsed=="function"&&o.onparsed(i)===!1)return;s=r.Renderer(i,o),typeof o.onrendered=="function"&&o.onrendered(s)},e.setTimeout(function(){r.Preload(o)},0),{render:function(e,t){return r.Renderer(e,r.Util.Extend(t,o))},parse:function(e,t){return r.Parse(e,r.Util.Extend(t,o))},preload:function(e){return r.Preload(r.Util.Extend(e,o))},log:u}},e.html2canvas.log=u,e.html2canvas.Renderer={Canvas:n},r.Renderer.Canvas=function(e){function f(e,t){e.beginPath(),t.forEach(function(t){e[t.name].apply(e,t.arguments)}),e.closePath()}function l(e){if(i.indexOf(e.arguments[0].src)===-1){o.drawImage(e.arguments[0],0,0);try{o.getImageData(0,0,1,1)}catch(t){return s=r.createElement("canvas"),o=s.getContext("2d"),!1}i.push(e.arguments[0].src)}return!0}function c(e){return e==="transparent"||e==="rgba(0, 0, 0, 0)"}function h(t,n){switch(n.type){case"variable":t[n.name]=n.arguments;break;case"function":if(n.name==="createPattern"){if(n.arguments[0].width>0&&n.arguments[0].height>0)try{t.fillStyle=t.createPattern(n.arguments[0],"repeat")}catch(r){u("html2canvas: Renderer: Error creating pattern",r.message)}}else n.name==="drawShape"?f(t,n.arguments):n.name==="drawImage"?n.arguments[8]>0&&n.arguments[7]>0&&(e.taintTest||e.taintTest&&l(n))&&t.drawImage.apply(t,n.arguments):t[n.name].apply(t,n.arguments)}}e=e||{};var r=t,i=[],s=t.createElement("canvas"),o=s.getContext("2d"),a=e.canvas||r.createElement("canvas");return function(e,t,r,i,s){var o=a.getContext("2d"),f,l,p,d,v,m;a.width=a.style.width=t.width||e.ctx.width,a.height=a.style.height=t.height||e.ctx.height,m=o.fillStyle,o.fillStyle=c(e.backgroundColor)&&t.background!==n?t.background:e.backgroundColor,o.fillRect(0,0,a.width,a.height),o.fillStyle=m;if(t.svgRendering&&e.svgRender!==n)o.drawImage(e.svgRender,0,0);else for(l=0,p=i.length;l<p;l+=1)f=i.splice(0,1)[0],f.canvasPosition=f.canvasPosition||{},o.textBaseline="bottom",f.clip&&(o.save(),o.beginPath(),o.rect(f.clip.left,f.clip.top,f.clip.width,f.clip.height),o.clip()),f.ctx.storage&&f.ctx.storage.forEach(h.bind(null,o)),f.clip&&o.restore();return u("html2canvas: Renderer: Canvas renderer done - returning canvas obj"),p=t.elements.length,p===1&&typeof t.elements[0]=="object"&&t.elements[0].nodeName!=="BODY"?(v=s.Util.Bounds(t.elements[0]),d=r.createElement("canvas"),d.width=v.width,d.height=v.height,o=d.getContext("2d"),o.drawImage(a,v.left,v.top,v.width,v.height,0,0,v.width,v.height),a=null,d):a}}})(window,document);
  7
+(function(e,t,n){"use strict";function u(t){r.logging&&e.console&&e.console.log&&e.console.log(t)}function a(e,t,n,i,s,o){var u=r.Util.getCSS(t,e,s),a,f,l,c;u.length===1&&(c=u[0],u=[],u[0]=c,u[1]=c);if(u[0].toString().indexOf("%")!==-1)l=parseFloat(u[0])/100,f=n.width*l,e!=="backgroundSize"&&(f-=(o||i).width*l);else if(e==="backgroundSize")if(u[0]==="auto")f=i.width;else if(u[0].match(/contain|cover/)){var h=r.Util.resizeBounds(i.width,i.height,n.width,n.height,u[0]);f=h.width,a=h.height}else f=parseInt(u[0],10);else f=parseInt(u[0],10);return u[1]==="auto"?a=f/i.width*i.height:u[1].toString().indexOf("%")!==-1?(l=parseFloat(u[1])/100,a=n.height*l,e!=="backgroundSize"&&(a-=(o||i).height*l)):a=parseInt(u[1],10),[f,a]}function f(e){return{zindex:e,children:[]}}function l(e,t){var n=[];return{storage:n,width:e,height:t,clip:function(){n.push({type:"function",name:"clip",arguments:arguments})},translate:function(){n.push({type:"function",name:"translate",arguments:arguments})},fill:function(){n.push({type:"function",name:"fill",arguments:arguments})},save:function(){n.push({type:"function",name:"save",arguments:arguments})},restore:function(){n.push({type:"function",name:"restore",arguments:arguments})},fillRect:function(){n.push({type:"function",name:"fillRect",arguments:arguments})},createPattern:function(){n.push({type:"function",name:"createPattern",arguments:arguments})},drawShape:function(){var e=[];return n.push({type:"function",name:"drawShape",arguments:e}),{moveTo:function(){e.push({name:"moveTo",arguments:arguments})},lineTo:function(){e.push({name:"lineTo",arguments:arguments})},arcTo:function(){e.push({name:"arcTo",arguments:arguments})},bezierCurveTo:function(){e.push({name:"bezierCurveTo",arguments:arguments})},quadraticCurveTo:function(){e.push({name:"quadraticCurveTo",arguments:arguments})}}},drawImage:function(){n.push({type:"function",name:"drawImage",arguments:arguments})},fillText:function(){n.push({type:"function",name:"fillText",arguments:arguments})},setVariable:function(e,t){n.push({type:"variable",name:e,arguments:t})}}}var r={},i,s,o;r.Util={},r.Util.trimText=function(e){return function(t){return e?e.apply(t):((t||"")+"").replace(/^\s+|\s+$/g,"")}}(String.prototype.trim),r.Util.parseBackgroundImage=function(e){var t=" \r\n	",n,r,i,s,o,u=[],a,f=0,l=0,c,h,p=function(){n&&(r.substr(0,1)==='"'&&(r=r.substr(1,r.length-2)),r&&h.push(r),n.substr(0,1)==="-"&&(s=n.indexOf("-",1)+1)>0&&(i=n.substr(0,s),n=n.substr(s)),u.push({prefix:i,method:n.toLowerCase(),value:o,args:h})),h=[],n=i=r=o=""};p();for(var d=0,v=e.length;d<v;d++){a=e[d];if(f===0&&t.indexOf(a)>-1)continue;switch(a){case'"':c?c===a&&(c=null):c=a;break;case"(":if(c)break;if(f===0){f=1,o+=a;continue}l++;break;case")":if(c)break;if(f===1){if(l===0){f=0,o+=a,p();continue}l--}break;case",":if(c)break;if(f===0){p();continue}if(f===1&&l===0&&!n.match(/^url$/i)){h.push(r),r="",o+=a;continue}}o+=a,f===0?n+=a:r+=a}return p(),u},r.Util.Bounds=function(t){var n,r={};if(t.getBoundingClientRect)return n=t.getBoundingClientRect(),r.top=n.top,r.bottom=n.bottom||n.top+n.height,r.left=n.left,r.width=n.width||n.right-n.left,r.height=n.height||n.bottom-n.top,r},r.Util.getCSS=function(e,o,u){function l(t,n){var r=e.runtimeStyle&&e.runtimeStyle[t],i,s=e.style;return!/^-?[0-9]+\.?[0-9]*(?:px)?$/i.test(n)&&/^-?\d/.test(n)&&(i=s.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":n||0,n=s.pixelLeft+"px",s.left=i,r&&(e.runtimeStyle.left=r)),/^(thin|medium|thick)$/i.test(n)?n:Math.round(parseFloat(n))+"px"}var a,f=o.match(/^background(Size|Position)$/);i!==e&&(s=t.defaultView.getComputedStyle(e,null)),a=s[o];if(f){a=(a||"").split(","),a=a[u||0]||a[0]||"auto",a=r.Util.trimText(a).split(" ");if(o!=="backgroundSize"||!!a[0]&&!a[0].match(/cover|contain|auto/)){a[0]=a[0].indexOf("%")===-1?l(o+"X",a[0]):a[0];if(a[1]===n){if(o==="backgroundSize")return a[1]="auto",a;a[1]=a[0]}a[1]=a[1].indexOf("%")===-1?l(o+"Y",a[1]):a[1]}}else if(/border(Top|Bottom)(Left|Right)Radius/.test(o)){var c=a.split(" ");c.length<=1&&(c[1]=c[0]),c[0]=parseInt(c[0],10),c[1]=parseInt(c[1],10),a=c}return a},r.Util.resizeBounds=function(e,t,n,r,i){var s=n/r,o=e/t,u,a;return!i||i==="auto"?(u=n,a=r):s<o^i==="contain"?(a=r,u=r*o):(u=n,a=n/o),{width:u,height:a}},r.Util.BackgroundPosition=function(e,t,n,r,i){var s=a("backgroundPosition",e,t,n,r,i);return{left:s[0],top:s[1]}},r.Util.BackgroundSize=function(e,t,n,r){var i=a("backgroundSize",e,t,n,r);return{width:i[0],height:i[1]}},r.Util.Extend=function(e,t){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},r.Util.Children=function(e){var t;try{t=e.nodeName&&e.nodeName.toUpperCase()==="IFRAME"?e.contentDocument||e.contentWindow.document:function(e){var t=[];return e!==null&&function(e,t){var r=e.length,i=0;if(typeof t.length=="number")for(var s=t.length;i<s;i++)e[r++]=t[i];else while(t[i]!==n)e[r++]=t[i++];return e.length=r,e}(t,e),t}(e.childNodes)}catch(r){u("html2canvas.Util.Children failed with exception: "+r.message),t=[]}return t},r.Util.Font=function(){var e={};return function(t,r,i){if(e[t+"-"+r]!==n)return e[t+"-"+r];var s=i.createElement("div"),o=i.createElement("img"),u=i.createElement("span"),a="Hidden Text",f,l,c;return s.style.visibility="hidden",s.style.fontFamily=t,s.style.fontSize=r,s.style.margin=0,s.style.padding=0,i.body.appendChild(s),o.src="data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=",o.width=1,o.height=1,o.style.margin=0,o.style.padding=0,o.style.verticalAlign="baseline",u.style.fontFamily=t,u.style.fontSize=r,u.style.margin=0,u.style.padding=0,u.appendChild(i.createTextNode(a)),s.appendChild(u),s.appendChild(o),f=o.offsetTop-u.offsetTop+1,s.removeChild(u),s.appendChild(i.createTextNode(a)),s.style.lineHeight="normal",o.style.verticalAlign="super",l=o.offsetTop-s.offsetTop+1,c={baseline:f,lineWidth:1,middle:l},e[t+"-"+r]=c,i.body.removeChild(s),c}}(),function(){r.Generate={};var e=[/^(-webkit-linear-gradient)\(([a-z\s]+)([\w\d\.\s,%\(\)]+)\)$/,/^(-o-linear-gradient)\(([a-z\s]+)([\w\d\.\s,%\(\)]+)\)$/,/^(-webkit-gradient)\((linear|radial),\s((?:\d{1,3}%?)\s(?:\d{1,3}%?),\s(?:\d{1,3}%?)\s(?:\d{1,3}%?))([\w\d\.\s,%\(\)\-]+)\)$/,/^(-moz-linear-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?))([\w\d\.\s,%\(\)]+)\)$/,/^(-webkit-radial-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?)),\s(\w+)\s([a-z\-]+)([\w\d\.\s,%\(\)]+)\)$/,/^(-moz-radial-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?)),\s(\w+)\s?([a-z\-]*)([\w\d\.\s,%\(\)]+)\)$/,/^(-o-radial-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?)),\s(\w+)\s([a-z\-]+)([\w\d\.\s,%\(\)]+)\)$/];r.Generate.parseGradient=function(t,n){var r,i,s=e.length,o,u,a,f,l,c,h,p,d,v;for(i=0;i<s;i+=1){o=t.match(e[i]);if(o)break}if(o)switch(o[1]){case"-webkit-linear-gradient":case"-o-linear-gradient":r={type:"linear",x0:null,y0:null,x1:null,y1:null,colorStops:[]},a=o[2].match(/\w+/g);if(a){f=a.length;for(i=0;i<f;i+=1)switch(a[i]){case"top":r.y0=0,r.y1=n.height;break;case"right":r.x0=n.width,r.x1=0;break;case"bottom":r.y0=n.height,r.y1=0;break;case"left":r.x0=0,r.x1=n.width}}r.x0===null&&r.x1===null&&(r.x0=r.x1=n.width/2),r.y0===null&&r.y1===null&&(r.y0=r.y1=n.height/2),a=o[3].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)(?:\s\d{1,3}(?:%|px))?)+/g);if(a){f=a.length,l=1/Math.max(f-1,1);for(i=0;i<f;i+=1)c=a[i].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%|px)?/),c[2]?(u=parseFloat(c[2]),c[3]==="%"?u/=100:u/=n.width):u=i*l,r.colorStops.push({color:c[1],stop:u})}break;case"-webkit-gradient":r={type:o[2]==="radial"?"circle":o[2],x0:0,y0:0,x1:0,y1:0,colorStops:[]},a=o[3].match(/(\d{1,3})%?\s(\d{1,3})%?,\s(\d{1,3})%?\s(\d{1,3})%?/),a&&(r.x0=a[1]*n.width/100,r.y0=a[2]*n.height/100,r.x1=a[3]*n.width/100,r.y1=a[4]*n.height/100),a=o[4].match(/((?:from|to|color-stop)\((?:[0-9\.]+,\s)?(?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)\))+/g);if(a){f=a.length;for(i=0;i<f;i+=1)c=a[i].match(/(from|to|color-stop)\(([0-9\.]+)?(?:,\s)?((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\)/),u=parseFloat(c[2]),c[1]==="from"&&(u=0),c[1]==="to"&&(u=1),r.colorStops.push({color:c[3],stop:u})}break;case"-moz-linear-gradient":r={type:"linear",x0:0,y0:0,x1:0,y1:0,colorStops:[]},a=o[2].match(/(\d{1,3})%?\s(\d{1,3})%?/),a&&(r.x0=a[1]*n.width/100,r.y0=a[2]*n.height/100,r.x1=n.width-r.x0,r.y1=n.height-r.y0),a=o[3].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)(?:\s\d{1,3}%)?)+/g);if(a){f=a.length,l=1/Math.max(f-1,1);for(i=0;i<f;i+=1)c=a[i].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%)?/),c[2]?(u=parseFloat(c[2]),c[3]&&(u/=100)):u=i*l,r.colorStops.push({color:c[1],stop:u})}break;case"-webkit-radial-gradient":case"-moz-radial-gradient":case"-o-radial-gradient":r={type:"circle",x0:0,y0:0,x1:n.width,y1:n.height,cx:0,cy:0,rx:0,ry:0,colorStops:[]},a=o[2].match(/(\d{1,3})%?\s(\d{1,3})%?/),a&&(r.cx=a[1]*n.width/100,r.cy=a[2]*n.height/100),a=o[3].match(/\w+/),c=o[4].match(/[a-z\-]*/);if(a&&c)switch(c[0]){case"farthest-corner":case"cover":case"":h=Math.sqrt(Math.pow(r.cx,2)+Math.pow(r.cy,2)),p=Math.sqrt(Math.pow(r.cx,2)+Math.pow(r.y1-r.cy,2)),d=Math.sqrt(Math.pow(r.x1-r.cx,2)+Math.pow(r.y1-r.cy,2)),v=Math.sqrt(Math.pow(r.x1-r.cx,2)+Math.pow(r.cy,2)),r.rx=r.ry=Math.max(h,p,d,v);break;case"closest-corner":h=Math.sqrt(Math.pow(r.cx,2)+Math.pow(r.cy,2)),p=Math.sqrt(Math.pow(r.cx,2)+Math.pow(r.y1-r.cy,2)),d=Math.sqrt(Math.pow(r.x1-r.cx,2)+Math.pow(r.y1-r.cy,2)),v=Math.sqrt(Math.pow(r.x1-r.cx,2)+Math.pow(r.cy,2)),r.rx=r.ry=Math.min(h,p,d,v);break;case"farthest-side":a[0]==="circle"?r.rx=r.ry=Math.max(r.cx,r.cy,r.x1-r.cx,r.y1-r.cy):(r.type=a[0],r.rx=Math.max(r.cx,r.x1-r.cx),r.ry=Math.max(r.cy,r.y1-r.cy));break;case"closest-side":case"contain":a[0]==="circle"?r.rx=r.ry=Math.min(r.cx,r.cy,r.x1-r.cx,r.y1-r.cy):(r.type=a[0],r.rx=Math.min(r.cx,r.x1-r.cx),r.ry=Math.min(r.cy,r.y1-r.cy))}a=o[5].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)(?:\s\d{1,3}(?:%|px))?)+/g);if(a){f=a.length,l=1/Math.max(f-1,1);for(i=0;i<f;i+=1)c=a[i].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%|px)?/),c[2]?(u=parseFloat(c[2]),c[3]==="%"?u/=100:u/=n.width):u=i*l,r.colorStops.push({color:c[1],stop:u})}}return r},r.Generate.Gradient=function(e,n){if(n.width===0||n.height===0)return;var i=t.createElement("canvas"),s=i.getContext("2d"),o,a,f,l;i.width=n.width,i.height=n.height,o=r.Generate.parseGradient(e,n);if(o)if(o.type==="linear"){a=s.createLinearGradient(o.x0,o.y0,o.x1,o.y1);for(f=0,l=o.colorStops.length;f<l;f+=1)try{a.addColorStop(o.colorStops[f].stop,o.colorStops[f].color)}catch(c){u(["failed to add color stop: ",c,"; tried to add: ",o.colorStops[f],"; stop: ",f,"; in: ",e])}s.fillStyle=a,s.fillRect(0,0,n.width,n.height)}else if(o.type==="circle"){a=s.createRadialGradient(o.cx,o.cy,0,o.cx,o.cy,o.rx);for(f=0,l=o.colorStops.length;f<l;f+=1)try{a.addColorStop(o.colorStops[f].stop,o.colorStops[f].color)}catch(c){u(["failed to add color stop: ",c,"; tried to add: ",o.colorStops[f],"; stop: ",f,"; in: ",e])}s.fillStyle=a,s.fillRect(0,0,n.width,n.height)}else if(o.type==="ellipse"){var h=t.createElement("canvas"),p=h.getContext("2d"),d=Math.max(o.rx,o.ry),v=d*2,m;h.width=h.height=v,a=p.createRadialGradient(o.rx,o.ry,0,o.rx,o.ry,d);for(f=0,l=o.colorStops.length;f<l;f+=1)try{a.addColorStop(o.colorStops[f].stop,o.colorStops[f].color)}catch(c){u(["failed to add color stop: ",c,"; tried to add: ",o.colorStops[f],"; stop: ",f,"; in: ",e])}p.fillStyle=a,p.fillRect(0,0,v,v),s.fillStyle=o.colorStops[f-1].color,s.fillRect(0,0,i.width,i.height),s.drawImage(h,o.cx-o.rx,o.cy-o.ry,2*o.rx,2*o.ry)}return i},r.Generate.ListAlpha=function(e){var t="",n;do n=e%26,t=String.fromCharCode(n+64)+t,e/=26;while(e*26>26);return t},r.Generate.ListRoman=function(e){var t=["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"],n=[1e3,900,500,400,100,90,50,40,10,9,5,4,1],r="",i,s=t.length;if(e<=0||e>=4e3)return e;for(i=0;i<s;i+=1)while(e>=n[i])e-=n[i],r+=t[i];return r}}(),r.Parse=function(i,s){function y(){return Math.max(Math.max(c.body.scrollWidth,c.documentElement.scrollWidth),Math.max(c.body.offsetWidth,c.documentElement.offsetWidth),Math.max(c.body.clientWidth,c.documentElement.clientWidth))}function b(){return Math.max(Math.max(c.body.scrollHeight,c.documentElement.scrollHeight),Math.max(c.body.offsetHeight,c.documentElement.offsetHeight),Math.max(c.body.clientHeight,c.documentElement.clientHeight))}function w(e,t){var n=parseInt(v(e,t),10);return isNaN(n)?0:n}function E(e,t,n,r,i,s){s!=="transparent"&&(e.setVariable("fillStyle",s),e.fillRect(t,n,r,i),a+=1)}function S(e,t){switch(t){case"lowercase":return e.toLowerCase();case"capitalize":return e.replace(/(^|\s|:|-|\(|\))([a-z])/g,function(e,t,n){if(e.length>0)return t+n.toUpperCase()});case"uppercase":return e.toUpperCase();default:return e}}function x(e){return/^(normal|none|0px)$/.test(e)}function T(e,t,n,i){e!==null&&r.Util.trimText(e).length>0&&(i.fillText(e,t,n),a+=1)}function N(e,t,n,i){var s=!1,o=v(t,"fontWeight"),u=v(t,"fontFamily"),a=v(t,"fontSize");switch(parseInt(o,10)){case 401:o="bold";break;case 400:o="normal"}e.setVariable("fillStyle",i),e.setVariable("font",[v(t,"fontStyle"),v(t,"fontVariant"),o,a,u].join(" ")),e.setVariable("textAlign",s?"right":"left");if(n!=="none")return r.Util.Font(u,a,c)}function C(e,t,n,r,i){switch(t){case"underline":E(e,n.left,Math.round(n.top+r.baseline+r.lineWidth),n.width,1,i);break;case"overline":E(e,n.left,Math.round(n.top),n.width,1,i);break;case"line-through":E(e,n.left,Math.ceil(n.top+r.middle+r.lineWidth),n.width,1,i)}}function k(e,t,n,i){var s;if(h.rangeBounds){if(n!=="none"||r.Util.trimText(t).length!==0)s=L(t,e.node,e.textOffset);e.textOffset+=t.length}else if(e.node&&typeof e.node.nodeValue=="string"){var o=i?e.node.splitText(t.length):null;s=A(e.node),e.node=o}return s}function L(e,t,n){var r=c.createRange();return r.setStart(t,n),r.setEnd(t,n+e.length),r.getBoundingClientRect()}function A(e){var t=e.parentNode,n=c.createElement("wrapper"),i=e.cloneNode(!0);n.appendChild(e.cloneNode(!0)),t.replaceChild(n,e);var s=r.Util.Bounds(n);return t.replaceChild(i,n),s}function O(e,t,n){var i=n.ctx,o=v(e,"color"),u=v(e,"textDecoration"),a=v(e,"textAlign"),f,l,c={node:t,textOffset:0};r.Util.trimText(t.nodeValue).length>0&&(t.nodeValue=S(t.nodeValue,v(e,"textTransform")),a=a.replace(["-webkit-auto"],["auto"]),l=!s.letterRendering&&/^(left|right|justify|auto)$/.test(a)&&x(v(e,"letterSpacing"))?t.nodeValue.split(/(\b| )/):t.nodeValue.split(""),f=N(i,e,u,o),s.chinese&&l.forEach(function(e,t){/.*[\u4E00-\u9FA5].*$/.test(e)&&(e=e.split(""),e.unshift(t,1),l.splice.apply(l,e))}),l.forEach(function(e,t){var n=k(c,e,u,t<l.length-1);n&&(T(e,n.left,n.bottom,i),C(i,u,n,f,o))}))}function M(e,t){var n=c.createElement("boundelement"),i,s;return n.style.display="inline",i=e.style.listStyleType,e.style.listStyleType="none",n.appendChild(c.createTextNode(t)),e.insertBefore(n,e.firstChild),s=r.Util.Bounds(n),e.removeChild(n),e.style.listStyleType=i,s}function _(e){var t=-1,n=1,r=e.parentNode.childNodes;if(e.parentNode){while(r[++t]!==e)r[t].nodeType===1&&n++;return n}return-1}function D(e,t){var n=_(e),i;switch(t){case"decimal":i=n;break;case"decimal-leading-zero":i=n.toString().length===1?n="0"+n.toString():n.toString();break;case"upper-roman":i=r.Generate.ListRoman(n);break;case"lower-roman":i=r.Generate.ListRoman(n).toLowerCase();break;case"lower-alpha":i=r.Generate.ListAlpha(n).toLowerCase();break;case"upper-alpha":i=r.Generate.ListAlpha(n)}return i+=". ",i}function P(e,t,n){var r,i,s=t.ctx,o=v(e,"listStyleType"),u;if(/^(decimal|decimal-leading-zero|upper-alpha|upper-latin|upper-roman|lower-alpha|lower-greek|lower-latin|lower-roman)$/i.test(o)){i=D(e,o),u=M(e,i),N(s,e,"none",v(e,"color"));if(v(e,"listStylePosition")!=="inside")return;s.setVariable("textAlign","left"),r=n.left,T(i,r,u.bottom,s)}}function H(e){var t=i[e];return t&&t.succeeded===!0?t.img:!1}function B(e,t){var n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.left+e.width,t.left+t.width),s=Math.min(e.top+e.height,t.top+t.height);return{left:n,top:r,width:i-n,height:s-r}}function j(e,t){var n;return t?e!=="auto"?(n=f(e),t.children.push(n),n):t:(n=f(0),n)}function F(e,t,n,r,i){var s=w(t,"paddingLeft"),o=w(t,"paddingTop"),u=w(t,"paddingRight"),a=w(t,"paddingBottom");G(e,n,0,0,n.width,n.height,r.left+s+i[3].width,r.top+o+i[0].width,r.width-(i[1].width+i[3].width+s+u),r.height-(i[0].width+i[2].width+o+a))}function I(e){return["Top","Right","Bottom","Left"].map(function(t){return{width:w(e,"border"+t+"Width"),color:v(e,"border"+t+"Color")}})}function q(e){return["TopLeft","TopRight","BottomRight","BottomLeft"].map(function(t){return v(e,"border"+t+"Radius")})}function U(e,t,n,r){var i=function(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}};return{start:e,startControl:t,endControl:n,end:r,subdivide:function(s){var o=i(e,t,s),u=i(t,n,s),a=i(n,r,s),f=i(o,u,s),l=i(u,a,s),c=i(f,l,s);return[U(e,o,f,c),U(c,l,a,r)]},curveTo:function(e){e.push(["bezierCurve",t.x,t.y,n.x,n.y,r.x,r.y])},curveToReversed:function(r){r.push(["bezierCurve",n.x,n.y,t.x,t.y,e.x,e.y])}}}function z(e,t,n,r,i,s,o){t[0]>0||t[1]>0?(e.push(["line",r[0].start.x,r[0].start.y]),r[0].curveTo(e),r[1].curveTo(e)):e.push(["line",s,o]),(n[0]>0||n[1]>0)&&e.push(["line",i[0].start.x,i[0].start.y])}function W(e,t,n,r,i,s,o){var u=[];return t[0]>0||t[1]>0?(u.push(["line",r[1].start.x,r[1].start.y]),r[1].curveTo(u)):u.push(["line",e.c1[0],e.c1[1]]),n[0]>0||n[1]>0?(u.push(["line",s[0].start.x,s[0].start.y]),s[0].curveTo(u),u.push(["line",o[0].end.x,o[0].end.y]),o[0].curveToReversed(u)):(u.push(["line",e.c2[0],e.c2[1]]),u.push(["line",e.c3[0],e.c3[1]])),t[0]>0||t[1]>0?(u.push(["line",i[1].end.x,i[1].end.y]),i[1].curveToReversed(u)):u.push(["line",e.c4[0],e.c4[1]]),u}function X(e,t,n){var r=e.left,i=e.top,s=e.width,o=e.height,u=t[0][0],a=t[0][1],f=t[1][0],l=t[1][1],c=t[2][0],h=t[2][1],p=t[3][0],d=t[3][1],v=s-f,m=o-c,g=s-h,y=o-d;return{topLeftOuter:R(r,i,u,a).topLeft.subdivide(.5),topLeftInner:R(r+n[3].width,i+n[0].width,Math.max(0,u-n[3].width),Math.max(0,a-n[0].width)).topLeft.subdivide(.5),topRightOuter:R(r+v,i,f,l).topRight.subdivide(.5),topRightInner:R(r+Math.min(v,s+n[3].width),i+n[0].width,v>s+n[3].width?0:f-n[3].width,l-n[0].width).topRight.subdivide(.5),bottomRightOuter:R(r+g,i+m,h,c).bottomRight.subdivide(.5),bottomRightInner:R(r+Math.min(g,s+n[3].width),i+Math.min(m,o+n[0].width),Math.max(0,h-n[1].width),Math.max(0,c-n[2].width)).bottomRight.subdivide(.5),bottomLeftOuter:R(r,i+y,p,d).bottomLeft.subdivide(.5),bottomLeftInner:R(r+n[3].width,i+y,Math.max(0,p-n[3].width),Math.max(0,d-n[2].width)).bottomLeft.subdivide(.5)}}function V(e,t,n,r,i){var s=v(e,"backgroundClip"),o=[];switch(s){case"content-box":case"padding-box":z(o,r[0],r[1],t.topLeftInner,t.topRightInner,i.left+n[3].width,i.top+n[0].width),z(o,r[1],r[2],t.topRightInner,t.bottomRightInner,i.left+i.width-n[1].width,i.top+n[0].width),z(o,r[2],r[3],t.bottomRightInner,t.bottomLeftInner,i.left+i.width-n[1].width,i.top+i.height-n[2].width),z(o,r[3],r[0],t.bottomLeftInner,t.topLeftInner,i.left+n[3].width,i.top+i.height-n[2].width);break;default:z(o,r[0],r[1],t.topLeftOuter,t.topRightOuter,i.left,i.top),z(o,r[1],r[2],t.topRightOuter,t.bottomRightOuter,i.left+i.width,i.top),z(o,r[2],r[3],t.bottomRightOuter,t.bottomLeftOuter,i.left+i.width,i.top+i.height),z(o,r[3],r[0],t.bottomLeftOuter,t.topLeftOuter,i.left,i.top+i.height)}return o}function $(e,t,n){var r=t.left,i=t.top,s=t.width,o=t.height,u,a,f,l,c,h,p=q(e),d=X(t,p,n),v={clip:V(e,d,n,p,t),borders:[]};for(u=0;u<4;u++)if(n[u].width>0){a=r,f=i,l=s,c=o-n[2].width;switch(u){case 0:c=n[0].width,h=W({c1:[a,f],c2:[a+l,f],c3:[a+l-n[1].width,f+c],c4:[a+n[3].width,f+c]},p[0],p[1],d.topLeftOuter,d.topLeftInner,d.topRightOuter,d.topRightInner);break;case 1:a=r+s-n[1].width,l=n[1].width,h=W({c1:[a+l,f],c2:[a+l,f+c+n[2].width],c3:[a,f+c],c4:[a,f+n[0].width]},p[1],p[2],d.topRightOuter,d.topRightInner,d.bottomRightOuter,d.bottomRightInner);break;case 2:f=f+o-n[2].width,c=n[2].width,h=W({c1:[a+l,f+c],c2:[a,f+c],c3:[a+n[3].width,f],c4:[a+l-n[2].width,f]},p[2],p[3],d.bottomRightOuter,d.bottomRightInner,d.bottomLeftOuter,d.bottomLeftInner);break;case 3:l=n[3].width,h=W({c1:[a,f+c+n[2].width],c2:[a,f],c3:[a+l,f+n[0].width],c4:[a+l,f+c]},p[3],p[0],d.bottomLeftOuter,d.bottomLeftInner,d.topLeftOuter,d.topLeftInner)}v.borders.push({args:h,color:n[u].color})}return v}function J(e,t){var n=e.drawShape();return t.forEach(function(e,t){n[t===0?"moveTo":e[0]+"To"].apply(null,e.slice(1))}),n}function K(e,t,n){n!=="transparent"&&(e.setVariable("fillStyle",n),J(e,t),e.fill(),a+=1)}function Q(e,t,n){var r=c.createElement("valuewrap"),i=["lineHeight","textAlign","fontFamily","color","fontSize","paddingLeft","paddingTop","width","height","border","borderLeftWidth","borderTopWidth"],s,o;i.forEach(function(t){try{r.style[t]=v(e,t)}catch(n){u("html2canvas: Parse: Exception caught in renderFormValue: "+n.message)}}),r.style.borderColor="black",r.style.borderStyle="solid",r.style.display="block",r.style.position="absolute";if(/^(submit|reset|button|text|password)$/.test(e.type)||e.nodeName==="SELECT")r.style.lineHeight=v(e,"height");r.style.top=t.top+"px",r.style.left=t.left+"px",s=e.nodeName==="SELECT"?(e.options[e.selectedIndex]||0).text:e.value,s||(s=e.placeholder),o=c.createTextNode(s),r.appendChild(o),d.appendChild(r),O(e,o,n),d.removeChild(r)}function G(e){e.drawImage.apply(e,Array.prototype.slice.call(arguments,1)),a+=1}function Y(n,i){var s=e.getComputedStyle(n,i);if(!s||!s.content||s.content==="none"||s.content==="-moz-alt-content")return;var o=s.content+"",u=o.substr(0,1);u===o.substr(o.length-1)&&u.match(/'|"/)&&(o=o.substr(1,o.length-2));var a=o.substr(0,3)==="url",f=t.createElement(a?"img":"span");return f.className=m+"-before "+m+"-after",Object.keys(s).filter(Z).forEach(function(e){f.style[e]=s[e]}),a?f.src=r.Util.parseBackgroundImage(o)[0].args[0]:f.innerHTML=o,f}function Z(t){return isNaN(e.parseInt(t,10))}function et(e,t){var n=Y(e,":before"),r=Y(e,":after");if(!n&&!r)return;n&&(e.className+=" "+m+"-before",e.parentNode.insertBefore(n,e),ht(n,t,!0),e.parentNode.removeChild(n),e.className=e.className.replace(m+"-before","").trim()),r&&(e.className+=" "+m+"-after",e.appendChild(r),ht(r,t,!0),e.removeChild(r),e.className=e.className.replace(m+"-after","").trim())}function tt(e,t,n,r){var i=Math.round(r.left+n.left),s=Math.round(r.top+n.top);e.createPattern(t),e.translate(i,s),e.fill(),e.translate(-i,-s)}function nt(e,t,n,r,i,s,o,u){var a=[];a.push(["line",Math.round(i),Math.round(s)]),a.push(["line",Math.round(i+o),Math.round(s)]),a.push(["line",Math.round(i+o),Math.round(u+s)]),a.push(["line",Math.round(i),Math.round(u+s)]),J(e,a),e.save(),e.clip(),tt(e,t,n,r),e.restore()}function rt(e,t,n){E(e,t.left,t.top,t.width,t.height,n)}function it(e,t,n,i,s){var o=r.Util.BackgroundSize(e,t,i,s),u=r.Util.BackgroundPosition(e,t,i,s,o),a=v(e,"backgroundRepeat").split(",").map(function(e){return e.trim()});i=ot(i,o),a=a[s]||a[0];switch(a){case"repeat-x":nt(n,i,u,t,t.left,t.top+u.top,99999,i.height);break;case"repeat-y":nt(n,i,u,t,t.left+u.left,t.top,i.width,99999);break;case"no-repeat":nt(n,i,u,t,t.left+u.left,t.top+u.top,i.width,i.height);break;default:tt(n,i,u,{top:t.top,left:t.left,width:i.width,height:i.height})}}function st(e,t,n){var i=v(e,"backgroundImage"),s=r.Util.parseBackgroundImage(i),o,a=s.length;while(a--){i=s[a];if(!i.args||i.args.length===0)continue;var f=i.method==="url"?i.args[0]:i.value;o=H(f),o?it(e,t,n,o,a):u("html2canvas: Error loading background:",i)}}function ot(e,t){if(e.width===t.width&&e.height===t.height)return e;var n,r=c.createElement("canvas");return r.width=t.width,r.height=t.height,n=r.getContext("2d"),G(n,e,0,0,e.width,e.height,0,0,t.width,t.height),r}function ut(e,t,n){var r=v(t,"opacity")*(n?n.opacity:1);return e.setVariable("globalAlpha",r),r}function at(e,t,n){var i=l(t?n.width:y(),t?n.height:b()),o={ctx:i,zIndex:j(v(e,"zIndex"),t?t.zIndex:null),opacity:ut(i,e,t),cssPosition:v(e,"position"),borders:I(e),clip:t&&t.clip?r.Util.Extend({},t.clip):null};return s.useOverflow===!0&&/(hidden|scroll|auto)/.test(v(e,"overflow"))===!0&&/(BODY)/i.test(e.nodeName)===!1&&(o.clip=o.clip?B(o.clip,n):n),o.zIndex.children.push(o),o}function ft(e,t,n){var r={left:t.left+e[3].width,top:t.top+e[0].width,width:t.width-(e[1].width+e[3].width),height:t.height-(e[0].width+e[2].width)};return n&&(r=B(r,n)),r}function lt(e,t,n){var i=r.Util.Bounds(e),s,o=p.test(e.nodeName)?"#efefef":v(e,"backgroundColor"),a=at(e,t,i),f=a.borders,l=a.ctx,c=ft(f,i,a.clip),h=$(e,i,f);J(l,h.clip),l.save(),l.clip(),c.height>0&&c.width>0&&(rt(l,i,o),st(e,c,l)),l.restore(),h.borders.forEach(function(e){K(l,e.args,e.color)}),n||et(e,a);switch(e.nodeName){case"IMG":(s=H(e.getAttribute("src")))?F(l,e,s,i,f):u("html2canvas: Error loading <img>:"+e.getAttribute("src"));break;case"INPUT":/^(text|url|email|submit|button|reset)$/.test(e.type)&&(e.value||e.placeholder).length>0&&Q(e,i,a);break;case"TEXTAREA":(e.value||e.placeholder||"").length>0&&Q(e,i,a);break;case"SELECT":(e.options||e.placeholder||"").length>0&&Q(e,i,a);break;case"LI":P(e,a,c);break;case"CANVAS":F(l,e,e,i,f)}return a}function ct(e){return v(e,"display")!=="none"&&v(e,"visibility")!=="hidden"&&!e.hasAttribute("data-html2canvas-ignore")}function ht(e,t,n){ct(e)&&(t=lt(e,t,n)||t,p.test(e.nodeName)||r.Util.Children(e).forEach(function(r){r.nodeType===1?ht(r,t,n):r.nodeType===3&&O(e,r,t)}))}function pt(e,t){function u(e){var t=r.Util.Children(e),n=t.length,i,s,a,f,l;for(l=0;l<n;l+=1){f=t[l];if(f.nodeType===3)o+=f.nodeValue.replace(/</g,"&lt;").replace(/>/g,"&gt;");else if(f.nodeType===1&&!/^(script|meta|title)$/.test(f.nodeName.toLowerCase())){o+="<"+f.nodeName.toLowerCase();if(f.hasAttributes()){i=f.attributes,a=i.length;for(s=0;s<a;s+=1)o+=" "+i[s].name+'="'+i[s].value+'"'}o+=">",u(f),o+="</"+f.nodeName.toLowerCase()+">"}}}var n=new Image,i=y(),s=b(),o="";u(e),n.src=["data:image/svg+xml,","<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='"+i+"' height='"+s+"'>","<foreignObject width='"+i+"' height='"+s+"'>","<html xmlns='http://www.w3.org/1999/xhtml' style='margin:0;'>",o.replace(/\#/g,"%23"),"</html>","</foreignObject>","</svg>"].join(""),n.onload=function(){t.svgRender=n}}function dt(){var e=lt(o,null);return h.svgRendering&&pt(t.documentElement,e),Array.prototype.slice.call(o.children,0).forEach(function(t){ht(t,e)}),e.backgroundColor=v(t.documentElement,"backgroundColor"),d.removeChild(g),e}e.scroll(0,0);var o=s.elements===n?t.body:s.elements[0],a=0,c=o.ownerDocument,h=r.Util.Support(s,c),p=new RegExp("("+s.ignoreElements+")"),d=c.body,v=r.Util.getCSS,m="___html2canvas___pseudoelement",g=c.createElement("style");g.innerHTML="."+m+'-before:before { content: "" !important; display: none !important; }'+"."+m+'-after:after { content: "" !important; display: none !important; }',d.appendChild(g),i=i||{};var R=function(e){return function(t,n,r,i){var s=r*e,o=i*e,u=t+r,a=n+i;return{topLeft:U({x:t,y:a},{x:t,y:a-o},{x:u-s,y:n},{x:u,y:n}),topRight:U({x:t,y:n},{x:t+s,y:n},{x:u,y:a-o},{x:u,y:a}),bottomRight:U({x:u,y:n},{x:u,y:n+o},{x:t+s,y:a},{x:t,y:a}),bottomLeft:U({x:u,y:a},{x:u-s,y:a},{x:t,y:n+o},{x:t,y:n})}}}(4*((Math.sqrt(2)-1)/3));return dt()},r.Preload=function(i){function y(e){v.href=e,v.href=v.href;var t=v.protocol+v.host;return t===o}function b(){u("html2canvas: start: images: "+s.numLoaded+" / "+s.numTotal+" (failed: "+s.numFailed+")"),!s.firstRun&&s.numLoaded>=s.numTotal&&(u("Finished loading images: # "+s.numTotal+" (failed: "+s.numFailed+")"),typeof i.complete=="function"&&i.complete(s))}function w(t,r,o){var u,a=i.proxy,f;v.href=t,t=v.href,u="html2canvas_"+l++,o.callbackname=u,a.indexOf("?")>-1?a+="&":a+="?",a+="url="+encodeURIComponent(t)+"&callback="+u,f=h.createElement("script"),e[u]=function(t){t.substring(0,6)==="error:"?(o.succeeded=!1,s.numLoaded++,s.numFailed++,b()):(k(r,o),r.src=t),e[u]=n;try{delete e[u]}catch(i){}f.parentNode.removeChild(f),f=null,delete o.script,delete o.callbackname},f.setAttribute("type","text/javascript"),f.setAttribute("src",a),o.script=f,e.document.body.appendChild(f)}function E(t,n){var i=e.getComputedStyle(t,n),s=i.content;s.substr(0,3)==="url"&&a.loadImage(r.Util.parseBackgroundImage(s)[0].args[0]),N(i.backgroundImage,t)}function S(e){E(e,":before"),E(e,":after")}function x(e,t){var i=r.Generate.Gradient(e,t);i!==n&&(s[e]={img:i,succeeded:!0},s.numTotal++,s.numLoaded++,b())}function T(e){return e&&e.method&&e.args&&e.args.length>0}function N(e,t){var i;r.Util.parseBackgroundImage(e).filter(T).forEach(function(e){e.method==="url"?a.loadImage(e.args[0]):e.method.match(/\-?gradient$/)&&(i===n&&(i=r.Util.Bounds(t)),x(e.value,i))})}function C(e){var t=!1;try{r.Util.Children(e).forEach(function(e){C(e)})}catch(i){}try{t=e.nodeType}catch(s){t=!1,u("html2canvas: failed to access some element's nodeType - Exception: "+s.message)}if(t===1||t===n){S(e);try{N(r.Util.getCSS(e,"backgroundImage"),e)}catch(i){u("html2canvas: failed to get background-image - Exception: "+i.message)}N(e)}}function k(t,r){t.onload=function(){r.timer!==n&&e.clearTimeout(r.timer),s.numLoaded++,r.succeeded=!0,t.onerror=t.onload=null,b()},t.onerror=function(){if(t.crossOrigin==="anonymous"){e.clearTimeout(r.timer);if(i.proxy){var n=t.src;t=new Image,r.img=t,t.src=n,w(t.src,t,r);return}}s.numLoaded++,s.numFailed++,r.succeeded=!1,t.onerror=t.onload=null,b()}}var s={numLoaded:0,numFailed:0,numTotal:0,cleanupDone:!1},o,a,f,l=0,c=i.elements[0]||t.body,h=c.ownerDocument,p=h.images,d=p.length,v=h.createElement("a"),m=function(e){return e.crossOrigin!==n}(new Image),g;v.href=e.location.href,o=v.protocol+v.host,a={loadImage:function(t){var r,o;t&&s[t]===n&&(r=new Image,t.match(/data:image\/.*;base64,/i)?(r.src=t.replace(/url\(['"]{0,}|['"]{0,}\)$/ig,""),o=s[t]={img:r},s.numTotal++,k(r,o)):y(t)||i.allowTaint===!0?(o=s[t]={img:r},s.numTotal++,k(r,o),r.src=t):m&&!i.allowTaint&&i.useCORS?(r.crossOrigin="anonymous",o=s[t]={img:r},s.numTotal++,k(r,o),r.src=t,r.customComplete=function(){this.img.complete?this.img.onerror():this.timer=e.setTimeout(this.img.customComplete,100)}.bind(o),r.customComplete()):i.proxy&&(o=s[t]={img:r},s.numTotal++,w(t,r,o)))},cleanupDOM:function(r){var o,a;if(!s.cleanupDone){r&&typeof r=="string"?u("html2canvas: Cleanup because: "+r):u("html2canvas: Cleanup after timeout: "+i.timeout+" ms.");for(a in s)if(s.hasOwnProperty(a)){o=s[a];if(typeof o=="object"&&o.callbackname&&o.succeeded===n){e[o.callbackname]=n;try{delete e[o.callbackname]}catch(f){}o.script&&o.script.parentNode&&(o.script.setAttribute("src","about:blank"),o.script.parentNode.removeChild(o.script)),s.numLoaded++,s.numFailed++,u("html2canvas: Cleaned up failed img: '"+a+"' Steps: "+s.numLoaded+" / "+s.numTotal)}}e.stop!==n?e.stop():t.execCommand!==n&&t.execCommand("Stop",!1),t.close!==n&&t.close(),s.cleanupDone=!0,(!r||typeof r!="string")&&b()}},renderingDone:function(){g&&e.clearTimeout(g)}},i.timeout>0&&(g=e.setTimeout(a.cleanupDOM,i.timeout)),u("html2canvas: Preload starts: finding background-images"),s.firstRun=!0,C(c),u("html2canvas: Preload: Finding images");for(f=0;f<d;f+=1)a.loadImage(p[f].getAttribute("src"));return s.firstRun=!1,u("html2canvas: Preload: Done."),s.numTotal===s.numLoaded&&b(),a},r.Renderer=function(e,i){function s(e){var t=[],n=function(e){var r=[],i=[];e.children.forEach(function(e){e.children&&e.children.length>0?(r.push(e),i.push(e.zindex)):t.push(e)}),i.sort(function(e,t){return e-t}),i.forEach(function(e){var t;r.some(function(n,r){return t=r,n.zindex===e}),n(r.splice(t,1)[0])})};return n(e.zIndex),t}function o(e){var t;if(typeof i.renderer=="string"&&r.Renderer[e]!==n)t=r.Renderer[e](i);else{if(typeof e!="function")throw new Error("Unknown renderer");t=e(i)}if(typeof t!="function")throw new Error("Invalid renderer defined");return t}return o(i.renderer)(e,i,t,s(e),r)},r.Util.Support=function(e,t){function r(){var e=new Image,r=t.createElement("canvas"),i=r.getContext===n?!1:r.getContext("2d");if(i===!1)return!1;r.width=r.height=10,e.src=["data:image/svg+xml,","<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10'>","<foreignObject width='10' height='10'>","<div xmlns='http://www.w3.org/1999/xhtml' style='width:10;height:10;'>","sup","</div>","</foreignObject>","</svg>"].join("");try{i.drawImage(e,0,0),r.toDataURL()}catch(s){return!1}return u("html2canvas: Parse: SVG powered rendering available"),!0}function i(){var e,n,r,i,s=!1;return t.createRange&&(e=t.createRange(),e.getBoundingClientRect&&(n=t.createElement("boundtest"),n.style.height="123px",n.style.display="block",t.body.appendChild(n),e.selectNode(n),r=e.getBoundingClientRect(),i=r.height,i===123&&(s=!0),t.body.removeChild(n))),s}return{rangeBounds:i(),svgRendering:e.svgRendering&&r()}},e.html2canvas=function(t,n){var i,s,o={logging:!1,elements:t,background:"#fff",proxy:null,timeout:0,useCORS:!1,allowTaint:!1,svgRendering:!1,ignoreElements:"IFRAME|OBJECT|PARAM",useOverflow:!0,letterRendering:!1,chinese:!1,width:null,height:null,taintTest:!0,renderer:"Canvas"};return o=r.Util.Extend(n,o),r.logging=o.logging,o.complete=function(e){if(typeof o.onpreloaded=="function"&&o.onpreloaded(e)===!1)return;i=r.Parse(e,o);if(typeof o.onparsed=="function"&&o.onparsed(i)===!1)return;s=r.Renderer(i,o),typeof o.onrendered=="function"&&o.onrendered(s)},e.setTimeout(function(){r.Preload(o)},0),{render:function(e,t){return r.Renderer(e,r.Util.Extend(t,o))},parse:function(e,t){return r.Parse(e,r.Util.Extend(t,o))},preload:function(e){return r.Preload(r.Util.Extend(e,o))},log:u}},e.html2canvas.log=u,e.html2canvas.Renderer={Canvas:n},r.Renderer.Canvas=function(e){function f(e,t){e.beginPath(),t.forEach(function(t){e[t.name].apply(e,t.arguments)}),e.closePath()}function l(e){if(i.indexOf(e.arguments[0].src)===-1){o.drawImage(e.arguments[0],0,0);try{o.getImageData(0,0,1,1)}catch(t){return s=r.createElement("canvas"),o=s.getContext("2d"),!1}i.push(e.arguments[0].src)}return!0}function c(e){return e==="transparent"||e==="rgba(0, 0, 0, 0)"}function h(t,n){switch(n.type){case"variable":t[n.name]=n.arguments;break;case"function":if(n.name==="createPattern"){if(n.arguments[0].width>0&&n.arguments[0].height>0)try{t.fillStyle=t.createPattern(n.arguments[0],"repeat")}catch(r){u("html2canvas: Renderer: Error creating pattern",r.message)}}else n.name==="drawShape"?f(t,n.arguments):n.name==="drawImage"?n.arguments[8]>0&&n.arguments[7]>0&&(!e.taintTest||e.taintTest&&l(n))&&t.drawImage.apply(t,n.arguments):t[n.name].apply(t,n.arguments)}}e=e||{};var r=t,i=[],s=t.createElement("canvas"),o=s.getContext("2d"),a=e.canvas||r.createElement("canvas");return function(e,t,r,i,s){var o=a.getContext("2d"),f,l,p,d,v,m;a.width=a.style.width=t.width||e.ctx.width,a.height=a.style.height=t.height||e.ctx.height,m=o.fillStyle,o.fillStyle=c(e.backgroundColor)&&t.background!==n?t.background:e.backgroundColor,o.fillRect(0,0,a.width,a.height),o.fillStyle=m;if(t.svgRendering&&e.svgRender!==n)o.drawImage(e.svgRender,0,0);else for(l=0,p=i.length;l<p;l+=1)f=i.splice(0,1)[0],f.canvasPosition=f.canvasPosition||{},o.textBaseline="bottom",f.clip&&(o.save(),o.beginPath(),o.rect(f.clip.left,f.clip.top,f.clip.width,f.clip.height),o.clip()),f.ctx.storage&&f.ctx.storage.forEach(h.bind(null,o)),f.clip&&o.restore();return u("html2canvas: Renderer: Canvas renderer done - returning canvas obj"),p=t.elements.length,p===1&&typeof t.elements[0]=="object"&&t.elements[0].nodeName!=="BODY"?(v=s.Util.Bounds(t.elements[0]),d=r.createElement("canvas"),d.width=v.width,d.height=v.height,o=d.getContext("2d"),o.drawImage(a,v.left,v.top,v.width,v.height,0,0,v.width,v.height),a=null,d):a}}})(window,document);
10  documentation.html
... ...
@@ -1,16 +1,16 @@
1 1
 <!doctype html>
2 2
 <html ng-app="site">
3 3
   <head>
4  
-    <title>html2canvas</title>
  4
+    <title ng-bind="title">html2canvas</title>
  5
+    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
  6
+    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.min.js"></script>
  7
+    <script src="/site/site.js"></script>
5 8
 
  9
+    <base href="" />
6 10
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
7 11
     <meta name="description" content="Screenshot creation with JavaScript">
8 12
     <meta name="author" content="Niklas von Hertzen">
9 13
 
10  
-    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
11  
-    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.min.js"></script>
12  
-    <script src="/site/site.js"></script>
13  
-
14 14
     <link href="/site/css/bootstrap.min.css" rel="stylesheet">
15 15
   </head>
16 16
   <body>
21  examples.html
... ...
@@ -0,0 +1,21 @@
  1
+<!doctype html>
  2
+<html ng-app="site">
  3
+  <head>
  4
+    <title ng-bind="title">html2canvas</title>
  5
+    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
  6
+    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.min.js"></script>
  7
+    <script src="/site/site.js"></script>
  8
+
  9
+    <base href="" />
  10
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11
+    <meta name="description" content="Screenshot creation with JavaScript">
  12
+    <meta name="author" content="Niklas von Hertzen">
  13
+
  14
+    <link href="/site/css/bootstrap.min.css" rel="stylesheet">
  15
+  </head>
  16
+  <body>
  17
+    <header ng-include="'site/header.html'"></header>
  18
+    <div class="container" ng-view></div>
  19
+    <footer ng-include="'site/footer.html'"></footer>
  20
+  </body>
  21
+</html>
21  faq.html
... ...
@@ -0,0 +1,21 @@
  1
+<!doctype html>
  2
+<html ng-app="site">
  3
+  <head>
  4
+    <title ng-bind="title">html2canvas</title>
  5
+    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
  6
+    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.min.js"></script>
  7
+    <script src="/site/site.js"></script>
  8
+
  9
+    <base href="" />
  10
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11
+    <meta name="description" content="Screenshot creation with JavaScript">
  12
+    <meta name="author" content="Niklas von Hertzen">
  13
+
  14
+    <link href="/site/css/bootstrap.min.css" rel="stylesheet">
  15
+  </head>
  16
+  <body>
  17
+    <header ng-include="'site/header.html'"></header>
  18
+    <div class="container" ng-view></div>
  19
+    <footer ng-include="'site/footer.html'"></footer>
  20
+  </body>
  21
+</html>
2  index.html
... ...
@@ -1,7 +1,7 @@
1 1
 <!doctype html>
2 2
 <html ng-app="site">
3 3
   <head>
4  
-    <title>html2canvas</title>
  4
+    <title ng-bind="title">html2canvas</title>
5 5
     <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
6 6
     <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.min.js"></script>
7 7
     <script src="/site/site.js"></script>
27  pages.js
... ...
@@ -0,0 +1,27 @@
  1
+var fs = require('fs'),
  2
+util = require('util');
  3
+
  4
+var copy = function (src, dst, cb) {
  5
+  function copy(err) {
  6
+    var is
  7
+    , os
  8
+    ;
  9
+
  10
+
  11
+    fs.stat(src, function (err) {
  12
+      if (err) {
  13
+        return cb(err);
  14
+      }
  15
+      is = fs.createReadStream(src);
  16
+      os = fs.createWriteStream(dst);
  17
+      util.pump(is, os, cb);
  18
+    });
  19
+  }
  20
+
  21
+  fs.stat(dst, copy);
  22
+};
  23
+
  24
+copy("index.html", "documentation.html", function() {});
  25
+copy("index.html", "screenshots.html", function() {});
  26
+copy("index.html", "examples.html", function() {});
  27
+copy("index.html", "faq.html", function() {});
2  screenshots.html
... ...
@@ -1,7 +1,7 @@
1 1
 <!doctype html>
2 2
 <html ng-app="site">
3 3
   <head>
4  
-    <title>html2canvas</title>
  4
+    <title ng-bind="title">html2canvas</title>
5 5
     <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
6 6
     <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.min.js"></script>
7 7
     <script src="/site/site.js"></script>
8  site/console.js
@@ -4,8 +4,6 @@ var message,
4 4
 timeoutTimer,
5 5
 timer;
6 6
 
7  
-var proxyUrl = "http://html2canvas.appspot.com/query";
8  
-
9 7
 function addRow(table,field,val){
10 8
   var tr = $('<tr />').appendTo( $(table));
11 9
   tr.append($('<td />').css('font-weight','bold').text(field)).append($('<td />').text(val));
@@ -82,11 +80,9 @@ $(function(){
82 80
         url:urlParts.href
83 81
 
84 82
       },
85  
-      url: proxyUrl,
  83
+      url: "http://html2canvas.appspot.com/query",
86 84
       dataType: "jsonp",
87 85
       success: function(html){
88  
-
89  
-
90 86
         iframe = document.createElement('iframe');
91 87
         $(iframe).css({
92 88
           'visibility':'hidden'
@@ -106,9 +102,7 @@ $(function(){
106 102
         }
107 103
 
108 104
         d.write(html);
109  
-
110 105
         d.close();
111  
-
112 106
       }
113 107
 
114 108
 
267  site/documentation.html
... ...
@@ -1,124 +1,159 @@
1 1
 <div class="row-fluid">
2  
-    <div class="span3">
3  
-        <div class="well sidebar-nav">
4  
-            <ul class="nav nav-list" id="doc-nav"></ul>
5  
-        </div>
6  
-    </div>
7  
-    <div class="span9">
8  
-        <div class="hero-unit">
9  
-            <h1>Documentation</h1>
10  
-        </div>
11  
-        <div class="row-fluid" id="docs">
12  
-
13  
-            <h2>Introduction</h2>
14  
-            <p>
15  
-                Before you get started with the script, there are a few things that are good to know regarding the script and some of its limitations.
16  
-            </p>
17  
-
18  
-            <h3>How it works</h3>
19  
-            <p>
20  
-                The script traverses through the DOM of the page it is loaded on. It gathers information on all the elements there, which it then uses to build a representation of the page.
21  
-                In other words, it does not actually take a screenshot of the page, but builds a representation of it based on the properties it reads from the DOM.
22  
-            </p>
23  
-            <p>As a result, it is only able to render correctly properties that it understands, meaning there are many CSS properties which do not work.</p>
24  
-
25  
-
26  
-            <h3>Limitations</h3>
27  
-            <p>
28  
-                All the images that the script uses need to reside under the <a href="http://en.wikipedia.org/wiki/Same_origin_policy">same origin</a> for it to be able to read them without the assistance of a <a href="#">proxy</a>.
29  
-                Similarly, if you have other <code>canvas</code> elements on the page, which you have drawed cross-origin images on, they will become dirty and no longer readable by html2canvas.
30  
-            </p>
31  
-
32  
-            <p>
33  
-                Rendering external content through <code>frames</code> does not work either and will just result in a gray box.
34  
-            </p>
35  
-
36  
-            <p>
37  
-                The script uses the <code>canvas</code> element to draw the screenshot on. Most notably, Internet Explorer 8 and older do not support the <code>canvas</code> element, but with the use of <a href="http://flashcanvas.net/">FlashCanvas</a>, the script is able to create screenshots for browsers that do not natively support the <code>canvas</code> element.
38  
-            </p>
39  
-
40  
-            <p>The FlashCanvas requires the user to have Flash installed and enabled and limits the size of the screenshot to 2880x2880px. </p>
41  
-
42  
-
43  
-            <h2>Getting Started</h2>
44  
-
45  
-            <h3>Preload content</h3>
46  
-            <p>Before the script can actually parse the DOM, it needs to gather all the images on the page as well as generate any dynamically created graphics such as gradients.</p>
47  
-
48  
-            <p>To run the preload, call <code>Preload</code> function like this.</p>
49  
-            <pre class="prettyprint linenums">html2canvas.Preload( element,  options );</pre>
50  
-
51  
-            <h4>element</h4>
52  
-            <p>The <code>element</code> variable defines what element you will be rendering, defaults to <code>document.body</code>.</p>
53  
-
54  
-            <h4>options</h4>
55  
-            <p>The options variable is an <code>object</code> which accepts the following parameters:</p>
56  
-            <table class="table table-bordered table-striped">
57  
-                <thead>
58  
-                    <tr>
59  
-                        <th>option</th>
60  
-                        <th>description</th>
61  
-                        <th>default</th>
62  
-                    </tr>
63  
-                </thead>
64  
-                <tbody>
65  
-                    <tr>
66  
-                        <td><code>complete</code></td>
67  
-                        <td><i>function</i> - Callback function which is called when Preloading is complete.</td>
68  
-                        <td><code>undefined</code></td>
69  
-                    </tr>
70  
-                    <!--
71  
-                    <tr>
72  
-                        <td><code>flashcanvas</code></td>
73  
-                        <td><i>string</i> - Path to the <code>flashcanvas.js</code> file. The <code>flashcanvas.swf</code> file must reside in the same folder. If left undefined, it will not use flashcanvas when necessary.</td>
74  
-                        <td><code>undefined</code></td>
75  
-                    </tr>-->
76  
-                    <tr>
77  
-                        <td><code>logging</code></td>
78  
-                        <td><i>boolean</i> - Whether to log events in the console.</td>
79  
-                        <td><code>false</code></td>
80  
-                    </tr>
81  
-                    <tr>
82  
-                        <td><code>proxy</code></td>
83  
-                        <td><i>string</i> - Url to the proxy which is to be used for loading cross-origin images. If left empty, cross-origin images won't be loaded.</td>
84  
-                        <td><code>undefined</code></td>
85  
-                    </tr>
86  
-                    <tr>
87  
-                        <td><code>timeout</code></td>
88  
-                        <td><i>integer</i> - Timeout for loading images, in milliseconds. Setting it to 0 will result in no timeout. </td>
89  
-                        <td><code>0</code></td>
90  
-                    </tr>
91  
-
92  
-
93  
-                </tbody>
94  
-            </table>
95  
-
96  
-            <h4 style="font-style:italic;">returns</h4>
97  
-            <p>
98  
-                The preload function returns an object containing a few helper methods which can be used load more images or clean the DOM.
99  
-            </p>
100  
-
101  
-            <h3>Parse</h3>
102  
-            <p>To be continued...</p>
103  
-
104  
-        </div><!--/row-->
105  
-
106  
-    </div><!--/span-->
107  
-</div><!--/row-->
  2
+  <div class="span3">
  3
+    <ul class="nav nav-tabs nav-stacked" id="doc-nav"></ul>
  4
+  </div>
  5
+  <div class="span9">
  6
+    <div class="row-fluid" id="docs">
  7
+      <div class="page-header">
  8
+        <h1>Introduction</h1>
  9
+      </div>
  10
+      <p class="lead">
  11
+        Before you get started with the script, there are a few things that are good to know regarding the script and some of its limitations.
  12
+      </p>
  13
+
  14
+      <h3>How it works</h3>
  15
+      <p>
  16
+        The script traverses through the DOM of the page it is loaded on. It gathers information on all the elements there, which it then uses to build a representation of the page.
  17
+        In other words, it does not actually take a screenshot of the page, but builds a representation of it based on the properties it reads from the DOM.
  18
+      </p>
  19
+      <p>As a result, it is only able to render correctly properties that it understands, meaning there are many CSS properties which do not work.</p>
  20
+
  21
+
  22
+      <h3>Limitations</h3>
  23
+      <p>
  24
+        All the images that the script uses need to reside under the <a href="http://en.wikipedia.org/wiki/Same_origin_policy">same origin</a> for it to be able to read them without the assistance of a <a href="#">proxy</a>.
  25
+        Similarly, if you have other <code>canvas</code> elements on the page, which have been tainted with cross-origin content, they will become dirty and no longer readable by html2canvas.
  26
+      </p>
  27
+
  28
+      <p>
  29
+        The script doesn't render plugin content such as Flash or Java applets. It doesn't render <code>iframe</code> content either, unless the content resides under the same origin.
  30
+      </p>
  31
+
  32
+      <div class="page-header">
  33
+        <h1>Getting started</h1>
  34
+      </div>
  35
+
  36
+      <p>To run html2canvas on an <code>element</code> with some <code>options</code> simply call:</p>
  37
+
  38
+      <pre class="prettyprint linenums">html2canvas(element, options);</pre>
  39
+
  40
+      <p>The rendered <code>canvas</code> is provided in the callback event <code>onrendered</code>, as such:</p>
  41
+
  42
+      <pre class="prettyprint linenums">html2canvas(element, {
  43
+    onrendered: function(canvas) {
  44
+        // canvas is the final rendered &lt;canvas&gt; element
  45
+    }
  46
+});</pre>
  47
+
  48
+      <h3>Available options</h3>
  49
+
  50
+      <p>The options variable is an <code>object</code> which accepts the following parameters:</p>
  51
+      <table class="table table-bordered table-striped">
  52
+        <thead>
  53
+          <tr>
  54
+            <th>Name</th>
  55
+            <th>Type</th>
  56
+            <th>Default</th>
  57
+            <th>Description</th>
  58
+
  59
+          </tr>
  60
+        </thead>
  61
+        <tbody>
  62
+
  63
+          <tr>
  64
+            <td>allowTaint</td>
  65
+            <td>boolean</td>
  66
+            <td>false</td>
  67
+            <td>Whether to allow cross-origin images to taint the canvas</td>
  68
+          </tr>
  69
+
  70
+          <tr>
  71
+            <td>background</td>
  72
+            <td>string</td>
  73
+            <td>#fff</td>
  74
+            <td>Canvas background color, if none is specified in DOM. Set undefined for transparent</td>
  75
+          </tr>
  76
+
  77
+          <tr>
  78
+            <td>height</td>
  79
+            <td>number</td>
  80
+            <td>null</td>
  81
+            <td>Define the heigt of the canvas in pixels. If null, renders with full height of the window.</td>
  82
+          </tr>
  83
+
  84
+          <tr>
  85
+            <td>letterRendering</td>
  86
+            <td>boolean</td>
  87
+            <td>false</td>
  88
+            <td>Whether to render each letter seperately. Necessary if <code>letter-spacing</code> is used.</td>
  89
+          </tr>
  90
+
  91
+          <tr>
  92
+            <td>logging</td>
  93
+            <td>boolean</td>
  94
+            <td>false</td>
  95
+            <td>Whether to log events in the console.</td>
  96
+          </tr>
  97
+
  98
+          <tr>
  99
+            <td>proxy</td>
  100
+            <td>string</td>
  101
+            <td>undefined</td>
  102
+            <td>Url to the proxy which is to be used for loading cross-origin images. If left empty, cross-origin images won't be loaded.</td>
  103
+          </tr>
  104
+
  105
+          <tr>
  106
+            <td>taintTest</td>
  107
+            <td>boolean</td>
  108
+            <td>true</td>
  109
+            <td>Whether to test each image if it taints the canvas before drawing them</td>
  110
+          </tr>
  111
+
  112
+          <tr>
  113
+            <td>timeout</td>
  114
+            <td>number</td>
  115
+            <td>0</td>
  116
+            <td>Timeout for loading images, in milliseconds. Setting it to 0 will result in no timeout. </td>
  117
+          </tr>
  118
+
  119
+          <tr>
  120
+            <td>width</td>
  121
+            <td>number</td>
  122
+            <td>null</td>
  123
+            <td>Define the width of the canvas in pixels. If null, renders with full width of the window.</td>
  124
+          </tr>
  125
+
  126
+          <tr>
  127
+            <td>useCORS</td>
  128
+            <td>boolean</td>
  129
+            <td>false</td>
  130
+            <td>Whether to attempt to load cross-origin images as CORS served, before reverting back to proxy</td>
  131
+          </tr>
  132
+
  133
+        </tbody>
  134
+      </table>
108 135
 
  136
+    </div>
109 137
 
  138
+  </div>
  139
+</div>
  140
+<script src="/site/js/prettify.js"></script>
110 141
 <script>
  142
+  (function(){
111 143
     var docNav = $("#doc-nav");
112  
-    $("#docs h2, #docs h3").each(function(i,e){
113  
-        var el = $(e);
114  
-        if (e.nodeName === "H2") {
115  
-            docNav.append($('<li />').addClass('nav-header').text(el.text()));
116  
-        } else {
117  
-            $("<a />").attr('name','doc-' + i).insertBefore(e);
118  
-            docNav.append($('<li />').append(
119  
-            $('<a />').text(el.text()).attr('href','#' + 'doc-' + i)
120  
-        ));
121  
-        }
  144
+    $("#docs h1, #docs h2, #docs h3").each(function(i,element){
  145
+      var $element = $(element);
  146
+      var id = $element.text().replace(/ /g, "-").toLowerCase();
  147
+
  148
+      $element.attr('id', id);
  149
+      docNav.append($('<li />').append($('<a />').text($element.text()).attr('href','#' + id)));
  150
+
  151
+    });
  152
+    $(window).scrollspy({
  153
+      target: ".span3"
122 154
     });
  155
+    docNav.affix()
  156
+    window.prettyPrint();
123 157
 
  158
+  })();
124 159
 </script>
34  site/examples.html
... ...
@@ -0,0 +1,34 @@
  1
+<div class="row-fluid" id="docs">
  2
+  <div class="page-header">
  3
+    <h1>Examples</h1>
  4
+  </div>
  5
+
  6
+  <p class="lead">
  7
+    Rendering the body element and appending the canvas to the body
  8
+  </p>
  9
+
  10
+  <pre class="prettyprint linenums">
  11
+html2canvas(document.body, {
  12
+  onrendered: function(canvas) {
  13
+    document.body.appendChild(canvas);
  14
+  }
  15
+});</pre>
  16
+  <button class="btn example1">Test on this page</button>
  17
+  <p></p>
  18
+  <script src="/build/html2canvas.js"></script>
  19
+  <script src="/site/js/prettify.js"></script>
  20
+  <script>
  21
+    window.prettyPrint();
  22
+    $(".example1").on("click", function(event) {
  23
+      event.preventDefault();
  24
+      html2canvas(document.body, {
  25
+        allowTaint: true,
  26
+        taintTest: false,
  27
+        onrendered: function(canvas) {
  28
+          document.body.appendChild(canvas);
  29
+        }
  30
+      });
  31
+    });
  32
+  </script>
  33
+
  34
+</div>
42  site/faq.html
... ...
@@ -0,0 +1,42 @@
  1
+<div class="row-fluid" id="docs">
  2
+  <div class="page-header">
  3
+    <h1>Frequently asked questions</h1>
  4
+  </div>
  5
+
  6
+  <p class="lead">
  7
+    Why aren't my images rendered?
  8
+  </p>
  9
+  <p>
  10
+    html2canvas does not get around content policy restrictions set by your browser. Drawing images that reside outside of the <a href="http://en.wikipedia.org/wiki/Same_origin_policy">origin</a> of the current page taint the <code>canvas</code> that they are drawn upon.
  11
+    If the <code>canvas</code> gets tainted, it cannot be read anymore. As such, html2canvas implements methods to check whether an image would taint the <code>canvas</code> before applying it. If you have set the <code>allowTaint</code> option to <code>false</code>, it will not draw the image.
  12
+  </p>
  13
+  <p>
  14
+    If you wish to load images that reside outside of your pages origin, you can use a <a href="https://github.com/niklasvh/html2canvas/wiki/Proxies">proxy</a> to load the images.
  15
+  </p>
  16
+
  17
+  <p class="lead">
  18
+    How do I get html2canvas to work in a browser extension?
  19
+  </p>
  20
+  <p>
  21
+    You shouldn't use html2canvas in a browser extension. Most browsers have native support for capturing screenshots from tabs within extensions.
  22
+    Relevant information for <a href="http://developer.chrome.com/extensions/tabs.html#method-captureVisibleTab">Chrome</a>, <a href="https://developer.mozilla.org/en-US/docs/DOM/CanvasRenderingContext2D#drawWindow()">Firefox</a> and <a href="http://dev.opera.com/articles/view/extensions-api-screenshot/">Opera</a>.
  23
+  </p>
  24
+
  25
+  <p class="lead">
  26
+    Why isn't SVG images getting rendered?
  27
+  </p>
  28
+  <p>
  29
+    As with the previous question, SVG images taint the canvas with many browsers regardless of where they are hosted, or even if they are inline.
  30
+  </p>
  31
+
  32
+  <p class="lead">
  33
+    Why doesn't CSS property X render correctly or only partially?
  34
+  </p>
  35
+  <p>
  36
+    As each CSS property needs to be manually coded to render correctly, html2canvas will <b>never</b> have full CSS support.
  37
+    The library tries to support the most commonly used CSS properties to the extent that it can. If some CSS property is missing or incomplete and you feel
  38
+    that it should be part of the library, create <a href="https://github.com/niklasvh/html2canvas/tree/master/tests">test cases</a> for it and a <a href="https://github.com/niklasvh/html2canvas/issues">new issue</a> for it.
  39
+  </p>
  40
+
  41
+
  42
+</div>
14  site/footer.html
... ...
@@ -1,7 +1,7 @@
@@ -11,9 +11,15 @@
57  site/header.html
@@ -12,21 +12,66 @@
12 12
     margin-bottom:-5px;
13 13
     margin-right: -50px;
14 14
   }
  15
+
  16
+  .page-header, .lead {
  17
+    color: #5A5A5A;
  18
+  }
  19
+  #doc-nav {
  20
+    width: 220px;
  21
+  }
  22
+
  23
+  #doc-nav .active a {
  24
+    background-color: #08C;
  25
+    color: #fff;
  26
+    border-color: #08C;
  27
+  }
  28
+
  29
+  html {
  30
+    overflow-y: scroll;
  31
+  }
  32
+
  33
+  .com { color: #93a1a1; }
  34
+.lit { color: #195f91; }
  35
+.pun, .opn, .clo { color: #93a1a1; }
  36
+.fun { color: #dc322f; }
  37
+.str, .atv { color: #D14; }
  38
+.kwd, .prettyprint .tag { color: #1e347b; }
  39
+.typ, .atn, .dec, .var { color: teal; }
  40
+.pln { color: #48484c; }
  41
+
  42
+.prettyprint {
  43
+  padding: 8px;
  44
+  background-color: #f7f7f9;
  45
+  border: 1px solid #e1e1e8;
  46
+}
  47
+.prettyprint.linenums {
  48
+  -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
  49
+     -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
  50
+          box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
  51
+}
  52
+
  53
+/* Specify class=linenums on a pre to get line numbering */
  54
+ol.linenums {
  55
+  margin: 0 0 0 33px; /* IE indents via margin-left */
  56
+}
  57
+ol.linenums li {
  58
+  padding-left: 12px;
  59
+  color: #bebec5;
  60
+  line-height: 20px;
  61
+  text-shadow: 0 1px 0 #fff;
  62
+}
  63
+
15 64
 </style>
  65
+<script src="/site/js/bootstrap.min.js"></script>
16 66
 <div class="navbar navbar-inverse navbar-fixed-top">
17 67
   <div class="navbar-inner">
18 68
     <div class="container">
19  
-      <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
20  
-        <span class="icon-bar"></span>
21  
-        <span class="icon-bar"></span>
22  
-        <span class="icon-bar"></span>
23  
-      </a>
24 69
       <a class="brand" href="index.html">html2canvas</a>
25 70
       <div class="nav-collapse">
26 71
         <ul class="nav" ng-controller="Navigation">
27 72
           <li ng-class="active('/')"><a href="/">Home</a></li>
28  
-          <li ng-class="active('/about.html')"><a href="/about.html">About</a></li>
29 73
           <li ng-class="active('/documentation.html')"><a href="/documentation.html">Documentation</a></li>
  74
+          <li ng-class="active('/faq.html')"><a href="/faq.html">FAQ</a></li>
30 75
           <li ng-class="active('/examples.html')"><a href="/examples.html">Examples</a></li>
31 76
           <li><a href="https://github.com/niklasvh/html2canvas/downloads">Download</a></li>
32 77
         </ul>
3  site/index.html
... ...
@@ -1,10 +1,9 @@
1 1
 <div class="hero-unit">
2 2
   <h1>html2canvas</h1>
3 3
   <p>This script allows you to take "screenshots" of webpages or parts of it, directly on the users browser. The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot, but builds the screenshot based on the information available on the page.</p>
4  
-  <p><a class="btn btn-primary btn-large" href="about.html">Learn more &raquo;</a></p>
  4
+  <p><a class="btn btn-primary btn-large" href="documentation.html">Learn more &raquo;</a></p>
5 5
 </div>
6 6
 
7  
-<!-- Example row of columns -->
8 7
 <div class="row">
9 8
   <div class="span4">
10 9
     <h2>Examples</h2>
28  site/js/prettify.js
... ...
@@ -0,0 +1,28 @@
  1
+var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
  2
+(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
  3
+[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<
  4
+f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&
  5
+(j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r=
  6
+{b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,
  7
+t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===
  8
+"string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
  9
+l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
  10
+q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
  11
+q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
  12
+"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
  13
+a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
  14
+for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",
  15
+m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&window.console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
  16
+a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
  17
+j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&window.console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
  18
+"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
  19
+H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
  20
+J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
  21
+I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
  22
+["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
  23
+/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
  24
+["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
  25
+hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
  26
+!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
  27
+250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
  28
+PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();
26  site/screenshots.html
... ...
@@ -1,7 +1,20 @@
1 1
 <script src="/build/html2canvas.js"></script>
2 2
 <script src="/site/console.js"></script>
3 3
 
4  
-<h1>JavaScript screenshot creator</h1>
  4
+<ul class="breadcrumb">
  5
+  <li><a href="/">Home</a> <span class="divider">/</span></li>
  6
+  <li><a href="/examples.html">Examples</a> <span class="divider">/</span></li>
  7
+  <li class="active">Test console</li>
  8
+</ul>
  9
+
  10
+<div class="page-header">
  11
+  <h1>JavaScript webpage renderer</h1>
  12
+</div>
  13
+
  14
+<p>
  15
+  The whole screenshot is created with JavaScript. The only server interaction that is happening on this page is the proxy for loading the external pages/images into JSONP/CORS enabled page and onwards onto the JavaScript renderer script.
  16
+  There are a lot of problemii s of loading external pages, even with a proxy, and as such many pages will not render at all. If you wish to try the script properly, I recommend you get a copy of the source from <a href="https://github.com/niklasvh/html2canvas">here</a> instead.
  17
+</p>
5 18
 <form class="well form-search">
6 19
   <label for="url">Website URL:</label>
7 20
   <input type="url" id="url" value="http://www.yahoo.com" class="input-medium search-query" /><button class="btn" id="getscreenshot">Get screenshot!</button>
@@ -13,7 +26,6 @@
13 26
 <h3>Recommended (tested) pages:</h3>
14 27
 
15 28
 <ul id="recommended">
16  
-
17 29
   <li><a href="http://www.twitter.com/niklasvh">twitter.com</a></li>
18 30
   <li><a href="http://www.yahoo.com">yahoo.com</a></li>
19 31
   <li><a href="http://www.jquery.com">jquery.com</a></li>
@@ -24,16 +36,8 @@
24 36
   <li><a href="http://www.facebook.com/google">facebook.com/google</a></li>
25 37
   <li><a href="http://www.youtube.com/">youtube.com</a></li>
26 38
   <li><a href="http://www.cnn.com/">cnn.com</a></li>
27  
-
28 39
   <li><a href="http://www.engadget.com/">engadget.com (lot of elements, very slow)</a></li>
29 40
   <li><a href="http://eu.battle.net/en/">battle.net</a></li>
30  
-
31  
-
32 41
 </ul>
33 42
 
34  
-<h4> About</h4>
35  
-<p>
36  
-  The whole screenshot is created with JavaScript. The only server interaction that is happening on this page is the proxy for loading the external pages/images into JSONP/CORS enabled page and onwards onto the JavaScript renderer script.
37  
-  There are a lot of problems of loading external pages, even with a proxy, and as such many pages will not render at all. If you wish to try the script properly, I recommend you get a copy of the source from <a href="https://github.com/niklasvh/html2canvas">here</a> instead.
38  
-</p>
39  
-<div id="content"></div>
  43
+<div id="content"></div>
35  site/site.js
... ...
@@ -1,17 +1,29 @@
1  
-angular.module('site', [])
2  
-  .config(function($routeProvider, $locationProvider) {
  1
+(function() {
  2
+  var app = angular.module('site', []);
  3
+
  4
+  app.config(function($routeProvider, $locationProvider) {
3 5
     $locationProvider.html5Mode(true);
4 6
 
5 7
     $routeProvider.
6 8
     when('/', {
7 9
       templateUrl:'site/index.html',
8  
-      activetab: 'index'
  10
+      title: 'html2canvas - Screenshots with JavaScript'
9 11
     }).
10 12
     when('/screenshots.html', {
11  
-      templateUrl:'site/screenshots.html'
  13
+      templateUrl:'site/screenshots.html',
  14
+      title: 'Test console'
  15
+    }).
  16
+    when('/examples.html', {
  17
+      templateUrl:'site/examples.html',
  18
+      title: 'Examples for html2canvas'
  19
+    }).
  20
+    when('/faq.html', {
  21
+      templateUrl:'site/faq.html',
  22
+      title: "FAQ"
12 23
     }).
13 24
     when('/documentation.html', {
14  
-      templateUrl:'site/documentation.html'
  25
+      templateUrl:'site/documentation.html',
  26
+      title: 'Documentation for html2canvas'
15 27
     }).
16 28
     when('/LICENSE', {
17 29
       templateUrl:'/LICENSE'
@@ -21,10 +33,19 @@ angular.module('site', [])
21 33
     });
22 34
   });
23 35
 
  36
+  app.run(['$location', '$rootScope', function($location, $rootScope) {
  37
+    $rootScope.$on('$routeChangeSuccess', function (event, current, previous) {
  38
+      if (current.$route) {
  39
+        $rootScope.title = current.$route.title;
  40
+      }
  41
+    });
  42
+  }]);
  43
+
  44
+})();
  45
+
24 46
 function Navigation($scope, $location) {
25  
-  console.log(arguments, $location);
26 47
   $scope.active = function (page) {
27 48
     var currentRoute = $location.path() || 'index';
28 49
     return page === currentRoute ? 'active' : '';
29 50
   };
30  
-}
  51
+}

0 notes on commit e706730

Please sign in to comment.
Something went wrong with that request. Please try again.