SignalR added to provide realtime episode status updates. (Series/Details and Downloading only currently)

This commit is contained in:
Mark McDowall 2012-02-12 01:52:51 -08:00
commit f19721912b
19 changed files with 1871 additions and 1156 deletions

View file

@ -62,4 +62,36 @@ function redrawGrid() {
//Force reload using Ajax Binding (bServerSide == false)
function reloadGrid() {
oTable.fnReloadAjax();
}
}
//SignalR
$(function () {
// Proxy created on the fly
var signalRProvider = $.connection.signalRProvider;
// Declare a function on the chat hub so the server can invoke it
signalRProvider.updatedStatus = function (episodeId, episodeStatus) {
var imageSrc = '../../Content/Images/' + episodeStatus + '.png';
var row = $('tr.episodeId_' + episodeId);
if (row.length == 0)
return;
var statusImage = $(row).find('img.statusImage');
if (statusImage.length == 0)
return;
statusImage.attr('alt', episodeStatus);
statusImage.attr('title', episodeStatus);
statusImage.attr('src', imageSrc);
if (episodeStatus != "Missing") {
statusImage.parent('td').removeClass('episodeMissing');
}
};
// Start the connection
$.connection.hub.start();
});