PluginProbe
Taskbuilder – Project Management & Task Management Tool With Kanban Board / 6.0.6
Taskbuilder – Project Management & Task Management Tool With Kanban Board v6.0.6
6.0.6 6.0.5 6.0.2 6.0.3 6.0.4 6.0.1 6.0.0 5.0.8 5.0.9 4.0.9 5.0.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 All 58 releases
← All changes | asset/js/notification.js +67 -67 6.0.46.0.6 View file →
@@ -1,68 +1,68 @@
1 -jQuery(document).ready(function() {
2 - // Load notification count when the page loads
3 - wppm_loadNotifications();
4 - // Refresh every 30 seconds
5 - setInterval(function () {
6 - if (!document.hidden) {
7 - wppm_loadNotifications();
8 - }
9 - }, 60000);
10 -});
11 -
12 -jQuery(document).on('click', function (e) {
13 - if (
14 - !jQuery(e.target).closest('#wppm_notification_bell').length &&
15 - !jQuery(e.target).closest('#wppm-notification-container').length
16 - ) {
17 - jQuery('#wppm-notification-container').hide();
18 - }
19 -});
20 -
21 -function wppm_loadNotifications() {
22 - jQuery.ajax({
23 - url: wppm_notification.ajax_url,
24 - type: "POST",
25 - data: {
26 - action: "wppm_get_notifications"
27 - },
28 - dataType: "json",
29 - success: function(response) {
30 - if(response.length > 0){
31 - jQuery("#wppm_notification_bell").addClass("wppm-has-notification");
32 - jQuery(".wppm-badge").text(response.length).show();
33 - }else{
34 - jQuery("#wppm_notification_bell").removeClass("wppm-has-notification");
35 - jQuery(".wppm-badge").text("0").show();
36 - }
37 - var html = "";
38 - if(response.length > 0){
39 - jQuery.each(response, function(i, notification){
40 - html += '<div class="wppm-notification-item" data-id="' + notification.id + '" data-link="' + notification.link + '">';
41 - html += '<div class="wppm-notification-message">'+notification.message+'</div>';
42 - html += '<small>'+notification.created_at+'</small>';
43 - html += '</div>';
44 - });
45 - }else{
46 - html = '<div class="wppm-no-notification">No new notifications</div>';
47 - }
48 - jQuery("#wppm-notification-container").html(html);
49 - }
50 - });
51 -}
52 -
53 -jQuery(document).on("click", ".wppm-notification-item", function () {
54 - var id = jQuery(this).data("id");
55 - jQuery.ajax({
56 - url: wppm_notification.ajax_url,
57 - type: "POST",
58 - data: {
59 - action: "wppm_mark_notification_read",
60 - id: id
61 - }
62 - });
63 - // Then open the task
64 -});
65 -jQuery(document).on('click', '#wppm_notification_bell', function () {
66 - wppm_loadNotifications();
67 - jQuery('#wppm-notification-container').toggle();
1 +jQuery(document).ready(function() {
2 + // Load notification count when the page loads
3 + wppm_loadNotifications();
4 + // Refresh every 30 seconds
5 + setInterval(function () {
6 + if (!document.hidden) {
7 + wppm_loadNotifications();
8 + }
9 + }, 60000);
10 +});
11 +
12 +jQuery(document).on('click', function (e) {
13 + if (
14 + !jQuery(e.target).closest('#wppm_notification_bell').length &&
15 + !jQuery(e.target).closest('#wppm-notification-container').length
16 + ) {
17 + jQuery('#wppm-notification-container').hide();
18 + }
19 +});
20 +
21 +function wppm_loadNotifications() {
22 + jQuery.ajax({
23 + url: wppm_notification.ajax_url,
24 + type: "POST",
25 + data: {
26 + action: "wppm_get_notifications"
27 + },
28 + dataType: "json",
29 + success: function(response) {
30 + if(response.length > 0){
31 + jQuery("#wppm_notification_bell").addClass("wppm-has-notification");
32 + jQuery(".wppm-badge").text(response.length).show();
33 + }else{
34 + jQuery("#wppm_notification_bell").removeClass("wppm-has-notification");
35 + jQuery(".wppm-badge").text("0").show();
36 + }
37 + var html = "";
38 + if(response.length > 0){
39 + jQuery.each(response, function(i, notification){
40 + html += '<div class="wppm-notification-item" data-id="' + notification.id + '" data-link="' + notification.link + '">';
41 + html += '<div class="wppm-notification-message">'+notification.message+'</div>';
42 + html += '<small>'+notification.created_at+'</small>';
43 + html += '</div>';
44 + });
45 + }else{
46 + html = '<div class="wppm-no-notification">No new notifications</div>';
47 + }
48 + jQuery("#wppm-notification-container").html(html);
49 + }
50 + });
51 +}
52 +
53 +jQuery(document).on("click", ".wppm-notification-item", function () {
54 + var id = jQuery(this).data("id");
55 + jQuery.ajax({
56 + url: wppm_notification.ajax_url,
57 + type: "POST",
58 + data: {
59 + action: "wppm_mark_notification_read",
60 + id: id
61 + }
62 + });
63 + // Then open the task
64 +});
65 +jQuery(document).on('click', '#wppm_notification_bell', function () {
66 + wppm_loadNotifications();
67 + jQuery('#wppm-notification-container').toggle();
68 68 });