mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-25 09:30:28 +00:00
Added full screen mode plugin
This commit is contained in:
parent
c39654917f
commit
7a17e7b216
30
core/plugins/fullscreen/init.js
Normal file
30
core/plugins/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 */
|
||||||
|
"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);
|
||||||
|
};
|
||||||
|
|
||||||
|
})();
|
7
core/plugins/fullscreen/tiddlywiki.plugin
Normal file
7
core/plugins/fullscreen/tiddlywiki.plugin
Normal file
@ -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"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user