https://bugzilla.wikimedia.org/show_bug.cgi?id=27730
Krinkle <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add JS utility function to |Move mw.uri module into the |get all parameter values |core |(like | |mw.util.getParamValue) in | |one call | --- Comment #7 from Krinkle <[email protected]> 2011-03-08 19:56:06 UTC --- Changing summary again to move that module into the core. Since none of the more advanced functions is used in core (yet) I suggest we keep that module optional and loaded whenever needed (ie. an extension could define it as a dependancy in which case it'll will be loaded on every page the extensions is on in the same http request.) (In reply to comment #5) > I would prefer if we just have a general Uri handler that can do everything > from parsing paths, hosts and parameters let you modify any of thous values > and > then get the reconstructed uri. mw.Uri is a step in the right direction... > custom functions for bits and pieces of Uri handling in the utilities class is > a ~not such a good~ direction. I agree. Now that I know mw.uri exists I think it's great to have it into core as it's own dedicated module. There's lots of more cool stuff in there [1]. It does possibly require a bit of updating when moved in core though, as it was written before the mw library was created in core: * making sure it doesn't rely on anything from the UploadWizard, * Small things like mw.isEmpty > $.isEmpty * No need to map window.mediaWiki to mw (mw and jQuery and globals in core, $ should still be wrapped though (for now)) * lowerCamelCase instead of UpperCamels Also a few things that could perhaps be made more effecient/correct. * Functions and variables that are called 'private' but are in fact not private. * Static things that aren't static (anything that is common to all instances and should never change can be made private/static by puttig it in a local variable that way it's not re-created on every instance (faster) and is also private for real (like the comments say now) ). Anyway, awesome script! extend() and clone() are very neat as well. As getting parameter values wikiEncoding (preserving slash and colons etc.) is by far the most common use of url functions (atleast in core js and in all gadgets/tools I've seen) I suggest we do keep that those stand-alone in mw.util without dependancies. -- Krinkle [1] http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/UploadWizard/resources/mw.Uri.js?view=markup -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
