Last modified: 2014-02-12 23:52:35 UTC
As pointed out in bug 36007 MobileFrontend's bigger issues, is "using awfully generic names and titles all in the main namespace". These include: - global function `wm_toggle_section` (which is present for the purpose of the Wikipedia Mobile app versions below 1.2 - id's on elements - we should at least where needed insert a mfe- prefix on these
Just a small note to suggest "mw-mf" or even "mw-mobilefrontend" even instead of "mfe" as prefix.
Sice there are plans to merge this thing with core, why not mw-?
I've started addressing this is the implementation of the new navigation. Are we agreed on a prefix? I'm currently using 'mw-mf-' Please shout quickly if a different one should be used
mw-mf- sounds good. Even when it is part of core, it will still be in a certain module. Putting everything in the root context would be wrong. Stuff for foo in component x in core is named like mw-x-foo.
I'm assuming that is for CSS classes and IDs, right? For javascript modules you wouldn't use dashes since that would make the variable still global. It'd instead be something like this: ( function ( $, mw ) { mw.mobileFrontend = { foo: 'bar' }; }( jQuery, mediaWiki ) ); ( function ( $, mw ) { var mf = mw.mobileFrontend; $( '#mw-mf-foo' ).text( mf.foo ); }( jQuery, mediaWiki ) );
Yes of course. Javascript modules currently use the MobileFrontend as the only global variable (although there is a single bit of legacy code that I am trying to throw away) Changing the name of the MobileFrontend global variable is going to be slightly more problematic and may take a bit more time as it would also require changes to the app (but it's on my plate :-)).
https://gerrit.wikimedia.org/r/9743