html2canvas/tests/test.js

37 lines
1.3 KiB
JavaScript
Raw Normal View History

2011-12-11 21:06:57 +04:00
/*
html2canvas @VERSION@ <http://html2canvas.hertzen.com>
Copyright (c) 2011 Niklas von Hertzen. All rights reserved.
http://www.twitter.com/niklasvh
Released under MIT License
*/
var h2cSelector, h2cOptions;
2011-12-11 21:06:57 +04:00
(function(document, window) {
2012-12-28 01:06:47 +04:00
var srcStart = '<script type="text/javascript" src="', scrEnd = '"></script>';
2012-12-28 01:57:06 +04:00
document.write(srcStart + '/tests/assets/jquery-1.6.2.js' + scrEnd);
2012-12-28 01:53:27 +04:00
document.write(srcStart + '/tests/assets/jquery.plugin.html2canvas.js' + scrEnd);
2012-12-30 23:26:25 +04:00
var html2canvas = ['Core', 'Generate', 'Parse', 'Preload', 'Queue', 'Renderer', 'Util', 'Support', 'Font', 'renderers/Canvas'], i;
2012-03-02 20:05:03 +04:00
for (i = 0; i < html2canvas.length; ++i) {
document.write(srcStart + '/src/' + html2canvas[i] + '.js?' + Math.random() + scrEnd);
2011-12-11 21:06:57 +04:00
}
2012-03-02 20:05:03 +04:00
window.onload = function() {
2012-03-03 23:03:59 +04:00
h2cSelector = [document.body];
2012-03-02 20:05:03 +04:00
if (window.setUp) {
window.setUp();
}
2012-03-02 20:05:03 +04:00
setTimeout(function() {
$(h2cSelector).html2canvas($.extend({
2012-03-02 20:05:03 +04:00
flashcanvas: "../external/flashcanvas.min.js",
logging: true,
profile: true,
2012-12-28 01:53:27 +04:00
proxy: "http://html2canvas.appspot.com/query",
2012-03-02 20:05:03 +04:00
useCORS: true
}, h2cOptions));
2012-03-02 20:05:03 +04:00
}, 100);
};
}(document, window));