Signalr working with Font-Awesome

pull/6/head
Mark McDowall 12 years ago
parent e459c0ff37
commit 3ce8ffe21f

@ -54,32 +54,48 @@
}); });
}); });
$('[data-status]').livequery(function () { $('[data-status="Downloading"]').livequery(function () {
var status = $(this).attr('data-status');
$(this).removeClass(function (index, css) { $(this).removeClass(function (index, css) {
return (css.match(/\bicon-\S+/g) || []).join(' '); return (css.match(/\bicon-\S+/g) || []).join(' ');
}); });
if (status == 'Downloading') {
$(this).addClass('icon-download-alt'); $(this).addClass('icon-download-alt');
} });
$('[data-status="Ready"]').livequery(function() {
$(this).removeClass(function (index, css) {
return (css.match(/\bicon-\S+/g) || []).join(' ');
});
if (status == 'Ready') {
$(this).addClass('icon-play'); $(this).addClass('icon-play');
}
if (status == 'AirsToday') { });
$('[data-status="AirsToday"]').livequery(function () {
$(this).removeClass(function (index, css) {
return (css.match(/\bicon-\S+/g) || []).join(' ');
});
$(this).addClass('icon-time'); $(this).addClass('icon-time');
}
if (status == 'NotAired') { });
$('[data-status="NotAired"]').livequery(function () {
$(this).removeClass(function (index, css) {
return (css.match(/\bicon-\S+/g) || []).join(' ');
});
$(this).addClass('icon-calendar'); $(this).addClass('icon-calendar');
}
if (status == 'Missing') { });
$('[data-status="Missing"]').livequery(function () {
$(this).removeClass(function (index, css) {
return (css.match(/\bicon-\S+/g) || []).join(' ');
});
$(this).addClass('icon-sign-blank'); $(this).addClass('icon-sign-blank');
}
}); });
$('.infoBox, .successBox, .warningBox, .errorBox, .validationBox').livequery(function () { $('.infoBox, .successBox, .warningBox, .errorBox, .validationBox').livequery(function () {

@ -70,23 +70,20 @@ $(function () {
// Declare a function on the chat hub so the server can invoke it // Declare a function on the chat hub so the server can invoke it
signalRProvider.updatedStatus = function (data) { signalRProvider.updatedStatus = function (data) {
var imageSrc = '../../Content/Images/' + data.EpisodeStatus + '.png';
var row = $('[data-episode-id="' + data.EpisodeId + '"]'); var row = $('[data-episode-id="' + data.EpisodeId + '"]');
if (row.length == 0) if (row.length == 0)
return; return;
var statusImage = $(row).find('img.statusImage'); var statusElement = $(row).find('i.statusImage');
if (statusImage.length == 0) if (statusElement.length == 0)
return; return;
statusImage.attr('alt', data.EpisodeStatus); statusElement.attr('data-status', data.EpisodeStatus);
statusImage.attr('title', data.EpisodeStatus);
statusImage.attr('src', imageSrc);
if (data.EpisodeStatus != "Missing") { if (data.EpisodeStatus != "Missing") {
statusImage.parent('td').removeClass('episodeMissing'); statusElement.parent('td').removeClass('episodeMissing');
} }
if (data.Quality != null) { if (data.Quality != null) {

Loading…
Cancel
Save