1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-11 13:32:42 +01:00
Radarr/NzbDrone.Web/Scripts/Notification.js

48 lines
964 B
JavaScript
Raw Normal View History

2010-10-18 08:06:16 +02:00
/// <reference path="jquery-1.4.1-vsdoc.js" />
2010-10-12 04:49:27 +02:00
2010-10-18 08:06:16 +02:00
$(function () {
var speed = 0;
refreshNotifications();
2010-10-12 04:49:27 +02:00
2010-10-18 08:06:16 +02:00
var timer = window.setInterval(function () {
speed = 1800;
refreshNotifications();
}, 2000);
2010-10-12 04:49:27 +02:00
2010-10-18 08:06:16 +02:00
function refreshNotifications() {
$.ajax({
url: '/Notification',
success: notificationCallback
});
}
2010-10-12 04:49:27 +02:00
2010-10-18 08:06:16 +02:00
function notificationCallback(data) {
2010-10-12 04:49:27 +02:00
2010-10-18 08:06:16 +02:00
if (data === "") {
CloseMsg();
2010-10-12 04:49:27 +02:00
}
2010-10-18 08:06:16 +02:00
else {
DisplayMsg(data);
2010-10-12 04:49:27 +02:00
}
2010-10-18 08:06:16 +02:00
}
2010-10-12 04:49:27 +02:00
2010-10-18 08:06:16 +02:00
//SetupNotifications();
//DisplayMsg("Scanning Series Folder.");
2010-10-12 04:49:27 +02:00
2010-10-18 08:06:16 +02:00
function DisplayMsg(sMsg) {
//set the message text
$("#msgText").text(sMsg);
//show the message
$('#msgBox').slideDown(speed, null);
2010-10-18 08:06:16 +02:00
}
2010-10-12 04:49:27 +02:00
2010-10-18 08:06:16 +02:00
function CloseMsg() {
//hide the message
$('#msgBox').slideUp(speed, null);
//clear msg text
$("#msgtText").val("");
}
});
2010-10-12 04:49:27 +02:00