mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
commit
ec5a3b6e5e
7 changed files with 90 additions and 5 deletions
|
@ -29,11 +29,14 @@ define(['events', 'dom'], function (events, dom) {
|
||||||
}
|
}
|
||||||
if (element.webkitEnterFullscreen) {
|
if (element.webkitEnterFullscreen) {
|
||||||
element.webkitEnterFullscreen();
|
element.webkitEnterFullscreen();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
fullscreenManager.prototype.exitFullscreen = function () {
|
fullscreenManager.prototype.exitFullscreen = function () {
|
||||||
|
|
||||||
|
if (!this.isFullScreen()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (document.exitFullscreen) {
|
if (document.exitFullscreen) {
|
||||||
document.exitFullscreen();
|
document.exitFullscreen();
|
||||||
} else if (document.mozCancelFullScreen) {
|
} else if (document.mozCancelFullScreen) {
|
||||||
|
@ -47,9 +50,15 @@ define(['events', 'dom'], function (events, dom) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// TODO: use screenfull.js
|
||||||
fullscreenManager.prototype.isFullScreen = function () {
|
fullscreenManager.prototype.isFullScreen = function () {
|
||||||
|
return document.fullscreen ||
|
||||||
return document.fullscreen || document.mozFullScreen || document.webkitIsFullScreen || document.msFullscreenElement ? true : false;
|
document.mozFullScreen ||
|
||||||
|
document.webkitIsFullScreen ||
|
||||||
|
document.msFullscreenElement || /* IE/Edge syntax */
|
||||||
|
document.fullscreenElement || /* Standard syntax */
|
||||||
|
document.webkitFullscreenElement || /* Chrome, Safari and Opera syntax */
|
||||||
|
document.mozFullScreenElement; /* Firefox syntax */
|
||||||
};
|
};
|
||||||
|
|
||||||
var manager = new fullscreenManager();
|
var manager = new fullscreenManager();
|
||||||
|
@ -71,4 +80,4 @@ define(['events', 'dom'], function (events, dom) {
|
||||||
});
|
});
|
||||||
|
|
||||||
return manager;
|
return manager;
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackManager', 'appRouter', 'appSettings', 'connectionManager', 'htmlMediaHelper', 'itemHelper'], function (browser, require, events, appHost, loading, dom, playbackManager, appRouter, appSettings, connectionManager, htmlMediaHelper, itemHelper) {
|
define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackManager', 'appRouter', 'appSettings', 'connectionManager', 'htmlMediaHelper', 'itemHelper', 'fullscreenManager'], function (browser, require, events, appHost, loading, dom, playbackManager, appRouter, appSettings, connectionManager, htmlMediaHelper, itemHelper, fullscreenManager) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var mediaManager;
|
var mediaManager;
|
||||||
|
@ -692,6 +692,8 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa
|
||||||
|
|
||||||
dlg.parentNode.removeChild(dlg);
|
dlg.parentNode.removeChild(dlg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fullscreenManager.exitFullscreen();
|
||||||
};
|
};
|
||||||
|
|
||||||
function onEnded() {
|
function onEnded() {
|
||||||
|
|
27
src/opensubtitles.html
Normal file
27
src/opensubtitles.html
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
<div id="openSubtitlesPage" data-role="page" class="page type-interior metadataConfigurationPage" data-require="scripts/opensubtitles,emby-input,emby-button,emby-linkbutton">
|
||||||
|
<div>
|
||||||
|
<div class="content-primary">
|
||||||
|
<form class="metadataSubtitlesForm">
|
||||||
|
<div style="height:0; overflow: hidden;"><input type="text" name="fakeusernameremembered" tabindex="-1" /><input type="password" name="fakepasswordremembered" tabindex="-1" /></div>
|
||||||
|
|
||||||
|
<div style="display: none;">
|
||||||
|
<input type="text" id="PreventChromeAutocomplete" name="PreventChromeAutocomplete" autocomplete="address-level4" />
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<div class="inputContainer">
|
||||||
|
<input is="emby-input" type="text" id="txtOpenSubtitleUsername" autocomplete="off" label="${LabelOpenSubtitlesUsername}" />
|
||||||
|
<div class="fieldDescription">
|
||||||
|
<a is="emby-linkbutton" class="button-link" target="_blank" href="http://www.opensubtitles.org/">${ButtonRegister}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="inputContainer">
|
||||||
|
<input is="emby-input" type="password" id="txtOpenSubtitlePassword" autocomplete="off" label="${LabelOpenSubtitlesPassword}" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button is="emby-button" type="submit" class="raised button-submit block"><span>${ButtonSave}</span></button>
|
||||||
|
</div>
|
||||||
|
<div class="fieldDescription">${SubtitleDownloadInstructions}</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -297,6 +297,11 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
|
||||||
icon: "swap_horiz",
|
icon: "swap_horiz",
|
||||||
href: "encodingsettings.html",
|
href: "encodingsettings.html",
|
||||||
pageIds: ["encodingSettingsPage"]
|
pageIds: ["encodingSettingsPage"]
|
||||||
|
}, {
|
||||||
|
name: "Open Subtitles",
|
||||||
|
href: "opensubtitles.html",
|
||||||
|
pageIds: ["openSubtitlesPage"],
|
||||||
|
icon: "closed_caption"
|
||||||
}];
|
}];
|
||||||
addPluginPagesToMainMenu(links, pluginItems, "server");
|
addPluginPagesToMainMenu(links, pluginItems, "server");
|
||||||
links.push({
|
links.push({
|
||||||
|
|
36
src/scripts/opensubtitles.js
Normal file
36
src/scripts/opensubtitles.js
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
define(["loading", "fnchecked", "emby-linkbutton", "emby-input", "emby-checkbox", "emby-button"], function (loading) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
function loadPage(page, config) {
|
||||||
|
page.querySelector("#txtOpenSubtitleUsername").value = config.OpenSubtitlesUsername;
|
||||||
|
page.querySelector("#txtOpenSubtitlePassword").value = config.OpenSubtitlesPasswordHash || "";
|
||||||
|
loading.hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
function onSubmit(evt) {
|
||||||
|
evt.preventDefault();
|
||||||
|
loading.show();
|
||||||
|
var form = this;
|
||||||
|
ApiClient.getNamedConfiguration("subtitles").then(function (config) {
|
||||||
|
config.OpenSubtitlesUsername = form.querySelector("#txtOpenSubtitleUsername").value;
|
||||||
|
var newPassword = form.querySelector("#txtOpenSubtitlePassword").value;
|
||||||
|
|
||||||
|
if (newPassword) {
|
||||||
|
config.OpenSubtitlesPasswordHash = newPassword;
|
||||||
|
}
|
||||||
|
|
||||||
|
ApiClient.updateNamedConfiguration("subtitles", config).then(Dashboard.processServerConfigurationUpdateResult);
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).on("pageinit", "#openSubtitlesPage", function() {
|
||||||
|
$(".metadataSubtitlesForm").off("submit", onSubmit).on("submit", onSubmit)
|
||||||
|
}).on("pageshow", "#openSubtitlesPage", function() {
|
||||||
|
loading.show();
|
||||||
|
var page = this;
|
||||||
|
ApiClient.getNamedConfiguration("subtitles").then(function (response) {
|
||||||
|
loadPage(page, response);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -512,6 +512,11 @@ var Dashboard = {
|
||||||
dependencies: [],
|
dependencies: [],
|
||||||
autoFocus: !1,
|
autoFocus: !1,
|
||||||
roles: "admin"
|
roles: "admin"
|
||||||
|
}), defineRoute({
|
||||||
|
path: "/opensubtitles.html",
|
||||||
|
dependencies: [],
|
||||||
|
autoFocus: !1,
|
||||||
|
roles: "admin"
|
||||||
}), defineRoute({
|
}), defineRoute({
|
||||||
path: "/forgotpassword.html",
|
path: "/forgotpassword.html",
|
||||||
dependencies: ["emby-input", "emby-button"],
|
dependencies: ["emby-input", "emby-button"],
|
||||||
|
|
|
@ -159,6 +159,7 @@
|
||||||
"ButtonReenable": "Re-enable",
|
"ButtonReenable": "Re-enable",
|
||||||
"ButtonRefresh": "Refresh",
|
"ButtonRefresh": "Refresh",
|
||||||
"ButtonRefreshGuideData": "Refresh Guide Data",
|
"ButtonRefreshGuideData": "Refresh Guide Data",
|
||||||
|
"ButtonRegister": "Register",
|
||||||
"ButtonReject": "Reject",
|
"ButtonReject": "Reject",
|
||||||
"ButtonRemote": "Remote",
|
"ButtonRemote": "Remote",
|
||||||
"ButtonRemoteControl": "Remote Control",
|
"ButtonRemoteControl": "Remote Control",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue