diff options
Diffstat (limited to 'src/pages')
-rw-r--r-- | src/pages/console.html | 20 | ||||
-rw-r--r-- | src/pages/console.js | 34 | ||||
-rw-r--r-- | src/pages/console.scss | 92 |
3 files changed, 0 insertions, 146 deletions
diff --git a/src/pages/console.html b/src/pages/console.html deleted file mode 100644 index 4222f12..0000000 --- a/src/pages/console.html +++ /dev/null @@ -1,20 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset=utf-8 /> - <title>VimVixen console</title> - <script src='console.js'></script> - </head> - <body class='vimvixen-console'> - <p id='vimvixen-console-error' - class='vimvixen-console-error'></p> - <div id='vimvixen-console-command'> - <ul id='vimvixen-console-completion' class='vimvixen-console-completion'></ul> - <div class='vimvixen-console-command'> - <i class='vimvixen-console-command-prompt'></i><input - id='vimvixen-console-command-input' - class='vimvixen-console-command-input'></input> - </div> - </div> - </body> -</html> diff --git a/src/pages/console.js b/src/pages/console.js deleted file mode 100644 index 4c6e16c..0000000 --- a/src/pages/console.js +++ /dev/null @@ -1,34 +0,0 @@ -import './console.scss'; -import messages from 'shared/messages'; -import CompletionComponent from 'components/completion'; -import ConsoleComponent from 'components/console'; -import reducers from 'reducers'; -import { createStore } from 'store'; -import * as consoleActions from 'actions/console'; - -const store = createStore(reducers); -let completionComponent = null; -let consoleComponent = null; - -window.addEventListener('load', () => { - let wrapper = document.querySelector('#vimvixen-console-completion'); - completionComponent = new CompletionComponent(wrapper, store); - - consoleComponent = new ConsoleComponent(document.body, store); -}); - -store.subscribe(() => { - completionComponent.update(); - consoleComponent.update(); -}); - -browser.runtime.onMessage.addListener((action) => { - switch (action.type) { - case messages.CONSOLE_SHOW_COMMAND: - return store.dispatch(consoleActions.showCommand(action.command)); - case messages.CONSOLE_SHOW_ERROR: - return store.dispatch(consoleActions.showError(action.text)); - case messages.CONSOLE_HIDE: - return store.dispatch(consoleActions.hide(action.command)); - } -}); diff --git a/src/pages/console.scss b/src/pages/console.scss deleted file mode 100644 index 5823dce..0000000 --- a/src/pages/console.scss +++ /dev/null @@ -1,92 +0,0 @@ -html, body, * { - margin: 0; - padding: 0; -} - -body { - position: absolute; - bottom: 0; - left: 0; - right: 0; - overflow: hidden; -} - -.vimvixen-console { - border-top: 1px solid gray; - bottom: 0; - margin: 0; - padding: 0; - - @mixin consoole-font { - font-style: normal; - font-family: monospace; - font-size: 12px; - line-height: 16px; - } - - &-completion { - background-color: white; - - @include consoole-font; - - &-title { - background-color: lightgray; - font-weight: bold; - margin: 0; - padding: 0; - } - - &-item { - padding-left: 1.5rem; - background-position: 0 center; - background-size: contain; - background-repeat: no-repeat; - white-space: nowrap; - - &.vimvixen-completion-selected { - background-color: yellow; - } - - &-caption { - display: inline-block; - width: 40%; - text-overflow: ellipsis; - overflow: hidden; - } - - &-url { - display: inline-block; - color: green; - width: 60%; - text-overflow: ellipsis; - overflow: hidden; - } - } - } - - &-error { - background-color: red; - font-weight: bold; - color: white; - - @include consoole-font; - } - - &-command { - background-color: white; - display: flex; - - &-prompt:before { - content: ':'; - - @include consoole-font; - } - - &-input { - border: none; - flex-grow: 1; - - @include consoole-font; - } - } -} |