From 6e5286ef10b26d0a09f3882d6c3bfdbd92223d0f Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Fri, 1 Sep 2017 08:51:14 +0900 Subject: [PATCH] Rename command-line to console --- manifest.json | 2 +- src/command-line/command-line.html | 18 ------------------ .../console-frame.js} | 8 ++++---- .../console-frame.scss} | 2 +- src/console/console.html | 18 ++++++++++++++++++ .../command-line.js => console/console.js} | 4 ++-- .../command-line.scss => console/console.scss} | 4 ++-- src/content/index.js | 8 ++++---- webpack.config.js | 6 +++--- 9 files changed, 35 insertions(+), 35 deletions(-) delete mode 100644 src/command-line/command-line.html rename src/{command-line/command-line-frame.js => console/console-frame.js} (58%) rename src/{command-line/command-line-frame.scss => console/console-frame.scss} (81%) create mode 100644 src/console/console.html rename src/{command-line/command-line.js => console/console.js} (92%) rename src/{command-line/command-line.scss => console/console.scss} (94%) diff --git a/manifest.json b/manifest.json index b687363..4922bd8 100644 --- a/manifest.json +++ b/manifest.json @@ -18,6 +18,6 @@ "sessions" ], "web_accessible_resources": [ - "build/command-line.html" + "build/console.html" ] } diff --git a/src/command-line/command-line.html b/src/command-line/command-line.html deleted file mode 100644 index bad0b66..0000000 --- a/src/command-line/command-line.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - VimVixen command-line - - - -
-

-
- -
-
- - diff --git a/src/command-line/command-line-frame.js b/src/console/console-frame.js similarity index 58% rename from src/command-line/command-line-frame.js rename to src/console/console-frame.js index 3f1dda4..cf72f25 100644 --- a/src/command-line/command-line-frame.js +++ b/src/console/console-frame.js @@ -1,13 +1,13 @@ -import './command-line-frame.scss'; +import './console-frame.scss'; -export default class CommandLineFrame { +export default class ConsoleFrame { constructor(win, initial = '') { - let url = browser.runtime.getURL('build/command-line.html') + + let url = browser.runtime.getURL('build/console.html') + '#' + encodeURIComponent(initial); let element = window.document.createElement('iframe'); element.src = url; - element.className = 'vimvixen-command-line-frame'; + element.className = 'vimvixen-console-frame'; win.document.body.append(element); this.element = element; diff --git a/src/command-line/command-line-frame.scss b/src/console/console-frame.scss similarity index 81% rename from src/command-line/command-line-frame.scss rename to src/console/console-frame.scss index 88772d9..1bab2b0 100644 --- a/src/command-line/command-line-frame.scss +++ b/src/console/console-frame.scss @@ -1,4 +1,4 @@ -.vimvixen-command-line-frame { +.vimvixen-console-frame { margin: 0; padding: 0; bottom: 0; diff --git a/src/console/console.html b/src/console/console.html new file mode 100644 index 0000000..9177045 --- /dev/null +++ b/src/console/console.html @@ -0,0 +1,18 @@ + + + + + VimVixen console + + + +
+

+
+ +
+
+ + diff --git a/src/command-line/command-line.js b/src/console/console.js similarity index 92% rename from src/command-line/command-line.js rename to src/console/console.js index 34f3f35..f8a91a6 100644 --- a/src/command-line/command-line.js +++ b/src/console/console.js @@ -1,4 +1,4 @@ -import './command-line.scss'; +import './console.scss'; const parent = window.parent; @@ -55,7 +55,7 @@ window.addEventListener('load', () => { initial = decodeURIComponent(hash.substring(1)); } - let input = window.document.querySelector('#vimvixen-command-line-line-input'); + let input = window.document.querySelector('#vimvixen-console-command-input'); input.addEventListener('blur', handleBlur); input.addEventListener('keydown', handleKeydown); input.addEventListener('keyup', handleKeyup); diff --git a/src/command-line/command-line.scss b/src/console/console.scss similarity index 94% rename from src/command-line/command-line.scss rename to src/console/console.scss index 68a0a03..becc15c 100644 --- a/src/command-line/command-line.scss +++ b/src/console/console.scss @@ -10,7 +10,7 @@ body { right: 0; } -.vimvixen-command-line { +.vimvixen-console { border-top: 1px solid gray; bottom: 0; margin: 0; @@ -32,7 +32,7 @@ body { @include input-style; } - &-line { + &-command { background-color: white; display: flex; diff --git a/src/content/index.js b/src/content/index.js index 9bd4e15..591aa98 100644 --- a/src/content/index.js +++ b/src/content/index.js @@ -1,7 +1,7 @@ import * as scrolls from './scrolls'; import * as histories from './histories'; import * as actions from '../shared/actions'; -import CommandLineFrame from '../command-line/command-line-frame'; +import ConsoleFrame from '../console/console-frame'; import Follow from './follow'; let cmd = null; @@ -13,14 +13,14 @@ const invokeEvent = (action) => { switch (action[0]) { case actions.CMD_OPEN: - cmd = new CommandLineFrame(window); + cmd = new ConsoleFrame(window); break; case actions.CMD_TABS_OPEN: if (action[1] || false) { // alter url - cmd = new CommandLineFrame(window, 'open ' + window.location.href); + cmd = new ConsoleFrame(window, 'open ' + window.location.href); } else { - cmd = new CommandLineFrame(window, 'open '); + cmd = new ConsoleFrame(window, 'open '); } break; case actions.SCROLL_LINES: diff --git a/webpack.config.js b/webpack.config.js index f34d203..ba08975 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -8,7 +8,7 @@ module.exports = { entry: { index: path.join(src, 'content'), background: path.join(src, 'background'), - 'command-line': path.join(src, 'command-line', 'command-line.js') + console: path.join(src, 'console', 'console.js') }, output: { @@ -43,8 +43,8 @@ module.exports = { plugins: [ new HtmlWebpackPlugin({ - template: path.join(src, 'command-line', 'command-line.html'), - filename: path.join(dist, 'command-line.html'), + template: path.join(src, 'console', 'console.html'), + filename: path.join(dist, 'console.html'), inject: false }) ]