Add fullscreen mode plug in

This commit is contained in:
paris
2014-04-10 15:20:41 +00:00
parent 96848a6425
commit c7f4658e97
4 changed files with 38 additions and 1 deletions
+10
View File
@@ -0,0 +1,10 @@
.xterm.fullscreen {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: auto;
height: auto;
z-index: 255;
}
+25
View File
@@ -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
View File
@@ -1,5 +1,5 @@
{
"name": "xterm.js",
"version": "0.7",
"version": "0.8",
"ignore": ["demo", "docs", "test", ".gitignore"]
}
+2
View File
@@ -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>