From 4397fbcba26037acc2c1323e73e5a54200da7c17 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Fri, 13 Apr 2012 19:25:45 +0200 Subject: Add do_paste() and remove ajax from upload_form If the session has timed out, javascript will get the login page and try to redirect to "base_url/$htmlcode" which will obviously fail. Instead of fixing the js code, reintroduce do_paste and use it. Signed-off-by: Florian Pritz --- data/js/upload_form.js | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) (limited to 'data') diff --git a/data/js/upload_form.js b/data/js/upload_form.js index cb8f072d9..7a71a5174 100644 --- a/data/js/upload_form.js +++ b/data/js/upload_form.js @@ -14,50 +14,3 @@ if (window.File && window.FileList) { document.getElementById('file').addEventListener('change', checkFileUpload, false); } -function encode64(inp){ - var key="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; - var chr1,chr2,chr3,enc3,enc4,i=0,out=""; - while(i127) chr1=88; - chr2=inp.charCodeAt(i++);if(chr2>127) chr2=88; - chr3=inp.charCodeAt(i++);if(chr3>127) chr3=88; - if(isNaN(chr3)) {enc4=64;chr3=0;} else enc4=chr3&63 - if(isNaN(chr2)) {enc3=64;chr2=0;} else enc3=((chr2<<2)|(chr3>>6))&63 - out+=key.charAt((chr1>>2)&63)+key.charAt(((chr1<<4)|(chr2>>4))&63)+key.charAt(enc3)+key.charAt(enc4); - } - return encodeURIComponent(out); -} - -function gen_boundary() { - var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"; - var string_length = 40; - var randomstring = ''; - for (var i=0; i