Does the function exist in the html file?

Monkey Targets Forums/HTML5/Does the function exist in the html file?

ElectricBoogaloo(Posted 2014) [#1]
My framework seems to be working fairly well, but this past week I finally decided to sign up to GameJolt, and a few "quirks" have popped up.
Most notably, the fact that my HTML target's "Fullscreen" button relies on the game being in my multi-resolution html file.
Obviously, when I upload to GameJolt, that's not there, but then it means faffing about with my source to remove the Fullscreen button, and.. well, we all know I'm too lazy to do that! (Especially when I've got 30-odd bloomin' games that I have to do that to!!)

I'm still relatively new to all this "Extern" stuff, so if anyone could poke me in the correct direction, that'd be great.
I now have two distinct html files in the html target. One is MonkeyGame.html, which is obviously the fully featured test thing, then the other is index.html which is much more barebones, and what GameJolt wants.
MonkeyGame contains a bunch of functions for resizing the canvas and allowing fullscreen, whilst index doesn't.

In my game's "Options" menu, there's a permanent "Fullscreen" button, which when in the MonkeyGame will make the canvas as big as possible, but when in index will casually fail and achieve no result.
I'd prefer it if I could go "If (Extern-Fullscreen) Add Fullscreen Button" or something of that sort, so that when the fullscreen function isn't inside the html file, the button wouldn't show up.

Is that do-able in the HTML target?
I've tried a couple of things, but they froze up the thing, and.. meh.. I couldn't be bothered to try any further!

Any clues would be helpful.
Thanks for any/all assistance.


Gerry Quinn(Posted 2014) [#2]
I don't know much about HTML5, but some possibilities spring to mind:

1. Can Monkey load and inspect the calling index.html? If so, it's easy.

2. You could include something in the data directory, e.g. a small image or text file, that is read by your program and identifies the specific target as Jolt or whatever. With HTML5 you wouldn't even need to recompile.


ElectricBoogaloo(Posted 2014) [#3]
1. Can't imagine that'd work very well, and sounds like it'd become yet another "per-browser" complication that I'd rather not have to deal with.

2. That would still require a difference between standard and GameJolt editions. (one would have the image, the other wouldn't) I'd rather have exactly the same bundle, and have it figure things out depending on the calling .html script, rather than fiddling. If I have to fiddle at all, it might as well be a simple "Const isGameJolt=1" at the top of the script, like I'm doing with "isOuya=1".