(function(e){"use strict";var a={csrfToken:e("meta[name=csrf-token]").attr("content"),csrfTokenName:e("meta[name=csrf-param]").attr("content"),nameLabel:"Name",descriptionLabel:"Description",hasName:true,hasDesc:true,uploadUrl:"",deleteUrl:"",updateUrl:"",arrangeUrl:"",photos:[]};function t(t,s){var o=e.extend({},a,s);var r=o.csrfToken?"&"+o.csrfTokenName+"="+o.csrfToken:"";var n={};var i=e(t);if(!o.hasName){if(!o.hasDesc){i.addClass("no-name-no-desc");e(".edit_selected",i).hide()}else i.addClass("no-name")}else if(!o.hasDesc)i.addClass("no-desc");var c=e(".sorter",i);var l=e(".images",c);var d=e(".editor-modal",i);var p=e(".progress-overlay",i);var h=e(".upload-progress",p);var f=e(".form",d);function v(e){return String(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function u(a,t,s,r){var n='
'+'
'+''+"
"+'
'+(o.hasName?'
'+'"+''+"
":"")+(o.hasDesc?'
'+'"+'"+"
":"")+"
"+"
";return e(n)}var m='
'+'
';if(o.hasName){m+="
"}if(o.hasDesc){m+="

"}m+='
';if(o.hasName||o.hasDesc){m+=' '}m+=''+'
';function g(a,t,s,r,i){var c=e(m);n[a]=c;c.data("id",a);c.data("rank",i);e("img",c).attr("src",t);if(o.hasName){e(".caption h5",c).text(s)}if(o.hasDesc){e(".caption p",c).text(r)}l.append(c);return c}function k(a){var t=a.length;var s=f.empty();for(var o=0;o0){d.modal("show")}}function D(a){e.ajax({type:"POST",url:o.deleteUrl,data:"id[]="+a.join("&id[]=")+r,success:function(e){if(e=="OK"){for(var t=0,s=a.length;t