// Simple logger
html2canvas.prototype.log = function(a){
if (this.opts.logging){
var logger = window.console.log || function(log){
alert(log);
};
/*
if (typeof(window.console) != "undefined" && console.log){
console.log(a);
}else{
alert(a);
}*/
}
}
/**
* Function to provide bounds for element
* @return {Bounds} object with position and dimension information
*/
html2canvas.prototype.getBounds = function(el){
window.scroll(0,0);
if (el.getBoundingClientRect){
var bounds = el.getBoundingClientRect();
bounds.top = bounds.top;
bounds.left = bounds.left;
return bounds;
}else{
// TODO remove jQuery dependancy
var p = $(el).offset();
return {
left: p.left + parseInt(this.getCSS(el,"border-left-width"),10),
top: p.top + parseInt(this.getCSS(el,"border-top-width"),10),
width:$(el).innerWidth(),
height:$(el).innerHeight()
}
}
}
/*
* Function for looping through array
*/
html2canvas.prototype.each = function(arrayLoop,callbackFunc){
callbackFunc = callbackFunc || function(){};
for (var i=0;i