mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
KeyboardNavigation renamed to KeyboardShortcuts
This commit is contained in:
parent
a6db997391
commit
130b95c932
5 changed files with 14 additions and 14 deletions
|
|
@ -3,7 +3,7 @@
|
|||
require('spatial-navigation-polyfill');
|
||||
const React = require('react');
|
||||
const { Router } = require('stremio-router');
|
||||
const { Core, Shell, Chromecast, KeyboardNavigation, ServicesProvider } = require('stremio/services');
|
||||
const { Core, Shell, Chromecast, KeyboardShortcuts, ServicesProvider } = require('stremio/services');
|
||||
const { NotFound } = require('stremio/routes');
|
||||
const { ToastProvider, CONSTANTS } = require('stremio/common');
|
||||
const CoreEventsToaster = require('./CoreEventsToaster');
|
||||
|
|
@ -18,7 +18,7 @@ const App = () => {
|
|||
core: new Core(),
|
||||
shell: new Shell(),
|
||||
chromecast: new Chromecast(),
|
||||
keyboardNavigation: new KeyboardNavigation()
|
||||
keyboardShortcuts: new KeyboardShortcuts()
|
||||
}), []);
|
||||
const [coreInitialized, setCoreInitialized] = React.useState(false);
|
||||
const [shellInitialized, setShellInitialized] = React.useState(false);
|
||||
|
|
@ -54,14 +54,14 @@ const App = () => {
|
|||
services.core.start();
|
||||
services.shell.start();
|
||||
services.chromecast.start();
|
||||
services.keyboardNavigation.start();
|
||||
services.keyboardShortcuts.start();
|
||||
window.core = services.core;
|
||||
window.shell = services.shell;
|
||||
return () => {
|
||||
services.core.stop();
|
||||
services.shell.stop();
|
||||
services.chromecast.stop();
|
||||
services.keyboardNavigation.stop();
|
||||
services.keyboardShortcuts.stop();
|
||||
services.core.off('stateChanged', onCoreStateChanged);
|
||||
services.shell.off('stateChanged', onShellStateChanged);
|
||||
services.chromecast.off('stateChanged', onChromecastStateChange);
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
// Copyright (C) 2017-2020 Smart code 203358507
|
||||
|
||||
const KeyboardNavigation = require('./KeyboardNavigation');
|
||||
|
||||
module.exports = KeyboardNavigation;
|
||||
|
|
@ -2,14 +2,14 @@
|
|||
|
||||
const EventEmitter = require('events');
|
||||
|
||||
function KeyboardNavigation() {
|
||||
function KeyboardShortcuts() {
|
||||
let active = false;
|
||||
|
||||
const events = new EventEmitter();
|
||||
events.on('error', () => { });
|
||||
|
||||
function onKeyDown(event) {
|
||||
if (event.keyboardNavigationPrevented || event.target.tagName === 'INPUT') {
|
||||
if (event.keyboardShortcutPrevented || event.target.tagName === 'INPUT') {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -96,4 +96,4 @@ function KeyboardNavigation() {
|
|||
};
|
||||
}
|
||||
|
||||
module.exports = KeyboardNavigation;
|
||||
module.exports = KeyboardShortcuts;
|
||||
5
src/services/KeyboardShortcuts/index.js
Normal file
5
src/services/KeyboardShortcuts/index.js
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
// Copyright (C) 2017-2020 Smart code 203358507
|
||||
|
||||
const KeyboardShortcuts = require('./KeyboardShortcuts');
|
||||
|
||||
module.exports = KeyboardShortcuts;
|
||||
|
|
@ -2,14 +2,14 @@
|
|||
|
||||
const Chromecast = require('./Chromecast');
|
||||
const Core = require('./Core');
|
||||
const KeyboardNavigation = require('./KeyboardNavigation');
|
||||
const KeyboardShortcuts = require('./KeyboardShortcuts');
|
||||
const { ServicesProvider, useServices } = require('./ServicesContext');
|
||||
const Shell = require('./Shell');
|
||||
|
||||
module.exports = {
|
||||
Chromecast,
|
||||
Core,
|
||||
KeyboardNavigation,
|
||||
KeyboardShortcuts,
|
||||
ServicesProvider,
|
||||
useServices,
|
||||
Shell
|
||||
|
|
|
|||
Loading…
Reference in a new issue