Last modified: 2014-05-13 16:42:17 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 65147 - Implement a way for wikis to provide js and css that is loaded in all skins (including mobile)
Implement a way for wikis to provide js and css that is loaded in all skins (...
Status: NEW
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
1.24rc
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: code_quality
  Show dependency treegraph
 
Reported: 2014-05-10 17:48 UTC by Liangent
Modified: 2014-05-13 16:42 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Liangent 2014-05-10 17:48:47 UTC
Having code duplicated in Common.css and Mobile.css, and possible App.css in the future doesn't look elegant.
Comment 1 MZMcBride 2014-05-11 15:31:59 UTC
I'm not sure I understand this bug report. For example, isn't "MediaWiki:Common.css" blank by default in MediaWiki core?
Comment 2 James Forrester 2014-05-11 15:34:52 UTC
(In reply to Liangent from comment #0)
> Having code duplicated in Common.css and Mobile.css, and possible App.css in
> the future doesn't look elegant.

Do you mean something more like "Rename Common.css to Desktop.css, and have Common.css be loaded on all platforms (Desktop, Mobile and App)"?
Comment 3 Liangent 2014-05-11 15:37:25 UTC
(In reply to James Forrester from comment #2)
> (In reply to Liangent from comment #0)
> > Having code duplicated in Common.css and Mobile.css, and possible App.css in
> > the future doesn't look elegant.
> 
> Do you mean something more like "Rename Common.css to Desktop.css, and have
> Common.css be loaded on all platforms (Desktop, Mobile and App)"?

Kind of this, but do not use the existing Common.js which are already crowded of contents unsuitable in mobile.
Comment 4 James Forrester 2014-05-11 15:38:44 UTC
(In reply to Liangent from comment #3)
> (In reply to James Forrester from comment #2)
> > (In reply to Liangent from comment #0)
> > > Having code duplicated in Common.css and Mobile.css, and possible App.css in
> > > the future doesn't look elegant.
> > 
> > Do you mean something more like "Rename Common.css to Desktop.css, and have
> > Common.css be loaded on all platforms (Desktop, Mobile and App)"?
> 
> Kind of this, but do not use the existing Common.js which are already
> crowded of contents unsuitable in mobile.

We can just move them; a bot move isn't that hard…
Comment 5 Yuvi Panda 2014-05-11 15:42:28 UTC
Just to note, there won't be an App.css. Mobile.css would load on both mobile web (and eventually) the apps.
Comment 6 Liangent 2014-05-11 15:48:11 UTC
(In reply to Yuvi Panda from comment #5)
> Just to note, there won't be an App.css. Mobile.css would load on both
> mobile web (and eventually) the apps.

Will apps support Mobile.js then?
Comment 7 Liangent 2014-05-11 15:49:22 UTC
and by the way I filed bug 65037 a while ago.
Comment 8 Krinkle 2014-05-13 16:42:17 UTC
The bug as filed is a case of "works for me".

We have a global js/css, it's MediaWiki:Common.js and MediaWiki:Common.css.

The MobileFrontend extension is violating documentation and expectation by not loading it, that's a bug on their end.

Their decision to not load it is understandable however. Due to how these are used on specific wikis (e.g. Wikimedia's).

It's not entirely the fault of these scripts though. Mobile browsers weren't always officially supported by MediaWiki. Reaching out to the community and requesting they migrate things accordingly should be a reasonable path from here on out. If any exceptional problems or struggles come up, they should be able to get help from Wikimedia's mobile team to find a solution.

As for introducing a Desktop.css/js, I don't think that makes sense. We already have skin-specific site modules (Vector.js/css, Monobook.js/css, Mobile.js/css).

If code is common between both vector and monobook, it should probably be either duplicated in both, or improved to be generic enough and work on mobile as well. Mobile doesn't deserve that kind of special treatment imho, that encourages bad practices.

A good example is the accessibility and mobile compatibility of the Vector dropdown. It used to only work on hover. For many reasons (including mobile, but that doesn't even matter to me in this context), it was improved to also work on focus and click. This made it much more accessible and usable, and also made it work on mobile.

It is imho not worth it to duplicate that logic so that the 2 lines of code binding the "hover" handler aren't loaded on mobile. The module binds on all three (hover, click, focus) and that seems like a good pattern to follow. Being purist about every line of code in bandwidth isn't useful imho as there's much bigger fish to catch (both in that area and others).

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links