diff --git a/dashboard-ui/log.html b/dashboard-ui/log.html index 8ec5a51ffb..748ec53be0 100644 --- a/dashboard-ui/log.html +++ b/dashboard-ui/log.html @@ -4,7 +4,7 @@ ${TitleSupport} -
+
@@ -15,10 +15,10 @@ ${TabSupporterKey} ${TabAbout}
- +

${HeaderServerLogFiles}

- +
diff --git a/dashboard-ui/scripts/connectlogin.js b/dashboard-ui/scripts/connectlogin.js index bffa5f0f42..5561d6e862 100644 --- a/dashboard-ui/scripts/connectlogin.js +++ b/dashboard-ui/scripts/connectlogin.js @@ -39,9 +39,8 @@ { var apiClient = result.ApiClient; - Dashboard.serverAddress(apiClient.serverAddress()); - Dashboard.setCurrentUser(apiClient.getCurrentUserId(), apiClient.accessToken()); - window.location.href = 'index.html'; + Dashboard.onLoggedIn(apiClient.serverAddress(), apiClient.getCurrentUserId(), apiClient.accessToken(), apiClient); + Dashboard.navigate('index.html'); } break; case MediaBrowser.ConnectionState.ServerSignIn: diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js index d5b65ca069..47a78a8996 100644 --- a/dashboard-ui/scripts/librarylist.js +++ b/dashboard-ui/scripts/librarylist.js @@ -532,7 +532,7 @@ html += '
'; html += ''; - html += '

'; + html += '

