html2canvas/tests/test.js

38 lines
1.5 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 = ['log', 'nodecontainer', 'stackingcontext', 'textcontainer', 'support', 'imagecontainer', 'proxyimagecontainer', 'gradientcontainer', 'lineargradientcontainer', 'webkitgradientcontainer',
2014-02-01 22:03:23 +04:00
'imageloader', 'nodeparser', 'font', 'fontmetrics', 'core', 'renderer', 'promise', '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() {
2014-02-23 19:02:49 +04:00
h2cSelector = [document.documentElement];
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",
useCORS: false
}, h2cOptions));
2012-03-02 20:05:03 +04:00
}, 100);
};
}(document, window));