From 18c08d74f1b3c15feb2b33689dc6e3427d7127e9 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 23 Jul 2013 08:29:28 -0400 Subject: [PATCH] show tips on web client home page --- dashboard-ui/index.html | 3 +++ dashboard-ui/scripts/indexpage.js | 27 +++++++++++++++++++++++++++ dashboard-ui/scripts/mediaplayer.js | 4 ++-- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/dashboard-ui/index.html b/dashboard-ui/index.html index e3404e2627..0bc6a7344d 100644 --- a/dashboard-ui/index.html +++ b/dashboard-ui/index.html @@ -10,6 +10,7 @@
+

Views

@@ -18,6 +19,8 @@

Media Collections

+ +
diff --git a/dashboard-ui/scripts/indexpage.js b/dashboard-ui/scripts/indexpage.js index 08b1a18a0d..ad3d9bbb7c 100644 --- a/dashboard-ui/scripts/indexpage.js +++ b/dashboard-ui/scripts/indexpage.js @@ -1,5 +1,24 @@ (function ($, document, apiClient) { + function reloadTips(page) { + + var tips = [ + 'Did you know that editing the artist or album of a music video will allow it to appear on the artist page?', + 'Did you know that editing the tmdb id, tvdb id, and/or games db id of an album will allow media browser to link it to a movie, series or game as a soundtrack?', + 'Did you know you can re-order your media collections by editing their sort names?' + ]; + + var random = Math.floor((Math.random() * tips.length * 2)); + + var tip = tips[random]; + + if (tip) { + $('#tip', page).html(tip).show(); + } else { + $('#tip', page).hide(); + } + } + function getViewHtml(view) { var html = ''; @@ -70,4 +89,12 @@ }); }); + $(document).on('pagebeforeshow', "#indexPage", function () { + + var page = this; + + reloadTips(page); + + }); + })(jQuery, document, ApiClient); \ No newline at end of file diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index e1409bc774..127cbc84bd 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -676,12 +676,12 @@ } // If none then look at user configuration - if (user.Configuration.AudioLanguagePreference) { + if (user.Configuration.SubtitleLanguagePreference) { for (i = 0, length = mediaStreams.length; i < length; i++) { mediaStream = mediaStreams[i]; - if (mediaStream.Type == "Audio" && mediaStream.Language == user.Configuration.AudioLanguagePreference) { + if (mediaStream.Type == "Subtitle" && mediaStream.Language == user.Configuration.SubtitleLanguagePreference) { if (user.Configuration.UseForcedSubtitlesOnly) {