Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Full screen button

36 views
Skip to first unread message

emf

unread,
Mar 14, 2016, 9:13:43 PM3/14/16
to
I need a button to turn the browser to full-screen mode to run some eye
exercises:

http://emf.neocities.org/ix/eyeExercises.html

I've found some code on the web that does this for the current page, but
returns to browser to normal screen when clicking on a link:

function requestFullScreen() {
var el = document.body;
// Supports most browsers and their versions.
var requestMethod = el.requestFullScreen ||
el.webkitRequestFullScreen
|| el.mozRequestFullScreen || el.msRequestFullScreen;
if (requestMethod) {
// Native full screen.
requestMethod.call(el);
} else if (typeof window.ActiveXObject !== "undefined") {
// Older IE.
var wscript = new ActiveXObject("WScript.Shell");
if (wscript !== null) {
wscript.SendKeys("{F11}");
}
}
}

How can I make it stay in full screen when you click on a link, like
when you press F11?

emf

--
Natal Transits Calculator
http://emf.neocities.org/nt/nataltransits.html

Thomas 'PointedEars' Lahn

unread,
Mar 15, 2016, 3:44:34 AM3/15/16
to
emf wrote:
^^^
For the last time now, get a real name.

> I need a button to turn the browser to full-screen mode to run some eye
> exercises:
>
> http://emf.neocities.org/ix/eyeExercises.html

OK.

