mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-21 11:42: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');
|
require('spatial-navigation-polyfill');
|
||||||
const React = require('react');
|
const React = require('react');
|
||||||
const { Router } = require('stremio-router');
|
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 { NotFound } = require('stremio/routes');
|
||||||
const { ToastProvider, CONSTANTS } = require('stremio/common');
|
const { ToastProvider, CONSTANTS } = require('stremio/common');
|
||||||
const CoreEventsToaster = require('./CoreEventsToaster');
|
const CoreEventsToaster = require('./CoreEventsToaster');
|
||||||
|
|
@ -18,7 +18,7 @@ const App = () => {
|
||||||
core: new Core(),
|
core: new Core(),
|
||||||
shell: new Shell(),
|
shell: new Shell(),
|
||||||
chromecast: new Chromecast(),
|
chromecast: new Chromecast(),
|
||||||
keyboardNavigation: new KeyboardNavigation()
|
keyboardShortcuts: new KeyboardShortcuts()
|
||||||
}), []);
|
}), []);
|
||||||
const [coreInitialized, setCoreInitialized] = React.useState(false);
|
const [coreInitialized, setCoreInitialized] = React.useState(false);
|
||||||
const [shellInitialized, setShellInitialized] = React.useState(false);
|
const [shellInitialized, setShellInitialized] = React.useState(false);
|
||||||
|
|
@ -54,14 +54,14 @@ const App = () => {
|
||||||
services.core.start();
|
services.core.start();
|
||||||
services.shell.start();
|
services.shell.start();
|
||||||
services.chromecast.start();
|
services.chromecast.start();
|
||||||
services.keyboardNavigation.start();
|
services.keyboardShortcuts.start();
|
||||||
window.core = services.core;
|
window.core = services.core;
|
||||||
window.shell = services.shell;
|
window.shell = services.shell;
|
||||||
return () => {
|
return () => {
|
||||||
services.core.stop();
|
services.core.stop();
|
||||||
services.shell.stop();
|
services.shell.stop();
|
||||||
services.chromecast.stop();
|
services.chromecast.stop();
|
||||||
services.keyboardNavigation.stop();
|
services.keyboardShortcuts.stop();
|
||||||
services.core.off('stateChanged', onCoreStateChanged);
|
services.core.off('stateChanged', onCoreStateChanged);
|
||||||
services.shell.off('stateChanged', onShellStateChanged);
|
services.shell.off('stateChanged', onShellStateChanged);
|
||||||
services.chromecast.off('stateChanged', onChromecastStateChange);
|
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');
|
const EventEmitter = require('events');
|
||||||
|
|
||||||
function KeyboardNavigation() {
|
function KeyboardShortcuts() {
|
||||||
let active = false;
|
let active = false;
|
||||||
|
|
||||||
const events = new EventEmitter();
|
const events = new EventEmitter();
|
||||||
events.on('error', () => { });
|
events.on('error', () => { });
|
||||||
|
|
||||||
function onKeyDown(event) {
|
function onKeyDown(event) {
|
||||||
if (event.keyboardNavigationPrevented || event.target.tagName === 'INPUT') {
|
if (event.keyboardShortcutPrevented || event.target.tagName === 'INPUT') {
|
||||||
return;
|
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 Chromecast = require('./Chromecast');
|
||||||
const Core = require('./Core');
|
const Core = require('./Core');
|
||||||
const KeyboardNavigation = require('./KeyboardNavigation');
|
const KeyboardShortcuts = require('./KeyboardShortcuts');
|
||||||
const { ServicesProvider, useServices } = require('./ServicesContext');
|
const { ServicesProvider, useServices } = require('./ServicesContext');
|
||||||
const Shell = require('./Shell');
|
const Shell = require('./Shell');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
Chromecast,
|
Chromecast,
|
||||||
Core,
|
Core,
|
||||||
KeyboardNavigation,
|
KeyboardShortcuts,
|
||||||
ServicesProvider,
|
ServicesProvider,
|
||||||
useServices,
|
useServices,
|
||||||
Shell
|
Shell
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue