PluginProbe ʕ •ᴥ•ʔ
NitroPack – Performance, Page Speed & Cache Plugin for Core Web Vitals, CDN & Image Optimization / 1.17.0
NitroPack – Performance, Page Speed & Cache Plugin for Core Web Vitals, CDN & Image Optimization v1.17.0
1.19.8 1.19.7 1.19.6 1.19.5 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.11.0 1.12.0 1.13.0 1.14.0 1.15.0 1.15.1 1.15.2 1.15.3 1.16.0 1.16.1 1.16.2 1.16.3 1.16.4 1.16.5 1.16.6 1.16.7 1.16.8 1.17.0 1.17.6 1.17.7 1.17.8 1.17.9 1.18.0 1.18.1 1.18.2 1.18.3 1.18.4 1.18.5 1.18.6 1.18.7 1.18.8 1.18.9 1.19.0 1.19.1 1.19.2 1.19.3 1.19.4 1.3.19 1.3.20 1.4.0 1.4.1 1.5.0 1.5.1 1.5.10 1.5.11 1.5.12 1.5.13 1.5.14 1.5.15 1.5.16 1.5.17 1.5.18 1.5.19 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.7.0 1.7.1 1.8.0 1.8.1 1.8.3 1.9.0 1.9.1 1.9.2
nitropack / view / javascript / np_notices.js
nitropack / view / javascript Last commit date
admin_bar_menu.js 1 year ago flowbite.min.js 2 years ago gravity_forms.js 3 years ago math_captcha.js 3 years ago metabox.js 2 years ago nitropackUI.js 2 years ago np_notices.js 1 year ago np_safemode.js 2 years ago np_settings.js 1 year ago popper.min.js 4 years ago widgets_ajax.js 3 years ago
np_notices.js
73 lines
1 (function () {
2 document.addEventListener("click", function (e) {
3 if (e.target.matches(".notice.is-dismissible[data-dismissible-id] button.notice-dismiss")) {
4 let noticeId = e.target.closest(".notice.is-dismissible[data-dismissible-id]").dataset.dismissibleId;
5 document.cookie = "dismissed_notice_" + noticeId + "=1;path=/;max-age=" + (86400 * 30) + "; secure";
6 }
7 }, true);
8
9
10 document.addEventListener("click", function (e) {
11 if (e.target.matches(".rml_btn")) {
12 var xhr = new XMLHttpRequest();
13 var data = new FormData();
14 data.append('action', 'nitropack_rml_notification');
15 data.append('nonce', nitropack_notices_vars.nonce);
16 data.append('notification_id', e.target.dataset.notification_id);
17 data.append('notification_end', e.target.dataset.notification_end);
18
19 xhr.onreadystatechange = function () {
20 if (xhr.readyState === XMLHttpRequest.DONE) {
21 if (xhr.status === 200) {
22 let response = JSON.parse(xhr.responseText);
23 if (response.transient_status === true) {
24 let notificationsCount = null;
25 let notificationElement = e.target.closest('.nitro-notification');
26
27 if (notificationElement) notificationElement.remove();
28
29 let notificationsCountContainer = document.getElementById('app-notifications');
30 if (notificationsCountContainer) notificationsCount = notificationsCountContainer.querySelectorAll('li').length;
31
32 if (notificationsCount === 0) document.getElementById('app-notifications').remove();
33
34 /* Admin bar update - NitroPack menu */
35 let totalIssues = document.getElementById('nitro-total-issues-count');
36 totalIssues.innerHTML = parseInt(totalIssues.innerHTML) - 1;
37 if (parseInt(totalIssues.innerHTML) === 0) totalIssues.remove();
38
39 /* settings sub menu count update */
40 let notificationIssues = document.getElementById('nitro-notification-issues-count');
41 notificationIssues.innerHTML = parseInt(notificationIssues.innerHTML) - 1;
42 if (parseInt(notificationIssues.innerHTML) === 0) notificationIssues.remove();
43
44 }
45 } else {
46 console.log('Error: ' + xhr.status);
47 }
48 }
49 };
50 xhr.open('POST', ajaxurl);
51 xhr.send(data);
52 }
53 }, true);
54
55 })();
56
57 var loadDismissibleNotices = function () {
58 var $ = jQuery;
59
60 $(".notice.is-dismissible").each(function () {
61 var b = $(this)
62 , c = $('<button type="button" class="notice-dismiss"><span class="screen-reader-text"></span></button>');
63 c.on("click.wp-dismiss-notice", function ($) {
64 $.preventDefault(),
65 b.fadeTo(100, 0, function () {
66 b.slideUp(100, function () {
67 b.remove()
68 })
69 })
70 }),
71 b.append(c)
72 });
73 }