From 130b95c9321e9d6dc93fc102f7d0cbf5148bcf54 Mon Sep 17 00:00:00 2001 From: nklhrstv Date: Fri, 15 May 2020 15:36:42 +0300 Subject: [PATCH] KeyboardNavigation renamed to KeyboardShortcuts --- src/App/App.js | 8 ++++---- src/services/KeyboardNavigation/index.js | 5 ----- .../KeyboardShortcuts.js} | 6 +++--- src/services/KeyboardShortcuts/index.js | 5 +++++ src/services/index.js | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) delete mode 100644 src/services/KeyboardNavigation/index.js rename src/services/{KeyboardNavigation/KeyboardNavigation.js => KeyboardShortcuts/KeyboardShortcuts.js} (94%) create mode 100644 src/services/KeyboardShortcuts/index.js diff --git a/src/App/App.js b/src/App/App.js index 3056e18dd..d521a4a34 100644 --- a/src/App/App.js +++ b/src/App/App.js @@ -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); diff --git a/src/services/KeyboardNavigation/index.js b/src/services/KeyboardNavigation/index.js deleted file mode 100644 index 28a24290c..000000000 --- a/src/services/KeyboardNavigation/index.js +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (C) 2017-2020 Smart code 203358507 - -const KeyboardNavigation = require('./KeyboardNavigation'); - -module.exports = KeyboardNavigation; diff --git a/src/services/KeyboardNavigation/KeyboardNavigation.js b/src/services/KeyboardShortcuts/KeyboardShortcuts.js similarity index 94% rename from src/services/KeyboardNavigation/KeyboardNavigation.js rename to src/services/KeyboardShortcuts/KeyboardShortcuts.js index ded82ce20..e1047a0ea 100644 --- a/src/services/KeyboardNavigation/KeyboardNavigation.js +++ b/src/services/KeyboardShortcuts/KeyboardShortcuts.js @@ -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; diff --git a/src/services/KeyboardShortcuts/index.js b/src/services/KeyboardShortcuts/index.js new file mode 100644 index 000000000..cebb92926 --- /dev/null +++ b/src/services/KeyboardShortcuts/index.js @@ -0,0 +1,5 @@ +// Copyright (C) 2017-2020 Smart code 203358507 + +const KeyboardShortcuts = require('./KeyboardShortcuts'); + +module.exports = KeyboardShortcuts; diff --git a/src/services/index.js b/src/services/index.js index 3c4c75556..93e87c471 100644 --- a/src/services/index.js +++ b/src/services/index.js @@ -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