mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
simplified API and cleaned up code
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user