'; html += ''; html += '
'; diff --git a/dashboard-ui/scripts/loginpage.js b/dashboard-ui/scripts/loginpage.js index 103fccf6d1..7d1a4d31e8 100644 --- a/dashboard-ui/scripts/loginpage.js +++ b/dashboard-ui/scripts/loginpage.js @@ -102,19 +102,17 @@ var serverId = getParameterByName('serverid'); - // In a multi-server supported app, set the server address - if (serverId) { - Dashboard.serverAddress(apiClient.serverAddress()); - } - - Dashboard.setCurrentUser(user.Id, result.AccessToken); + var newUrl; if (user.Policy.IsAdministrator && !serverId) { - window.location.href = "dashboard.html?u=" + user.Id + '&t=' + result.AccessToken; + newUrl = "dashboard.html?u=" + user.Id + '&t=' + result.AccessToken; } else { - window.location.href = "index.html?u=" + user.Id + '&t=' + result.AccessToken; + newUrl = "index.html?u=" + user.Id + '&t=' + result.AccessToken; } + Dashboard.onLoggedIn(apiClient.serverAddress(), user.Id, result.AccessToken, apiClient); + Dashboard.navigate(newUrl); + }).fail(function () { $('#pw', '#loginPage').val(''); diff --git a/dashboard-ui/scripts/logpage.js b/dashboard-ui/scripts/logpage.js index aeabebf709..b73d9be888 100644 --- a/dashboard-ui/scripts/logpage.js +++ b/dashboard-ui/scripts/logpage.js @@ -1,6 +1,6 @@ (function () { - $(document).on('pagebeforeshow', "#logPage", function () { + $(document).on('pageshown', "#logPage", function () { var page = this; @@ -46,8 +46,6 @@ $('.serverLogs', page).html(html).trigger('create'); }); - - }); })(); \ No newline at end of file diff --git a/dashboard-ui/scripts/mediaplayer-video.js b/dashboard-ui/scripts/mediaplayer-video.js index 4bd07aac91..5902e88e42 100644 --- a/dashboard-ui/scripts/mediaplayer-video.js +++ b/dashboard-ui/scripts/mediaplayer-video.js @@ -4,9 +4,7 @@ var timeout; var initialVolume; - var fullscreenExited = false; var idleState = true; - var remoteFullscreen = false; var muteButton = null; var unmuteButton = null; @@ -27,32 +25,10 @@ })[0]; }; - self.remoteFullscreen = function () { - - if (remoteFullscreen) { - exitFullScreenToWindow(); - } else { - enterFullScreen(); - } - - remoteFullscreen = !remoteFullscreen; - }; - self.toggleFullscreen = function () { if (self.isFullScreen()) { - if (document.cancelFullScreen) { - document.cancelFullScreen(); - } - else if (document.mozCancelFullScreen) { - document.mozCancelFullScreen(); - } - else if (document.webkitExitFullscreen) { - document.webkitExitFullscreen(); - } - else if (document.webkitCancelFullScreen) { - document.webkitCancelFullScreen(); - } - $('#videoPlayer').removeClass('fullscreenVideo'); + + self.exitFullScreen(); } else { requestFullScreen(document.body); } @@ -66,17 +42,18 @@ }; self.exitFullScreen = function () { + if (document.exitFullscreen) { document.exitFullscreen(); } else if (document.mozExitFullScreen) { document.mozExitFullScreen(); } else if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); + } else if (document.msExitFullscreen) { + document.msExitFullscreen(); } $('#videoPlayer').removeClass('fullscreenVideo'); - - fullscreenExited = true; }; self.isFullScreen = function () { @@ -676,7 +653,7 @@ function requestFullScreen(element) { // Supports most browsers and their versions. - var requestMethod = element.requestFullscreen || element.webkitRequestFullscreen || element.webkitRequestFullScreen || element.mozRequestFullScreen; + var requestMethod = element.requestFullscreen || element.webkitRequestFullscreen || element.mozRequestFullScreen || element.msRequestFullscreen; if (requestMethod) { // Native full screen. requestMethod.call(element); @@ -691,9 +668,6 @@ var player = $("#videoPlayer"); player.addClass("fullscreenVideo"); - - remoteFullscreen = true; - } function exitFullScreenToWindow() { @@ -701,9 +675,6 @@ var player = $("#videoPlayer"); player.removeClass("fullscreenVideo"); - - remoteFullscreen = false; - } function getChaptersFlyoutHtml() { @@ -1008,7 +979,7 @@ $('.itemVideo').on('mousemove.videoplayer keydown.videoplayer scroll.videoplayer', idleHandler).trigger('mousemove'); } - $(document).on('webkitfullscreenchange.videoplayer mozfullscreenchange.videoplayer fullscreenchange.videoplayer', function (e) { + $(document).on('webkitfullscreenchange.videoplayer mozfullscreenchange.videoplayer msfullscreenchange.videoplayer fullscreenchange.videoplayer', function (e) { if (self.isFullScreen()) { enterFullScreen(); @@ -1017,24 +988,6 @@ } else { exitFullScreenToWindow(); } - - fullscreenExited = self.isFullScreen() == false; - - }).on("msfullscreenchange.videoplayer", function (e) { - - fullscreenExited = self.isFullScreen() == false; - - }).on("keyup.videoplayer", function (e) { - - if (fullscreenExited) { - $("#videoPlayer", $("#mediaPlayer")).removeClass("fullscreenVideo"); - fullscreenExited = false; - return; - } - - if (e.keyCode == 27) { - self.stop(); - } }); // Stop playback on browser back button nav @@ -1053,7 +1006,7 @@ function unbindEventsForPlayback() { - $(document).off('webkitfullscreenchange.videoplayer mozfullscreenchange.videoplayer fullscreenchange.videoplayer').off("msfullscreenchange.videoplayer").off("keyup.videoplayer"); + $(document).off('webkitfullscreenchange.videoplayer mozfullscreenchange.videoplayer msfullscreenchange.videoplayer fullscreenchange.videoplayer'); // Stop playback on browser back button nav $(window).off("popstate.videoplayer"); @@ -1335,8 +1288,6 @@ mediaPlayerContainer.trigger("create"); - fullscreenExited = false; - self.currentSubtitleStreamIndex = mediaSource.DefaultSubtitleStreamIndex; $('body').addClass('bodyWithPopupOpen'); diff --git a/dashboard-ui/scripts/registrationservices.js b/dashboard-ui/scripts/registrationservices.js index 286964a3d6..239bd42454 100644 --- a/dashboard-ui/scripts/registrationservices.js +++ b/dashboard-ui/scripts/registrationservices.js @@ -1,7 +1,7 @@ window.RegistrationServices = { renderPluginInfo: function (page, pkg, pluginSecurityInfo) { - + if (pkg.isPremium) { $('.premiumPackage', page).show(); @@ -82,8 +82,8 @@ } }, - addRecurringFields: function(page, period) { - + addRecurringFields: function (page, period) { + var formSelector = '.supporterForm'; // Add recurring fields to form @@ -107,6 +107,12 @@ $('#ppCmd', page).val('_xclick-subscriptions'); $(formSelector, page).trigger('create'); - } + }, + + initSupporterForm: function (page) { + + $('.supporterForm', page).attr('action', 'https://www.paypal.com/cgi-bin/webscr'); + $('.recurringSubscriptionCancellationHelp', page).html(Globalize.translate('LabelRecurringDonationCanBeCancelledHelp')); + } }; \ No newline at end of file diff --git a/dashboard-ui/scripts/selectserver.js b/dashboard-ui/scripts/selectserver.js index 9a7322329d..5267b2b684 100644 --- a/dashboard-ui/scripts/selectserver.js +++ b/dashboard-ui/scripts/selectserver.js @@ -14,9 +14,8 @@ { var apiClient = result.ApiClient; - Dashboard.serverAddress(apiClient.serverAddress()); - Dashboard.setCurrentUser(apiClient.getCurrentUserId(), apiClient.accessToken()); - window.location.href = 'index.html'; + Dashboard.onLoggedIn(apiClient.serverAddress(), apiClient.getCurrentUserId(), apiClient.accessToken(), apiClient); + Dashboard.navigate('index.html'); } break; case MediaBrowser.ConnectionState.ServerSignIn: diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index d46923e848..833e7d31f1 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -206,17 +206,19 @@ var Dashboard = { store.removeItem("token"); store.removeItem("serverAddress"); - var loginPage = !Dashboard.isConnectMode() ? - 'login.html' : - 'connectlogin.html'; + function onLogoutDone() { + + var loginPage = !Dashboard.isConnectMode() ? + 'login.html' : + 'connectlogin.html'; + + window.location.href = loginPage; + } if (logoutWithServer === false) { - window.location.href = loginPage; + onLogoutDone(); } else { - ConnectionManager.logout().done(function () { - window.location.href = loginPage; - }); - + ConnectionManager.logout().done(onLogoutDone); } }, @@ -354,14 +356,17 @@ var Dashboard = { reloadPage: function () { var currentUrl = getWindowUrl().toLowerCase(); + var newUrl; // If they're on a plugin config page just go back to the dashboard // The plugin may not have been loaded yet, or could have been uninstalled if (currentUrl.indexOf('configurationpage') != -1) { - window.location.href = "dashboard.html"; + newUrl = "dashboard.html"; } else { - window.location.href = getWindowUrl(); + newUrl = getWindowUrl(); } + + window.location.href = newUrl; }, hideDashboardVersionWarning: function () { @@ -1375,7 +1380,7 @@ var Dashboard = { // The native app can handle a little bit more than safari if (Dashboard.isRunningInCordova()) { - quality -= 10; + quality -= 15; if (isBackdrop) { quality -= 20; @@ -1481,6 +1486,16 @@ var Dashboard = { deferred.resolve(); }); return deferred.promise(); + }, + + onLoggedIn: function(serverAddress, userId, accessToken, apiClient) { + + if (Dashboard.isConnectMode()) { + Dashboard.serverAddress(serverAddress); + } + + Dashboard.setCurrentUser(userId, accessToken); + window.ApiClient = apiClient; } }; diff --git a/dashboard-ui/scripts/streamingsettings.js b/dashboard-ui/scripts/streamingsettings.js index d55d1635a0..2c05789519 100644 --- a/dashboard-ui/scripts/streamingsettings.js +++ b/dashboard-ui/scripts/streamingsettings.js @@ -7,7 +7,23 @@ Dashboard.hideLoadingMsg(); } - $(document).on('pageinit', "#streamingSettingsPage", function () { + function onSubmit() { + Dashboard.showLoadingMsg(); + + var form = this; + + ApiClient.getServerConfiguration().done(function (config) { + + config.RemoteClientBitrateLimit = parseInt(parseFloat(($('#txtRemoteClientBitrateLimit', form).val() || '0')) * 1000000); + + ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult); + }); + + // Disable default form submission + return false; + } + + $(document).on('pageinitdepends', "#streamingSettingsPage", function () { var page = this; @@ -31,7 +47,9 @@ }); }); - }).on('pageshow', "#streamingSettingsPage", function () { + $('.streamingSettingsForm').off('submit', onSubmit).on('submit', onSubmit); + + }).on('pageshown', "#streamingSettingsPage", function () { Dashboard.showLoadingMsg(); @@ -44,24 +62,4 @@ }); }); - window.StreamingSettingsPage = { - - onSubmit: function () { - - Dashboard.showLoadingMsg(); - - var form = this; - - ApiClient.getServerConfiguration().done(function (config) { - - config.RemoteClientBitrateLimit = parseInt(parseFloat(($('#txtRemoteClientBitrateLimit', form).val() || '0')) * 1000000); - - ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult); - }); - - // Disable default form submission - return false; - } - }; - })(jQuery, document, window); diff --git a/dashboard-ui/scripts/supporterpage.js b/dashboard-ui/scripts/supporterpage.js index a6f3075b1b..48a32696ee 100644 --- a/dashboard-ui/scripts/supporterpage.js +++ b/dashboard-ui/scripts/supporterpage.js @@ -105,7 +105,23 @@ }); } - $(document).on('pageinit', "#supporterPage", function () { + function onSubmit() { + var form = this; + var page = $(form).parents('.page'); + + if ($('.hfIsActive', page).val() == 'true') { + + var currentPlanType = $('.hfPlanType', page).val(); + + if (currentPlanType != 'Lifetime') { + + // Use a regular alert to block the submission process until they hit ok + alert(Globalize.translate('MessageChangeRecurringPlanConfirm')); + } + } + } + + $(document).on('pageinitdepends', "#supporterPage", function () { var page = this; @@ -156,7 +172,11 @@ updateSavedDonationAmount(page); }); - }).on('pageshow', "#supporterPage", function () { + RegistrationServices.initSupporterForm(page); + + $('.supporterForm').off('submit', onSubmit).on('submit', onSubmit); + + }).on('pageshown', "#supporterPage", function () { var page = this; @@ -174,26 +194,4 @@ loadUserInfo(page); }); - window.SupporterPage = { - - onSubmit: function () { - - var form = this; - var page = $(form).parents('.page'); - - if ($('.hfIsActive', page).val() == 'true') { - - var currentPlanType = $('.hfPlanType', page).val(); - - if (currentPlanType != 'Lifetime') { - - // Use a regular alert to block the submission process until they hit ok - alert(Globalize.translate('MessageChangeRecurringPlanConfirm')); - } - } - - } - - }; - })(); \ No newline at end of file diff --git a/dashboard-ui/scripts/tvlatest.js b/dashboard-ui/scripts/tvlatest.js index 9ff7b4a85d..a48a01e6b9 100644 --- a/dashboard-ui/scripts/tvlatest.js +++ b/dashboard-ui/scripts/tvlatest.js @@ -9,7 +9,7 @@ return 'Thumb'; } - $(document).on('pagebeforeshow', "#tvNextUpPage", function () { + $(document).on('pageshown', "#tvNextUpPage", function () { var userId = Dashboard.getCurrentUserId(); diff --git a/dashboard-ui/scripts/usernew.js b/dashboard-ui/scripts/usernew.js index 4dfe10aa52..8350273979 100644 --- a/dashboard-ui/scripts/usernew.js +++ b/dashboard-ui/scripts/usernew.js @@ -109,21 +109,15 @@ }); } - function newUserPage() { + function onSubmit() { + var page = $(this).parents('.page'); - var self = this; + Dashboard.showLoadingMsg(); - self.onSubmit = function () { + saveUser(page); - var page = $(this).parents('.page'); - - Dashboard.showLoadingMsg(); - - saveUser(page); - - // Disable default form submission - return false; - }; + // Disable default form submission + return false; } function loadData(page) { @@ -131,9 +125,7 @@ loadUser(page); } - window.NewUserPage = new newUserPage(); - - $(document).on('pageinit', "#newUserPage", function () { + $(document).on('pageinitdepends', "#newUserPage", function () { var page = this; @@ -157,7 +149,9 @@ }); - }).on('pageshow', "#newUserPage", function () { + $('.newUserProfileForm').off('submit', onSubmit).on('submit', onSubmit); + + }).on('pageshown', "#newUserPage", function () { var page = this; diff --git a/dashboard-ui/streamingsettings.html b/dashboard-ui/streamingsettings.html index 5bf6b351c3..ee3de68e4a 100644 --- a/dashboard-ui/streamingsettings.html +++ b/dashboard-ui/streamingsettings.html @@ -4,7 +4,7 @@ ${TitlePlayback} -
+
@@ -39,10 +39,6 @@
- -
diff --git a/dashboard-ui/supporter.html b/dashboard-ui/supporter.html index db5f749aed..bd1d967bc5 100644 --- a/dashboard-ui/supporter.html +++ b/dashboard-ui/supporter.html @@ -4,7 +4,7 @@ ${TitleSupport} -
+
@@ -27,7 +27,7 @@

