forked from drikin/FlickrEx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexificonex.min.js
More file actions
7 lines (7 loc) · 3.03 KB
/
Copy pathexificonex.min.js
File metadata and controls
7 lines (7 loc) · 3.03 KB
1
2
3
4
5
6
7
var __extends=this.__extends||function(b,d){function g(){this.constructor=b}g.prototype=d.prototype;b.prototype=new g},com;
(function(b){var d=b.teruhisa||(b.teruhisa={}),d=d.ExifIconEx||(d.ExifIconEx={}),g=new b.drikin.FlickrEx.Base,k="img";void 0!==window.FLICKREX_EXIF_JQUERY_SELECTOR&&(k=window.FLICKREX_EXIF_JQUERY_SELECTOR,delete window.FLICKREX_EXIF_JQUERY_SELECTOR);var n={".":"dot"},c=function(a,c){this.type=a;this.exif=c;this.classPrefix="flickr-exif-icon-"};c.prototype.getValue=function(){return this.exif?this.exif.raw._content:""};c.prototype.getValueBlockClass=function(a){return"text-"+(n[a]||a)+" "+this.classPrefix+
"text"};c.prototype.getBlock=function(a,c,b){return"<"+a+' class="'+this.classPrefix+c+'">'+b+"</"+a+">"};c.prototype.getHtmlBlocks=function(){var a=this.getValue(),c,b="";if(a)for(var d=0;d<a.length;d++)c=a[d],b+=this.getBlock("span",this.getValueBlockClass(c),c);else b=this.getBlock("span","empty","empty");return b};c.prototype.getHtml=function(){return this.getBlock("div",this.type,this.getHtmlBlocks())};d.ExifProperty=c;b=function(a,b){c.call(this,a,b)};__extends(b,c);b.prototype.getValue=function(){return parseFloat(c.prototype.getValue.call(this))+
""};b.prototype.getHtmlBlocks=function(){var a=c.prototype.getHtmlBlocks.call(this);return this.getBlock("span","label","F")+a};d.ExifAperture=b;var f=function(a,b){c.call(this,a,b);this.fraction=!1};__extends(f,c);f.prototype.getValue=function(){var a=c.prototype.getValue.call(this);a&&0===a.indexOf("1/")&&(a=a.substring(2),this.fraction=!0);return a};f.prototype.getHtmlBlocks=function(){var a=c.prototype.getHtmlBlocks.call(this);return(this.fraction?this.getBlock("span","text-frac","1/"):"")+a+
this.getBlock("span","label","S")};d.ExifExposure=f;var h=function(a,b){c.call(this,a,b);this.highiso=!1};__extends(h,c);h.prototype.getValue=function(){var a=c.prototype.getValue.call(this);a&&4<a.length&&(a=a.substring(0,a.length-2),this.highiso=!0);return a};h.prototype.getHtmlBlocks=function(){var a=c.prototype.getHtmlBlocks.call(this);return this.getBlock("span","label","ISO")+a+(this.highiso?this.getBlock("span","text-high","00"):"")};d.ExifISO=h;var l=["aperture","exposure","iso speed"],p=
{aperture:b,exposure:f,"iso speed":h};$(document).ready(function(){for(var a=g.getAllFlickrImageObjects(k),b=0,d=a.length;b<d;b++)(function(){var d=a[b];g.getExif(a[b].id,function(a){var b=a.photo.exif;a="";for(var g=[],f=0,h=b.length;f<h;f++){var j=b[f],e=j.tag.toLowerCase(),k=j.label.toLowerCase(),m=l.indexOf(k);-1!==m&&(j=new p[k](e,j),g[m]=j.getHtml())}if(0<g.length)for(b=0;b<l.length;b++)(f=g[b])?a+=f:(j=new c(e,null),a+=j.getHtml());a&&(e=$(d.node),e=e.width()+parseInt(e.css("border-left-width"),
10)+parseInt(e.css("border-right-width"),10)+parseInt(e.css("margin-left"),10)+parseInt(e.css("margin-right"),10)+parseInt(e.css("padding-left"),10)+parseInt(e.css("padding-right"),10),a=$("<div class='flickr-exif-icon' style='width:"+e+"px'><div class='flickr-exif-icon-block'>"+a+"</div></div>"),$(d.node).before(a),$(d.node).parent().addClass("flickr-exif-container"))})})()})})(com||(com={}));