|
|
@ -1,30 +1,27 @@
|
|
|
|
/// <reference path="jquery-1.5.2-vsdoc.js" />
|
|
|
|
$(window).load(function () {
|
|
|
|
$(document).ready(function ()
|
|
|
|
var speed = 700;
|
|
|
|
{
|
|
|
|
|
|
|
|
var speed = 0;
|
|
|
|
|
|
|
|
var isShown = false;
|
|
|
|
var isShown = false;
|
|
|
|
refreshNotifications();
|
|
|
|
var currentMessage = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.doTimeout(200, refreshNotifications);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var timer = window.setInterval(function () {
|
|
|
|
|
|
|
|
speed = 1000;
|
|
|
|
|
|
|
|
refreshNotifications();
|
|
|
|
|
|
|
|
}, 2000);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function refreshNotifications() {
|
|
|
|
function refreshNotifications() {
|
|
|
|
$.ajax({
|
|
|
|
$.get('/notification/Comet', { message: currentMessage }, notificationCallback);
|
|
|
|
url: '/Notification',
|
|
|
|
|
|
|
|
success: notificationCallback
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function notificationCallback(data) {
|
|
|
|
function notificationCallback(data) {
|
|
|
|
|
|
|
|
currentMessage = data;
|
|
|
|
|
|
|
|
|
|
|
|
if (data === "") {
|
|
|
|
if (data === "") {
|
|
|
|
CloseMsg();
|
|
|
|
closeMsg();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
DisplayMsg(data);
|
|
|
|
displayMsg(data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
refreshNotifications();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//SetupNotifications();
|
|
|
|
//SetupNotifications();
|
|
|
@ -32,32 +29,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function DisplayMsg(sMsg) {
|
|
|
|
function displayMsg(sMsg) {
|
|
|
|
//set the message text
|
|
|
|
//set the message text
|
|
|
|
|
|
|
|
$("#msgText").showHtml(sMsg, 150);
|
|
|
|
|
|
|
|
|
|
|
|
//$("#msgText").text(sMsg);
|
|
|
|
|
|
|
|
$("#msgText").showHtml(sMsg, 200);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isShown) {
|
|
|
|
if (!isShown) {
|
|
|
|
isShown = true;
|
|
|
|
$('#msgBox').show("slide", { direction: "right" }, speed / 2);
|
|
|
|
if (speed === 0) {
|
|
|
|
|
|
|
|
$('#msgBox').show();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
$('#msgBox').show("slide", { direction: "right" }, speed);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isShown = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function CloseMsg() {
|
|
|
|
function closeMsg() {
|
|
|
|
//hide the message
|
|
|
|
//hide the message
|
|
|
|
if (isShown) {
|
|
|
|
$('#msgBox').hide("slide", { direction: "right" }, speed);
|
|
|
|
$('#msgBox').hide("slide", { direction: "right" }, speed);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isShown = false;
|
|
|
|
isShown = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|