From 6ef6c79f24739bf3f2c8869e8cf4a4f21c97d461 Mon Sep 17 00:00:00 2001 From: Niklas von Hertzen Date: Thu, 1 Mar 2012 19:51:07 +0200 Subject: [PATCH] todo update proxy --- readme.md | 3 ++- src/Preload.js | 36 +----------------------------------- 2 files changed, 3 insertions(+), 36 deletions(-) diff --git a/readme.md b/readme.md index bd800bc..71de62e 100644 --- a/readme.md +++ b/readme.md @@ -38,7 +38,8 @@ For more information and examples, please visit the niklasvh) + +* Added support for CORS images and option to create canvas as tainted (niklasvh) * Improved minification saved ~1K! (cobexer) * Added integrated support for Flashcanvas (niklasvh) * Fixed a variety of legacy IE bugs (niklasvh) diff --git a/src/Preload.js b/src/Preload.js index 05d0a09..bb4f67b 100644 --- a/src/Preload.js +++ b/src/Preload.js @@ -66,6 +66,7 @@ html2canvas.Preload = function(element, opts){ } } + // TODO modify proxy to serve images with CORS enabled, where available function proxyGetImage(url, img, imageObj){ var callback_name, scriptUrl = options.proxy, @@ -110,41 +111,6 @@ html2canvas.Preload = function(element, opts){ imageObj.script = script; window.document.body.appendChild(script); - /* - - // enable xhr2 requests where available (no need for base64 / json) - - $.ajax({ - data:{ - xhr2:false, - url:url - }, - url: options.proxy, - dataType: "jsonp", - success: function(a){ - - if (a.substring(0,6) === "error:"){ - images.splice(getIndex(images, url), 2); - start(); - }else{ - img.onload = function(){ - imagesLoaded+=1; - start(); - - }; - img.src = a; - } - - - }, - error: function(){ - images.splice(getIndex(images, url), 2); - start(); - } - - - }); - */ } function getImages (el) {