3 * @brief Javascript for the notifications module
6 // Catch the intro ID from the URL
7 var introID = location.pathname.split("/").pop();
9 $(document).ready(function(){
10 // Since only the DIV's inside the notification-list are marked
11 // with the class "unseen", we need some js to transfer this class
12 // to the parent li list-elements.
13 if($(".notif-item").hasClass("unseen")) {
14 $(".notif-item.unseen").parent("li").addClass("unseen");
18 $(window).load(function(){
19 // Scroll to the intro by its intro ID.
21 scrollToItem('intro-' + introID);
25 // Check if it is a real introduction ID.
26 function isIntroID() {
27 // Check for the correct path.
28 if (window.location.href.indexOf("/notifications/intros/") !== -1) {
29 // Make sure the introID is a positive Integer value.
30 var intVal = Number(introID);
31 if (Math.floor(intVal) !== Infinity && String(intVal) === introID && intVal > 0) {