Hello,
the button I did in .js is now partly working,
it can change the browser into Fullscreen
three Problems are not solved yet.
-In Fullscreenmode the button switches to Exit Fullscreen after it is
clicked a second time.
-Either the ToggleBrowserFullscreen or the exitFullscreen function does
not work.
-How can I get the browser to remember my decision to allow Fullscreen?
I hope someone can help me on this.
!Button
<script label="Fullscreen">
//looks if the Browser is Fullscreenenabled
var fullscreenEnabled = document.fullscreenEnabled ||
document.mozFullScreenEnabled || document.webkitFullscreenEnabled;
//looks if the document is already in Fullscreen.
var fullscreenElement = document.fullscreenElement ||
document.mozFullScreenElement || document.webkitFullscreenElement;
//defines a function that will exit Fullscreen if the dokument is in
Fullscreen and otherwise go into fullscreen with the browserspecific
term, calling F11 as last option.
//defines a browserspecific EXITFullscreen function
function exitFullscreen()
{
if(document.exitFullscreen)
{
document.exitFullscreen();
}
else if(document.mozCancelFullScreen)
{
document.mozCancelFullScreen();
}
else if(document.webkitExitFullscreen)
{
document.webkitExitFullscreen();
}
}
//defines a browserspecific ENTERFullscreen function
function goFullscreen(element)
{
if(element.requestFullscreen)
{
element.requestFullscreen();
}
else if(element.mozRequestFullScreen)
{
element.mozRequestFullScreen();
}
else if(element.webkitRequestFullscreen)
{
element.webkitRequestFullscreen();
}
else if(element.msRequestFullscreen)
{
element.msRequestFullscreen();
}
}
goFullscreen(document.documentElement)
// This Function decides which Function should be used
function toggleBrowserFullscreen(fullscreenEnabled,fullscreenElement)
{
if(fullscreenElement)
{
exitFullscreen()
}
else if(fullscreenEnabled)
{
goFullscreen(document.documentElement)
}
else
{
SendKeys("{F11}") // ancient brute force method to toggle Fullscreen.
}
}
//create a button which is telling what will be done.
place.innerHTML=fullscreenElement?"Exit Fullscreen":"Fullscreen";
toggleBrowserFullscreen(document.documentElement);
</script>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/553509F6.9050500%40googlemail.com.
For more options, visit https://groups.google.com/d/optout.