@@ -0,0 +1,1826 @@
+/* %0A * base64 Encode%0A * http://www.philten.com/us-xmlhttprequest-image/%0A */%0Afunction base64Encode(inputStr) %7B%0A    var b64 = %22ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=%22,%0A        outputStr = %22%22,%0A        i = 0;%0A               %0A    while (i %3C inputStr.length) %7B%0A        //all three %22& 0xff%22 added below are there to fix a known bug %0A        //with bytes returned by xhr.responseText%0A        var byte1 = inputStr.charCodeAt(i++) & 0xff,%0A            byte2 = inputStr.charCodeAt(i++) & 0xff,%0A            byte3 = inputStr.charCodeAt(i++) & 0xff,%0A            %0A            enc1 = byte1 %3E%3E 2,%0A            enc2 = ((byte1 & 3) %3C%3C 4) %7C (byte2 %3E%3E 4),       %0A            enc3,%0A            enc4;%0A%0A            if (isNaN(byte2)) %7B%0A                enc3 = enc4 = 64;%0A            %7D else %7B%0A                enc3 = ((byte2 & 15) %3C%3C 2) %7C (byte3 %3E%3E 6);%0A                if (isNaN(byte3)) %7B%0A                    enc4 = 64;%0A                %7D else %7B%0A                    enc4 = byte3 & 63;%0A                %7D%0A            %7D%0A        outputStr += b64.charAt(enc1) + b64.charAt(enc2) + b64.charAt(enc3) + b64.charAt(enc4);%0A    %7D         %0A    return outputStr;%0A%7D%0A%0A/* %0A * image load progress%0A * http://blogs.adobe.com/webplatform/2012/01/13/html5-image-progress-events/%0A */%0Afunction loadImage(url) %7B%0A    var request;%0A                    %0A    request = new XMLHttpRequest();%0A                %0A    request.onloadstart = function() %7B%0A        console.log('start')%0A    %7D;%0A%0A    request.onprogress = function(e) %7B%0A        console.log(e.loaded +'###'+ e.total)%0A    %7D;%0A%0A    request.onload = function() %7B%0A        console.log('showimg')%0A    %7D;%0A%0A    request.onloadend = function() %7B%0A        console.log('done')%0A    %7D;%0A    %0A    request.open(%22GET%22, imageURI, true)%0A    request.overrideMimeType('text/plain; charset=x-user-defined')%0A    request.send(null)%0A%7D%0A

add loadimage function