1var Notification = Notification || {}; 2 3Notification.getNotifications = function () { 4 $.post('/Notification/getNotifications', function (data) { 5 if (data != undefined && data != null) { 6 Notification.bindNotifications(data) 7 } 8 }); 9} 10 11Notification.bindNotifications = function (notifications) { 12 if (notifications.length > 0) { 13 var viewed = true; 14 var contToView = 0; 15 $(".notificationButtom").show(); 16 for (i in notifications) { 17 var template = Notification.getTemplate(); 18 template = template.replace("#thumb#", notifications[i].NotificationThumb); 19 template = template.replace("#title#", notifications[i].NotificationTitle); 20 template = template.replace("#message#", notifications[i].DisplayMessage); 21 $(".notifications .notificationsItens").append(template); 22 $(".notifications .notificationsItens .notification").last().find(".notificationId").val(notifications[i].Id) 23 $(".notifications .notificationsItens .notification").last().find(".destinationView").val(notifications[i].DestinationView) 24 $(".notifications .notificationsItens .notification").last().find(".destinationValue").val(notifications[i].DestinationValue[0].Value) 25 $(".notifications .notificationsItens .notification").last().find(".viewed").val(notifications[i].Viewed) 26 27 if (!notifications[i].Viewed) { 28 contToView++; 29 $(".notifications .notificationsItens .notification").last().addClass("newNotification"); 30 viewed = false; 31 } 32 $(".notifications .notificationsItens .notification").last().click(function () { 33 Helpers.showLoading(); 34 35 GoogleAnalytics.sendEvent({ 36 category: 'Navegação', 37 action: 'Notificação', 38 label: $(this).find(".notificationTitle").html() 39 }) 40 41 var param = "notificationId=" + $(this).find(".notificationId").val(); 42 param += "&destinationView=" + $(this).find(".destinationView").val(); 43 param += "&destinationValue=" + $(this).find(".destinationValue").val(); 44 param += "&viewed=" + $(this).find(".viewed").val(); 45 window.location = ("/notification/viewedNotification?" + param); 46 }) 47 } 48 if (viewed) $(".notificationButtom .notificationAlert").hide(); 49 else $(".notificationButtom .notificationAlert").html(contToView); 50 } 51} 52 53Notification.getTemplate = function () { 54 return $("#notificationTemplate").html(); 55}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.