-
+
${HeaderDonationType} @@ -53,7 +53,7 @@
-
${LabelRecurringDonationCanBeCancelledHelp}
+
@@ -113,10 +113,6 @@
- -
diff --git a/dashboard-ui/thirdparty/cordova/registrationservices.js b/dashboard-ui/thirdparty/cordova/registrationservices.js index 9755641a37..4f7f2a29d1 100644 --- a/dashboard-ui/thirdparty/cordova/registrationservices.js +++ b/dashboard-ui/thirdparty/cordova/registrationservices.js @@ -1,12 +1,16 @@ window.RegistrationServices = { renderPluginInfo: function (page, pkg, pluginSecurityInfo) { - + }, addRecurringFields: function (page, period) { - } + }, + initSupporterForm: function (page) { + + $('.recurringSubscriptionCancellationHelp', page).html(''); + } }; \ No newline at end of file diff --git a/dashboard-ui/tvlatest.html b/dashboard-ui/tvlatest.html index 8e6f2185e3..07a1c15318 100644 --- a/dashboard-ui/tvlatest.html +++ b/dashboard-ui/tvlatest.html @@ -4,7 +4,7 @@ Emby -
+
${TabSuggestions} ${TabLatest} diff --git a/dashboard-ui/usernew.html b/dashboard-ui/usernew.html index 5d9425a7f2..35c0add89f 100644 --- a/dashboard-ui/usernew.html +++ b/dashboard-ui/usernew.html @@ -4,12 +4,12 @@ ${TitleNewUser} -
+
- +
  • @@ -62,9 +62,6 @@
-