SAAS-1061 - implement podcast list view skeleton; small bugfixes

This commit is contained in:
Duncan Sommerville 2015-09-14 18:26:28 -04:00
parent fe5db4761e
commit 0fcf6a8dac
16 changed files with 512 additions and 439 deletions

View file

@ -80,22 +80,20 @@ var AIRTIME = (function(AIRTIME) {
var libEmpty = $('#library_empty');
if (emptyRow.length > 0) {
emptyRow.hide();
var mediaType = parseInt($('.media_type_selector.selected').attr('data-selection-id')),
var mediaType = parseInt($('.media_type_selector.selected').data('selection-id')),
img = $('#library_empty_image');
// Remove all classes for when we change between empty media types
img.removeClass(function() {
return $( this ).attr( "class" );
});
// TODO: once the new manual pages are added, change links!
$.getJSON( "ajax/library_placeholders.json", function( data ) {
var opts = data[mediaType];
img.addClass("icon-white " + opts.icon);
$('#library_empty_text').html(
$.i18n._("You haven't added any " + opts.media + ".")
+ "<br/>" + $.i18n._(opts.subtext)
+ "<br/><a target='_blank' href='" + opts.href + "'>" + $.i18n._("Learn about " + opts.media) + "</a>"
);
});
var opts = AIRTIME.library.placeholder(mediaType);
img.addClass("icon-white " + opts.icon);
$('#library_empty_text').html(
$.i18n._("You haven't added any " + opts.media + ".")
+ "<br/>" + $.i18n._(opts.subtext)
+ "<br/><a target='_blank' href='" + opts.href + "'>" + $.i18n._("Learn about " + opts.media) + "</a>"
);
libEmpty.show();
} else {
@ -333,13 +331,13 @@ var AIRTIME = (function(AIRTIME) {
return;
}
var selection = $(".media_type_selector.selected").attr("data-selection-id");
var selection = $(".media_type_selector.selected").data("selection-id");
if (selection == 2) {
if (selection == AIRTIME.library.MediaTypeEnum.PLAYLIST) {
AIRTIME.playlist.fnNew();
} else if (selection == 3) {
} else if (selection == AIRTIME.library.MediaTypeEnum.BLOCK) {
AIRTIME.playlist.fnNewBlock();
} else if (selection == 4) {
} else if (selection == AIRTIME.library.MediaTypeEnum.WEBSTREAM) {
AIRTIME.playlist.fnWsNew();
}
});