Easy Watermark - Version 1.0.2

Version Description

  • [Fixed] Media library not working with ACF plugin enabled
Download this release

Release Info

Developer Kubitomakita
Plugin Icon Easy Watermark
Version 1.0.2
Comparing to
See all releases

Code changes from version 1.0.1 to 1.0.2

assets/dist/scripts/media-library.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function s(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,s),r.l=!0,r.exports}s.m=e,s.c=t,s.d=function(e,t,i){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)s.d(i,r,function(t){return e[t]}.bind(null,r));return i},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="../",s(s.s=18)}({0:function(e,t){e.exports=jQuery},1:function(e,t,s){"use strict";s.d(t,"a",(function(){return a})),s.d(t,"b",(function(){return o})),s.d(t,"c",(function(){return n})),s.d(t,"d",(function(){return l}));var i=s(0),r=s.n(i);function a(e,t="info"){const s=r()(document.createElement("div")),i=r()(document.createElement("p")),a=r()(document.createElement("button"));s.addClass("notice notice-"+t+" is-dismissible").hide(),a.addClass("notice-dismiss"),i.html(e),s.append(i).append(a),a.on("click",e=>{e.preventDefault(),s.fadeOut(200,()=>{s.remove()})}),r()("hr.wp-header-end").after(s),s.fadeIn(200)}function o(e,t=!1,s=!0){let i=e.length;for(const r of e.clone().models)(!l(r)||r.get("usedAsWatermark")||!0===t&&!r.get("hasBackup"))&&(!0===s&&e.remove(r),i--);return i}function n(e,t){const s=e.indexOf("?");return-1!==s&&(e=e.substr(0,s)),e+="?v="+t}function l(e){return"object"==typeof e&&e.get&&(e=e.get("mime")),Object.keys(ew.mime).includes(e)}},16:function(e,t){wp.media&&"function"==typeof wp.media.view.SelectModeToggleButton&&(wp.media.view.SelectModeToggleButton=class extends wp.media.view.SelectModeToggleButton{initialize(){super.initialize(),this.controller.on("processing:activate processing:deactivate",this.toggleDisabled,this)}toggleDisabled(){this.model.set("disabled",this.controller.isModeActive("processing"))}toggleBulkEditHandler(){super.toggleBulkEditHandler(),this.controller.trigger("selection:toggle");const e=this.controller.content.get().toolbar;this.controller.isModeActive("select")?e.$(".watermark-mode-toggle-button").removeClass("hidden"):e.$(".watermark-mode-toggle-button").addClass("hidden"),e.$(".watermark-selector").css("display",""),e.$(".ew-status").css("display","")}})},17:function(e,t){wp.media&&("function"==typeof wp.media.view.AttachmentFilters.All&&(wp.media.view.AttachmentFilters.All=class extends wp.media.view.AttachmentFilters.All{initialize(){super.initialize(),this.controller.on("processing:activate processing:deactivate",this.toggleDisabled,this)}toggleDisabled(){this.$el.prop("disabled",!this.$el.is(":disabled"))}}),"function"==typeof wp.media.view.AttachmentFilters.Uploaded&&(wp.media.view.AttachmentFilters.Uploaded=class extends wp.media.view.AttachmentFilters.Uploaded{initialize(){super.initialize(),this.controller.on("processing:activate processing:deactivate",this.toggleDisabled,this)}toggleDisabled(){this.$el.prop("disabled",!this.$el.is(":disabled"))}}),"function"==typeof wp.media.view.DateFilter&&(wp.media.view.DateFilter=class extends wp.media.view.DateFilter{initialize(){super.initialize(),this.controller.on("processing:activate processing:deactivate",this.toggleDisabled,this)}toggleDisabled(){this.$el.prop("disabled",!this.$el.is(":disabled"))}}))},18:function(e,t,s){"use strict";s.r(t);s(30);var i=s(0),r=s.n(i),a=s(1);wp.media&&"function"==typeof wp.media.view.Attachment.Library&&(wp.media.view.Attachment.Library=class extends wp.media.view.Attachment.Library{initialize(){super.initialize(),this.listenTo(this.model,"ewBulkAction:start",this.showLoader),this.listenTo(this.model,"ewBulkAction:done",this.render),this.controller.on("selection:toggle watermark:activate processing:activate",this.disable,this),this.controller.on("watermark:deactivate processing:deactivate",this.enable,this)}render(){super.render(),this.$el.append(r()("<span></span>").addClass("spinner"))}toggleSelection(e){const{method:t}=e;(!this.controller.isModeActive("watermark")||Object(a.d)(this.model)&&!this.model.get("usedAsWatermark")||"between"===t)&&super.toggleSelection(e),this.controller.isModeActive("watermark")&&(Object(a.d)(this.model)&&!this.model.get("usedAsWatermark")||this.$el.blur(),"between"===t&&Object(a.b)(this.options.selection))}showLoader(){this.$el.find(".spinner").css({visibility:"visible"})}disable(){if(!this.controller.isModeActive("watermark")&&!this.controller.isModeActive("processing"))return;if(this.hasBadge)return;if(this.controller.isModeActive("processing")&&!this.wasSelected())return;let e;if(Object(a.d)(this.model))if(this.model.get("usedAsWatermark"))e=ew.i18n.usedAsWatermark;else{if(!this.controller.isModeActive("restoring")||this.model.get("hasBackup"))return;e=ew.i18n.noBackupAvailable}else e=ew.i18n.notSupported;const t=r()("<div>",{class:"badge"}).text(e);this.$el.addClass("disabled").append(t),this.hasBadge=!0}enable(){this.controller.isModeActive("watermark")||this.controller.isModeActive("processing")||(this.$el.removeClass("disabled").find(".badge").remove(),this.hasBadge=!1)}wasSelected(){const e=this.controller.state().get("originalSelection");if(e)return!!e.get(this.model.cid)}});let o=null;wp.media&&"function"==typeof wp.media.view.Button&&(o=class extends wp.media.view.Button{initialize(){super.initialize(),this.controller.on("watermark:activate",()=>{this.$el.removeClass("hidden").show()}),this.controller.on("watermark:deactivate",()=>{this.$el.addClass("hidden").hide()}),this.controller.on("watermark:selected",this.toggleDisabled,this),this.model.set("disabled",!0)}render(){return super.render(),this.controller.isModeActive("watermark")?this.$el.addClass("watermark-button"):this.$el.addClass("watermark-button hidden"),this}click(){super.click(),this.controller.state().get("watermark")&&this.controller.ewWatermark()}toggleDisabled(e){this.model.set("disabled",!e.length)}});var n=o;let l=null;wp.media&&"function"==typeof wp.media.view.Button&&(l=class extends wp.media.view.Button{initialize(){super.initialize(),this.model.set({originalText:this.model.get("text")}),this.controller.on("selection:toggle",this.update,this),this.controller.on("watermark:activate watermark:deactivate",this.render,this),this.controller.on("select:activate select:deactivate",this.render,this)}render(){return super.render(),this.controller.isModeActive("select")&&!this.controller.isModeActive("watermark")?this.$el.addClass("restore-button"):this.$el.addClass("restore-button hidden"),this.update(),this}click(){super.click(),this.controller.isModeActive("select")&&this.controller.ewRestoreBackup()}update(){const e=this.model.get("filteredSelectionCount"),t=Object(a.b)(this.controller.state().get("selection"),!0,!1);t!==e&&(this.model.set({filteredSelectionCount:t,text:`${this.model.get("originalText")} (${t})`}),this.model.set("disabled",!Boolean(t)))}});var c=l;let d=null;if(wp.media&&"function"==typeof wp.media.view.Button){class e extends wp.media.view.Button{initialize(){super.initialize(),this.model.set({originalText:this.model.get("text"),cancelText:this.options.cancelText}),delete this.options.cancelText,this.controller.on("selection:toggle",this.update,this),this.controller.on("watermark:activate",()=>this.$el.html(this.model.get("cancelText"))),this.controller.on("watermark:deactivate",this.update,this)}render(){return super.render(),this.controller.isModeActive("select")?this.$el.addClass("watermark-mode-toggle-button"):this.$el.addClass("watermark-mode-toggle-button hidden"),this.update(),this}click(){super.click(),this.controller.isModeActive("watermark")?this.controller.deactivateMode("watermark"):(this.controller.activateMode("watermark"),Object(a.b)(this.controller.state().get("selection")))}update(){if(this.controller.isModeActive("watermark"))return;const e=this.model.get("filteredSelectionCount"),t=Object(a.b)(this.controller.state().get("selection"),!1,!1);t!==e&&(this.model.set({filteredSelectionCount:t,text:`${this.model.get("originalText")} (${t})`}),this.model.set("disabled",!Boolean(t)),this.controller.state().get("selection").length||this.controller.deactivateMode("watermark"))}}d=e}var h=d;let u=null;if(wp.media&&"function"==typeof wp.media.View){class e extends wp.media.View{constructor(e){super(e),this.controller.on("watermark:activate",this.show,this),this.controller.on("watermark:deactivate",this.hide,this)}events(){return{change:"selectWatermark"}}tagName(){return"select"}selectWatermark(){this.controller.trigger("watermark:selected",this.$el.val()),this.controller.state().set("watermark",this.$el.val())}show(){this.$el.removeClass("hidden")}hide(){this.$el.addClass("hidden")}render(){if(super.render(),this.$el.append(r()("<option>",{value:""}).html(ew.i18n.selectWatermarkLabel)),ew.watermarks){1<Object.keys(ew.watermarks).length&&this.$el.append(r()("<option>",{value:"all"}).html(ew.i18n.allWatermarksLabel));for(const e in ew.watermarks)this.$el.append(r()("<option>",{value:e}).html(ew.watermarks[e]))}return this.controller.isModeActive("select")?this.$el.addClass("watermark-selector"):this.$el.addClass("watermark-selector hidden"),this}}u=e}var p=u;let g=null;if(wp.media&&"function"==typeof wp.media.View){class e extends wp.media.View{tagName(){return"p"}className(){return"ew-status"}template(){let e=this.status.get("text");if(this.status.get("progress")){const t=this.status.get("processed"),s=this.status.get("total"),i=`${t}/${s}`,r=Math.floor(t/s*100);"string"==typeof status&&(e=e.replace("{counter}",i)),e+=` (${r}%)`}return`<span class="status">${e}</span>`}constructor(e){super(e),this.status=this.controller.state().get("ewStatus"),this.status.on("change",this.update,this)}render(){return this.update(),this}update(){this.status.get("visible")?this.$el.removeClass("hidden").html(this.template()):this.$el.addClass("hidden")}cancel(e){e.preventDefault(),this.controller.deactivateMode("watermarking")}}g=e}var m=g;wp.media&&"function"==typeof wp.media.view.AttachmentsBrowser&&(wp.media.view.AttachmentsBrowser=class extends wp.media.view.AttachmentsBrowser{createToolbar(){super.createToolbar(),Object.keys(ew.watermarks).length&&(this.toolbar.set("watermarkModeToggleButton",new h({text:ew.i18n.watermarkModeToggleButtonLabel,cancelText:ew.i18n.cancelLabel,controller:this.controller,priority:-60}).render()),this.toolbar.set("watermarkSelector",new p({controller:this.controller,priority:-50}).render()),this.toolbar.set("watermarkButton",new n({text:ew.i18n.watermarkButtonLabel,style:"primary",controller:this.controller,priority:-40}).render())),this.toolbar.set("restoreButton",new c({text:ew.i18n.restoreButtonLabel,controller:this.controller,priority:-30}).render()),this.toolbar.set("watermarkingStatus",new m({style:"primary",controller:this.controller,priority:-20}).render()),this.controller.on("select:deactivate",()=>this.controller.deactivateMode("watermark")),this.controller.on("watermark:activate",this.hideButtons,this),this.controller.on("watermark:deactivate",this.showButtons,this),this.controller.on("processing:activate processing:deactivate",this.disableViewSwitch,this)}hideButtons(){this.$(".select-mode-toggle-button").addClass("hidden"),this.$(".delete-selected-button").addClass("hidden")}showButtons(){this.$el.html(this.model.get("text")),this.$(".select-mode-toggle-button").removeClass("hidden"),this.$(".delete-selected-button").removeClass("hidden")}disableViewSwitch(){const e=this.toolbar.$(".view-switch");e.hasClass("disabled")?e.removeClass("disabled"):e.addClass("disabled")}});s(16),s(17);var w=s(2);wp.media&&wp.media.view&&wp.media.view.MediaFrame&&"function"==typeof wp.media.view.MediaFrame.Manage&&(wp.media.view.MediaFrame.Manage=class extends wp.media.view.MediaFrame.Manage{browseContent(e){this.state().set({ewCollection:new w.Collection,ewStatus:new w.Model}),super.browseContent(e)}ewBulkAction(){const e=this.state(),t=e.get("selection"),s=e.get("ewAction"),i=t.clone();if(e.set("originalSelection",i),Object(a.b)(t,"restore"===s),!t.length)return;const r=e.get("ewCollection"),o=e.get("ewStatus");r.reset();for(const e of t.models)r.add(e),e.trigger("ewBulkAction:start");this.deactivateMode("watermark").trigger("selection:action:done"),this.activateMode("processing"),o.set({total:r.length,processed:0,error:!1,visible:!0,progress:!0}),this.ewBulkActionRecursive()}ewBulkActionRecursive(){const e=this.state(),t=e.get("ewAction"),s=e.get("watermark");let i,o="easy-watermark/";if("watermark"===t)o+="all"===s?"apply_all":"apply_single",i="all"===s?ew.applyAllNonce:ew.applySingleNonces[s];else{if("restore"!==t)return;o+="restore_backup",i=ew.restoreBackupNonce}const n=e.get("ewStatus"),l=e.get("ewCollection").shift(),c={action:o,nonce:i,watermark:s};let d=n.get("processed");c.attachment_id=l.get("id"),e.set("ewCurrentModel",l),r.a.ajax(ajaxurl,{data:c}).done(e=>{if(!0===e.success){if(e.data.attachmentVersion){l.set("url",Object(a.c)(l.get("url"),e.data.attachmentVersion));const t=l.get("sizes");for(const s of Object.keys(t))t[s].url=Object(a.c)(t[s].url,e.data.attachmentVersion);l.set("sizes",t)}l.set("hasBackup",!!e.data.hasBackup),d++,n.set({processed:d}),l.trigger("ewBulkAction:done"),n.get("total")===d?this.ewBulkActionDone():this.ewBulkActionRecursive()}else{const t="string"==typeof e.data.message?e.data.message:ew.i18n.genericErrorMessage;this.ewBulkActionError(t)}}).fail(()=>{this.ewBulkActionError(ew.i18n.genericErrorMessage)})}ewWatermark(){this.state().set({ewAction:"watermark",ewSuccessMessage:ew.i18n.watermarkingSuccessMessage}).get("ewStatus").set({text:ew.i18n.watermarkingStatus}),this.activateMode("watermarking"),this.ewBulkAction()}ewRestoreBackup(){this.state().set({ewAction:"restore",ewSuccessMessage:ew.i18n.restoringSuccessMessage}).get("ewStatus").set({text:ew.i18n.restoringStatus}),this.activateMode("restoring"),this.ewBulkAction()}ewBulkActionError(e){const t=this.state(),s=t.get("ewStatus"),i=t.get("ewCollection"),r=t.get("ewCurrentModel");r&&i.push(r);for(const e of i.models)e.trigger("ewBulkAction:done");s.set({error:e}),this.ewBulkActionDone()}ewBulkActionDone(){const e=this.state(),t=e.get("ewStatus"),s=e.get("ewCurrentModel"),i=t.get("processed"),r=t.get("error"),o=e.get("ewSuccessMessage");if(this.deactivateMode("watermarking"),this.deactivateMode("restoring"),this.deactivateMode("processing"),i>0&&Object(a.a)(o.replace("{procesed}",i),"success"),r){const e=ew.i18n.bulkActionErrorMessage.replace("{imageTitle}",s.get("title")).replace("{error}",r);Object(a.a)(e,"error")}t.set({visible:!1,progress:!1})}});var k=class extends w.View{constructor(e){super(e),this.controller=e.controller,this.bulkActionSelector=e.bulkActionSelector}},b=class extends k{tagName(){return"select"}className(){return"ew-status"}events(){return{change:"selectWatermark"}}constructor(e){super(e),this.listenTo(this.controller,"change",this.update),this.listenTo(this.controller,"bulkAction:start",this.reset)}render(){super.render(),this.$el.append(r()("<option>",{value:""}).html(ew.i18n.selectWatermarkLabel)),1<Object.keys(ew.watermarks).length&&this.$el.append(r()("<option>",{value:"all"}).html(ew.i18n.allWatermarksLabel));for(const e in ew.watermarks)this.$el.append(r()("<option>",{value:e}).html(ew.watermarks[e]));return this.attach(),this}update(){this.bulkActionSelector.is(this.controller.get("select"))&&("watermark"!==this.controller.get("action")||this.controller.status().get("processing")?this.$el.hide():this.$el.show())}reset(){this.$el.val("all").hide()}attach(){return this.bulkActionSelector.after(this.$el),this.$el.hide(),this}selectWatermark(){this.controller.set("watermark",this.$el.val())}},f=class extends k{tagName(){return"p"}className(){return"ew-status"}template(){let e=this.status.get("text");if(this.status.get("processing")){const t=this.status.get("processed"),s=this.status.get("total"),i=`${t}/${s}`;let r=Math.floor(t/s*100);"string"==typeof e&&(e=e.replace("{counter}",i)),isNaN(r)&&(r=0),e=`${e} (${r}%)`}return e}constructor(e){super(e),this.status=this.controller.status(),this.listenTo(this.status,"change",this.update)}render(){super.render(),this.attach()}update(){this.bulkActionSelector.is(this.controller.get("select"))&&(this.status.get("text")?(this.$el.html(this.template()),this.$el.show()):this.$el.hide())}attach(){return this.bulkActionSelector.parent().append(this.$el),this.$el.hide(),this}},v=class extends k{constructor(e){super(e),this.model=e.model,this.listenTo(this.model,"processing:start",this.showSpinner),this.listenTo(this.model,"processing:done",this.reset),this.listenTo(this.model,"remove",this.deselect),this.controller.on("bulkAction:finished",this.reset,this)}showSpinner(){this.getSpinner().appendTo(this.$el.find("span.media-icon"))}getSpinner(){return this.spinner||(this.spinner=r()("<span>",{class:"spinner ew-spinner"})),this.spinner}reset(){this.spinner&&this.spinner.remove(),this.getStatus().text(""),this.$el.find('input[type="checkbox"]').click().prop("checked",!1)}deselect(){if(this.controller.status().get("processing"))return;let e;this.$el.find('input[type="checkbox"]').click().prop("checked",!1),Object(a.d)(this.model)?this.model.get("usedAsWatermark")?e=ew.i18n.usedAsWatermark:"restore"!==this.controller.get("action")||this.model.get("hasBackup")||(e=ew.i18n.noBackupAvailable):e=ew.i18n.notSupported,this.getStatus().text(` - ${e}`)}getStatus(){return this.status||(this.status=r()("<span>",{class:"ew-status"}),this.$el.find("strong.has-media-icon").append(this.status)),this.status}};class A extends w.Model{constructor(){super(),this.bulkActionsSelectors=r()("select#bulk-action-selector-top, select#bulk-action-selector-bottom"),this.bulkActionsSelectors.length&&this.init()}init(){this.selectBulkAction=this.selectBulkAction.bind(this),this.doAction=this.doAction.bind(this),this.form=r()("form#posts-filter"),this.actionButtons=this.form.find("#doaction, #doaction2"),this.bulkActionsSelectors.each((e,t)=>{const s=r()(t);new b({controller:this,bulkActionSelector:s}).render(),new f({controller:this,bulkActionSelector:s}).render()}).val(-1).on("change",this.selectBulkAction),this.set({attachments:new w.Collection,selection:new w.Collection}),this.actionButtons.on("click",this.doAction),this.on("bulkAction:start",()=>{this.bulkActionsSelectors.val(-1).prop("disabled",!0),this.actionButtons.prop("disabled",!0)}),this.on("bulkAction:finished",()=>{this.bulkActionsSelectors.prop("disabled",!1),this.actionButtons.prop("disabled",!1)})}selectBulkAction(e){const t=r()(e.target);this.set({select:t,action:t.val()})}doAction(e){const t=this.get("action");if(!this.checkAction(t))return;e.preventDefault();const s=this.get("watermark");if("watermark"===t&&!s)return;const i=this.form.find('input[name="media[]"]:checked');if(!i.length)return void this.status().set({text:ew.i18n.noItemsSelected});const a=this.get("attachments"),o=this.get("selection"),n=[];this.trigger("bulkAction:start"),i.each((e,t)=>{const s=r()(t).val(),i=a.get(s);i?o.add(i):n.push(s)}),n.length?(this.status().set({text:'<span class="spinner ew-spinner"></span>'}),r.a.ajax(ajaxurl,{data:{action:"easy-watermark/attachments-info",nonce:ew.attachmentsInfoNonce,attachments:n}}).done(e=>{if(!0===e.success){for(const t of e.data){const e=new w.Model(t);a.push(e),o.push(e),new v({el:`#post-${t.id}`,controller:this,model:e})}this.prepare()}else{const t=e.data.message?e.data.message:ew.i18n.genericErrorMessage;this.actionError(t)}}).fail(()=>{this.actionError(ew.i18n.genericErrorMessage)})):o.length&&this.prepare()}prepare(){const e=this.get("action"),t=this.get("selection"),s="restore"===e,i="watermark"===e?ew.i18n.watermarkingStatus:ew.i18n.restoringStatus,r="watermark"===e?ew.i18n.watermarkingSuccessMessage:ew.i18n.restoringSuccessMessage;if(Object(a.b)(t,s),!t.length)return this.status().set({successMessage:"watermark"===e?ew.i18n.watermarkingNoItems:ew.i18n.restoringNoItems}),void this.actionDone();this.status().set({successMessage:r,text:i,processing:!0,total:t.length,processed:0});for(const e of t.models)e.trigger("processing:start");this.doActionRecursive()}doActionRecursive(){const e=this.get("action"),t=this.get("watermark");let s,i="easy-watermark/";if("watermark"===e)i+="all"===t?"apply_all":"apply_single",s="all"===t?ew.applyAllNonce:ew.applySingleNonces[t];else{if("restore"!==e)return;i+="restore_backup",s=ew.restoreBackupNonce}const o=this.status(),n=this.get("selection"),l=n.shift(),c={action:i,nonce:s,watermark:t};let d=o.get("processed");c.attachment_id=l.get("id"),this.set("currentAttachmentID",c.attachment_id),r.a.ajax(ajaxurl,{data:c}).done(e=>{if(!0===e.success){if(e.data.attachmentVersion){const t=this.form.find("tr#post-"+c.attachment_id+" img"),s=Object(a.c)(t.attr("src"),e.data.attachmentVersion);t.attr({src:s,srcset:""})}d++,o.set({processed:d}),l.set("hasBackup",!!e.data.hasBackup),l.trigger("processing:done"),n.length?this.doActionRecursive():this.actionDone()}else{const t="string"==typeof e.data.message?e.data.message:ew.i18n.genericErrorMessage;this.actionError(t)}}).fail(()=>{this.actionError(ew.i18n.genericErrorMessage)})}actionError(e){this.status().set({error:e}),this.actionDone()}actionDone(){this.trigger("bulkAction:finished"),this.bulkActionsSelectors.prop("disabled",!1);const e=this.status(),t=e.get("processed"),s=e.get("error"),i=e.get("successMessage"),r=this.get("currentAttachmentID");if(t>0?Object(a.a)(i.replace("{procesed}",t),"success"):Object(a.a)(i,"info"),s){const e=this.form.find("tr#post-"+r).find(".column-title a").attr("aria-label"),t=ew.i18n.bulkActionErrorMessage.replace("{imageTitle}",e).replace("{error}",s);Object(a.a)(t,"error")}this.status().set({processing:!1,processed:0,total:0,text:""})}status(){let e=this.get("status");return void 0===e&&((e=new w.Model).set({processed:0,total:0}),this.set({status:e})),e}checkAction(e){return["watermark","restore"].includes(e)}}r()(document).ready(()=>new A)},2:function(e,t){e.exports=Backbone},30:function(e,t){}});
1
+ !function(e){var t={};function s(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,s),r.l=!0,r.exports}s.m=e,s.c=t,s.d=function(e,t,i){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)s.d(i,r,function(t){return e[t]}.bind(null,r));return i},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="../",s(s.s=18)}({0:function(e,t){e.exports=jQuery},1:function(e,t,s){"use strict";s.d(t,"a",(function(){return o})),s.d(t,"b",(function(){return a})),s.d(t,"c",(function(){return n})),s.d(t,"d",(function(){return l}));var i=s(0),r=s.n(i);function o(e,t="info"){const s=r()(document.createElement("div")),i=r()(document.createElement("p")),o=r()(document.createElement("button"));s.addClass("notice notice-"+t+" is-dismissible").hide(),o.addClass("notice-dismiss"),i.html(e),s.append(i).append(o),o.on("click",e=>{e.preventDefault(),s.fadeOut(200,()=>{s.remove()})}),r()("hr.wp-header-end").after(s),s.fadeIn(200)}function a(e,t=!1,s=!0){let i=e.length;for(const r of e.clone().models)(!l(r)||r.get("usedAsWatermark")||!0===t&&!r.get("hasBackup"))&&(!0===s&&e.remove(r),i--);return i}function n(e,t){const s=e.indexOf("?");return-1!==s&&(e=e.substr(0,s)),e+="?v="+t}function l(e){return"object"==typeof e&&e.get&&(e=e.get("mime")),Object.keys(ew.mime).includes(e)}},16:function(e,t){wp.media&&"function"==typeof wp.media.view.SelectModeToggleButton&&(wp.media.view.SelectModeToggleButton=class extends wp.media.view.SelectModeToggleButton{initialize(){super.initialize(),this.controller.on("processing:activate processing:deactivate",this.toggleDisabled,this)}toggleDisabled(){this.model.set("disabled",this.controller.isModeActive("processing"))}toggleBulkEditHandler(){super.toggleBulkEditHandler(),this.controller.trigger("selection:toggle");const e=this.controller.content.get().toolbar;this.controller.isModeActive("select")?e.$(".watermark-mode-toggle-button").removeClass("hidden"):e.$(".watermark-mode-toggle-button").addClass("hidden"),e.$(".watermark-selector").css("display",""),e.$(".ew-status").css("display","")}})},17:function(e,t){wp.media&&("function"==typeof wp.media.view.AttachmentFilters.All&&(wp.media.view.AttachmentFilters.All=class extends wp.media.view.AttachmentFilters.All{initialize(){super.initialize(),this.controller.on("processing:activate processing:deactivate",this.toggleDisabled,this)}toggleDisabled(){this.$el.prop("disabled",!this.$el.is(":disabled"))}}),"function"==typeof wp.media.view.AttachmentFilters.Uploaded&&(wp.media.view.AttachmentFilters.Uploaded=class extends wp.media.view.AttachmentFilters.Uploaded{initialize(){super.initialize(),this.controller.on("processing:activate processing:deactivate",this.toggleDisabled,this)}toggleDisabled(){this.$el.prop("disabled",!this.$el.is(":disabled"))}}),"function"==typeof wp.media.view.DateFilter&&(wp.media.view.DateFilter=class extends wp.media.view.DateFilter{initialize(){super.initialize(),this.controller.on("processing:activate processing:deactivate",this.toggleDisabled,this)}toggleDisabled(){this.$el.prop("disabled",!this.$el.is(":disabled"))}}))},18:function(e,t,s){"use strict";s.r(t);s(30);var i=s(0),r=s.n(i),o=s(1);if(wp.media&&"function"==typeof wp.media.view.Attachment.Library){const e=wp.media.view.Attachment.Library;wp.media.view.Attachment.Library=e.extend({initialize(){e.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"ewBulkAction:start",this.showLoader),this.listenTo(this.model,"ewBulkAction:done",this.render),this.controller.on("selection:toggle watermark:activate processing:activate",this.disable,this),this.controller.on("watermark:deactivate processing:deactivate",this.enable,this)},render(){e.prototype.render.apply(this,arguments),this.$el.append(r()("<span></span>").addClass("spinner"))},toggleSelection({method:t}){(!this.controller.isModeActive("watermark")||Object(o.d)(this.model)&&!this.model.get("usedAsWatermark")||"between"===t)&&e.prototype.toggleSelection.apply(this,arguments),this.controller.isModeActive("watermark")&&(Object(o.d)(this.model)&&!this.model.get("usedAsWatermark")||this.$el.blur(),"between"===t&&Object(o.b)(this.options.selection))},showLoader(){this.$el.find(".spinner").css({visibility:"visible"})},disable(){if(!this.controller.isModeActive("watermark")&&!this.controller.isModeActive("processing"))return;if(this.hasBadge)return;if(this.controller.isModeActive("processing")&&!this.wasSelected())return;let e;if(Object(o.d)(this.model))if(this.model.get("usedAsWatermark"))e=ew.i18n.usedAsWatermark;else{if(!this.controller.isModeActive("restoring")||this.model.get("hasBackup"))return;e=ew.i18n.noBackupAvailable}else e=ew.i18n.notSupported;const t=r()("<div>",{class:"badge"}).text(e);this.$el.addClass("disabled").append(t),this.hasBadge=!0},enable(){this.controller.isModeActive("watermark")||this.controller.isModeActive("processing")||(this.$el.removeClass("disabled").find(".badge").remove(),this.hasBadge=!1)},wasSelected(){const e=this.controller.state().get("originalSelection");if(e)return!!e.get(this.model.cid)}})}let a=null;wp.media&&"function"==typeof wp.media.view.Button&&(a=class extends wp.media.view.Button{initialize(){super.initialize(),this.controller.on("watermark:activate",()=>{this.$el.removeClass("hidden").show()}),this.controller.on("watermark:deactivate",()=>{this.$el.addClass("hidden").hide()}),this.controller.on("watermark:selected",this.toggleDisabled,this),this.model.set("disabled",!0)}render(){return super.render(),this.controller.isModeActive("watermark")?this.$el.addClass("watermark-button"):this.$el.addClass("watermark-button hidden"),this}click(){super.click(),this.controller.state().get("watermark")&&this.controller.ewWatermark()}toggleDisabled(e){this.model.set("disabled",!e.length)}});var n=a;let l=null;wp.media&&"function"==typeof wp.media.view.Button&&(l=class extends wp.media.view.Button{initialize(){super.initialize(),this.model.set({originalText:this.model.get("text")}),this.controller.on("selection:toggle",this.update,this),this.controller.on("watermark:activate watermark:deactivate",this.render,this),this.controller.on("select:activate select:deactivate",this.render,this)}render(){return super.render(),this.controller.isModeActive("select")&&!this.controller.isModeActive("watermark")?this.$el.addClass("restore-button"):this.$el.addClass("restore-button hidden"),this.update(),this}click(){super.click(),this.controller.isModeActive("select")&&this.controller.ewRestoreBackup()}update(){const e=this.model.get("filteredSelectionCount"),t=Object(o.b)(this.controller.state().get("selection"),!0,!1);t!==e&&(this.model.set({filteredSelectionCount:t,text:`${this.model.get("originalText")} (${t})`}),this.model.set("disabled",!Boolean(t)))}});var c=l;let d=null;if(wp.media&&"function"==typeof wp.media.view.Button){class e extends wp.media.view.Button{initialize(){super.initialize(),this.model.set({originalText:this.model.get("text"),cancelText:this.options.cancelText}),delete this.options.cancelText,this.controller.on("selection:toggle",this.update,this),this.controller.on("watermark:activate",()=>this.$el.html(this.model.get("cancelText"))),this.controller.on("watermark:deactivate",this.update,this)}render(){return super.render(),this.controller.isModeActive("select")?this.$el.addClass("watermark-mode-toggle-button"):this.$el.addClass("watermark-mode-toggle-button hidden"),this.update(),this}click(){super.click(),this.controller.isModeActive("watermark")?this.controller.deactivateMode("watermark"):(this.controller.activateMode("watermark"),Object(o.b)(this.controller.state().get("selection")))}update(){if(this.controller.isModeActive("watermark"))return;const e=this.model.get("filteredSelectionCount"),t=Object(o.b)(this.controller.state().get("selection"),!1,!1);t!==e&&(this.model.set({filteredSelectionCount:t,text:`${this.model.get("originalText")} (${t})`}),this.model.set("disabled",!Boolean(t)),this.controller.state().get("selection").length||this.controller.deactivateMode("watermark"))}}d=e}var h=d;let u=null;if(wp.media&&"function"==typeof wp.media.View){class e extends wp.media.View{constructor(e){super(e),this.controller.on("watermark:activate",this.show,this),this.controller.on("watermark:deactivate",this.hide,this)}events(){return{change:"selectWatermark"}}tagName(){return"select"}selectWatermark(){this.controller.trigger("watermark:selected",this.$el.val()),this.controller.state().set("watermark",this.$el.val())}show(){this.$el.removeClass("hidden")}hide(){this.$el.addClass("hidden")}render(){if(super.render(),this.$el.append(r()("<option>",{value:""}).html(ew.i18n.selectWatermarkLabel)),ew.watermarks){1<Object.keys(ew.watermarks).length&&this.$el.append(r()("<option>",{value:"all"}).html(ew.i18n.allWatermarksLabel));for(const e in ew.watermarks)this.$el.append(r()("<option>",{value:e}).html(ew.watermarks[e]))}return this.controller.isModeActive("select")?this.$el.addClass("watermark-selector"):this.$el.addClass("watermark-selector hidden"),this}}u=e}var p=u;let g=null;if(wp.media&&"function"==typeof wp.media.View){class e extends wp.media.View{tagName(){return"p"}className(){return"ew-status"}template(){let e=this.status.get("text");if(this.status.get("progress")){const t=this.status.get("processed"),s=this.status.get("total"),i=`${t}/${s}`,r=Math.floor(t/s*100);"string"==typeof status&&(e=e.replace("{counter}",i)),e+=` (${r}%)`}return`<span class="status">${e}</span>`}constructor(e){super(e),this.status=this.controller.state().get("ewStatus"),this.status.on("change",this.update,this)}render(){return this.update(),this}update(){this.status.get("visible")?this.$el.removeClass("hidden").html(this.template()):this.$el.addClass("hidden")}cancel(e){e.preventDefault(),this.controller.deactivateMode("watermarking")}}g=e}var m=g;wp.media&&"function"==typeof wp.media.view.AttachmentsBrowser&&(wp.media.view.AttachmentsBrowser=class extends wp.media.view.AttachmentsBrowser{createToolbar(){super.createToolbar(),Object.keys(ew.watermarks).length&&(this.toolbar.set("watermarkModeToggleButton",new h({text:ew.i18n.watermarkModeToggleButtonLabel,cancelText:ew.i18n.cancelLabel,controller:this.controller,priority:-60}).render()),this.toolbar.set("watermarkSelector",new p({controller:this.controller,priority:-50}).render()),this.toolbar.set("watermarkButton",new n({text:ew.i18n.watermarkButtonLabel,style:"primary",controller:this.controller,priority:-40}).render())),this.toolbar.set("restoreButton",new c({text:ew.i18n.restoreButtonLabel,controller:this.controller,priority:-30}).render()),this.toolbar.set("watermarkingStatus",new m({style:"primary",controller:this.controller,priority:-20}).render()),this.controller.on("select:deactivate",()=>this.controller.deactivateMode("watermark")),this.controller.on("watermark:activate",this.hideButtons,this),this.controller.on("watermark:deactivate",this.showButtons,this),this.controller.on("processing:activate processing:deactivate",this.disableViewSwitch,this)}hideButtons(){this.$(".select-mode-toggle-button").addClass("hidden"),this.$(".delete-selected-button").addClass("hidden")}showButtons(){this.$el.html(this.model.get("text")),this.$(".select-mode-toggle-button").removeClass("hidden"),this.$(".delete-selected-button").removeClass("hidden")}disableViewSwitch(){const e=this.toolbar.$(".view-switch");e.hasClass("disabled")?e.removeClass("disabled"):e.addClass("disabled")}});s(16),s(17);var w=s(2);wp.media&&wp.media.view&&wp.media.view.MediaFrame&&"function"==typeof wp.media.view.MediaFrame.Manage&&(wp.media.view.MediaFrame.Manage=class extends wp.media.view.MediaFrame.Manage{browseContent(e){this.state().set({ewCollection:new w.Collection,ewStatus:new w.Model}),super.browseContent(e)}ewBulkAction(){const e=this.state(),t=e.get("selection"),s=e.get("ewAction"),i=t.clone();if(e.set("originalSelection",i),Object(o.b)(t,"restore"===s),!t.length)return;const r=e.get("ewCollection"),a=e.get("ewStatus");r.reset();for(const e of t.models)r.add(e),e.trigger("ewBulkAction:start");this.deactivateMode("watermark").trigger("selection:action:done"),this.activateMode("processing"),a.set({total:r.length,processed:0,error:!1,visible:!0,progress:!0}),this.ewBulkActionRecursive()}ewBulkActionRecursive(){const e=this.state(),t=e.get("ewAction"),s=e.get("watermark");let i,a="easy-watermark/";if("watermark"===t)a+="all"===s?"apply_all":"apply_single",i="all"===s?ew.applyAllNonce:ew.applySingleNonces[s];else{if("restore"!==t)return;a+="restore_backup",i=ew.restoreBackupNonce}const n=e.get("ewStatus"),l=e.get("ewCollection").shift(),c={action:a,nonce:i,watermark:s};let d=n.get("processed");c.attachment_id=l.get("id"),e.set("ewCurrentModel",l),r.a.ajax(ajaxurl,{data:c}).done(e=>{if(!0===e.success){if(e.data.attachmentVersion){l.set("url",Object(o.c)(l.get("url"),e.data.attachmentVersion));const t=l.get("sizes");for(const s of Object.keys(t))t[s].url=Object(o.c)(t[s].url,e.data.attachmentVersion);l.set("sizes",t)}l.set("hasBackup",!!e.data.hasBackup),d++,n.set({processed:d}),l.trigger("ewBulkAction:done"),n.get("total")===d?this.ewBulkActionDone():this.ewBulkActionRecursive()}else{const t="string"==typeof e.data.message?e.data.message:ew.i18n.genericErrorMessage;this.ewBulkActionError(t)}}).fail(()=>{this.ewBulkActionError(ew.i18n.genericErrorMessage)})}ewWatermark(){this.state().set({ewAction:"watermark",ewSuccessMessage:ew.i18n.watermarkingSuccessMessage}).get("ewStatus").set({text:ew.i18n.watermarkingStatus}),this.activateMode("watermarking"),this.ewBulkAction()}ewRestoreBackup(){this.state().set({ewAction:"restore",ewSuccessMessage:ew.i18n.restoringSuccessMessage}).get("ewStatus").set({text:ew.i18n.restoringStatus}),this.activateMode("restoring"),this.ewBulkAction()}ewBulkActionError(e){const t=this.state(),s=t.get("ewStatus"),i=t.get("ewCollection"),r=t.get("ewCurrentModel");r&&i.push(r);for(const e of i.models)e.trigger("ewBulkAction:done");s.set({error:e}),this.ewBulkActionDone()}ewBulkActionDone(){const e=this.state(),t=e.get("ewStatus"),s=e.get("ewCurrentModel"),i=t.get("processed"),r=t.get("error"),a=e.get("ewSuccessMessage");if(this.deactivateMode("watermarking"),this.deactivateMode("restoring"),this.deactivateMode("processing"),i>0&&Object(o.a)(a.replace("{procesed}",i),"success"),r){const e=ew.i18n.bulkActionErrorMessage.replace("{imageTitle}",s.get("title")).replace("{error}",r);Object(o.a)(e,"error")}t.set({visible:!1,progress:!1})}});var k=class extends w.View{constructor(e){super(e),this.controller=e.controller,this.bulkActionSelector=e.bulkActionSelector}},b=class extends k{tagName(){return"select"}className(){return"ew-status"}events(){return{change:"selectWatermark"}}constructor(e){super(e),this.listenTo(this.controller,"change",this.update),this.listenTo(this.controller,"bulkAction:start",this.reset)}render(){super.render(),this.$el.append(r()("<option>",{value:""}).html(ew.i18n.selectWatermarkLabel)),1<Object.keys(ew.watermarks).length&&this.$el.append(r()("<option>",{value:"all"}).html(ew.i18n.allWatermarksLabel));for(const e in ew.watermarks)this.$el.append(r()("<option>",{value:e}).html(ew.watermarks[e]));return this.attach(),this}update(){this.bulkActionSelector.is(this.controller.get("select"))&&("watermark"!==this.controller.get("action")||this.controller.status().get("processing")?this.$el.hide():this.$el.show())}reset(){this.$el.val("all").hide()}attach(){return this.bulkActionSelector.after(this.$el),this.$el.hide(),this}selectWatermark(){this.controller.set("watermark",this.$el.val())}},f=class extends k{tagName(){return"p"}className(){return"ew-status"}template(){let e=this.status.get("text");if(this.status.get("processing")){const t=this.status.get("processed"),s=this.status.get("total"),i=`${t}/${s}`;let r=Math.floor(t/s*100);"string"==typeof e&&(e=e.replace("{counter}",i)),isNaN(r)&&(r=0),e=`${e} (${r}%)`}return e}constructor(e){super(e),this.status=this.controller.status(),this.listenTo(this.status,"change",this.update)}render(){super.render(),this.attach()}update(){this.bulkActionSelector.is(this.controller.get("select"))&&(this.status.get("text")?(this.$el.html(this.template()),this.$el.show()):this.$el.hide())}attach(){return this.bulkActionSelector.parent().append(this.$el),this.$el.hide(),this}},v=class extends k{constructor(e){super(e),this.model=e.model,this.listenTo(this.model,"processing:start",this.showSpinner),this.listenTo(this.model,"processing:done",this.reset),this.listenTo(this.model,"remove",this.deselect),this.controller.on("bulkAction:finished",this.reset,this)}showSpinner(){this.getSpinner().appendTo(this.$el.find("span.media-icon"))}getSpinner(){return this.spinner||(this.spinner=r()("<span>",{class:"spinner ew-spinner"})),this.spinner}reset(){this.spinner&&this.spinner.remove(),this.getStatus().text(""),this.$el.find('input[type="checkbox"]').click().prop("checked",!1)}deselect(){if(this.controller.status().get("processing"))return;let e;this.$el.find('input[type="checkbox"]').click().prop("checked",!1),Object(o.d)(this.model)?this.model.get("usedAsWatermark")?e=ew.i18n.usedAsWatermark:"restore"!==this.controller.get("action")||this.model.get("hasBackup")||(e=ew.i18n.noBackupAvailable):e=ew.i18n.notSupported,this.getStatus().text(` - ${e}`)}getStatus(){return this.status||(this.status=r()("<span>",{class:"ew-status"}),this.$el.find("strong.has-media-icon").append(this.status)),this.status}};class A extends w.Model{constructor(){super(),this.bulkActionsSelectors=r()("select#bulk-action-selector-top, select#bulk-action-selector-bottom"),this.bulkActionsSelectors.length&&this.init()}init(){this.selectBulkAction=this.selectBulkAction.bind(this),this.doAction=this.doAction.bind(this),this.form=r()("form#posts-filter"),this.actionButtons=this.form.find("#doaction, #doaction2"),this.bulkActionsSelectors.each((e,t)=>{const s=r()(t);new b({controller:this,bulkActionSelector:s}).render(),new f({controller:this,bulkActionSelector:s}).render()}).val(-1).on("change",this.selectBulkAction),this.set({attachments:new w.Collection,selection:new w.Collection}),this.actionButtons.on("click",this.doAction),this.on("bulkAction:start",()=>{this.bulkActionsSelectors.val(-1).prop("disabled",!0),this.actionButtons.prop("disabled",!0)}),this.on("bulkAction:finished",()=>{this.bulkActionsSelectors.prop("disabled",!1),this.actionButtons.prop("disabled",!1)})}selectBulkAction(e){const t=r()(e.target);this.set({select:t,action:t.val()})}doAction(e){const t=this.get("action");if(!this.checkAction(t))return;e.preventDefault();const s=this.get("watermark");if("watermark"===t&&!s)return;const i=this.form.find('input[name="media[]"]:checked');if(!i.length)return void this.status().set({text:ew.i18n.noItemsSelected});const o=this.get("attachments"),a=this.get("selection"),n=[];this.trigger("bulkAction:start"),i.each((e,t)=>{const s=r()(t).val(),i=o.get(s);i?a.add(i):n.push(s)}),n.length?(this.status().set({text:'<span class="spinner ew-spinner"></span>'}),r.a.ajax(ajaxurl,{data:{action:"easy-watermark/attachments-info",nonce:ew.attachmentsInfoNonce,attachments:n}}).done(e=>{if(!0===e.success){for(const t of e.data){const e=new w.Model(t);o.push(e),a.push(e),new v({el:`#post-${t.id}`,controller:this,model:e})}this.prepare()}else{const t=e.data.message?e.data.message:ew.i18n.genericErrorMessage;this.actionError(t)}}).fail(()=>{this.actionError(ew.i18n.genericErrorMessage)})):a.length&&this.prepare()}prepare(){const e=this.get("action"),t=this.get("selection"),s="restore"===e,i="watermark"===e?ew.i18n.watermarkingStatus:ew.i18n.restoringStatus,r="watermark"===e?ew.i18n.watermarkingSuccessMessage:ew.i18n.restoringSuccessMessage;if(Object(o.b)(t,s),!t.length)return this.status().set({successMessage:"watermark"===e?ew.i18n.watermarkingNoItems:ew.i18n.restoringNoItems}),void this.actionDone();this.status().set({successMessage:r,text:i,processing:!0,total:t.length,processed:0});for(const e of t.models)e.trigger("processing:start");this.doActionRecursive()}doActionRecursive(){const e=this.get("action"),t=this.get("watermark");let s,i="easy-watermark/";if("watermark"===e)i+="all"===t?"apply_all":"apply_single",s="all"===t?ew.applyAllNonce:ew.applySingleNonces[t];else{if("restore"!==e)return;i+="restore_backup",s=ew.restoreBackupNonce}const a=this.status(),n=this.get("selection"),l=n.shift(),c={action:i,nonce:s,watermark:t};let d=a.get("processed");c.attachment_id=l.get("id"),this.set("currentAttachmentID",c.attachment_id),r.a.ajax(ajaxurl,{data:c}).done(e=>{if(!0===e.success){if(e.data.attachmentVersion){const t=this.form.find("tr#post-"+c.attachment_id+" img"),s=Object(o.c)(t.attr("src"),e.data.attachmentVersion);t.attr({src:s,srcset:""})}d++,a.set({processed:d}),l.set("hasBackup",!!e.data.hasBackup),l.trigger("processing:done"),n.length?this.doActionRecursive():this.actionDone()}else{const t="string"==typeof e.data.message?e.data.message:ew.i18n.genericErrorMessage;this.actionError(t)}}).fail(()=>{this.actionError(ew.i18n.genericErrorMessage)})}actionError(e){this.status().set({error:e}),this.actionDone()}actionDone(){this.trigger("bulkAction:finished"),this.bulkActionsSelectors.prop("disabled",!1);const e=this.status(),t=e.get("processed"),s=e.get("error"),i=e.get("successMessage"),r=this.get("currentAttachmentID");if(t>0?Object(o.a)(i.replace("{procesed}",t),"success"):Object(o.a)(i,"info"),s){const e=this.form.find("tr#post-"+r).find(".column-title a").attr("aria-label"),t=ew.i18n.bulkActionErrorMessage.replace("{imageTitle}",e).replace("{error}",s);Object(o.a)(t,"error")}this.status().set({processing:!1,processed:0,total:0,text:""})}status(){let e=this.get("status");return void 0===e&&((e=new w.Model).set({processed:0,total:0}),this.set({status:e})),e}checkAction(e){return["watermark","restore"].includes(e)}}r()(document).ready(()=>new A)},2:function(e,t){e.exports=Backbone},30:function(e,t){}});
easy-watermark.php CHANGED
@@ -6,7 +6,7 @@
6
  * Author URI: https://bracketspace.com/
