From 4a198f18f5b51647eee3007dc38f28f3168104ff Mon Sep 17 00:00:00 2001 From: root Date: Fri, 17 Apr 2015 18:22:25 +0200 Subject: [PATCH] All fixed!!! --- functions.js | 15 ++++++++------- functions.min.js | 2 +- style.css | 2 +- style.min.css | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/functions.js b/functions.js index deb94ac..95b6ae2 100644 --- a/functions.js +++ b/functions.js @@ -711,25 +711,26 @@ function openpic(srcthumb) $.data(img,'original',url); location.hash = "#!image="+basename(url); container.style.display=""; - if(typeof $.data(srcthumb,'by') == "undefined") + var d = $(srcthumb).data(); + if("by" in d) { by = meta['all'] != undefined ? meta['all'] : "Unknown"; } else { - by = $.data(srcthumb,'description'); + by = d.by; } - if(typeof $.data(srcthumb,'description') == "undefined") + if("description" in d) { - desc = "Unbenannt"; + desc = d.description; } else { - desc = $.data(srcthumb,'description'); + desc = "Unbenannt"; } infobut.style.display=""; var exif = mdata[url] != undefined ? mdata[url] : json_decode(file_get_contents("download.php/exif/"+url)), - inf = $.data(srcthumb,'description')+", hochgeladen von "+$.data(srcthumb,'by'), + inf = desc+", hochgeladen von "+by, lstr = blob ? "
In Originalgröße downloaden" : "
In Originalgröße downloaden"; //lstr += "
Link this image"; if($.data(srcthumb,'description') == "undefined") @@ -1232,7 +1233,7 @@ if(typeof HTMLElement.prototype.remove != "function") } } var thumbsize = 0, -svg = typeof SVGRect != "undefined" ? true : false, +svg = typeof SVGRect != "undefined" && window.navigator.userAgent.indexOf("Windows") < 0 ? true : false, realsize = "dyn", argr,args, mobile = false, diff --git a/functions.min.js b/functions.min.js index 705d63d..5ae74ca 100644 --- a/functions.min.js +++ b/functions.min.js @@ -1,3 +1,3 @@ (function(){if(!Event.prototype.preventDefault){Event.prototype.preventDefault=function(){this.returnValue=false}}if(!Event.prototype.stopPropagation){Event.prototype.stopPropagation=function(){this.cancelBubble=true}}if(!Element.prototype.addEventListener){var c=[];var b=function(f,h){var d=this;var k=function(l){l.target=l.srcElement;l.currentTarget=d;if(h.handleEvent){h.handleEvent(l)}else{h.call(d,l)}};if(f=="DOMContentLoaded"){var g=function(l){if(document.readyState=="complete"){k(l)}};document.attachEvent("onreadystatechange",g);c.push({object:this,type:f,listener:h,wrapper:g});if(document.readyState=="complete"){var j=new Event();j.srcElement=window;g(j)}}else{this.attachEvent("on"+f,k);c.push({object:this,type:f,listener:h,wrapper:k})}};var a=function(f,g){var d=0;while(dc){b.height*=c/b.width;b.width=c}var j=CE("canvas"),h=j.getContext("2d");h.clearRect(0,0,j.width,j.height);j.width=b.width;j.height=b.height;h.drawImage(b,0,0,b.width,b.height);stackBlurCanvasRGBA(j,0,0,b.width,b.height,10);h.font=(b.height/100)*12+"px Ubuntu";h.fillInversedText("Uploading image...",(b.width/100)*20,(b.height/100)*50);var g=j.toDataURL(),l=new Image();j.remove();b.remove();l.src=g;l.classList.add("image");l.style.maxWidth="19%";l.style.minWidth="200px";grid.appendChild(l);if(isset(l.y)&&typeof window.scrollTo=="function"){window.scrollTo(0,l.y)}var k=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP");k.addEventListener("readystatechange",function(){if(k.readyState==4&&k.status==200){delete uploads[d];l.remove();var m=json_decode(k.responseText);if(m.success){imgs.push(m.file);addimg(m.file);console.log(m.orig_file+" was successfully uploaded")}else{alert("There was an error while uploading: "+m.error+", file: "+m.file)}}});k.upload.addEventListener("progress",function(n){if(n.lengthComputable){var m=n.loaded/n.total;uploads[d]=m}else{console.warn("Unable to compute progress information since the total size is unknown")}});k.addEventListener("abort",error);k.addEventListener("timeout",error);k.addEventListener("error",error);k.open("POST","upload.php?name="+e+"&date="+a,true);k.send(f);uploads[d]=0})}function error(a){console.warn(a);console.log(this)}function startWorker(){if(typeof(Worker)!=="undefined"&&typeof(w)=="undefined"&&preload){w=new Worker("preload.js");w.onmessage=function(c){var d=basename(c.data[1]),a=c.data[0];var b=(window.URL||window.webkitURL).createObjectURL(a);imgs[d]=b;mdata[d]=json_decode(c.data[2]);console.info("WebWorker has successfully downloaded "+d+" to "+b)};w.postMessage(imgs);console.info("Preload WebWorker started")}}function lhash(){requestAnimationFrame(lhash);var g=location.hash;if(g[1]=="!"){if(g.length<=2){console.warn("No arguments provided but #!. Stopping.")}else{argr=substr(g,2);args=explode(",",argr);for(var d=0;d2){console.warn("Multiple values specified, using first one")}if(c=="ts"){if(f!=""){thumbsize=f}}if(c=="rs"){if(f!=""){realsize=f}}if(c=="image"){if(f!=""&&f!=undefined){var e=(container.style.display=="none");if(e||$.data(img,"original")!=f){var b=findthumb(f);if(b!=undefined&&($.data(img,"original")!=$.data(b,"original")||e)){openpic(b)}}}}if(c=="info"){if(f=="true"){infolay.classList.remove("closed")}else{if(f=="false"){infolay.classList.add("closed")}}}if(c=="preload"){if(f=="false"||f==false){preload=false}if(f=="true"||f==true){preload=true}}if(c=="overview"){if(f=="true"||f==true){if(container.style.display!="none"){container.click()}}}}}}}function winwidth(){var b=window,h=document,f=h.documentElement,c=h.getElementsByTagName("body")[0],a=b.innerWidth||f.clientWidth||c.clientWidth;return a}CanvasRenderingContext2D.prototype.fillInversedText=function(e,l,h){var f=this.measureText(e).width;var a=parseInt(this.font,"10");a=(a===0)?16:a;var j=document.createElement("canvas");j.width=f;j.height=a;var n=j.getContext("2d");n.font=this.font;n.textBaseline="top";n.fillText(e,0,0);var k=this.getImageData(l,h,f,a);var d=n.getImageData(0,0,f,a);var m=k.data;var b=d.data;var g=b.length;for(var c=0;c0){m[c]=(255-m[c]);m[c+1]=(255-m[c+1]);m[c+2]=(255-m[c+2])}}this.putImageData(k,l,h)};function kinput(b){var a=b.keyCode||b.which;if(a==105){infooverlay()}if(a==102){fs()}if(a==27){b.preventDefault();container.click()}if(a==39){next()}if(a==37){prev()}if(a==8||a==46){b.preventDefault();del()}}function addimg(a){var b=CE("img");if(thumbsize!=0){b.src="download.php/resize/"+(parseInt(thumbsize)+(parseInt(thumbsize)/10))+"/"+a;b.style.width=thumbsize+"px"}else{b.src="thumbs.dir/"+a+".jpg";b.style.width="19%";if(mobile){b.style.width="92%"}b.style.minWidth="200px"}$.data(b,"original",a);b.classList.add("image");if(meta[a]!=undefined){$.data(b,"by",meta[a].by);$.data(b,"description",meta[a].description)}b.addEventListener("click",openpic);grid.appendChild(b)}function openpic(g){if(this.tagName=="IMG"){g=this}if(g==undefined){console.warn("srcthumb is undefined");return}var d=$.data(g,"original"),a=false,q=imgs[d];if(substr(q,0,4)=="blob"){console.info("Reading image "+d+" from "+q);img.src=q;a=true}else{if(realsize==0){img.src=d}else{if(realsize=="dyn"){img.src="download.php/resize/"+(winwidth()/100)*95+"/"+d}else{img.src="download.php/resize/"+realsize+"/"+d}}}$.data(img,"original",d);location.hash="#!image="+basename(d);container.style.display="";if(typeof $.data(g,"by")=="undefined"){by=meta.all!=undefined?meta.all:"Unknown"}else{by=$.data(g,"description")}if(typeof $.data(g,"description")=="undefined"){desc="Unbenannt"}else{desc=$.data(g,"description")}infobut.style.display="";var u=mdata[d]!=undefined?mdata[d]:json_decode(file_get_contents("download.php/exif/"+d)),f=$.data(g,"description")+", hochgeladen von "+$.data(g,"by"),o=a?'
In Originalgröße downloaden':'
In Originalgröße downloaden';if($.data(g,"description")=="undefined"){f="Hochgeladen von "+$.data(g,"by")}if(u!=false&&u!=null){var n=u.width,j=u.height,b=u.make,c=u.model,m=u.GPS,s=u.date,r=u.ISO,h=u.aperture,t=u.exposure,e=u.filesize,l=u.flash,k=u.software;if(s!=false){f+=", fotografiert am "+s}if(s!=false&&b!=false&&c!=false){var p=b+" "+c;if(b==c){p=c}if(c.indexOf(b)!=-1){p=c}f+=", mit einer / einem "+p}else{if(b!=false&&c!=false){var p=b+" "+c;if(b==c){p=c}if(c.indexOf(b)!=-1){p=c}f+=", fotografiert mit einer / einem "+p}}if(r!=false){f+=", ISO: "+r}if(h!=false){f+=", Blende: "+h}if(t!=false){f+=", Belichtungszeit: "+t}if(l!=false){f+=", Blitz aktiviert"}if(e!=false){f+=", Dateigrösse: "+e}if(n!=false&&j!=false){f+=", Abmessungen: "+n+"x"+j}if(k!=false&&k!=null){f+=", software: "+k}f+=o;if(m!=false){f+=' Ort in Karten öffnen'}if(features.deleting){f+="    "}}infolay.innerHTML=f}function infooverlay(){infolay.classList.toggle("closed")}function findthumb(b){var a=document.getElementsByClassName("image");for(i=0;i>d;if(A!=0){A=255/A;h[v]=((f*B)>>d)*A;h[v+1]=((g*B)>>d)*A;h[v+2]=((E*B)>>d)*A}else{h[v]=h[v+1]=h[v+2]=0}f-=r;g-=G;E-=C;T-=b;r-=W.r;G-=W.g;C-=W.b;b-=W.a;U=(n+((U=O+Q+1)>d;if(A>0){A=255/A;h[U]=((f*B)>>d)*A;h[U+1]=((g*B)>>d)*A;h[U+2]=((E*B)>>d)*A}else{h[U]=h[U+1]=h[U+2]=0}f-=r;g-=G;E-=C;T-=b;r-=W.r;G-=W.g;C-=W.b;b-=W.a;U=(O+(((U=N+l)c){b.height*=c/b.width;b.width=c}var j=CE("canvas"),h=j.getContext("2d");h.clearRect(0,0,j.width,j.height);j.width=b.width;j.height=b.height;h.drawImage(b,0,0,b.width,b.height);stackBlurCanvasRGBA(j,0,0,b.width,b.height,10);h.font=(b.height/100)*12+"px Ubuntu";h.fillInversedText("Uploading image...",(b.width/100)*20,(b.height/100)*50);var g=j.toDataURL(),l=new Image();j.remove();b.remove();l.src=g;l.classList.add("image");l.style.maxWidth="19%";l.style.minWidth="200px";grid.appendChild(l);if(isset(l.y)&&typeof window.scrollTo=="function"){window.scrollTo(0,l.y)}var k=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP");k.addEventListener("readystatechange",function(){if(k.readyState==4&&k.status==200){delete uploads[d];l.remove();var m=json_decode(k.responseText);if(m.success){imgs.push(m.file);addimg(m.file);console.log(m.orig_file+" was successfully uploaded")}else{alert("There was an error while uploading: "+m.error+", file: "+m.file)}}});k.upload.addEventListener("progress",function(n){if(n.lengthComputable){var m=n.loaded/n.total;uploads[d]=m}else{console.warn("Unable to compute progress information since the total size is unknown")}});k.addEventListener("abort",error);k.addEventListener("timeout",error);k.addEventListener("error",error);k.open("POST","upload.php?name="+e+"&date="+a,true);k.send(f);uploads[d]=0})}function error(a){console.warn(a);console.log(this)}function startWorker(){if(typeof(Worker)!=="undefined"&&typeof(w)=="undefined"&&preload){w=new Worker("preload.js");w.onmessage=function(c){var d=basename(c.data[1]),a=c.data[0];var b=(window.URL||window.webkitURL).createObjectURL(a);imgs[d]=b;mdata[d]=json_decode(c.data[2]);console.info("WebWorker has successfully downloaded "+d+" to "+b)};w.postMessage(imgs);console.info("Preload WebWorker started")}}function lhash(){requestAnimationFrame(lhash);var g=location.hash;if(g[1]=="!"){if(g.length<=2){console.warn("No arguments provided but #!. Stopping.")}else{argr=substr(g,2);args=explode(",",argr);for(var d=0;d2){console.warn("Multiple values specified, using first one")}if(c=="ts"){if(f!=""){thumbsize=f}}if(c=="rs"){if(f!=""){realsize=f}}if(c=="image"){if(f!=""&&f!=undefined){var e=(container.style.display=="none");if(e||$.data(img,"original")!=f){var b=findthumb(f);if(b!=undefined&&($.data(img,"original")!=$.data(b,"original")||e)){openpic(b)}}}}if(c=="info"){if(f=="true"){infolay.classList.remove("closed")}else{if(f=="false"){infolay.classList.add("closed")}}}if(c=="preload"){if(f=="false"||f==false){preload=false}if(f=="true"||f==true){preload=true}}if(c=="overview"){if(f=="true"||f==true){if(container.style.display!="none"){container.click()}}}}}}}function winwidth(){var b=window,h=document,f=h.documentElement,c=h.getElementsByTagName("body")[0],a=b.innerWidth||f.clientWidth||c.clientWidth;return a}CanvasRenderingContext2D.prototype.fillInversedText=function(e,l,h){var f=this.measureText(e).width;var a=parseInt(this.font,"10");a=(a===0)?16:a;var j=document.createElement("canvas");j.width=f;j.height=a;var n=j.getContext("2d");n.font=this.font;n.textBaseline="top";n.fillText(e,0,0);var k=this.getImageData(l,h,f,a);var d=n.getImageData(0,0,f,a);var m=k.data;var b=d.data;var g=b.length;for(var c=0;c0){m[c]=(255-m[c]);m[c+1]=(255-m[c+1]);m[c+2]=(255-m[c+2])}}this.putImageData(k,l,h)};function kinput(b){var a=b.keyCode||b.which;if(a==105){infooverlay()}if(a==102){fs()}if(a==27){b.preventDefault();container.click()}if(a==39){next()}if(a==37){prev()}if(a==8||a==46){b.preventDefault();del()}}function addimg(a){var b=CE("img");if(thumbsize!=0){b.src="download.php/resize/"+(parseInt(thumbsize)+(parseInt(thumbsize)/10))+"/"+a;b.style.width=thumbsize+"px"}else{b.src="thumbs.dir/"+a+".jpg";b.style.width="19%";if(mobile){b.style.width="92%"}b.style.minWidth="200px"}$.data(b,"original",a);b.classList.add("image");if(meta[a]!=undefined){$.data(b,"by",meta[a].by);$.data(b,"description",meta[a].description)}b.addEventListener("click",openpic);grid.appendChild(b)}function openpic(h){if(this.tagName=="IMG"){h=this}if(h==undefined){console.warn("srcthumb is undefined");return}var e=$.data(h,"original"),a=false,r=imgs[e];if(substr(r,0,4)=="blob"){console.info("Reading image "+e+" from "+r);img.src=r;a=true}else{if(realsize==0){img.src=e}else{if(realsize=="dyn"){img.src="download.php/resize/"+(winwidth()/100)*95+"/"+e}else{img.src="download.php/resize/"+realsize+"/"+e}}}$.data(img,"original",e);location.hash="#!image="+basename(e);container.style.display="";var t=$(h).data();if("by" in t){by=meta.all!=undefined?meta.all:"Unknown"}else{by=t.by}if("description" in t){desc=t.description}else{desc="Unbenannt"}infobut.style.display="";var x=mdata[e]!=undefined?mdata[e]:json_decode(file_get_contents("download.php/exif/"+e)),g=desc+", hochgeladen von "+by,p=a?'
In Originalgröße downloaden':'
In Originalgröße downloaden';if($.data(h,"description")=="undefined"){g="Hochgeladen von "+$.data(h,"by")}if(x!=false&&x!=null){var o=x.width,k=x.height,b=x.make,c=x.model,n=x.GPS,u=x.date,s=x.ISO,j=x.aperture,v=x.exposure,f=x.filesize,m=x.flash,l=x.software;if(u!=false){g+=", fotografiert am "+u}if(u!=false&&b!=false&&c!=false){var q=b+" "+c;if(b==c){q=c}if(c.indexOf(b)!=-1){q=c}g+=", mit einer / einem "+q}else{if(b!=false&&c!=false){var q=b+" "+c;if(b==c){q=c}if(c.indexOf(b)!=-1){q=c}g+=", fotografiert mit einer / einem "+q}}if(s!=false){g+=", ISO: "+s}if(j!=false){g+=", Blende: "+j}if(v!=false){g+=", Belichtungszeit: "+v}if(m!=false){g+=", Blitz aktiviert"}if(f!=false){g+=", Dateigrösse: "+f}if(o!=false&&k!=false){g+=", Abmessungen: "+o+"x"+k}if(l!=false&&l!=null){g+=", software: "+l}g+=p;if(n!=false){g+=' Ort in Karten öffnen'}if(features.deleting){g+="    "}}infolay.innerHTML=g}function infooverlay(){infolay.classList.toggle("closed")}function findthumb(b){var a=document.getElementsByClassName("image");for(i=0;i>d;if(A!=0){A=255/A;h[v]=((f*B)>>d)*A;h[v+1]=((g*B)>>d)*A;h[v+2]=((E*B)>>d)*A}else{h[v]=h[v+1]=h[v+2]=0}f-=r;g-=G;E-=C;T-=b;r-=W.r;G-=W.g;C-=W.b;b-=W.a;U=(n+((U=O+Q+1)>d;if(A>0){A=255/A;h[U]=((f*B)>>d)*A;h[U+1]=((g*B)>>d)*A;h[U+2]=((E*B)>>d)*A}else{h[U]=h[U+1]=h[U+2]=0}f-=r;g-=G;E-=C;T-=b;r-=W.r;G-=W.g;C-=W.b;b-=W.a;U=(O+(((U=N+l)