-
Notifications
You must be signed in to change notification settings - Fork 135
Expand file tree
/
Copy pathnotifications.build.js
More file actions
2 lines (2 loc) · 3.41 KB
/
notifications.build.js
File metadata and controls
2 lines (2 loc) · 3.41 KB
1
2
!function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t){var r="error",o={NO_ACCESS:{id:"no_access",name:ef_notifications_localization.no_access,status:r},NO_EMAIL:{id:"no_email",name:ef_notifications_localization.no_email,status:r},POST_AUTHOR:{id:"post_author",name:ef_notifications_localization.post_author,class:"ef-badge-neutral"},AUTO_SUBSCRIBE:{id:"auto_subscribed",name:ef_notifications_localization.auto_subscribed,class:"ef-badge-neutral"}},n=function(e,t){var r=e.find("[data-badge-id='".concat(t.id,"']"));return r.length?jQuery(r[0]):null},a=function(e,t){n(e,t)||e.append(function(e){var t="ef-user-badge";return r===e.status&&(t+=" ef-user-badge-error"),'<div class="'.concat(t,'" data-badge-id="').concat(e.id,'">').concat(e.name,"</div>")}(t))},i=function(e,t){var r=n(e,t);r&&r.remove()};jQuery(document).ready(function(e){jQuery("#ef-post_following_users_box ul").listFilterizer();var t,r={action:"save_notifications",post_id:jQuery("#post_ID").val()};"undefined"!=typeof ef_post_author_id&&(t=jQuery("label[for='ef-selected-users-"+ef_post_author_id+"'] .ef-user-list-badges"),a(t,o.POST_AUTHOR));"undefined"!=typeof ef_post_author_auto_subscribe&&(!function(){var e=jQuery("label[for='ef-selected-users-"+ef_post_author_id+"'] .ef-user-list-badges");a(e,o.AUTO_SUBSCRIBE)}(),jQuery("#ef-selected-users-"+ef_post_author_id).prop("disabled",!0)),jQuery(document).on("click",".ef-post_following_list li input:checkbox, .ef-following_usergroups li input:checkbox",function(){var t=[],n=jQuery(this);r.ef_notifications_name=jQuery(this).attr("name"),r._nonce=jQuery("#ef_notifications_nonce").val(),jQuery(this).parents(".ef-post_following_list").find("input:checked").map(function(){t.push(jQuery(this).val())}),r.user_group_ids=t,e.ajax({type:"POST",url:ajaxurl||wpListL10n.url,data:r,success:function(e){var t=e.data.subscribers_with_no_access.includes(parseInt(jQuery(n).val(),10)),r=e.data.subscribers_with_no_email.includes(parseInt(jQuery(n).val(),10));!function(e,t){var r=t.userHasNoAccess,n=t.userHasNoEmail,s=jQuery(e).parent().closest("li").find(".ef-user-list-badges");r?a(s,o.NO_ACCESS):i(s,o.NO_ACCESS),n?a(s,o.NO_EMAIL):i(s,o.NO_EMAIL)}(jQuery(n),{userHasNoAccess:t,userHasNoEmail:r});var s="#90d296";(t||r)&&(s="#ea8484");jQuery(n.parents("label")).animate({backgroundColor:s},200).animate({backgroundColor:"transparent"},200),jQuery("#ef-post_following_box").trigger("following_list_updated")},error:function(){jQuery("#ef-post_following_users_box").prev().append(' <p class="error">There was an error. Please reload the page.</p>')}})})})}]);
//# sourceMappingURL=notifications.build.js.map