simplified API and cleaned up code

This commit is contained in:
Niklas von Hertzen
2012-03-02 18:05:03 +02:00
parent bf994849e0
commit c7d526c9ea
11 changed files with 203 additions and 143 deletions

View File

@@ -1,6 +1,6 @@
(function() {
/* options, customize to your needs */
var server = '//html2canvas.hertzen.com/build',
var server = '//html2canvas.hertzen.com/js',
proxy = '//html2canvas.appspot.com',
debug = false,
profile = false;

View File

@@ -7,17 +7,15 @@
console.profile();
}
var date = new Date(),
html2obj,
$message = null,
timeoutTimer = false,
timer = date.getTime();
options = options || {};
options.elements = this;
options.flashcanvas = "../external/flashcanvas.min.js";
html2canvas.logging = options && options.logging;
options.complete = function(images){
var queue = html2canvas.Parse(this[0], images, options),
$canvas = $(html2canvas.Renderer(queue, options)),
options.onrendered = function( canvas ) {
var $canvas = $(canvas),
finishTime = new Date();
if (options && options.profile && window.console && window.console.profileEnd) {
@@ -45,9 +43,9 @@
alert("Canvas is tainted, unable to read data");
}
}
};
html2canvas.Preload(this[0], options);
html2obj = html2canvas(this[0], options);
function throwMessage(msg,duration){
window.clearTimeout(timeoutTimer);
@@ -77,7 +75,7 @@
textDecoration:'none',
display:'none'
}).appendTo(document.body).fadeIn();
html2canvas.log(msg);
html2obj.log(msg);
}
};
})( jQuery );