1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

fix fullscreen button with IE

This commit is contained in:
Luke Pulverenti 2015-05-17 21:27:48 -04:00
parent c5802fc5ab
commit 3114742ab7
18 changed files with 125 additions and 176 deletions

View file

@ -4,7 +4,7 @@
<title>${TitleSupport}</title>
</head>
<body>
<div id="logPage" data-role="page" class="page type-interior">
<div id="logPage" data-role="page" class="page type-interior" data-require="scripts/logpage">
<div data-role="content">
<div class="content-primary">

View file

@ -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:

View file

@ -532,7 +532,7 @@
html += '<div style="padding:1em 1em;background:rgba(20,20,20,1);margin:0;text-align:center;" class="detailsMenuHeader">';
html += '<button type="button" class="imageButton detailsMenuLeftButton" data-role="none"><i class="fa fa-arrow-left"></i></button>';
html += '<h3 style="font-weight:400;margin:.5em 0;line-height:0;"></h3>';
html += '<h3 style="font-weight:400;margin:.5em 0;line-height:.5;"></h3>';
html += '<button type="button" class="imageButton detailsMenuRightButton" data-role="none"><i class="fa fa-arrow-right"></i></button>';
html += '</div>';

View file

@ -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('');

View file

@ -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');
});
});
})();

View file

@ -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');

View file

@ -82,7 +82,7 @@
}
},
addRecurringFields: function(page, period) {
addRecurringFields: function (page, period) {
var formSelector = '.supporterForm';
@ -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'));
}
};

View file

@ -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:

View file

@ -206,17 +206,19 @@ var Dashboard = {
store.removeItem("token");
store.removeItem("serverAddress");
function onLogoutDone() {
var loginPage = !Dashboard.isConnectMode() ?
'login.html' :
'connectlogin.html';
if (logoutWithServer === false) {
window.location.href = loginPage;
} else {
ConnectionManager.logout().done(function () {
window.location.href = loginPage;
});
}
if (logoutWithServer === false) {
onLogoutDone();
} else {
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;
}
};

View file

@ -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);

View file

@ -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'));
}
}
}
};
})();

View file

@ -9,7 +9,7 @@
return 'Thumb';
}
$(document).on('pagebeforeshow', "#tvNextUpPage", function () {
$(document).on('pageshown', "#tvNextUpPage", function () {
var userId = Dashboard.getCurrentUserId();

View file

@ -109,12 +109,7 @@
});
}
function newUserPage() {
var self = this;
self.onSubmit = function () {
function onSubmit() {
var page = $(this).parents('.page');
Dashboard.showLoadingMsg();
@ -123,7 +118,6 @@
// 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;

View file

@ -4,7 +4,7 @@
<title>${TitlePlayback}</title>
</head>
<body>
<div id="streamingSettingsPage" data-role="page" class="page type-interior playbackConfigurationPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Streaming">
<div id="streamingSettingsPage" data-role="page" class="page type-interior playbackConfigurationPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Streaming" data-require="scripts/streamingsettings">
<div data-role="content">
<div class="content-primary">
@ -39,10 +39,6 @@
</form>
</div>
</div>
<script type="text/javascript">
$('.streamingSettingsForm').off('submit', StreamingSettingsPage.onSubmit).on('submit', StreamingSettingsPage.onSubmit);
</script>
</div>
</body>
</html>

View file

@ -4,7 +4,7 @@
<title>${TitleSupport}</title>
</head>
<body>
<div id="supporterPage" data-role="page" class="page type-interior">
<div id="supporterPage" data-role="page" class="page type-interior" data-require="scripts/supporterpage,scripts/registrationservices">
<div data-role="content">
<div class="content-primary">
@ -27,7 +27,7 @@
<p class="planSummary"></p>
</div>
<form style="margin-top:1.5em;" name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" class="supporterForm" method="post">
<form style="margin-top:1.5em;" name="_xclick" class="supporterForm" method="post">
<fieldset data-role="controlgroup">
<legend>${HeaderDonationType}</legend>
@ -53,7 +53,7 @@
</label>
</div>
</fieldset>
<div class="fieldDescription">${LabelRecurringDonationCanBeCancelledHelp}</div>
<div class="fieldDescription recurringSubscriptionCancellationHelp"></div>
<fieldset data-role="controlgroup" style="margin-top:1.5em;">
<input type="radio" class="radioDonationType" name="radioDonationType" id="radioOneTimeDonation" value="once">
@ -113,10 +113,6 @@
</div>
</div>
</div>
<script type="text/javascript">
$('.supporterForm').off('submit', SupporterPage.onSubmit).on('submit', SupporterPage.onSubmit);
</script>
</div>
</body>
</html>

View file

@ -7,6 +7,10 @@
addRecurringFields: function (page, period) {
}
},
initSupporterForm: function (page) {
$('.recurringSubscriptionCancellationHelp', page).html('');
}
};

View file

@ -4,7 +4,7 @@
<title>Emby</title>
</head>
<body>
<div id="tvNextUpPage" data-role="page" class="page libraryPage backdropPage" data-backdroptype="series">
<div id="tvNextUpPage" data-role="page" class="page libraryPage backdropPage" data-backdroptype="series" data-require="scripts/tvlatest">
<div class="libraryViewNav scopedLibraryViewNav">
<a href="tvrecommended.html">${TabSuggestions}</a>
<a href="#" class="ui-btn-active">${TabLatest}</a>

View file

@ -4,12 +4,12 @@
<title>${TitleNewUser}</title>
</head>
<body>
<div id="newUserPage" data-role="page" class="page type-interior userProfilesPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Users">
<div id="newUserPage" data-role="page" class="page type-interior userProfilesPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Users" data-require="scripts/usernew">
<div data-role="content">
<div class="content-primary">
<form id="newUserProfileForm">
<form class="newUserProfileForm">
<ul data-role="listview" class="ulForm">
<li id="fldUserName">
<label for="txtUserName">${LabelName}</label>
@ -62,9 +62,6 @@
</form>
</div>
</div>
<script type="text/javascript">
$('#newUserProfileForm').on('submit', NewUserPage.onSubmit);
</script>
</div>
</body>
</html>