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