?
Path : /home/admin/public_html/old/media/media/js/ |
Current File : /home/admin/public_html/old/media/media/js/popup-imagemanager.min.js |
!function(e,t){"use strict";window.ImageManager={initialize:function(){var i=this.getUriObject(window.self.location.href),r=this.getQueryObject(i.query);this.editor=decodeURIComponent(r.e_name),this.fields={url:t.getElementById("f_url"),alt:t.getElementById("f_alt"),align:t.getElementById("f_align"),title:t.getElementById("f_title"),caption:t.getElementById("f_caption"),c_class:t.getElementById("f_caption_class")},this.folderlist=t.getElementById("folderlist"),this.frame=window.frames.imageframe,this.frameurl=this.frame.location.href,e("#imageframe").on("load",function(){ImageManager.onloadimageview()}),e("#upbutton").off("click").on("click",function(){ImageManager.upFolder()})},onloadimageview:function(){var t,i,r=this.getImageFolder(),a=e("#uploadForm"),l="";this.frameurl=this.frame.location.href,this.setFolder(r),t=this.getUriObject(a.attr("action")),i=this.getQueryObject(t.query),i.folder=r,t.query=e.param(i),"undefined"!=typeof t.port&&80!=t.port&&(l=":"+t.port),a.attr("action",t.scheme+"://"+t.domain+l+t.path+"?"+t.query)},getImageFolder:function(){return this.getQueryObject(this.frame.location.search.substring(1)).folder},onok:function(){var e="",t=[],i="",r="",a=this.fields.url.value,l=this.fields.alt.value,s=this.fields.align.value,n=this.fields.title.value,o=this.fields.caption.value,f=this.fields.c_class.value;return a&&(t.push('alt="'+l+'"'),s&&!o&&t.push('class="pull-'+s+'"'),n&&t.push('title="'+n+'"'),e='<img src="'+a+'" '+t.join(" ")+"/>",o&&(s&&(i=' class="pull-'+s+'"'),f&&(r=' class="'+f+'"'),e="<figure"+i+">"+e+"<figcaption"+r+">"+o+"</figcaption></figure>")),window.parent.jInsertEditorText(e,this.editor),!0},setFolder:function(t,i,r){for(var a=0,l=this.folderlist.length;l>a;a++)if(t==this.folderlist.options[a].value){this.folderlist.selectedIndex=a,e(this.folderlist).trigger("liszt:updated").trigger("chosen:updated");break}(i||r)&&this.setFrameUrl(t,i,r)},upFolder:function(){var e,t=this.folderlist.value.split("/");t.pop(),e=t.join("/"),this.setFolder(e),this.setFrameUrl(e)},populateFields:function(t){e("#f_url").val(image_base_path+t)},showMessage:function(t){var i=e("#message");i.find(">:first-child").remove(),i.append(t),e("#messages").css("display","block")},refreshFrame:function(){this.frame.location.href=this.frameurl},setFrameUrl:function(t,i,r){var a={option:"com_media",view:"imagesList",tmpl:"component",asset:i,author:r};this.frameurl="index.php?"+e.param(a)+"&folder="+t,this.frame.location.href=this.frameurl},getQueryObject:function(t){var i={};return e.each((t||"").split(/[&;]/),function(e,t){var r=t.split("=");i[r[0]]=2==r.length?r[1]:null}),i},getUriObject:function(t){var i={},r=t.match(/^(?:([^:\/?#.]+):)?(?:\/\/)?(([^:\/?#]*)(?::(\d*))?)((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[\?#]|$)))*\/?)?([^?#\/]*))?(?:\?([^#]*))?(?:#(.*))?/);return e.each(["uri","scheme","authority","domain","port","path","directory","file","query","fragment"],function(e,t){i[t]=r&&r[e]?r[e]:""}),i}},e(function(){window.ImageManager.initialize()})}(jQuery,document);