From 7726cd9f39d548eb62e0a887c82e70834df509c8 Mon Sep 17 00:00:00 2001 From: Niklas von Hertzen Date: Sat, 3 Mar 2012 00:52:46 +0200 Subject: [PATCH] updated test.js to allow options --- readme.md | 2 +- src/plugins/jquery.plugin.html2canvas.js | 2 +- tests/test.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index 8e1f7ee..fb3ac29 100644 --- a/readme.md +++ b/readme.md @@ -39,7 +39,7 @@ For more information and examples, please visit the niklasvh) +* Split renderers to their own objects (niklasvh) * Simplified API, cleaned up code (niklasvh) v0.33 - 2.3.2012 diff --git a/src/plugins/jquery.plugin.html2canvas.js b/src/plugins/jquery.plugin.html2canvas.js index 9ac1c50..43a8c0e 100644 --- a/src/plugins/jquery.plugin.html2canvas.js +++ b/src/plugins/jquery.plugin.html2canvas.js @@ -13,7 +13,7 @@ timer = date.getTime(); options = options || {}; - options.onrendered = function( canvas ) { + options.onrendered = options.onrendered || function( canvas ) { var $canvas = $(canvas), finishTime = new Date(); diff --git a/tests/test.js b/tests/test.js index 2e86ce4..81bbf5f 100644 --- a/tests/test.js +++ b/tests/test.js @@ -8,7 +8,7 @@ (function(document, window) { var scrStart = ''; document.write(scrStart + '../external/jquery-1.6.2.js' + scrEnd); - var html2canvas = ['Core', 'Generate', 'Parse', 'Preload', 'Queue', 'Renderer', 'Util', 'renderers/Canvas', 'plugins/jquery.plugin.html2canvas'], i; + var html2canvas = ['Core', 'Generate', 'Parse', 'Preload', 'Queue', 'Renderer', 'Util', 'renderers/Canvas', 'plugins/jquery.plugin.html2canvas'], i; for (i = 0; i < html2canvas.length; ++i) { document.write(scrStart + '../src/' + html2canvas[i] + '.js' + scrEnd); } @@ -17,7 +17,7 @@ window.setUp(); } setTimeout(function() { - $(document.body).html2canvas({ + $(document.body).html2canvas((typeof h2cOptions !== "undefined") ? h2cOptions : { flashcanvas: "../external/flashcanvas.min.js", logging: true, profile: true,