html2canvas/tests/test.js

37 lines
1.2 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);
var html2canvas = ['Core', 'Generate', 'Parse', 'Preload', 'Queue', 'Renderer', 'Util', 'renderers/Canvas'], i;
2012-03-02 20:05:03 +04:00
for (i = 0; i < html2canvas.length; ++i) {
2012-12-28 01:06:47 +04:00
document.write(srcStart + '/src/' + html2canvas[i] + '.js' + 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));