aboutsummaryrefslogtreecommitdiff
path: root/src/console/console-frame.js
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-09-11 21:45:48 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2017-09-11 21:45:48 +0900
commitb2cddcd69b4ae06770d66808624fc43f3dcbcb0e (patch)
tree548eb65f678cfa1dca36773f01c635ec6c0e2066 /src/console/console-frame.js
parent15d39a479aa7f2c4b804bac8c4352dd0a120bc75 (diff)
parent7bc569eac745b97137e1db8b9271493b3e5c8a20 (diff)
Merge branch 'message-passing-refactoring'
Diffstat (limited to 'src/console/console-frame.js')
-rw-r--r--src/console/console-frame.js61
1 files changed, 0 insertions, 61 deletions
diff --git a/src/console/console-frame.js b/src/console/console-frame.js
deleted file mode 100644
index e6bf3f5..0000000
--- a/src/console/console-frame.js
+++ /dev/null
@@ -1,61 +0,0 @@
-import './console-frame.scss';
-import * as messages from '../shared/messages';
-
-export default class ConsoleFrame {
- constructor(win) {
- let element = window.document.createElement('iframe');
- element.src = browser.runtime.getURL('build/console.html');
- element.className = 'vimvixen-console-frame';
- win.document.body.append(element);
-
- this.element = element;
-
- this.errorShown = true;
-
- this.hide();
- }
-
- showCommand(text) {
- this.showFrame();
-
- let message = {
- type: 'vimvixen.console.show.command',
- text: text
- };
- messages.send(this.element.contentWindow, message);
- this.errorShown = false;
- }
-
- showError(text) {
- this.showFrame();
-
- let message = {
- type: 'vimvixen.console.show.error',
- text: text
- };
- messages.send(this.element.contentWindow, message);
- this.errorShown = true;
- this.element.blur();
- }
-
- showFrame() {
- this.element.style.display = 'block';
- }
-
- hide() {
- this.element.style.display = 'none';
- this.element.blur();
- this.errorShown = false;
- }
-
- isErrorShown() {
- return this.element.style.display === 'block' && this.errorShown;
- }
-
- setCompletions(completions) {
- messages.send(this.element.contentWindow, {
- type: 'vimvixen.console.set.completions',
- completions: completions
- });
- }
-}