html2canvas/tests/test.js

34 lines
1.1 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-03-02 20:05:03 +04:00
var scrStart = '<script type="text/javascript" src="', scrEnd = '"></script>';
document.write(scrStart + '../external/jquery-1.6.2.js' + scrEnd);
2012-03-03 02:52:46 +04:00
var html2canvas = ['Core', 'Generate', 'Parse', 'Preload', 'Queue', 'Renderer', 'Util', 'renderers/Canvas', 'plugins/jquery.plugin.html2canvas'], i;
2012-03-02 20:05:03 +04:00
for (i = 0; i < html2canvas.length; ++i) {
document.write(scrStart + '../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-03 23:03:59 +04:00
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,
useCORS: true
}, h2cOptions));
2012-03-02 20:05:03 +04:00
}, 100);
};
}(document, window));