mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Add fullscreen mode plug in
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
.xterm.fullscreen {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: auto;
|
||||
height: auto;
|
||||
z-index: 255;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Fullscreen addon for xterm.js
|
||||
*
|
||||
* Implements the toggleFullscreen function.
|
||||
*
|
||||
* If the `fullscreen` argument has been supplied, then
|
||||
* if it is true, the fullscreen mode gets turned on,
|
||||
* if it is false or null, the fullscreen mode gets turned off.
|
||||
*
|
||||
* If the `fullscreen` argument has not been supplied, the
|
||||
* fullscreen mode is being toggled.
|
||||
*/
|
||||
Terminal.prototype.toggleFullscreen = function (fullscreen) {
|
||||
var fn;
|
||||
|
||||
if (typeof fullscreen == 'undefined') {
|
||||
fn = (this.element.classList.contains('fullscreen')) ? 'remove' : 'add';
|
||||
} else if (!fullscreen) {
|
||||
fn = 'remove';
|
||||
} else {
|
||||
fn = 'add';
|
||||
}
|
||||
|
||||
this.element.classList[fn]('fullscreen');
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "xterm.js",
|
||||
"version": "0.7",
|
||||
"version": "0.8",
|
||||
"ignore": ["demo", "docs", "test", ".gitignore"]
|
||||
}
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
<head>
|
||||
<title>xterm.js demo</title>
|
||||
<link rel="stylesheet" href="../src/xterm.css" />
|
||||
<link rel="stylesheet" href="../addon/fullscreen/fullscreen.css" />
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
<script src="../src/xterm.js"></script>
|
||||
<script src="../addon/fullscreen/fullscreen.js"></script>
|
||||
<script src="main.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user