Rename command-line to console
This commit is contained in:
parent
f1b9c6ba9d
commit
6e5286ef10
9 changed files with 35 additions and 35 deletions
|
@ -1,18 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset=utf-8 />
|
||||
<title>VimVixen command-line</title>
|
||||
<script src='command-line.js'></script>
|
||||
</head>
|
||||
<body class='vimvixen-command-line'>
|
||||
<div>
|
||||
<p class='vimvixen-command-line-title'></p>
|
||||
<div class='vimvixen-command-line-line'>
|
||||
<i class='vimvixen-command-line-line-prompt'></i><input
|
||||
id='vimvixen-command-line-line-input'
|
||||
class='vimvixen-command-line-line-input'></input>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -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;
|
|
@ -1,4 +1,4 @@
|
|||
.vimvixen-command-line-frame {
|
||||
.vimvixen-console-frame {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
bottom: 0;
|
18
src/console/console.html
Normal file
18
src/console/console.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset=utf-8 />
|
||||
<title>VimVixen console</title>
|
||||
<script src='console.js'></script>
|
||||
</head>
|
||||
<body class='vimvixen-console'>
|
||||
<div>
|
||||
<p class='vimvixen-console-title'></p>
|
||||
<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>
|
|
@ -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);
|
|
@ -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;
|
||||
|
|
@ -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:
|
||||
|
|
Reference in a new issue