aboutsummaryrefslogtreecommitdiff
path: root/src/console
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-11-06 19:47:58 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2017-11-11 16:16:01 +0900
commitcb4b26e03f97ff2f1789f7a59efe2973ab1d0eb9 (patch)
tree1ded1b572e0ff8ebc6e7b950aaa8ab1998fc2048 /src/console
parent86b534b1e1de03d51efb9f28cd32296d037f07fc (diff)
flexible prompt
Diffstat (limited to 'src/console')
-rw-r--r--src/console/components/console.js12
-rw-r--r--src/console/site.scss8
2 files changed, 18 insertions, 2 deletions
diff --git a/src/console/components/console.js b/src/console/components/console.js
index 5028e2a..7997f24 100644
--- a/src/console/components/console.js
+++ b/src/console/components/console.js
@@ -95,13 +95,23 @@ export default class ConsoleComponent {
}
showCommand(text) {
+ this.showConsole('command', text);
+ }
+
+ showFind() {
+ this.showConsole('find', '');
+ }
+
+ showConsole(mode, initial) {
let doc = this.wrapper.ownerDocument;
let command = doc.querySelector('#vimvixen-console-command');
let input = doc.querySelector('#vimvixen-console-command-input');
+ let promptEle = doc.querySelector('.vimvixen-console-command-prompt');
command.style.display = 'block';
- input.value = text;
+ input.value = initial;
input.focus();
+ promptEle.className = `vimvixen-console-command-prompt prompt-${mode}`;
window.focus();
this.onInput({ target: input });
diff --git a/src/console/site.scss b/src/console/site.scss
index e5cb2df..cd40db5 100644
--- a/src/console/site.scss
+++ b/src/console/site.scss
@@ -85,9 +85,15 @@ body {
display: flex;
&-prompt:before {
+ @include consoole-font;
+ }
+
+ &-prompt.prompt-command:before {
content: ':';
+ }
- @include consoole-font;
+ &-prompt.prompt-find:before {
+ content: '/';
}
&-input {