aboutsummaryrefslogtreecommitdiffstats
path: root/resources/src/mediawiki.Uri/Uri.js
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary local context variablesEd Sanders2024-11-081-8/+7
| | | | Change-Id: I52fdc5e5bc64bbe7ea895b9d7106dd3c99b0a908
* eslint: Manually enforce prefer-const in all remaining codeEd Sanders2024-10-051-12/+8
| | | | Change-Id: Ic9f254b55d3936f351ba9c7cc3b553544fc63a58
* eslint: Autofix var to let/constEd Sanders2024-09-121-11/+11
| | | | | | | Temporarily disable no-var & prefer-const as resulting errors need to be fixed manually. Change-Id: I6cb62a2c70a4c1fc265a00b1f18af127ac9d5029
* mediawiki.Uri: Fix extend() for undefined parametersLucas Werkmeister2024-08-191-1/+6
| | | | | | | | | With the previous $.extend()-based implementation, `undefined` parameters were not added to the URI, and some gadgets relied on this. Restore that behavior. Bug: T372742 Change-Id: Ib6203b08a29880176f7add15548585586434d7c2
* Object.assign's first argument must never be null/undefinedMichael Große2024-06-211-1/+1
| | | | | | | | | I looked through all of Ic6330fcb116e99d5827b4877e094e3073e2b7b72 (commit 2af1c3c) and there were the ones where I could not quickly convince myself that the first argument is an object in all circumstances. Change-Id: I5c744f04cd91e3a4328fb1dc86294aa1905f62a5
* ESLint: Enforce prefer-arrow-callback and autofixEd Sanders2024-06-111-8/+6
| | | | Change-Id: Iddfa574e42e569ac5e2a2b098ad2f11ca80c5955
* build: Update eslint-config-wikimedia to 0.28.1 and autofixEd Sanders2024-06-111-3/+3
| | | | | | | Also remove temporary explicit dependency on eslint-plugin-vue introduced in Ibd616750f046a. Change-Id: Ic6330fcb116e99d5827b4877e094e3073e2b7b72
* mediawiki.Uri/Uri: Add spaces as required for JSDocparthiv-m2024-05-031-0/+8
| | | | | Bug: T363545 Change-Id: I50df14cf6fc74707c15ff659b7a85ea412c5e7eb
* docs: Standardize use of class descriptions in JSDocapaskulin2024-04-251-6/+5
| | | | | | | | | * Uses class descriptions for classes and descriptions for constructors. * Switch out deprecated "done" function for Promise compatible "then" Bug: T357164 Change-Id: I6071851a2519638d67954bba5d74260d99237863
* docs: Simplify JSDoc descriptionsapaskulin2024-04-151-2/+2
| | | | | Bug: T360241 Change-Id: Ie99d3b3989d4a5f150e2b7bd36450a5d085c0a34
* docs: Fix JSDoc linksapaskulin2024-04-011-1/+1
| | | | | Bug: T360241 Change-Id: I90d7a58ca9385d7380472883b5bb7f1e7cacf785
* docs: Use Markdown syntax in JSDoc descriptionsapaskulin2024-02-291-27/+27
| | | | | | | | Use Markdown syntax to format code samples within JSDoc descriptions. Bug: T352233 Change-Id: I89476931ec836813fd3999fe5eb8143c3df50068
* Merge "Document rcfilters"jenkins-bot2024-02-281-2/+2
|\
| * Document rcfiltersJon Robson2024-02-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | * Mark @events as @ignore and move description to top of block * Replace @cfg with @param * Add additional OOUI classes * Add full stops to ends of sentences * @ignore various functions Bug: T352308 Change-Id: Id68733a2283f3a61f913ee1eb7b32f9a8911ca3d
* | docs: Fix class properties so that jsdoc picks them upRoan Kattouw2024-02-151-25/+42
|/ | | | | | | @property doesn't work for this, so use a combination of @type and @name. Change-Id: I4518f61fc61f41632e297361f8b53a23c21c03f7
* jsdoc: Support dots in '@module <name>' and '@exports <name>'Bartosz Dziewoński2024-02-071-1/+1
| | | | | | | | | | | | | JSDoc mangles dots in '@module <name>' and '@exports <name>' annotations: https://github.com/jsdoc/jsdoc/issues/1157 Work around this bug with a small plugin. Update '@link', '@memberof' etc. annotations that had to be written using incorrect names to work. (Those annotations are not affected by the bug, so we had to mangle them by hand.) Bug: T356913 Change-Id: I68bfb7be0f7d1d49901a1d5ceebc618771380b35
* Correctly document missing properties/methodsJon Robson2023-12-191-9/+19
| | | | | | | | | | | | * mw.UriRelative was being documented on global.html * Api was missing a summary line on mw namespace * Add summary for mw.user.options and mw.user.tokens and summary for mw.user * Documents mw.Uri class (missing summary) and methods (missing from docs) Bug: T352308 Change-Id: Ieb87b94e4d5f6f83f025a94da242c05622c01aca
* Fix mw.UriRelative documentationtacsipacsi2023-12-191-2/+1
| | | | | | | | | mw.UriRelative was documented as `mw` itself rather than a member of `mw`, not only making the actual name not appear, but also hiding all other members (classes, subnamespaces, properties, functions) of `mw`. Bug: T352308 Change-Id: Ib7ee760f63186fe71fb17c76dd0154a124acd991
* Documentation: Port mw.Uri to JSDoclwatson2023-12-151-64/+64
| | | | | Bug: T352308 Change-Id: If780d42c77ac270046ac19a534c758ef2e6f7215
* Resources: Clean up instances of no-jquery/no-each-utilJon Robson2023-05-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These all concern iterating through objects Replace $.each( obj, function ( key, value ) {} ) with for ( var key in obj ) { var value = arr[key]; .. } OR Object.keys( obj ).forEach( ( key ) { var value = arr[key]; .. } ); Note I've not cleaned up all instances in this patch as I exhausted the timebox I set myself Additional change: Document second parameter to mw.jqueryMsg.HtmlEmitter as optional which became obvious from this change. Bug: T334853 Change-Id: I1ca870246e54648912ef2d0ea370e48058761b50
* Update eslint-config-wikimedia to 0.25.0Ed Sanders2023-05-051-0/+1
| | | | Change-Id: I70d4e311d369bd160e0cb9411d1b074e22104006
* mediawiki.Uri: Document potential for corrupting the fragmentGergő Tisza2023-03-101-1/+7
| | | | | | | | | | | | | | mw.Uri uses encodeURIComponent() for encoding the fragment, which percent-encodes more characters than it should, including the / character which is often used in routes the fragment is matched agains. This means that URL manipulation using mw.Uri with and something like history.replace might break routing. Mention this in the documentation of mw.Uri.toString() and refer to URL which handles fragment roundtripping according to the WHATWG URL spec. Change-Id: Ib17349308359665b1ed2c28b91e15207f6fa966c
* build: Update eslint-config-wikimedia to 0.22.1Ed Sanders2022-02-211-1/+0
| | | | | | Also some minor version updates to karma dependencies as required. Change-Id: I2740faca2d28ad2b2896a3b0222678115d11a166
* resourceloader: Convert mediawiki.Uri to package filesTimo Tijhof2020-02-241-5/+5
| | | | | | | | | | | This replaces the client-side compiler for 'mediawiki.template.regexp', with a simple PHP callback. The regexp temple compiler is not used anywhere after this and will be removed in a follow-up commit. Bug: T233676 Change-Id: I1baa1465d88293d03975cadf2efdd57283427722
* mw.Uri: Add support for array parameters with explicit indexesBartosz Dziewoński2019-08-271-8/+42
| | | | | | | | | | | | | | | | | When the new 'arrayParams' option is set, query strings like `&foo[0]=a&foo[1]=b` will be parsed as a single parameter `foo` containing an array, rather than two separate parameters. The new option also affects the behavior of array parameters like `&foo[]=a&foo[]=b`, which will be parsed as a parameter named `foo` rather than `foo[]`, and disables array handling for parameters that don't contain an array index at the end. Unlike in PHP, this does not handle associative or multi-dimensional arrays, but that may be improved in the future. Bug: T231382 Change-Id: I48d4bb3fdf0ea7f5eb133c59bf63651ba356fc42
* mw.Uri: Use more intuitive variable namesBartosz Dziewoński2019-06-141-5/+4
| | | | Change-Id: I8e53d7a0e0b89909a5c3798a819a0690c757a060
* build: Update eslint-config-wikimedia to 0.11.0Ed Sanders2019-02-201-1/+1
| | | | Change-Id: Iee025a518962e68c5ec2c07d952f402cd2a7f69b
* Document Uri.js constructor and methods throwing ErrorsThiemo Kreuz2019-01-241-3/+6
| | | | | | | | | | I, personally, think the fact an empty `new Uri()` call can fail with an Error being thrown is a bug. But it seems others think this is a feature (see Ib4dc568). Can we at least document it then? And then somehow (not sure how) tell everybody who ever used this class to fix their code? Change-Id: I86ef1ccf90f9be9c61bc6a8312369ae09d622b0c
* build: Use eslint-config-wikimedia v0.9.0 and make passEd Sanders2018-11-231-1/+1
| | | | Change-Id: I7b5d228a3de4b3006751a427dec907a5bebf2f51
* resources: Strip '$' and 'mw' from file closuresTimo Tijhof2018-09-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follows-up Id6d13bbea6: - '$': mw.loader.implement does this already. - 'mw': Use the canonical name directly. This replaces the following patterns: File closures (common): - `( function ( $, mw ) {` => `( function () {` - `( function ( $ ) {` => `( function () {` - `( function ( mw ) {` => `( function () {` - `( function ( mw, $ ) {` => `( function () {` File closures (rare): - `( function ( mw, $, OO ) {` => `( function () {` - `( function ( mw, OO, $ ) {` => `( function () {` - `( function ( mw, document ) {` => `( function () {` Combined dom-ready and file closure (rare): - `jQuery( function ( $ ) {` => `$( function () { - `jQuery( function () {` => `$( function () { Remaining references in files without a closure, as found by the new ESLint setting (rare): - `jQuery` => `$` - `mediaWiki` => `mw` Change-Id: I7cf2426cde597259e8c6f3f6f615a1a81a0ca82b
* Hygiene: Discourage use of $.eachjdlrobson2018-09-051-0/+1
| | | | | | | | | | | Even though Array.prototype.forEach only works on arrays, and $.each is more generic, I think it makes sense to begin discouraging the usage of $.each now. This can be overriden by ignore lines or by Array.prototype.forEach compatible lines. This doesn't seem too much of an ask of engineers and helps future migrations Bug: T200877 Change-Id: I339cff311a830699c8e32f07cec338a39870c53f
* build: Enable and make pass no-prototype-builtinsJames D. Forrester2018-07-051-1/+1
| | | | Change-Id: I26a98be16c005c1c864ec592e1a41b44943f8f29
* Remove eslint-disable no-use-before-defineFomafix2018-05-271-2/+1
| | | | | | | | | | mediawiki.js: Reorder setGlobalMapValue() to avoid a forward reference. mediawiki.action.edit.stash.js: Reorder two functions without to avoid forward references. In all other cases add eslint-disable-next-line no-use-before-define. Change-Id: Ic8b2f8cf61dcfb1a215ad3d3dddfd40282e3e836
* resources: Move the remaining src/mediawiki/ filesTimo Tijhof2018-05-091-0/+438
Single-file modules to src/, the remaining as sub directories. A few highlights: * mediawiki.Upload.BookletLayout. (stylesheet: no image references) * mediawiki.feedback - Also move the image to its own images/ subdir. * mediawiki.searchSuggest. (stylesheet: no image references) * mediawiki.toc. (stylesheet: no image references) Also updated any other references to 'src/mediawiki/' that I could find in core: * Fixed references in docs/uidesign/*.html * Remove redundant exclude from jsduck.json. After this, there are 4 files remaining in src/mediawiki, which are the 4 files used by the actual 'mediawiki' base module. Bug: T193826 Change-Id: I8058652892a78b3f5976397bd850741dd5c92427