diff --git a/dashboard-ui/plugincatalog.html b/dashboard-ui/plugincatalog.html index f9b1dd9ade..e62fba706f 100644 --- a/dashboard-ui/plugincatalog.html +++ b/dashboard-ui/plugincatalog.html @@ -22,8 +22,6 @@ - -

diff --git a/dashboard-ui/scripts/addpluginpage.js b/dashboard-ui/scripts/addpluginpage.js index de3bbaa7e3..0119f0591d 100644 --- a/dashboard-ui/scripts/addpluginpage.js +++ b/dashboard-ui/scripts/addpluginpage.js @@ -77,7 +77,7 @@ html += "

"; html += ""; html += new Date(review.timestamp).toDateString(); - html += " " + Dashboard.getStoreRatingHtml(review.rating, review.id, review.name, true); + html += " " + RatingHelpers.getStoreRatingHtml(review.rating, review.id, review.name, true); html += " " + review.title; html += ""; if (review.review) { @@ -110,7 +110,7 @@ html += "
"; html += ""; html += new Date(review.timestamp).toDateString(); - html += " " + Dashboard.getStoreRatingHtml(review.rating, review.id, review.name, true); + html += " " + RatingHelpers.getStoreRatingHtml(review.rating, review.id, review.name, true); html += " " + review.title; html += ""; if (review.review) { @@ -241,7 +241,7 @@ } //Ratings and Reviews - var ratingHtml = "Overall " + Dashboard.getStoreRatingHtml(pkg.avgRating, pkg.id, pkg.name); + var ratingHtml = "Overall " + RatingHelpers.getStoreRatingHtml(pkg.avgRating, pkg.id, pkg.name); ratingHtml += ""; ratingHtml += " " + pkg.totalRatings + " Reviews"; ratingHtml += ""; diff --git a/dashboard-ui/scripts/dlnaprofile.js b/dashboard-ui/scripts/dlnaprofile.js index 9f5be97c13..b4bb417583 100644 --- a/dashboard-ui/scripts/dlnaprofile.js +++ b/dashboard-ui/scripts/dlnaprofile.js @@ -5,6 +5,8 @@ var currentSubProfile; var isSubProfileNew; + var allText = Globalize.translate('LabelAll'); + function loadProfile(page) { Dashboard.showLoadingMsg(); @@ -86,7 +88,7 @@ profile.ContainerProfiles = (profile.ContainerProfiles || []); profile.CodecProfiles = (profile.CodecProfiles || []); profile.ResponseProfiles = (profile.ResponseProfiles || []); - + var usersHtml = '' + users.map(function (u) { return ''; }).join(''); @@ -144,13 +146,15 @@ html += '
  • '; html += ''; - html += '

    Container: ' + (profile.Container || 'All') + '

    '; + html += '

    ' + Globalize.translate('ValueContainer').replace('{0}', (profile.Container || allText)) + '

    '; if (profile.Type == 'Video') { - html += '

    Video Codec: ' + (profile.VideoCodec || 'All') + '

    '; - html += '

    Audio Codec: ' + (profile.AudioCodec || 'All') + '

    '; + + html += '

    ' + Globalize.translate('ValueVideoCodec').replace('{0}', (profile.VideoCodec || allText)) + '

    '; + html += '

    ' + Globalize.translate('ValueAudioCodec').replace('{0}', (profile.AudioCodec || allText)) + '

    '; + } else if (profile.Type == 'Audio') { - html += '

    Codec: ' + (profile.AudioCodec || 'All') + '

    '; + html += '

    ' + Globalize.translate('ValueCodec').replace('{0}', (profile.AudioCodec || allText)) + '

    '; } html += '
    '; @@ -198,7 +202,7 @@ $('#txtDirectPlayContainer', popup).val(directPlayProfile.Container || ''); $('#txtDirectPlayAudioCodec', popup).val(directPlayProfile.AudioCodec || ''); $('#txtDirectPlayVideoCodec', popup).val(directPlayProfile.VideoCodec || ''); - + popup.popup('open'); } @@ -224,13 +228,13 @@ html += ''; html += '

    Protocol: ' + (profile.Protocol || 'Http') + '

    '; - html += '

    Container: ' + (profile.Container || 'All') + '

    '; + html += '

    ' + Globalize.translate('ValueContainer').replace('{0}', (profile.Container || allText)) + '

    '; if (profile.Type == 'Video') { - html += '

    Video Codec: ' + (profile.VideoCodec || 'All') + '

    '; - html += '

    Audio Codec: ' + (profile.AudioCodec || 'All') + '

    '; + html += '

    ' + Globalize.translate('ValueVideoCodec').replace('{0}', (profile.VideoCodec || allText)) + '

    '; + html += '

    ' + Globalize.translate('ValueAudioCodec').replace('{0}', (profile.AudioCodec || allText)) + '

    '; } else if (profile.Type == 'Audio') { - html += '

    Codec: ' + (profile.AudioCodec || 'All') + '

    '; + html += '

    ' + Globalize.translate('ValueCodec').replace('{0}', (profile.AudioCodec || allText)) + '

    '; } html += '
    '; @@ -277,7 +281,7 @@ $('#chkReportByteRangeRequests', popup).checked(transcodingProfile.TranscodeSeekInfo == 'Bytes').checkboxradio('refresh'); $('.radioTabButton:first', popup).checked(true).checkboxradio('refresh').trigger('change'); - + popup.popup('open'); } @@ -334,14 +338,16 @@ html += '
  • '; html += ''; - html += '

    Container: ' + (profile.Container || 'All') + '

    '; + html += '

    ' + Globalize.translate('ValueContainer').replace('{0}', (profile.Container || allText)) + '

    '; if (profile.Conditions && profile.Conditions.length) { - html += '

    Conditions: '; - html += profile.Conditions.map(function (c) { + html += '

    '; + + html += Globalize.translate('ValueConditions').replace('{0}', profile.Conditions.map(function (c) { return c.Property; - }).join(', '); + }).join(', ')); + html += '

    '; } @@ -377,7 +383,7 @@ renderContainerProfiles(page, currentProfile.ContainerProfiles); } - + function editContainerProfile(page, containerProfile) { isSubProfileNew = containerProfile == null; @@ -390,7 +396,7 @@ $('#txtContainerProfileContainer', popup).val(containerProfile.Container || ''); $('.radioTabButton:first', popup).checked(true).checkboxradio('refresh').trigger('change'); - + popup.popup('open'); } @@ -434,14 +440,16 @@ html += '
  • '; html += ''; - html += '

    Codec: ' + (profile.Codec || 'All') + '

    '; + html += '

    ' + Globalize.translate('ValueCodec').replace('{0}', (profile.Codec || allText)) + '

    '; if (profile.Conditions && profile.Conditions.length) { - html += '

    Conditions: '; - html += profile.Conditions.map(function (c) { + html += '

    '; + + html += Globalize.translate('ValueConditions').replace('{0}', profile.Conditions.map(function (c) { return c.Property; - }).join(', '); + }).join(', ')); + html += '

    '; } @@ -490,7 +498,7 @@ $('#txtCodecProfileCodec', popup).val(codecProfile.Codec || ''); $('.radioTabButton:first', popup).checked(true).checkboxradio('refresh').trigger('change'); - + popup.popup('open'); } @@ -532,21 +540,23 @@ html += '
  • '; html += ''; - html += '

    Container: ' + (profile.Container || 'All') + '

    '; + html += '

    ' + Globalize.translate('ValueContainer').replace('{0}', (profile.Container || allText)) + '

    '; if (profile.Type == 'Video') { - html += '

    Video Codec: ' + (profile.VideoCodec || 'All') + '

    '; - html += '

    Audio Codec: ' + (profile.AudioCodec || 'All') + '

    '; + html += '

    ' + Globalize.translate('ValueVideoCodec').replace('{0}', (profile.VideoCodec || allText)) + '

    '; + html += '

    ' + Globalize.translate('ValueAudioCodec').replace('{0}', (profile.AudioCodec || allText)) + '

    '; } else if (profile.Type == 'Audio') { - html += '

    Codec: ' + (profile.AudioCodec || 'All') + '

    '; + html += '

    ' + Globalize.translate('ValueCodec').replace('{0}', (profile.AudioCodec || allText)) + '

    '; } if (profile.Conditions && profile.Conditions.length) { - html += '

    Conditions: '; - html += profile.Conditions.map(function (c) { + html += '

    '; + + html += Globalize.translate('ValueConditions').replace('{0}', profile.Conditions.map(function (c) { return c.Property; - }).join(', '); + }).join(', ')); + html += '

    '; } @@ -570,7 +580,7 @@ $('.lnkEditSubProfile', elem).on('click', function () { var index = parseInt(this.getAttribute('data-profileindex')); - + editResponseProfile(page, currentProfile.ResponseProfiles[index]); }); } @@ -787,13 +797,13 @@ editTranscodingProfile(page); }); - + $('.btnAddContainerProfile', page).on('click', function () { editContainerProfile(page); }); - + $('.btnAddCodecProfile', page).on('click', function () { editCodecProfile(page); @@ -854,8 +864,8 @@ return false; }, - - onContainerProfileFormSubmit: function() { + + onContainerProfileFormSubmit: function () { var form = this; var page = $(form).parents('.page'); @@ -864,8 +874,8 @@ return false; }, - - onCodecProfileFormSubmit: function() { + + onCodecProfileFormSubmit: function () { var form = this; var page = $(form).parents('.page'); @@ -873,8 +883,8 @@ return false; }, - - onResponseProfileFormSubmit: function() { + + onResponseProfileFormSubmit: function () { var form = this; var page = $(form).parents('.page'); diff --git a/dashboard-ui/scripts/edititemimages.js b/dashboard-ui/scripts/edititemimages.js index cebc27a5b7..b05e6b0407 100644 --- a/dashboard-ui/scripts/edititemimages.js +++ b/dashboard-ui/scripts/edititemimages.js @@ -75,7 +75,7 @@ return ''; }); - $('#selectImageProvider', page).html('' + providersHtml).val(provider).selectmenu('refresh'); + $('#selectImageProvider', page).html('' + providersHtml).val(provider).selectmenu('refresh'); Dashboard.hideLoadingMsg(); }); @@ -215,7 +215,7 @@ html += '
  • '; } - html += '
    '; + html += '
    '; html += '
    '; @@ -242,9 +242,9 @@ if (showControls) { html += '
    '; - html += ''; + html += ''; - html += ''; + html += ''; html += '
    '; } @@ -275,7 +275,7 @@ $('#btnEditCollectionTitles', page).hide(); } - if (item.MediaType == "Video" && item.LocationType == "FileSystem") { + if (item.MediaType == "Video" && item.LocationType == "FileSystem" && item.Type !== 'TvChannel') { $('#btnEditSubtitles', page).show(); } else { $('#btnEditSubtitles', page).hide(); @@ -325,22 +325,22 @@ if (image.ImageType == "Backdrop" || image.ImageType == "Screenshot") { if (i > 0) { - html += ''; + html += ''; } else { - html += ''; + html += ''; } if (i < length - 1) { - html += ''; + html += ''; } else { - html += ''; + html += ''; } } - html += ''; + html += ''; if (imageProviders.length) { - html += ''; + html += ''; } html += '

    '; @@ -407,15 +407,13 @@ switch (evt.target.error.code) { case evt.target.error.NOT_FOUND_ERR: - Dashboard.showError('File Not Found!'); - break; - case evt.target.error.NOT_READABLE_ERR: - Dashboard.showError('File is not readable'); + Dashboard.showError(Globalize.translate('MessageFileNotFound')); break; case evt.target.error.ABORT_ERR: break; // noop default: - Dashboard.showError('An error occurred reading this file.'); + Dashboard.showError(Globalize.translate('MessageFileReadError')); + break; }; } @@ -440,7 +438,7 @@ }; reader.onabort = function () { Dashboard.hideLoadingMsg(); - Dashboard.showError('File read cancelled'); + console.log('File read cancelled'); }; // Closure to capture the file information. @@ -501,7 +499,7 @@ var page = $.mobile.activePage; - Dashboard.confirm("Are you sure you wish to delete this image?", "Delete " + type + " Image", function (result) { + Dashboard.confirm(Globalize.translate('DeleteImageConfirmation'), Globalize.translate('HeaderDeleteImage'), function (result) { if (result) { ApiClient.deleteItemImage(currentItem.Id, type, index).done(function () { diff --git a/dashboard-ui/scripts/edititemmetadata.js b/dashboard-ui/scripts/edititemmetadata.js index 7faf2d49f8..e804bc60ed 100644 --- a/dashboard-ui/scripts/edititemmetadata.js +++ b/dashboard-ui/scripts/edititemmetadata.js @@ -70,7 +70,7 @@ $('#btnEditCollectionTitles', page).hide(); } - if (item.MediaType == "Video" && item.LocationType == "FileSystem") { + if (item.MediaType == "Video" && item.LocationType == "FileSystem" && item.Type !== 'TvChannel') { $('#btnEditSubtitles', page).show(); } else { $('#btnEditSubtitles', page).hide(); @@ -462,7 +462,7 @@ $('#txtName', page).val(item.Name || ""); $('#txtOverview', page).val(item.Overview || ""); $('#txtShortOverview', page).val(item.ShortOverview || ""); - $('#txtTagline', page).val((item.Taglines.length ? item.Taglines[0] : '')); + $('#txtTagline', page).val((item.Taglines && item.Taglines.length ? item.Taglines[0] : '')); $('#txtSortName', page).val(item.ForcedSortName || ""); $('#txtDisplayMediaType', page).val(item.DisplayMediaType || ""); $('#txtCommunityRating', page).val(item.CommunityRating || ""); @@ -536,7 +536,7 @@ } $('#txtProductionYear', page).val(item.ProductionYear || ""); - $('#txtAirTime', page).val(convertTo24HourFormat(item.AirTime || "")); + $('#txtAirTime', page).val(item.AirTime || ""); var placeofBirth = item.ProductionLocations && item.ProductionLocations.length ? item.ProductionLocations[0] : ''; $('#txtPlaceOfBirth', page).val(placeofBirth); @@ -576,14 +576,14 @@ html += '
  • '; - html += '

    ' + (person.Name || 'Unknown name') + '

    '; + html += '

    ' + (person.Name || '') + '

    '; if (person.Role && person.Role != lastType) { html += '

    ' + (person.Role) + '

    '; } html += '
    '; - html += 'Delete'; + html += '' + Globalize.translate('Delete') + ''; html += '
  • '; } @@ -652,46 +652,6 @@ populatePeople(page, currentItem.People); } - function convertTo24HourFormat(time) { - if (time == "") - return time; - var match = time.match(/^(\d+):(\d+)(.*)$/); - if (match) { - var hours = Number(match[1]); - var minutes = Number(match[2]); - var ampm = $.trim(match[3]); - ampm = ampm.toUpperCase(); - if (ampm == "PM" && hours < 12) hours = hours + 12; - if (ampm == "AM" && hours == 12) hours = 0; - var sHours = hours.toString(); - var sMinutes = minutes.toString(); - if (hours < 10) sHours = "0" + sHours; - if (minutes < 10) sMinutes = "0" + sMinutes; - return sHours + ":" + sMinutes; - } else { - return time; - } - } - - function convertTo12HourFormat(time) { - if (time == "") - return time; - var hours = Number(time.match(/^(\d+)/)[1]); - var minutes = Number(time.match(/:(\d+)/)[1]); - var ampm = "AM"; - if (hours >= 12) { - ampm = "PM"; - hours = hours - 12; - hours = hours == 0 ? 12 : hours; - } - hours = hours == 0 ? 12 : hours; - var sHours = hours.toString(); - var sMinutes = minutes.toString(); - if (hours < 10) sHours = "0" + sHours; - if (minutes < 10) sMinutes = "0" + sMinutes; - return sHours + ":" + sMinutes + " " + ampm; - } - function populateRatings(allParentalRatings, select) { var html = ""; @@ -722,8 +682,8 @@ var html = ""; html += ""; - html += ""; - html += ""; + html += ""; + html += ""; select.html(html).selectmenu("refresh"); } @@ -752,12 +712,11 @@ var field = fields[i]; var name = field.name; var value = field.value || field.name; - var fieldTitle = $.trim(name.replace(/([A-Z])/g, ' $1')); html += '
    '; - html += ''; + html += ''; html += ''; html += '
    '; } @@ -769,37 +728,37 @@ lockedFields = lockedFields || new Array(); var metadatafields = [ - { name: "Name" }, - { name: "Overview" }, - { name: "Genres" }, - { name: "Parental Rating", value: "OfficialRating" }, - { name: "People", value: "Cast" } + { name: Globalize.translate('OptionName'), value: "Name" }, + { name: Globalize.translate('OptionOverview'), value: "Overview" }, + { name: Globalize.translate('OptionGenres'), value: "Genres" }, + { name: Globalize.translate('OptionParentalRating'), value: "OfficialRating" }, + { name: Globalize.translate('OptionPeople'), value: "Cast" } ]; if (item.Type == "Person") { - metadatafields.push({ name: "Birth location", value: "ProductionLocations" }); + metadatafields.push({ name: Globalize.translate('OptionBirthLocation'), value: "ProductionLocations" }); } else { - metadatafields.push({ name: "Production Locations", value: "ProductionLocations" }); + metadatafields.push({ name: Globalize.translate('OptionProductionLocations'), value: "ProductionLocations" }); } if (item.Type == "Series") { - metadatafields.push({ name: "Runtime" }); + metadatafields.push({ name: Globalize.translate('OptionRuntime'), value: "Runtime" }); } - metadatafields.push({ name: "Studios" }); - metadatafields.push({ name: "Tags" }); - metadatafields.push({ name: "Keywords" }); - metadatafields.push({ name: "Images" }); - metadatafields.push({ name: "Backdrops" }); + metadatafields.push({ name: Globalize.translate('OptionStudios'), value: "Studios" }); + metadatafields.push({ name: Globalize.translate('OptionTags'), value: "Tags" }); + metadatafields.push({ name: Globalize.translate('OptionKeywords'), value: "Keywords" }); + metadatafields.push({ name: Globalize.translate('OptionImages'), value: "Images" }); + metadatafields.push({ name: Globalize.translate('OptionBackdrops'), value: "Backdrops" }); if (item.Type == "Game") { - metadatafields.push({ name: "Screenshots" }); + metadatafields.push({ name: Globalize.translate('OptionScreenshots'), value: "Screenshots" }); } var html = ''; - html += "

    Fields

    "; - html += "

    Slide a field to 'off' to lock it and prevent it's data from being changed.

    "; + html += "

    " + Globalize.translate('HeaderFields') + "

    "; + html += "

    " + Globalize.translate('HeaderFieldsHelp') + "

    "; html += generateSliders(metadatafields, 'Fields'); container.html(html).trigger('create'); for (var fieldIndex = 0; fieldIndex < lockedFields.length; fieldIndex++) { @@ -873,7 +832,7 @@ ShortOverview: $('#txtShortOverview', form).val(), Status: $('#selectStatus', form).val(), AirDays: getSelectedAirDays(form), - AirTime: convertTo12HourFormat($('#txtAirTime', form).val()), + AirTime: $('#txtAirTime', form).val(), Genres: editableListViewValues($("#listGenres", form)), ProductionLocations: editableListViewValues($("#listCountries", form)), Tags: editableListViewValues($("#listTags", form)), @@ -928,7 +887,7 @@ ApiClient.updateItem(item).done(function () { - Dashboard.alert('Item saved.'); + Dashboard.alert(Globalize.translate('MessageItemSaved')); MetadataEditor.getItemPromise().done(function (i) { $(form).parents('.page').trigger('itemsaved', [i]); @@ -969,7 +928,7 @@ var page = $(this).parents('.page'); if ($('#fldChallengeValue', page).val() != $('#txtDeleteTest', page).val()) { - Dashboard.alert('The value entered is not correct. Please try again.'); + Dashboard.alert(Globalize.translate('MessageValueNotCorrect')); } else { performDelete(page); } @@ -1090,7 +1049,7 @@ }); if (!hasId && !lookupInfo.Name) { - Dashboard.alert('Please enter a name or an external Id.'); + Dashboard.alert(Globalize.translate('MessagePleaseEnterNameOrId')); return; } @@ -1296,9 +1255,9 @@ } else { - var msg = "

    Are you sure you wish to delete this item from your library?

    "; + var msg = "

    " + Globalize.translate('ConfirmDeleteItem') + "

    "; - Dashboard.confirm(msg, "Confirm Deletion", function (result) { + Dashboard.confirm(msg, Globalize.translate('HeaderDeleteItem'), function (result) { if (result) { diff --git a/dashboard-ui/scripts/editorsidebar.js b/dashboard-ui/scripts/editorsidebar.js index ae26ff4c59..79435f1eb3 100644 --- a/dashboard-ui/scripts/editorsidebar.js +++ b/dashboard-ui/scripts/editorsidebar.js @@ -10,9 +10,9 @@ return { attr: { id: item.Id, rel: rel, itemtype: item.Type }, data: htmlName, state: state }; } - + function getNodeInnerHtml(item) { - + var name = item.Name; // Channel number @@ -38,22 +38,22 @@ htmlName += name; if (!item.LocalTrailerCount && item.Type == "Movie") { - htmlName += ''; + htmlName += ''; } if (!item.ImageTags || !item.ImageTags.Primary) { - htmlName += ''; + htmlName += ''; } if (!item.BackdropImageTags || !item.BackdropImageTags.length) { if (item.Type !== "Episode" && item.Type !== "Season" && item.MediaType !== "Audio" && item.Type !== "TvChannel" && item.Type !== "MusicAlbum") { - htmlName += ''; + htmlName += ''; } } if (!item.ImageTags || !item.ImageTags.Logo) { if (item.Type == "Movie" || item.Type == "Trailer" || item.Type == "Series" || item.Type == "MusicArtist" || item.Type == "BoxSet") { - htmlName += ''; + htmlName += ''; } } @@ -61,7 +61,7 @@ try { if (item.PremiereDate && (new Date().getTime() >= parseISO8601Date(item.PremiereDate, { toLocal: true }).getTime())) { - htmlName += ''; + htmlName += ''; } } catch (err) { @@ -76,7 +76,7 @@ function loadChildrenOfRootNode(page, callback, openItems, selectedId) { - var promise2 = ApiClient.getLiveTvChannels({limit: 0}); + var promise2 = ApiClient.getLiveTvChannels({ limit: 0 }); $.when(promise2).done(function (response2) { @@ -84,10 +84,10 @@ var nodes = []; - nodes.push({ attr: { id: 'MediaFolders', rel: 'folder', itemtype: 'mediafolders' }, data: 'Media Folders', state: 'open' }); + nodes.push({ attr: { id: 'MediaFolders', rel: 'folder', itemtype: 'mediafolders' }, data: Globalize.translate('HeaderMediaFolders'), state: 'open' }); if (result.TotalRecordCount) { - nodes.push({ attr: { id: 'livetv', rel: 'folder', itemtype: 'livetv' }, data: 'Live TV', state: 'closed' }); + nodes.push({ attr: { id: 'livetv', rel: 'folder', itemtype: 'livetv' }, data: Globalize.translate('HeaderLiveTV'), state: 'closed' }); } callback(nodes); @@ -249,7 +249,7 @@ }); } - + function updateEditorNode(page, item) { var elem = $('#' + item.Id + '>a', page)[0]; @@ -261,7 +261,7 @@ $('.editorNode', elem).remove(); $(elem).append(getNodeInnerHtml(item)); - + if (item.IsFolder) { var tree = jQuery.jstree._reference(".libraryTree"); diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 087a99b6f6..fa88adb12e 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -354,7 +354,7 @@ $('.playFlyout').popup("close").remove(); }, - getHref: function (item, context) { + getHref: function (item, context, topParentId) { var href = LibraryBrowser.getHrefInternal(item); @@ -363,6 +363,15 @@ href += context; } + if (topParentId == null) { + topParentId = LibraryMenu.getTopParentId(); + } + + if (topParentId) { + href += href.indexOf('?') == -1 ? "?topParentId=" : "&topParentId="; + href += topParentId; + } + return href; }, diff --git a/dashboard-ui/scripts/livetvchannel.js b/dashboard-ui/scripts/livetvchannel.js index 4ce429f77c..0d65c4e537 100644 --- a/dashboard-ui/scripts/livetvchannel.js +++ b/dashboard-ui/scripts/livetvchannel.js @@ -164,6 +164,28 @@ window.LiveTvHelpers = { + getDaysOfWeek: function () { + + var days = [ + 'Sunday', + 'Monday', + 'Tuesday', + 'Wednesday', + 'Thursday', + 'Friday', + 'Saturday' + ]; + + return days.map(function (d) { + + return { + name: d, + value: d + }; + + }); + }, + getDisplayTime: function (date) { if ((typeof date).toString().toLowerCase() === 'string') { diff --git a/dashboard-ui/scripts/livetvnewrecording.js b/dashboard-ui/scripts/livetvnewrecording.js index 20330a4631..e9aa161115 100644 --- a/dashboard-ui/scripts/livetvnewrecording.js +++ b/dashboard-ui/scripts/livetvnewrecording.js @@ -72,19 +72,13 @@ } } - + function getDaysOfWeek() { - + // Do not localize. These are used as values, not text. - return [ - 'Sunday', - 'Monday', - 'Tuesday', - 'Wednesday', - 'Thursday', - 'Friday', - 'Saturday' - ]; + return LiveTvHelpers.getDaysOfWeek().map(function (d) { + return d.value; + }); } function getDays(page) { @@ -152,7 +146,7 @@ } window.LiveTvNewRecordingPage = { - + onSubmit: onSubmit }; diff --git a/dashboard-ui/scripts/livetvseriestimer.js b/dashboard-ui/scripts/livetvseriestimer.js index 6a4ece92b9..33c3459dbe 100644 --- a/dashboard-ui/scripts/livetvseriestimer.js +++ b/dashboard-ui/scripts/livetvseriestimer.js @@ -37,27 +37,39 @@ $('#chkAnyTime', page).checked(item.RecordAnyTime).checkboxradio('refresh'); var channelHtml = ''; - - if (item.RecurrenceType == 'NewProgramEventsAllChannels' || item.RecurrenceType == 'AllProgramEventsAllChannels') { - channelHtml += 'All Channels'; + if (item.RecordAnyChannel) { + channelHtml += Globalize.translate('LabelAllChannels'); } else if (item.ChannelId) { channelHtml += '' + item.ChannelName + ''; } - $('.channel', page).html('Channel:   ' + channelHtml).trigger('create'); + $('.channel', page).html(channelHtml).trigger('create'); selectDays(page, item.Days); - - $('.time', page).html('Time:   ' + LiveTvHelpers.getDisplayTime(item.StartDate)); + if (item.RecordAnyTime) { + $('.time', page).html(Globalize.translate('LabelAnytime')).trigger('create'); + } + else if (item.ChannelId) { + $('.time', page).html(LiveTvHelpers.getDisplayTime(item.StartDate)).trigger('create'); + } Dashboard.hideLoadingMsg(); } + function getDaysOfWeek() { + + // Do not localize. These are used as values, not text. + return LiveTvHelpers.getDaysOfWeek().map(function (d) { + return d.value; + }); + + } + function selectDays(page, days) { - var daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; + var daysOfWeek = getDaysOfWeek(); for (var i = 0, length = daysOfWeek.length; i < length; i++) { @@ -71,7 +83,7 @@ function getDays(page) { - var daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; + var daysOfWeek = getDaysOfWeek(); var days = []; @@ -82,7 +94,6 @@ if ($('#chk' + day, page).checked()) { days.push(day); } - } return days; @@ -180,13 +191,13 @@ html += '

    '; if (program.IsLive) { - html += 'LIVE  '; + html += '' + Globalize.translate('LabelLiveProgram') + '  '; } else if (program.IsPremiere) { - html += 'PREMIERE  '; + html += '' + Globalize.translate('LabelPremiereProgram') + '  '; } else if (program.IsSeries && !program.IsRepeat) { - html += 'NEW  '; + html += '' + Globalize.translate('LabelNewProgram') + '  '; } html += LiveTvHelpers.getDisplayTime(timer.StartDate); diff --git a/dashboard-ui/scripts/medialibrarypage.js b/dashboard-ui/scripts/medialibrarypage.js index f485deee49..51f00bd1e5 100644 --- a/dashboard-ui/scripts/medialibrarypage.js +++ b/dashboard-ui/scripts/medialibrarypage.js @@ -17,7 +17,6 @@ }); $('#divMediaLibrary', page).show(); - Dashboard.setPageTitle("Media Library"); }, shouldRefreshLibraryAfterChanges: function () { @@ -55,8 +54,8 @@ changeCollectionType: function () { Dashboard.alert({ - message: "To change the folder type, please remove and rebuild the collection with the new type.", - title: "Change Folder Type" + message: Globalize.translate('HeaderChangeFolderTypeHelp'), + title: Globalize.translate('HeaderChangeFolderType') }); }, @@ -380,13 +379,13 @@ var WizardLibraryPage = { var lastResult = task.LastExecutionResult ? task.LastExecutionResult.Status : ''; if (lastResult == "Failed") { - $('.lastRefreshResult', page).html('(failed)'); + $('.lastRefreshResult', page).html('' + Globalize.translate('LabelFailed') + ''); } else if (lastResult == "Cancelled") { - $('.lastRefreshResult', page).html('(cancelled)'); + $('.lastRefreshResult', page).html('' + Globalize.translate('LabelCancelled') + ''); } else if (lastResult == "Aborted") { - $('.lastRefreshResult', page).html('(Aborted by server shutdown)'); + $('.lastRefreshResult', page).html('' + Globalize.translate('LabelAbortedByServerShutdown') + ''); } else { $('.lastRefreshResult', page).html(lastResult); } diff --git a/dashboard-ui/scripts/mediaplayer-video.js b/dashboard-ui/scripts/mediaplayer-video.js index 426ba09fb2..d06952c1ae 100644 --- a/dashboard-ui/scripts/mediaplayer-video.js +++ b/dashboard-ui/scripts/mediaplayer-video.js @@ -897,7 +897,7 @@ function bindEventsForPlayback() { var hideElementsOnIdle = !$.browser.mobile; - + if (hideElementsOnIdle) { $('.itemVideo').off('mousemove.videoplayer keydown.videoplayer scroll.videoplayer', idleHandler); $('.itemVideo').on('mousemove.videoplayer keydown.videoplayer scroll.videoplayer', idleHandler).trigger('mousemove'); @@ -1003,7 +1003,8 @@ self.startTimeTicksOffset = isStatic ? 0 : startPosition || 0; - var seekParam = startPosition ? '#t=' + (startPosition / 10000000) : ''; + var startPositionInSeekParam = startPosition ? (startPosition / 10000000) : 0; + var seekParam = startPositionInSeekParam ? '#t=' + startPositionInSeekParam : ''; var mp4VideoUrl = ApiClient.getUrl('Videos/' + item.Id + '/stream.mp4', $.extend({}, baseParams, { Static: isStatic, @@ -1158,7 +1159,14 @@ volumeSlider.val(initialVolume).slider('refresh'); updateVolumeButtons(initialVolume); - video.on("volumechange.mediaplayerevent", function (e) { + video.one("loadedmetadata.mediaplayerevent", function (e) { + + // Appending #t=xxx to the query string doesn't seem to work with HLS + if (startPositionInSeekParam && this.currentSrc && this.currentSrc.toLowerCase().indexOf('.m3u8') != -1) { + this.currentTime = startPositionInSeekParam; + } + + }).on("volumechange.mediaplayerevent", function (e) { var vol = this.volume; @@ -1234,7 +1242,7 @@ }).on("ended.playbackstopped", function () { - currentTimeElement.empty(); + currentTimeElement.html('--:--'); self.onPlaybackStopped.call(this); diff --git a/dashboard-ui/scripts/plugincatalogpage.js b/dashboard-ui/scripts/plugincatalogpage.js index 56db3126da..604ddbd9c8 100644 --- a/dashboard-ui/scripts/plugincatalogpage.js +++ b/dashboard-ui/scripts/plugincatalogpage.js @@ -6,39 +6,11 @@ IsAdult: false }; - function getApps() { - - var apps = []; - - apps.push({ - type: "UserInstalled", - name: "MBKinect", - category: "Voice Control", - isApp: true, - tileColor: "#050810", - thumbImage: "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/images/mbkinect/thumb.png", - externalUrl: "http://mediabrowser.tv/community/index.php?/topic/850-media-browser-kinect-sensor-plug-in-support/", - isPremium: false, - isExternal: true - }); - - return apps; - } - - function getAppsPromise() { - - var deferred = $.Deferred(); - - deferred.resolveWith(null, [[getApps()]]); - - return deferred.promise(); - } - function reloadList(page) { Dashboard.showLoadingMsg(); - var promise1 = query.TargetSystems == "Apps" ? getAppsPromise() : ApiClient.getAvailablePlugins(query); + var promise1 = ApiClient.getAvailablePlugins(query); var promise2 = ApiClient.getInstalledPlugins(); @@ -113,7 +85,7 @@ if (!plugin.isExternal) { html += "

    "; html += plugin.price > 0 ? "$" + plugin.price.toFixed(2) : Globalize.translate('LabelFree'); - html += Dashboard.getStoreRatingHtml(plugin.avgRating, plugin.id, plugin.name); + html += RatingHelpers.getStoreRatingHtml(plugin.avgRating, plugin.id, plugin.name); html += ""; html += " " + Globalize.translate('LabelNumberReviews').replace("{0}", plugin.totalRatings); diff --git a/dashboard-ui/scripts/ratingdialog.js b/dashboard-ui/scripts/ratingdialog.js index 35e66d598d..87376e9a32 100644 --- a/dashboard-ui/scripts/ratingdialog.js +++ b/dashboard-ui/scripts/ratingdialog.js @@ -9,7 +9,7 @@ options = options || {}; options.header = options.header || "Rate and Review"; - + var html = ''; @@ -514,9 +514,9 @@ var Dashboard = { html += '
    '; - html += '

    My Preferences'; - html += '

    My Profile'; - html += '

    '; + html += '

    ' + Globalize.translate('ButtonMyPreferences') + ''; + html += '

    ' + Globalize.translate('ButtonMyProfile') + ''; + html += '

    '; html += '
    '; html += '
    '; @@ -604,7 +604,6 @@ var Dashboard = { var html = '
    '; - //html += '

    MEDIABROWSER

    '; html += '
    '; html += ''; // videoTopControls @@ -1267,30 +1218,30 @@ $(function () { // Create controls videoPlayerHtml += '
    '; - videoPlayerHtml += ''; - videoPlayerHtml += ''; - videoPlayerHtml += ''; - videoPlayerHtml += ''; + videoPlayerHtml += ''; + videoPlayerHtml += ''; + videoPlayerHtml += ''; + videoPlayerHtml += ''; videoPlayerHtml += '
    '; videoPlayerHtml += ''; videoPlayerHtml += '
    '; - videoPlayerHtml += '
    '; + videoPlayerHtml += '
    --:--
    '; videoPlayerHtml += '
    '; videoPlayerHtml += '
    '; videoPlayerHtml += '
    '; videoPlayerHtml += '
    '; // nowPlayingInfo - videoPlayerHtml += ''; - videoPlayerHtml += ''; + videoPlayerHtml += ''; + videoPlayerHtml += ''; videoPlayerHtml += '
    '; videoPlayerHtml += ''; videoPlayerHtml += '
    '; - videoPlayerHtml += ''; + videoPlayerHtml += ''; videoPlayerHtml += '
    '; // videoControls diff --git a/dashboard-ui/supporter.html b/dashboard-ui/supporter.html index 78a7248674..b0878408e7 100644 --- a/dashboard-ui/supporter.html +++ b/dashboard-ui/supporter.html @@ -21,7 +21,7 @@
    + method="post"> - + +

    ${DonationNextStep}

    -

    Enter supporter key

    +

    ${ButtonEnterSupporterKey}