|
|
@@ -1,25 +1,25 @@
|
|
|
-<terminal id={ id } tabindex='1'>
|
|
|
- <display welcome={ welcome } events={ this } />
|
|
|
- <commandline prompt={ prompt } events={ this } />
|
|
|
+<terminal-ui id={ id } tabindex='1'>
|
|
|
+ <display-buffer welcome={ welcome } events={ this } />
|
|
|
+ <command-line prompt={ prompt } events={ this } />
|
|
|
|
|
|
<style>
|
|
|
- terminal { outline: none; }
|
|
|
- terminal * { padding: 0; margin: 0; line-height: normal; font-size: 100%; }
|
|
|
+ terminal-ui { outline: none; }
|
|
|
+ terminal-ui * { padding: 0; margin: 0; line-height: normal; font-size: 100%; }
|
|
|
</style>
|
|
|
|
|
|
/**
|
|
|
- * Create a new shell with the class name given to the terminal tag.
|
|
|
- * The terminal tag object passes events between the shell and the other tags.
|
|
|
+ * Create a new shell with the class name given to the terminal-ui tag.
|
|
|
+ * The terminal-ui tag object passes events between the shell and the other tags.
|
|
|
*/
|
|
|
var shell = window[opts.shell] ? new window[opts.shell](this) : {}
|
|
|
this.welcome = shell.welcome || opts.welcome
|
|
|
this.prompt = shell.prompt || opts.prompt
|
|
|
this.id = 'term-' + Math.floor(Math.random() * 10000)
|
|
|
-</terminal>
|
|
|
+</terminal-ui>
|
|
|
|
|
|
-<display>
|
|
|
+<display-buffer>
|
|
|
<div each={ output }>
|
|
|
- <raw content={ content } />
|
|
|
+ <raw-html content={ content } />
|
|
|
</div>
|
|
|
|
|
|
var ev = opts.events, self = this
|
|
|
@@ -58,18 +58,18 @@
|
|
|
this.output.length = 0
|
|
|
this.update()
|
|
|
}
|
|
|
-</display>
|
|
|
+</display-buffer>
|
|
|
|
|
|
-<commandline>
|
|
|
+<command-line>
|
|
|
<form autocomplete='off' onsubmit={ process } show={ visible }>
|
|
|
- <raw name='lhs' content={ prompt } show={ prompt_visible }>
|
|
|
- </raw><input type='text' name='command' />
|
|
|
+ <raw-html name='lhs' content={ prompt } show={ prompt_visible }>
|
|
|
+ </raw-html><input type='text' name='command' />
|
|
|
</form>
|
|
|
|
|
|
<style>
|
|
|
- commandline input[name='command'],
|
|
|
- commandline input[name='command']:hover,
|
|
|
- commandline input[name='command']:focus {
|
|
|
+ command-line input[name='command'],
|
|
|
+ command-line input[name='command']:hover,
|
|
|
+ command-line input[name='command']:focus {
|
|
|
padding: 0; margin: 0; line-height: normal; font-size: 100%;
|
|
|
background-color: transparent; border: none; outline: none;
|
|
|
height: auto; width: 70%;
|
|
|
@@ -139,13 +139,13 @@
|
|
|
encode(text) {
|
|
|
return text.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>')
|
|
|
}
|
|
|
-</commandline>
|
|
|
+</command-line>
|
|
|
|
|
|
-<raw>
|
|
|
+<raw-html>
|
|
|
<span></span>
|
|
|
|
|
|
<style>
|
|
|
- raw { white-space: pre-wrap }
|
|
|
+ raw-html { white-space: pre-wrap }
|
|
|
</style>
|
|
|
|
|
|
// Set initial html using `content` option, and...
|
|
|
@@ -153,4 +153,4 @@
|
|
|
|
|
|
// Call `write()` manually to update the html.
|
|
|
write(text) { this.root.innerHTML = text }
|
|
|
-</raw>
|
|
|
+</raw-html>
|