> I've found some code on the web that does this for the current page, but
> returns to browser to normal screen when clicking on a link:
>
> […]
> } else if (typeof window.ActiveXObject !== "undefined") {
> // Older IE.
> var wscript = new ActiveXObject("WScript.Shell");
> if (wscript !== null) {
> wscript.SendKeys("{F11}");
> }

You do not want to do *that*.

> How can I make it stay in full screen when you click on a link, like
> when you press F11?

AFAIK, and I think unfortunately, you cannot.

You should design the exercises so that they work with any viewport size.
And you should use CSS animations if possible. At least read on how to
create smooth animations with scripting as your current eye tests do not
have smooth movement.

--
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.

Stefan Weiss

unread,
Mar 15, 2016, 5:32:38 AM3/15/16
to
On 03/15/2016 02:13, emf wrote:
> I need a button to turn the browser to full-screen mode to run some eye
> exercises:
>
> http://emf.neocities.org/ix/eyeExercises.html
>
> I've found some code on the web that does this for the current page, but
> returns to browser to normal screen when clicking on a link:
>
> function requestFullScreen() {
[snip]
> How can I make it stay in full screen when you click on a link, like
> when you press F11?

As far as I know, that's not possible, but you can use a workaround:
navigation inside an iframe will preserve the fullscreen mode, so you
could just load the whole thing in an iframe.

Demo: http://foo.at/paste/2016/03-emf/

Note that the onclick attribute on the button has also changed.

- stefan

John Harris

unread,
Mar 15, 2016, 5:44:42 AM3/15/16
to
On Tue, 15 Mar 2016 08:44:23 +0100, Thomas 'PointedEars' Lahn
<Point...@web.de> wrote:

>emf wrote:
>^^^
>For the last time now, get a real name.
<snip>

In English law that *is* a real name.

John

Evertjan.

unread,
Mar 15, 2016, 7:16:41 AM3/15/16
to
John Harris <ni...@jghnorth.org.uk.invalid> wrote on 15 Mar 2016 in
comp.lang.javascript:
Usenet and this NG are not subjected to English legislation,
but to Netiquette.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

John Harris

unread,
Mar 15, 2016, 4:14:01 PM3/15/16
to
On Tue, 15 Mar 2016 12:16:38 +0100, "Evertjan."
<exxjxw.h...@inter.nl.net> wrote:

>John Harris <ni...@jghnorth.org.uk.invalid> wrote on 15 Mar 2016 in
>comp.lang.javascript:
>
>> On Tue, 15 Mar 2016 08:44:23 +0100, Thomas 'PointedEars' Lahn
>> <Point...@web.de> wrote:
>>
>>>emf wrote:
>>>^^^
>>>For the last time now, get a real name.
>> <snip>
>>
>> In English law that *is* a real name.
>
>Usenet and this NG are not subjected to English legislation,
>but to Netiquette.

I'm pointing out that the German meaning of "real name" is not the
same as the meaning in other countries.

If you want your Netiquette guideline to talk about permitted names
then you have to avoid terms that vary with location. (And "legal
name" doesn't work either.)

John

Evertjan.

unread,
Mar 15, 2016, 5:19:02 PM3/15/16
to
John Harris <ni...@jghnorth.org.uk.invalid> wrote on 15 Mar 2016 in
comp.lang.javascript:

> On Tue, 15 Mar 2016 12:16:38 +0100, "Evertjan."
> <exxjxw.h...@inter.nl.net> wrote:
>
>>John Harris <ni...@jghnorth.org.uk.invalid> wrote on 15 Mar 2016 in
>>comp.lang.javascript:
[..]
>>> In English law that *is* a real name.
>>
>>Usenet and this NG are not subjected to English legislation,
>>but to Netiquette.
>
> I'm pointing out that the German meaning of "real name" is not the
> same as the meaning in other countries.

No, you did not even mention anything German.

What has Germany to do with it?

The words "real name" don't even exist in German,
like they do not in Indonesian, Sanskrit and Swahili.

> If you want your Netiquette guideline to talk about permitted names
> then you have to avoid terms that vary with location. (And "legal
> name" doesn't work either.)
>
> John
>



Thomas 'PointedEars' Lahn

unread,
Mar 15, 2016, 5:34:38 PM3/15/16
to
Stefan Weiss wrote:

> On 03/15/2016 02:13, emf wrote:
>> How can I make it stay in full screen when you click on a link, like
>> when you press F11?
>
> As far as I know, that's not possible, but you can use a workaround:
> navigation inside an iframe will preserve the fullscreen mode, so you
> could just load the whole thing in an iframe.

Interesting idea. Unfortunately, it works only as long as oneself or the
authors of the resources navigated to are not running a general frame
breaker. So that would need to be adapted to recognize the iframe that
one wants, and there is no remedy for when you navigate to other sites.

I am at a loss to see the logic in the decision-making process of browser
vendors here. The fullscreen mode cannot be enabled without user
interaction either way (“Failed to execute 'requestFullScreen' on 'Element':
API can only be initiated by a user gesture.”), and if the user is enabling
fullscreen mode without script involvement using e.g. the F11 key, the
browser window *stays* in fullscreen mode until the user disables it *even
when navigating*. Why can it not just stay in fullscreen mode as well if
enabling the mode is scripted? It’s a bug, not a feature.

John Harris

unread,
Mar 16, 2016, 11:56:28 AM3/16/16
to
On Tue, 15 Mar 2016 22:18:55 +0100, "Evertjan."
<exxjxw.h...@inter.nl.net> wrote:

>John Harris <ni...@jghnorth.org.uk.invalid> wrote on 15 Mar 2016 in
>comp.lang.javascript:
>
>> On Tue, 15 Mar 2016 12:16:38 +0100, "Evertjan."
>> <exxjxw.h...@inter.nl.net> wrote:
>>
>>>John Harris <ni...@jghnorth.org.uk.invalid> wrote on 15 Mar 2016 in
>>>comp.lang.javascript:
>[..]
>>>> In English law that *is* a real name.
>>>
>>>Usenet and this NG are not subjected to English legislation,
>>>but to Netiquette.
>>
>> I'm pointing out that the German meaning of "real name" is not the
>> same as the meaning in other countries.
>
>No, you did not even mention anything German.
>
>What has Germany to do with it?

Surely it's obvious. We assume that Thomas believes the term "real
name" has a meaning. It's most likely that meaning is the one
appropriate to Thomas's location. Thomas is German. Hence 'German
meaning'.


>The words "real name" don't even exist in German,
>like they do not in Indonesian, Sanskrit and Swahili.
<snip>

The words don't exist in Dutch either, but you seem to be using them
without problems.

John

Evertjan.

unread,
Mar 16, 2016, 12:36:52 PM3/16/16
to
John Harris <ni...@jghnorth.org.uk.invalid> wrote on 16 Mar 2016 in
comp.lang.javascript:

>>What has Germany to do with it?
>
> Surely it's obvious. We assume that Thomas

Who is "we"?

Why select a group that you surmize have a goup's meaning?

> believes the term "real
> name" has a meaning. It's most likely

I disagree that Thomas "most likely" acts and thinks as a German,
and thinks like a speaker of German.

> that meaning is the one appropriate to Thomas's location.

Why would Thomas have an "appropriate" meaning anyway?

> Thomas is German. Hence 'German meaning'.

What nonsense, why assume people of a country have a single meaning,
or should have a meaning dependent on their language?

Why assume German is only spoken in Germany, or do you think he has a
meaning appropriate fore wherever German is spoken>?

May I remind you "real name" is NOT German in the first place.

emf

unread,
Mar 17, 2016, 3:58:27 AM3/17/16
to
Thanks Stefan! Excellent solution. I only vaguely remember reading about
iframe -- I did not consider it relevant to me at the time -- but now be
sure I'll educate myself on the issue in the near future.

The only problem now is the addition on top of the alert of the line:

"The page at http://emf.neocities.org says:"

(at least with Firefox). Is there a way to avoid this, or would you
suggest an alternative?

One possibility now, of course, would be to eliminate the alert
entirely; a main reason I had included the alerts was that sometimes I
would click on the link before entering full screen mode. Now this seems
less of an issue...

Eustace

--
Spherical Triangle Calculator
http://emf.neocities.org/tr/spherical.html

emf

unread,
Mar 17, 2016, 4:45:49 AM3/17/16
to
Oops! My enthusiasm was premature. The serious drawback of this method
is that after finishing an exercise, you cannot return to the original
page to start a second one. Maybe there is no good way to use a button
after all. Well, I guess I'll just remove it an let the user enter
full-screen mode manually, after all.

Eustace

--
Date Calculator with all-purpose JS code
http://emf.neocities.org/ti/datecalculator.html

emf

unread,
Mar 17, 2016, 6:03:09 AM3/17/16
to
On 2016-03-15 03:44, Thomas 'PointedEars' Lahn wrote:
> emf wrote:
...
>> How can I make it stay in full screen when you click on a link, like
>> when you press F11?
>
> AFAIK, and I think unfortunately, you cannot.

Yes, it seems after all that you are right. I've removed the full screen
button.

> You should design the exercises so that they work with any viewport size.

No, not this, they are not supposed to do that, Especially the first 3
exercises.

> And you should use CSS animations if possible. At least read on how to
> create smooth animations with scripting as your current eye tests do not
> have smooth movement.

Yes, I have to look into this sometime in the future -- for the next
version of the first 2 exercises. Though I am not sure that as they are
they are much worse than the ones of the original executable file.

emf

John Harris

unread,
Mar 17, 2016, 6:44:09 AM3/17/16
to
On Wed, 16 Mar 2016 17:36:45 +0100, "Evertjan."
<exxjxw.h...@inter.nl.net> wrote:

<snip>
>May I remind you "real name" is NOT German in the first place.

Let's finish discussing how to discuss and go back to the original
problem.

Thomas insists that authors display their "real name" in all their
Usenet articles.

What do you think he means by "real name"? Do you have a meaning for
"real name" in Usenet articles?

In my country I can have as many names as I like and they can be
anything I like. I don't need permission for this. If I want one of my
names to be Qwertyuiop it's perfectly legal. Now what does "real name"
mean here? How would anyone decide whether Qwertyuiop is a "real name"
or not?

Does your country have rules saying which are "real names" and which
are not? Does Usenet?

John

Christoph M. Becker

unread,
Mar 17, 2016, 6:51:03 AM3/17/16
to
emf wrote:

> On 2016-03-15 03:44, Thomas 'PointedEars' Lahn wrote:
>
>> You should design the exercises so that they work with any viewport size.
>
> No, not this, they are not supposed to do that, Especially the first 3
> exercises.

You may consider to rewrite these exercises to use the viewport size
instead of the screen size.

--
Christoph M. Becker

Evertjan.

unread,
Mar 17, 2016, 8:32:27 AM3/17/16
to
John Harris <ni...@jghnorth.org.uk.invalid> wrote on 17 Mar 2016 in
comp.lang.javascript:

> Thomas insists that authors display their "real name" in all their
> Usenet articles.
>
> What do you think he means by "real name"? Do you have a meaning for
> "real name" in Usenet articles?

I have no idea and I am not very interested. Usning the name of another
participant would perhaps count as an negative example.

But the notion that someone's ideas must be coupled on someone's nationality,
language or abode, seems, while possible, not something to assume by default.

Aleksandro

unread,
Mar 17, 2016, 10:30:58 PM3/17/16
to
In my country (Chile) there are certain rules, you can't give your
children names that can be offensive or derogatory or that can mean
anything like that when read in a certain order.

lol

John Harris

unread,
Mar 18, 2016, 5:28:48 AM3/18/16
to
On Thu, 17 Mar 2016 13:31:42 +0100, "Evertjan."
<exxjxw.h...@inter.nl.net> wrote:

>John Harris <ni...@jghnorth.org.uk.invalid> wrote on 17 Mar 2016 in
>comp.lang.javascript:
>
>> Thomas insists that authors display their "real name" in all their
>> Usenet articles.
>>
>> What do you think he means by "real name"? Do you have a meaning for
>> "real name" in Usenet articles?
>
>I have no idea and I am not very interested.
<snip>

So, you don't care whether or not Thomas has a good reason to scream
'Use your real name' at people. That's ok, but it would have saved
both of us time if you had said so earlier.

John

Evertjan.

unread,
Mar 18, 2016, 5:42:44 AM3/18/16
to
John Harris <ni...@jghnorth.org.uk.invalid> wrote on 18 Mar 2016 in
comp.lang.javascript:

>>I have no idea and I am not very interested.
> <snip>
>
> So, you don't care whether or not Thomas has a good reason to scream
> 'Use your real name' at people.

Should I care?

> That's ok, but it would have saved
> both of us time if you had said so earlier.

Well, my time is my own, don't you dare presume on that.

I never said that I cared, that too seems your presumption only.

I said that presuming that someone's nationality, abode or language would
predispose of what is ment by "real name" in English is ludicrous.

btw, what is this preoccupation with saving time,
in sensu strictior you cannot?

Dr J R Stockton

unread,
Mar 20, 2016, 7:44:26 PM3/20/16
to
In comp.lang.javascript message <4449708.y...@PointedEars.de>,
Tue, 15 Mar 2016 08:44:23, Thomas 'PointedEars' Lahn
<Point...@web.de> posted:

>emf wrote:
>^^^
>For the last time now, get a real name.
^^^^^^^^^^^^^^^^^^^^^

That is a promise which I greatly hope, with the expectation of
disappointment, that you will keep. Remember the words of the Bard.

Man to small boy : "What's your dog's name?"
Reply : "I don't know. We call him Rover."

--
(c) John Stockton, Surrey, UK. 拯merlyn.demon.co.uk Turnpike v6.05 MIME.
Merlyn Web Site < > - FAQish topics, acronyms, & links.


markl...@gmail.com

unread,
Jul 23, 2016, 7:37:12 AM7/23/16
to
0 new messages