mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-28 05:44:43 +00:00
Refactoring plugin implementation
Including introducing the terminology "tiddler bundles"
This commit is contained in:
30
plugins/tiddlywiki/fullscreen/init.js
Normal file
30
plugins/tiddlywiki/fullscreen/init.js
Normal file
@@ -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, Element: false */
|
||||
"use strict";
|
||||
|
||||
var toggleFullScreen = function() {
|
||||
if(document[$tw.browser.isFullScreen]) {
|
||||
document[$tw.browser.cancelFullScreen]();
|
||||
} else {
|
||||
document.documentElement[$tw.browser.requestFullScreen](Element.ALLOW_KEYBOARD_INPUT);
|
||||
}
|
||||
};
|
||||
|
||||
exports.startup = function() {
|
||||
// Install the full screen handler
|
||||
document.addEventListener("tw-full-screen",function(event) {
|
||||
toggleFullScreen();
|
||||
},false);
|
||||
};
|
||||
|
||||
})();
|
||||
Reference in New Issue
Block a user