|
@@ -39,6 +39,33 @@ function markread(notif) {
|
|
|
alert('La richiesta è fallita.');
|
|
|
};
|
|
|
}
|
|
|
+
|
|
|
+function markdeleted(notif) {
|
|
|
+ let xhr=new XMLHttpRequest();
|
|
|
+ xhr.open('GET','notifsh.php?act=delete&id='+notif.id.replace(/^notif-([0-9]+)$/,'$1'));
|
|
|
+ xhr.responseType='json';
|
|
|
+ xhr.send();
|
|
|
+ xhr.onload=function() {
|
|
|
+ if (xhr.response['deleted']) {
|
|
|
+ notif.remove();
|
|
|
+ } else {
|
|
|
+ alert("Il server non ha potuto cancellare la notifica " + notif.text);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ xhr.onerror=function() {
|
|
|
+ alert('La richiesta è fallita.');
|
|
|
+ };
|
|
|
+}
|
|
|
+
|
|
|
+function applyAllSelected(fun) {
|
|
|
+ let notifs = document.querySelectorAll("div#notifs-list > div");
|
|
|
+ notifs.forEach(function (notif) {
|
|
|
+ let checkbox = notif.querySelector("input.seen-checkbox");
|
|
|
+ if (checkbox.checked) {
|
|
|
+ fun(notif);
|
|
|
+ }});
|
|
|
+}
|
|
|
+
|
|
|
lmt=<?php echo($notifs['lastmicrotime']); ?>;
|
|
|
chunk=0;
|
|
|
end=false;
|