View Album';
+ getImgurBox().appendChild(div);
+ localStorage.setItem('imgur',JSON.stringify(data));
+}
+function storeImgurUploads(img){
+ if(typeof(localStorage)!="object")
+ return false;
+ var data=localStorage.getItem('imgur'),id,b,a,ele,ele2,div,f;
+ data=parseJSON(data==null?'{}':data);
+ ele=getImgurBox();
for(var i in img){
if(typeof(img[i])=='boolean')
continue;
@@ -706,12 +729,12 @@ function bulkUpload(){
httpRequest.onreadystatechange = function(){
if(httpRequest.readyState==4){
if(httpRequest.status==200){//printMsg('Debug',encodeHTML(httpRequest.responseText),'center',0);
- var json=parseJSON(httpRequest.responseText);
+ var json=parseJSON(httpRequest.responseText),ids=false,c=0;
if(json['success']){
printMsg('Success','All '+json['images'].length+' image(s) were uploaded to your new album You delete hash is '+json['album']['data']['deletehash']+
'. Sorry, I do not know the URL to delete albums. XP','center',0);
- storeImgurUploads(json['images']);
+ ids=Array();
}
else{
if(json['images'].length==0){
@@ -725,10 +748,22 @@ function bulkUpload(){
json['album']['data']['id']+'" target="_blank">album before a error occurred You delete hash is '+
json['album']['data']['deletehash']+'. Sorry, I do not know the URL to delete albums. The error message was: '+
(json['images'][json['images'].length-1]?json['images'][json['images'].length-1]["data"]["error"]:'Connection failure'),'center',0);
- if(json['images'].length-1>0)
- storeImgurUploads(json['images']);
+ delete(json['images'][json['images'].length-1]);
+ if(json['images'].length>0)
+ ids=Array();
}
}
+ if(ids!==false){
+ for(var i in json['images']){
+ if(c>3)
+ break;
+ ids.push(json['images'][i]["data"]["id"]);
+ c++;
+ }
+ storeImgurAlbum(Array(json['album']['data']['id'],json['album']['data']['deletehash'],json['album']['data']['title']),ids);
+ storeImgurUploads(json['images']);
+ imgurPopup(json['album']['data']['title'],json['album']['data']['id']);
+ }
var btn=getID('upload-'+now);
if(btn)
sendE(btn.nextSibling,'click');
@@ -819,11 +854,26 @@ function upload(file){
return false;
}
function imgurPopup(file,links){
+ var attrs='onclick="void(setClipboard(this)?null:this.select());" readonly="readonly" type="text"';
+ if(typeof(links)=='string'){
+ links='http://imgur.com/a/'+links;
+ file=encodeHTML(file);
+ getID("blanket").childNodes[0].innerHTML='