70% Complete50% completed
')}),$(".cancel_button").on("click",function(e){e.preventDefault();var a=$(this).attr("to_cancel"),l=0;$(this).attr("disabled",!0),$(this).text("Canceled"),$.each(o,function(e,n){n.id===a&&(t.removeFile(o[l]),$(this).unbind().remove(),$(".progress-bar_"+a).addClass("progress-bar-danger"),$(".realProgText_"+a).text("Canceled"),$("li#"+l).fadeOut("slow"),totalFiles-=1),l++})}),t.bind("UploadProgress",function(e,a){var t=a.id,o=a.percent;$(".progress-bar_"+t).css("width",o+"%"),$(".realProgText_"+t).text(o+"% Completed"),100==o&&($(".cancel_button[to_cancel='"+t+"']").fadeOut("slow"),$(".progress-bar_"+t).addClass("progress-bar-success"))}),setTimeout(function(){$(".upload-area").addClass("hidden"),$(".form_header").addClass("hidden"),$("#uploadDataContainer").removeClass("hidden"),$(".uploadingProgressContainer").removeClass("hidden"),$("#uploadedFilesInfo").text("Uploaded 0 of "+a.length),$(".allProgress").removeClass("hidden"),t.start()},1e3),$("#allUploadForms").css("display","block")}),t.bind("BeforeUpload",function(){$("#fileUploadProgress").removeClass("hidden"),$(".progress-container").removeClass("hidden")});var o=0;t.bind("UploadProgress",function(e,a){$("#progressNumber").text(a.percent+"%"),$("#videoNumber").text(a.name)}),t.bind("FileUploaded",function(e,t,l){$("#overallProgress").css("width",100/a.length*++o+"%"),$("#overallProgress").parents(".row").find("#uploadedFilesInfo").text("Uploaded "+o+" of "+a.length);var n,s=$.parseJSON(l.response);n=collection_id||$("#SelectionDIV select").val();var i=0,d=0;plupload.each(e.files,function(e){i++,e.id===t.id&&(d=i)}),$.ajax({url:"/actions/photo_uploader.php",type:"post",data:{insertPhoto:"yes",title:t.name,file_name:s.file_name,collection_id:n,ext:s.extension,photo_title:t.name,photo_description:t.name,photo_tags:""},dataType:"JSON",success:function(e){var a=document.createElement("input");a.name="photo_id",a.type="hidden",a.value=e.photoID,$("#tab"+d+" form").append(a),$("#tab"+d+" form").find(".edit-img-thumbnail > img").prop("src",e.photoPreview),$("#tab"+d+" .savePhotoDetails").removeAttr("disabled"),t.data.photoThumb=e.photoPreview,t.data.photo_id=e.photoID}})}),t.bind("UploadComplete",function(e,a){$("#fileUploadProgress").addClass("hidden"),$("#uploadMore").removeClass("hidden"),$(".uploadingProgressContainer").addClass("hidden"),t.refresh(),$("#uploadMessage").html("All Files are uploaded Successfully").attr("class","alert alert-success container"),setTimeout(function(){$("#uploadMessage").addClass("hidden")},5e3)}),t.bind("error",function(e,a){$("#uploadMessage").removeClass("hidden"),a&&$("#uploadMessage").html(a.message).attr("class","alert alert-danger container"),setTimeout(function(){$("#uploadMessage").addClass("hidden")},8e3)}),$("#addNewCollection").on({click:function(e){e.preventDefault();var a=$(this).parents("form").serialize();a+="&mode=add_collection";var t=$(this).parents("form").find("#collection_name").val();$.ajax({type:"post",url:"/ajax.php",data:a,success:function(e){if(null===(e=$.parseJSON(e)).err||void 0===e.err){var a=document.createElement("option");a.value=parseInt(e.id),a.innerHTML=t,a.selected=!0,$("select[name='collection_id']").get(0).appendChild(a),$("#collectionSelection").get(0).appendChild(a.cloneNode(!0)),$("#collectionSelection option").last().attr("selected","selected"),$("#uploadMessage").html(e.msg).attr("class","alert alert-success container").removeClass("hidden"),$("#CollectionDIV").toggle("fast"),$(".form_header").show(),$(".upload-area").show(),$("#collectionSelection").parent().show(),$("#SelectionDIV").find(".alert-danger").hide(),setTimeout(function(){$("#uploadMessage").addClass("hidden")},5e3)}else e.err,$("#uploadMessage").html(e.err).attr("class","alert alert-danger container").removeClass("hidden"),setTimeout(function(){$("#uploadMessage").addClass("hidden")},5e3)}})}}),$("#createNewCollection").on({click:function(e){e.preventDefault(),$("#CollectionDIV").toggle("fast").find("form")[0].reset(),$(".tagit li:not(.tagit-new)").remove(),$(".form_header").hide(),$(".upload-area").hide()}}),$("#cancelAddCollection").on({click:function(e){e.preventDefault(),$("#CollectionDIV").toggle("fast"),$(".form_header").show(),$(".upload-area").show()}}),$("#selectedFilesList a").on({click:function(e){e.preventDefault(),$(this).tab("show")}}),$("#SelectionDIV select").on({change:function(e){var a=$("#collectionId");if(a)$(a).val(this.value);else{var t=document.createElement("input");t.type="hidden",t.name="collection_id",t.value=this.value,$("#allUploadForms form").each(function(e,a){$(a).get(0).appendChild(t)})}}}),$("#uploadMorePhotos").on({click:function(e){e.preventDefault(),$(".upload-area").removeClass("hidden"),$(".form_header").removeClass("hidden"),$("#uploadDataContainer").addClass("hidden")}})}),init_tags("collection_tags",available_collection_tags)});
+window,$(document).ready(function(){$.get(theme+"/js/plupload/js/plupload.full.min.js",function(e){var u=[],m=new plupload.Uploader({browse_button:"selectFiles",runtimes:"html5,flash,silverlight,html4",url:uploadScriptPath,dragdrop:!0,drop_element:"dragDrop",max_file_size:max_upload_size+"Mb",filters:{mime_types:[{title:"Image files",extensions:photo_extensions}]}});m.init(),m.bind("FilesAdded",function(e,l){for(let e=0;e