Shuffle button has "style = 'display: none'" but is is showing up in production; button hidden locally and on mobile.
Closed, DeclinedPublic

Description

Locally, the shuffle button doesn't show up for me. When I look at the html, it looks like this:

<input class="shuffle" name="shuffleButton" type="button" value="Shuffle questions" style="display: none;"/>

So for me it is correctly hidden, even though it shouldn't be. In production, i.e. view-source:https://en.wikiversity.org/wiki/Help:Quiz it also has the style display;none but shows up nonetheless.

In mobile the shuffle button is also missing:

https://en.m.wikiversity.org/wiki/Help:Quiz

Presumably it shouldn't have display;none as the style, but I'm curious also as to why it *is* showing up in production? Is the style for shuffle button being overwritten somewhere?

Mvolz created this task.Jun 12 2017, 9:16 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 12 2017, 9:16 AM
Mvolz triaged this task as Normal priority.Jun 12 2017, 9:16 AM

The shuffle button is added via php and always has display;none as style, this is modified by the JavaScript residing inside ext.quiz.js.

It's probably not showing Locally due to browser cache.I had the same issue in Chromium browser.Using firefox and selecting Disable HTTP Cache when tool box is open can help.Also Ctrl + R works too to reload without cache.

Screenshot -

According to this wiki page, MobileFrontend extension by default specifically disables all ResourceLoader modules and it specifies reasons to support it.

This explains why the shuffle is not visible in mobile version.
Also the mobile version works differently, it doesn't have dropdown similar to web version.
Screenshot -

The module can be loaded if decided according to criteria mentioned here.

Mvolz added a comment.Jun 12 2017, 5:58 PM
This comment was removed by Mvolz.
Aklapper renamed this task from Shuffle button has "style = 'display; none'"but is is showing up in production; button incorrectly hidden locally and on mobile. to Shuffle button has "style = 'display: none'" but is is showing up in production; button incorrectly hidden locally and on mobile. .Jun 12 2017, 6:25 PM

Change 358948 had a related patch set uploaded (by Harjotsingh; owner: Harjotsingh):
[mediawiki/extensions/Quiz@master] Add Target mobile for Quiz extension

https://gerrit.wikimedia.org/r/358948

I've submitted a change to add target="mobile" in extension.json.
Not commenting whether it should be merged or not.

Mvolz renamed this task from Shuffle button has "style = 'display: none'" but is is showing up in production; button incorrectly hidden locally and on mobile. to Shuffle button has "style = 'display: none'" but is is showing up in production; button hidden locally and on mobile. .Jun 15 2017, 9:18 AM
Mvolz added a comment.Jun 15 2017, 9:37 AM

We potentially could continue to leave off the shuffle button in mobile; I assume it uses JS to shuffle so that would make sense why it would hide it if JS is disabled. So I guess that's as intended! Maybe we shouldn't merge then.

I'm not sure it is the cache because in chromium you can use Chrt+shift+R to clear the cache and refresh. It's also not cached if you have the developer tools open. I've tried both, no luck. And I opened it in Firefox as well where I'd never accessed the page before... still doesn't show up.

I'm also not seeing the file at all in my network inspection from developer tools... looks like for some reason the JS is not being loaded at all for me locally.

The only thing that works is adding ?debug=true to the end which does load the file (and all the other files!) and then it's able to run. But when I take it off... nada.

Agreed, It is probably intended and may cause other issues if merged.
My chromium browser never shows shuffle button locally no matter what.Only in chrome or firefox it is visible.
For firefox it is important to open dev tools and disable cache in settings.
The file in network is named as

http://localhost/load.php?debug=false&lang=en&modules=ext.quiz|jquery.accessKeyLabel,checkboxShiftClick,client,getAttrs,highlightText,mw-jump,suggestions,tabIndex,throttle-debounce|mediawiki.RegExp,api,notify,searchSuggest,storage,user,util|mediawiki.api.user|mediawiki.page.ready,startup|site|skins.vector.js|user.defaults&skin=vector&version=0qj313p

Change 358948 abandoned by Mvolz:
Add Target mobile for Quiz extension

Reason:
We decided not to do this.

https://gerrit.wikimedia.org/r/358948

Mvolz closed this task as Declined.Jun 19 2017, 8:39 AM
Mvolz removed a project: Patch-For-Review.