diff --git a/core/plugins/fullscreen/init.js b/core/plugins/fullscreen/init.js new file mode 100644 index 000000000..ef0bb9f83 --- /dev/null +++ b/core/plugins/fullscreen/init.js @@ -0,0 +1,30 @@ +/*\ +title: $:/plugins/tiddlywiki/fullscreen/init.js +type: application/javascript +module-type: browser-startup + +Message handler for full screen mode + +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +var toggleFullScreen = function() { + if(document[$tw.browser.isFullScreen]) { + document[$tw.browser.cancelFullScreen](); + } else { + document.documentElement[$tw.browser.requestFullScreen](); + } +}; + +exports.startup = function() { + // Install the full screen handler + document.addEventListener("tw-full-screen",function(event) { + toggleFullScreen(); + },false); +}; + +})(); diff --git a/core/plugins/fullscreen/tiddlywiki.plugin b/core/plugins/fullscreen/tiddlywiki.plugin new file mode 100644 index 000000000..916b27ad9 --- /dev/null +++ b/core/plugins/fullscreen/tiddlywiki.plugin @@ -0,0 +1,7 @@ +{ + "title": "$:/plugins/tiddlywiki/fullscreen", + "description": "Adds support for HTML5 full screen mode", + "author": "JeremyRuston", + "version": "0.0.0", + "coreVersion": ">=5.0.0" +}