diff options
-rw-r--r-- | src/background/actions/command.js | 2 | ||||
-rw-r--r-- | src/background/components/background.js | 4 | ||||
-rw-r--r-- | src/background/components/operation.js | 4 | ||||
-rw-r--r-- | src/background/shared/completions/histories.js (renamed from src/background/histories.js) | 0 | ||||
-rw-r--r-- | src/background/shared/completions/index.js (renamed from src/shared/commands/complete.js) | 6 | ||||
-rw-r--r-- | src/background/shared/completions/tabs.js | 10 | ||||
-rw-r--r-- | src/background/shared/tabs.js (renamed from src/background/tabs.js) | 11 | ||||
-rw-r--r-- | src/background/shared/zooms.js (renamed from src/background/zooms.js) | 0 | ||||
-rw-r--r-- | src/shared/commands/index.js | 3 |
9 files changed, 19 insertions, 21 deletions
diff --git a/src/background/actions/command.js b/src/background/actions/command.js index 4c52bca..2f7305a 100644 --- a/src/background/actions/command.js +++ b/src/background/actions/command.js @@ -1,5 +1,5 @@ import actions from '../actions'; -import * as tabs from 'background/tabs'; +import * as tabs from '../shared/tabs'; import * as parsers from 'shared/commands/parsers'; import * as properties from 'shared/settings/properties'; diff --git a/src/background/components/background.js b/src/background/components/background.js index 81d815b..e13424b 100644 --- a/src/background/components/background.js +++ b/src/background/components/background.js @@ -3,7 +3,7 @@ import * as commandActions from 'background/actions/command'; import * as settingActions from 'background/actions/setting'; import * as findActions from 'background/actions/find'; import * as tabActions from 'background/actions/tab'; -import * as commands from 'shared/commands'; +import * as completions from '../shared/completions'; export default class BackgroundComponent { constructor(store) { @@ -44,7 +44,7 @@ export default class BackgroundComponent { case messages.SETTINGS_QUERY: return Promise.resolve(this.store.getState().setting.value); case messages.CONSOLE_QUERY_COMPLETIONS: - return commands.complete(message.text, settings.value); + return completions.complete(message.text, settings.value); case messages.SETTINGS_RELOAD: this.store.dispatch(settingActions.load()); return this.broadcastSettingsChanged(); diff --git a/src/background/components/operation.js b/src/background/components/operation.js index e1094c5..b9581c9 100644 --- a/src/background/components/operation.js +++ b/src/background/components/operation.js @@ -1,7 +1,7 @@ import messages from 'shared/messages'; import operations from 'shared/operations'; -import * as tabs from 'background/tabs'; -import * as zooms from 'background/zooms'; +import * as tabs from '../shared//tabs'; +import * as zooms from '../shared/zooms'; export default class BackgroundComponent { constructor(store) { diff --git a/src/background/histories.js b/src/background/shared/completions/histories.js index a7d3d47..a7d3d47 100644 --- a/src/background/histories.js +++ b/src/background/shared/completions/histories.js diff --git a/src/shared/commands/complete.js b/src/background/shared/completions/index.js index 0bdbab8..73b7b27 100644 --- a/src/shared/commands/complete.js +++ b/src/background/shared/completions/index.js @@ -1,5 +1,5 @@ -import * as tabs from 'background/tabs'; -import * as histories from 'background/histories'; +import * as tabs from './tabs'; +import * as histories from './histories'; const getOpenCompletions = (command, keywords, searchConfig) => { return histories.getCompletions(keywords).then((pages) => { @@ -81,4 +81,4 @@ const complete = (line, settings) => { return getCompletions(line, settings); }; -export default complete; +export { complete }; diff --git a/src/background/shared/completions/tabs.js b/src/background/shared/completions/tabs.js new file mode 100644 index 0000000..5edddca --- /dev/null +++ b/src/background/shared/completions/tabs.js @@ -0,0 +1,10 @@ +const getCompletions = (keyword) => { + return browser.tabs.query({ currentWindow: true }).then((tabs) => { + let matched = tabs.filter((t) => { + return t.url.includes(keyword) || t.title && t.title.includes(keyword); + }); + return matched; + }); +}; + +export { getCompletions }; diff --git a/src/background/tabs.js b/src/background/shared/tabs.js index e939870..277afb2 100644 --- a/src/background/tabs.js +++ b/src/background/shared/tabs.js @@ -66,15 +66,6 @@ const selectByKeyword = (current, keyword) => { }); }; -const getCompletions = (keyword) => { - return browser.tabs.query({ currentWindow: true }).then((tabs) => { - let matched = tabs.filter((t) => { - return t.url.includes(keyword) || t.title && t.title.includes(keyword); - }); - return matched; - }); -}; - const selectPrevTab = (current, count) => { return browser.tabs.query({ currentWindow: true }).then((tabs) => { if (tabs.length < 2) { @@ -139,7 +130,7 @@ const duplicate = (id) => { export { closeTab, closeTabForce, reopenTab, selectAt, selectByKeyword, - getCompletions, selectPrevTab, selectNextTab, selectFirstTab, + selectPrevTab, selectNextTab, selectFirstTab, selectLastTab, selectPrevSelTab, reload, updateTabPinned, toggleTabPinned, duplicate }; diff --git a/src/background/zooms.js b/src/background/shared/zooms.js index e3e2aa6..e3e2aa6 100644 --- a/src/background/zooms.js +++ b/src/background/shared/zooms.js diff --git a/src/shared/commands/index.js b/src/shared/commands/index.js deleted file mode 100644 index 78cb4df..0000000 --- a/src/shared/commands/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import complete from './complete'; - -export { complete }; |