index of
/
home
/
thefkyzp
/
www
/
wp-content
/
plugins
/
ocean-extra
/
includes
/
admin-bar
/
assets
/
js
/
File: /home/thefkyzp/www/wp-content/plugins/ocean-extra/includes/admin-bar/assets/js/notifications.min.js
"use strict";jQuery(document).ready(function(e){var n={active_blocking_process:!1,elements:{$notifications:e("#ocean-notifications"),$nextButton:e("#ocean-notifications .navigation .next"),$prevButton:e("#ocean-notifications .navigation .prev"),$adminBarCounter:e("#wp-admin-bar-ocean-menu .ocean-menu-notification-counter"),$adminBarMenuItem:e("#wp-admin-bar-ocean-notifications")},init:function(){n.updateNavigation(),n.add_events()},add_events:function(){n.elements.$notifications.on("click",".notice-dismiss",n.block).on("click",".next",n.navNext).on("click",".prev",n.navPrev)},block_block_buttons:function(){n.elements.$notifications.find(".notice-dismiss").prop("disabled",!0)},unblock_block_buttons:function(){n.elements.$notifications.find(".notice-dismiss").prop("disabled",!1)},block:function(t){if(n.block_block_buttons(),!n.active_blocking_process&&(n.active_blocking_process=!0,0!==n.elements.$currentMessage.length)){var s=parseInt(n.elements.$adminBarCounter.text(),10);s>1?(--s,n.elements.$adminBarCounter.html(s)):(n.elements.$adminBarCounter.remove(),n.elements.$adminBarMenuItem.remove());var a=n.elements.$nextMessage.length<1?n.elements.$prevMessage:n.elements.$nextMessage,o=n.elements.$currentMessage.data("message-id");0===a.length?n.elements.$notifications.remove():(n.elements.$currentMessage.remove(),a.addClass("current"),n.updateNavigation());var i={action:"ocean_notification_block",nonce:ocean_notifications_admin.nonce,id:o};e.post(ocean_notifications_admin.ajax_url,i,function(e){n.active_blocking_process=!1,n.unblock_block_buttons()}).fail(function(e,t,s){n.active_blocking_process=!1,n.unblock_block_buttons(),console.log(e.responseText)})}},navNext:function(e){n.elements.$nextButton.hasClass("disabled")||(n.elements.$currentMessage.removeClass("current"),n.elements.$nextMessage.addClass("current"),n.updateNavigation())},navPrev:function(e){n.elements.$prevButton.hasClass("disabled")||(n.elements.$currentMessage.removeClass("current"),n.elements.$prevMessage.addClass("current"),n.updateNavigation())},updateNavigation:function(){n.elements.$currentMessage=n.elements.$notifications.find(".ocean-notifications-message.current"),n.elements.$nextMessage=n.elements.$currentMessage.next(".ocean-notifications-message"),n.elements.$prevMessage=n.elements.$currentMessage.prev(".ocean-notifications-message"),0===n.elements.$nextMessage.length?n.elements.$nextButton.addClass("disabled"):n.elements.$nextButton.removeClass("disabled"),0===n.elements.$prevMessage.length?n.elements.$prevButton.addClass("disabled"):n.elements.$prevButton.removeClass("disabled")}};n.init()});