I experimented a bit more and the error only occurs when a mobile device is used and the mobile theme is active. Using a desktop browser and switching to the mobile skin (minerva provided by MobileFrontend) works fine and using a mobile device with desktop theme (strapping) works as well.
Also: the “Mobile view” link at the bottom of Whonix - Overview brings you to the .onion site.
This bug also affects the code selection. Until we have a solution I could edit the styles so it looks like JS was disabled and not so broken.
We could use widget parameters for that (migth also be useful for translations):
{{sd-start-short|shortLabel=Recommended|longLabel=Alternatives}}
short text {{sd-end-short-start-detailed}}
some more text {{sd-end-detailed}}
@Patrick@Lobster: We’re now on 1.27.0; the error has changed, but I don’t think the problem is solved. I can’t get the buttons to react in the mobile theme (whether using the “regular” browser nor the emulated mobile device.) I’m not sure the Unknown dependency error is the source of our current problems, but I haven’t investigated very thoroughly. I’ll keep looking.
EDIT 1: I think the buttons not working on the mobile view is a problem with the widgets, rather than a problem with Mediawiki. They work great on the desktop view (thanks @Lobster!) but don’t quite work properly on the mobile view yet.
Ah, I think I found the problem and a solution.
The JS code has to go additionally to MediaWiki:Mobile.js - Whonix the buttons aren’t styled because the CSS classes used in bootstrap are not included in the minerva skin.
I’ve updated MediaWiki:Mobile.js - Whonix and it looks like it’s being served in the mobile view, but it’s still not working. Do we need to adjust the divs it’s targeting?
EDIT 1: It looks like the buttons are changing classes properly, so I’m guessing it’s the CSS.
EDIT 2: The divs sd-short and sd-detailed aren’t getting filled with content on mobile…
Yes, the mobile version seems to close the div container right after opening it. I guess it’s some feature that tries to fix HTML errors automatically.
Yes, I can confirm that these errors are gone now.
The scripts from mobile JS are still missing on the emulated mobile device though.
Using a dektop browser with mobile skin these scripts get loaded (the bold one contains the mobile.js):
Could be a caching issue. I restarted apache and varnish. Can you check again please?
When reloading the Control and Monitor Tor page, I am getting the following notices in apache error log.
[Mon Jul 11 13:25:11.911960 2016] [:error] [pid 28859] [client 127.0.0.1:56540] PHP Notice: Undefined index: short in /var/www/w/extensions/Widgets/compiled_templates/32d1dd80866bfda26e75bbb35de419e3f414bb2e.wiki.Sd-start-short.php on line 32
[Mon Jul 11 13:25:11.912368 2016] [:error] [pid 28859] [client 127.0.0.1:56540] PHP Notice: Trying to get property of non-object in /var/www/w/extensions/Widgets/compiled_templates/32d1dd80866bfda26e75bbb35de419e3f414bb2e.wiki.Sd-start-short.php on line 32
[Mon Jul 11 13:25:11.939090 2016] [:error] [pid 28859] [client 127.0.0.1:56540] PHP Notice: Undefined index: long in /var/www/w/extensions/Widgets/compiled_templates/c3090e1c39f1b5190390c58647e4ee2f8c799c3e.wiki.Sd-end-short-start-detailed.php on line 28
[Mon Jul 11 13:25:11.939487 2016] [:error] [pid 28859] [client 127.0.0.1:56540] PHP Notice: Trying to get property of non-object in /var/www/w/extensions/Widgets/compiled_templates/c3090e1c39f1b5190390c58647e4ee2f8c799c3e.wiki.Sd-end-short-start-detailed.php on line 28
We had a similar issue with the download table widget which was due to some bug in the widget [usage]. Can you check please if you think something could be wrong?
Something you cannot possibly know… And something we are doing for quite some time now so I did not make the metal connection… We are using varnish devicedetect. When a mobile device is detected (using a known user agent), we transparently add ?useformat=mobile to the apache backend request.
Deactivated the varnish mobile auto detection for now to simplify the setup. Dunno if that interacted badly. Let’s see if we can figure out to have the mobile frontend load the javascript. If we do not, can we at least communicate this upstream to mediawiki in form of a bug or support request?
Collected some notes here as this thread is getting long:
On a real mobile browser using the desktop version, both codeselect and buttons are working! (Interesting to me as a proof of concept, that mobile browsers do support such features.)
The buttons do work now, they just need to be styled a bit for the mobile skin.
Also there is a minor bug in the codeselect JS on mobile because the JS gets loaded a a module, so the SelectText function is not in global namespace.
The mobile version with javascript disabled does not work yet. It shows non-styled javascript buttons that do not work.
The desktop version with javascript disabled has a minor issue. The text Short version: and Detailed version: cannot be selected by mice so it cannot be easily copied and pasted.
If you mean the grey “Contents”-button that expands if you click on it: that one has moved between the content and Licence section on Control and Monitor Tor . That happens already in the HTML code, probably because the template engine doesn’t like the original position. I could move the button up with JS but I can’t fix it for non-JS browsers.
I’m afraid by now that this is impossible, I just figured out that the mobile.css gets injected via javascript, so without JS enabled on mobile our custom CSS won’t get loaded.
That’s because the text gets added via CSS. To change that: