This repository has been archived by the owner on Jan 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce working popout-terminal alternative
- Loading branch information
1 parent
db23667
commit 7132081
Showing
7 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
var pageBus = require('page-bus'); | ||
|
||
module.exports = (function() { | ||
module.exports = bus = (function() { | ||
return pageBus({key: 'learn-ide'}) | ||
})() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.exports = { | ||
module.exports = local = { | ||
get(key) { | ||
return localStorage.getItem(key) | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<link rel="stylesheet" href="../node_modules/xterm/dist/xterm.css" /> | ||
<link rel="stylesheet" href="../styles/terminal-colors.css" /> | ||
<script src="../node_modules/xterm/dist/xterm.js"></script> | ||
|
||
<script src="../node_modules/xterm/dist/addons/fit/fit.js"></script> | ||
|
||
<link rel="stylesheet" href="../node_modules/xterm/dist/addons/fullscreen/fullscreen.css" /> | ||
<script src="../node_modules/xterm/dist/addons/fullscreen/fullscreen.js"></script> | ||
|
||
<script src="../lib/event-bus.js"></script> | ||
<script src="../lib/local-storage.js"></script> | ||
</head> | ||
<body> | ||
<div id="terminal"></div> | ||
<script> | ||
var el = document.getElementById('terminal') | ||
var term = new Terminal({cursorBlink: true}) | ||
|
||
term.open(el) | ||
term.toggleFullscreen() | ||
|
||
term.on('data', (data) => { | ||
bus.emit('popout-terminal:data', data) | ||
}) | ||
|
||
bus.on('popout-terminal:message', (msg) => { | ||
term.write(msg) | ||
}) | ||
|
||
bus.emit('popout-terminal:data', 'clear\r') | ||
</script> | ||
</body> | ||
</html> |