7
  * Text Domain: easy-watermark
8
  * Domain Path: /languages
9
- * Version: 1.0.1
10
  * License: GPLv2 or later
11
  *
12
  * @package easy-watermark
6
  * Author URI: https://bracketspace.com/
7
  * Text Domain: easy-watermark
8
  * Domain Path: /languages
9
+ * Version: 1.0.2
10
  * License: GPLv2 or later
11
  *
12
  * @package easy-watermark
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: watermark, image, picture, photo, media, gallery, signature, transparent,
5
  Requires at least: 3.8
6
  Requires PHP: 5.6
7
  Tested up to: 5.2
8
- Stable tag: 1.0.1
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  Text Domain: easy-watermark
@@ -118,6 +118,9 @@ All available placeholders are listed in a box titled 'Placeholders' displayed w
118
 
119
  == Changelog ==
120
 
 
 
 
121
  = 1.0.1 =
122
  * [Fixed] Freemius screen displayed incorrectly after activation
123
  * [Fixed] Permission settings now actualy works
5
  Requires at least: 3.8
6
  Requires PHP: 5.6
7
  Tested up to: 5.2
8
+ Stable tag: 1.0.2
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  Text Domain: easy-watermark
118
 
119
  == Changelog ==
120
 
121
+ = 1.0.2 =
122
+ * [Fixed] Media library not working with ACF plugin enabled
123
+
124
  = 1.0.1 =
125
  * [Fixed] Freemius screen displayed incorrectly after activation
126
  * [Fixed] Permission settings now actualy works