Move fullscreen button into core from plugin

This commit is contained in:
Jermolene
2014-08-01 16:52:12 +01:00
parent 6d06a54530
commit 799a5b059a
18 changed files with 72 additions and 67 deletions
+9
View File
@@ -66,6 +66,15 @@ exports.startup = function() {
downloadType: "text/plain"
});
});
var fullscreen = $tw.utils.getFullScreenApis();
$tw.rootWidget.addEventListener("tw-full-screen",function(event) {
if(document[fullscreen._fullscreenElement]) {
document[fullscreen._exitFullscreen]();
} else {
document.documentElement[fullscreen._requestFullscreen](Element.ALLOW_KEYBOARD_INPUT);
}
});
// If we're being viewed on a data: URI then give instructions for how to save
if(document.location.protocol === "data:") {
$tw.rootWidget.dispatchEvent({