PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.7.0.11
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.7.0.11
1.8.13.1 1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 All 212 releases
charitable / assets / js / charitable-plupload-fields.min.js

charitable-plupload-fields.min.js in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.7.0.11, at assets/js/charitable-plupload-fields.min.js

2 lines 3.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /*! 1.6.61 2022-07-13 16:23 */
2 CHARITABLE=window.CHARITABLE||{},function(t,e){function a(e){var o=this,a=e.data("params"),i=new plupload.Uploader(a);this.$dragdrop=e,this.$dropzone=t(i.settings.drop_element),this.$images=t("#"+e.data("images")),this.$loader=this.$dragdrop.find(".charitable-drag-drop-image-loader").first(),this.max_file_uploads=a.multipart_params.max_uploads,this.max_file_size=parseInt(this.$dragdrop.data("max-size"),10),this.uploaded=this.$images.children().length,this.max_uploads_alert_shown=!1,this.max_upload_size_alert_shown=!1,i.init(),i.bind("Init",function(e){o.Init(e)}),i.bind("PostInit",function(e){e.refresh()}),i.bind("FileFiltered",function(e,a){o.FileFiltered(e,a)}),i.bind("FilesAdded",function(e,a){o.FilesAdded(e,a)}),i.bind("Error",function(e,a){console.log(a)}),i.bind("FileUploaded",function(e,a,i){o.FileUploaded(e,a,i)})}a.prototype.Init=function(a){var i=this;this.$dropzone&&(a.features.dragdrop&&!this.$dragdrop.parent().hasClass("mobile")&&(this.$dragdrop.parent().addClass("supports-drag-drop"),this.$dropzone.bind("dragover",function(){i.$dropzone.addClass("drag-over")}),this.$dropzone.bind("dragleave",function(){i.$dropzone.removeClass("drag-over")})),this.$dragdrop.on("click",".remove-image",function(e){return e.preventDefault(),i.remove_image(t(this),a)}))},a.prototype.FileFiltered=function(e,a){return this.max_file_uploads&&this.uploaded>=this.max_file_uploads?(this.max_uploads_alert_shown||alert(this.get_max_uploads_message()),this.max_uploads_alert_shown=!0,e.removeFile(a)):a.size>=this.max_file_size?(this.max_upload_size_alert_shown||alert(CHARITABLE_UPLOAD_VARS.max_file_size.replace("%1$s",a.name).replace("%2$s",this.bytes_to_mb(this.max_file_size))),this.max_upload_size_alert_shown=!0,e.removeFile(a)):(this.uploaded+=1,this.uploaded===this.max_file_uploads&&this.hide_dropzone(),void this.add_image_loader(a))},a.prototype.FilesAdded=function(e,a){this.$dropzone.removeClass("drag-over"),this.max_uploads_alert_shown=!1,this.max_upload_size_alert_shown=!1,e.refresh(),e.start()},a.prototype.FileUploaded=function(e,a,i){(i=t.parseJSON(i.response)).success?(this.hide_image_loader(a),this.$images.append(i.data)):this.add_image_error(a,CHARITABLE_UPLOAD_VARS.upload_problem.replace("%s",a.name))},a.prototype.get_max_uploads_message=function(){return(1<this.max_file_uploads?CHARITABLE_UPLOAD_VARS.max_file_uploads_plural:CHARITABLE_UPLOAD_VARS.max_file_uploads_single).replace("%d",this.max_file_uploads)},a.prototype.add_image_loader=function(e){this.$loader.fadeIn(300),this.$loader.children(".images").append('<li data-file-id="'+e.id+'" class="">'+e.name+"</li>")},a.prototype.hide_image_loader=function(e){this.$loader.find("[data-file-id="+e.id+"]").remove(),this.$loader.find(".images li").length||this.$loader.hide()},a.prototype.remove_image=function(e,a){return e.parent().fadeOut(300,function(){this.remove()}),this.$dropzone.fadeIn(300),--this.uploaded,a.refresh(),!1},a.prototype.hide_dropzone=function(){this.$dropzone.removeClass("drag-over"),this.$dropzone.hide()},a.prototype.bytes_to_mb=function(e){var a=Math.floor(Math.log(e)/Math.log(1024));return+(e/Math.pow(1024,a)).toFixed(2)+" "+["B","kB","MB","GB","TB"][a]},a.prototype.add_image_error=function(e,a){var i=this;i.$dropzone.fadeIn(300),i.$loader.find("[data-file-id="+e.id+"]").addClass("error").text(a).delay(5e3).fadeOut(300,function(){i.hide_image_loader(e)})},e.Uploader=a,t(document).ready(function(){t(".charitable-drag-drop").each(function(){new a(t(this))})})}(jQuery,CHARITABLE);