mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
define apiInput as a module for webpack
This commit is contained in:
parent
2665923bb0
commit
3dba261ae7
5 changed files with 23 additions and 22 deletions
|
@ -234,6 +234,19 @@ define(['connectionManager', 'playbackManager', 'events', 'inputManager', 'focus
|
|||
events.on(apiClient, "message", onMessageReceived);
|
||||
}
|
||||
|
||||
function enableNativeGamepadKeyMapping() {
|
||||
if (!(!window.navigator || "string" != typeof window.navigator.gamepadInputEmulation)) {
|
||||
window.navigator.gamepadInputEmulation = "keyboard";
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function isGamepadSupported() {
|
||||
return "ongamepadconnected" in window || navigator.getGamepads || navigator.webkitGetGamepads;
|
||||
}
|
||||
|
||||
connectionManager.getApiClients().forEach(bindEvents);
|
||||
|
||||
events.on(connectionManager, 'apiclientcreated', function (e, newApiClient) {
|
||||
|
@ -241,5 +254,11 @@ define(['connectionManager', 'playbackManager', 'events', 'inputManager', 'focus
|
|||
bindEvents(newApiClient);
|
||||
});
|
||||
|
||||
if (!enableNativeGamepadKeyMapping() && isGamepadSupported()) {
|
||||
require(["components/apiInput/gamepadtokey"]);
|
||||
}
|
||||
|
||||
require(["components/apiInput/mouseManager"]);
|
||||
|
||||
return serverNotifications;
|
||||
});
|
3
src/components/apiInput/package.json
Normal file
3
src/components/apiInput/package.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"main": "apiInput.js"
|
||||
}
|
|
@ -1198,19 +1198,6 @@ var AppInfo = {};
|
|||
});
|
||||
}
|
||||
|
||||
function enableNativeGamepadKeyMapping() {
|
||||
if (!(!window.navigator || "string" != typeof window.navigator.gamepadInputEmulation)) {
|
||||
window.navigator.gamepadInputEmulation = "keyboard";
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function isGamepadSupported() {
|
||||
return "ongamepadconnected" in window || navigator.getGamepads || navigator.webkitGetGamepads;
|
||||
}
|
||||
|
||||
function onAppReady(browser) {
|
||||
console.log("Begin onAppReady");
|
||||
|
||||
|
@ -1238,10 +1225,6 @@ var AppInfo = {};
|
|||
hashbang: true
|
||||
});
|
||||
|
||||
if (!enableNativeGamepadKeyMapping() && isGamepadSupported()) {
|
||||
require(["components/input/gamepadtokey"]);
|
||||
}
|
||||
|
||||
require(["components/thememediaplayer", "scripts/autobackdrops"]);
|
||||
|
||||
if (!("cordova" !== self.appMode && "android" !== self.appMode)) {
|
||||
|
@ -1268,8 +1251,6 @@ var AppInfo = {};
|
|||
require(["mediaSession"]);
|
||||
}
|
||||
|
||||
require(["apiInput", "mouseManager"]);
|
||||
|
||||
if (!(browser.tv || browser.xboxOne)) {
|
||||
require(["components/playback/playbackorientation"]);
|
||||
registerServiceWorker();
|
||||
|
@ -1471,7 +1452,6 @@ var AppInfo = {};
|
|||
define("cardBuilder", [embyWebComponentsBowerPath + "/cardbuilder/cardbuilder"], returnFirstDependency);
|
||||
define("peoplecardbuilder", [embyWebComponentsBowerPath + "/cardbuilder/peoplecardbuilder"], returnFirstDependency);
|
||||
define("chaptercardbuilder", [embyWebComponentsBowerPath + "/cardbuilder/chaptercardbuilder"], returnFirstDependency);
|
||||
define("mouseManager", [embyWebComponentsBowerPath + "/input/mouse"], returnFirstDependency);
|
||||
define("flexStyles", ["css!" + embyWebComponentsBowerPath + "/flexstyles"], returnFirstDependency);
|
||||
define("deleteHelper", [embyWebComponentsBowerPath + "/deletehelper"], returnFirstDependency);
|
||||
define("tvguide", [embyWebComponentsBowerPath + "/guide/guide"], returnFirstDependency);
|
||||
|
@ -1570,8 +1550,7 @@ var AppInfo = {};
|
|||
define("fnchecked", ["legacy/fnchecked"], returnFirstDependency);
|
||||
define("dialogHelper", [embyWebComponentsBowerPath + "/dialoghelper/dialoghelper"], returnFirstDependency);
|
||||
define("inputmanager", ["inputManager"], returnFirstDependency);
|
||||
define("apiInput", [embyWebComponentsBowerPath + "/input/api"], returnFirstDependency);
|
||||
define("serverNotifications", ["apiInput"], returnFirstDependency);
|
||||
define("serverNotifications", [embyWebComponentsBowerPath + "/apiInput/apiInput"], returnFirstDependency);
|
||||
define("headroom-window", ["headroom"], createWindowHeadroom);
|
||||
define("appFooter-shared", ["appFooter"], createSharedAppFooter);
|
||||
define("skinManager", [embyWebComponentsBowerPath + "/skinmanager"], function (skinManager) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue