rhymix/modules/editor/components/image_gallery/tpl/gallery.min.js
2015-07-07 18:03:49 +09:00

1 line
No EOL
846 B
JavaScript

!function(a){var b=xe.createApp("Gallery",{_imgs:{},_styles:{},init:function(){this._imgs={}},API_ADD_IMAGE:function(a,b){var c=b[0],d=b[1],e="@"+c;/^files/.test(d)&&(d=request_uri+d),is_def(this._imgs[e])||(this._imgs[e]=[]),this._imgs[e].push({path:d,loaded:!1})},API_ONREADY:function(b,c){var d,e,f,g,h=this._imgs;for(f in h)if(h.hasOwnProperty(f))for(d=0,e=h[f].length;e>d;d++)g=h[f][d],g.$obj=a("<img />").attr("src",g.path),g.$obj.load({img:g},function(a){var b=a.data.img;b.loaded=!0,b.$obj.unbind("load")})},API_GET_IMAGES:function(a,b){var c=b[0];return this._imgs["@"+c]||[]},API_SET_STYLE:function(a,b){var c=b[0],d=b[1];this._styles["@"+c]=d},API_ONLOAD:function(){var a,b;for(a in this._imgs)this._imgs.hasOwnProperty(a)&&(b=this._styles[a]||"list",this.cast("SHOW_"+b.toUpperCase(),[a.substr(1)]))}});xe.registerApp(new b)}(jQuery);