1 // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPLv3-or-later
4 * Javascript for the notifications module
7 // Catch the intro ID from the URL
8 var introID = location.pathname.split("/").pop();
10 $(document).ready(function () {
11 // Since only the DIV's inside the notification-list are marked
12 // with the class "unseen", we need some js to transfer this class
13 // to the parent li list-elements.
14 if ($(".notif-item").hasClass("unseen")) {
15 $(".notif-item.unseen").parent("li").addClass("unseen");
19 $(window).load(function () {
20 // Scroll to the intro by its intro ID.
22 scrollToItem("intro-" + introID);
26 // Check if it is a real introduction ID.
27 function isIntroID() {
28 // Check for the correct path.
29 if (window.location.href.indexOf("/notifications/intros/") !== -1) {
30 // Make sure the introID is a positive Integer value.
31 var intVal = Number(introID);
32 if (Math.floor(intVal) !== Infinity && String(intVal) === introID && intVal > 0) {