diff --git a/addon/fullscreen/fullscreen.css b/addon/fullscreen/fullscreen.css new file mode 100644 index 00000000..ced6c529 --- /dev/null +++ b/addon/fullscreen/fullscreen.css @@ -0,0 +1,10 @@ +.xterm.fullscreen { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + width: auto; + height: auto; + z-index: 255; +} \ No newline at end of file diff --git a/addon/fullscreen/fullscreen.js b/addon/fullscreen/fullscreen.js new file mode 100644 index 00000000..a3012a7e --- /dev/null +++ b/addon/fullscreen/fullscreen.js @@ -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'); +} \ No newline at end of file diff --git a/bower.json b/bower.json index 71ac4581..c7aa76f4 100644 --- a/bower.json +++ b/bower.json @@ -1,5 +1,5 @@ { "name": "xterm.js", - "version": "0.7", + "version": "0.8", "ignore": ["demo", "docs", "test", ".gitignore"] } diff --git a/demo/index.html b/demo/index.html index 36016c1d..73aa304a 100644 --- a/demo/index.html +++ b/demo/index.html @@ -3,8 +3,10 @@