Adds the MDN polyfills for Array.prototype.find, findIndex, and
includes to core, along with a skip function. Polyfills live a
single "es6-polyfills" module in case additional similar polyfills
need to be introduced in the future.
Introducing these in core will allow certain extensions
to stop shipping local copies.
Bug: T264135
Change-Id: I37953f6fcad693a8d25e1a19764abd55bbbbb242
When watching a page, a toast appears with a message to confirm it has been
watched/unwatched successfully. This replaces the toast with a OOUI popup.
Bug: T249259
Change-Id: Ib1b8e31ce8e6fe271cb0d6e5fbaf80bc65360da1
I split this out of it back in 2011 with 83a7822df7.
I don't remember why. I think it had something to do with
Special:JavaScriptTest where I wanted to do something with colors.
Having those functions is useful in theory, but that doesn't require
its own module.
Change-Id: I8815d32c7072da83ddb9fbf955534d1f954692ba
Was originally created for Vector, which was originally part
of MediaWiki core. It hasn't been used for a while, and Vector
is in its own repository now.
Found 0 uses of this anywhere in Wikimedia Git, nor elsewhere
indexed by MediaWiki Codesearch.
Bug: T202154
Change-Id: I72ab5ad7f25be87b2f6d2f5f41a672b6a48b8005
Embed the essential files to define mw.loader directly as part of
the startup module.
* This means the internal 'mediawiki' module no longer exists.
This is safe to remove because:
1) While registered server-side for loading from startup.js, a PHPUnit
structure test disallowed being specified as a dependency.
2) Anything that attempted to load it client-side failed because the
module was marked in the registry as 'raw', thereby excluding it
from the data sent to the client-side. As such, it was seen as an
unknown module that the client refused to fetch from the server.
* Deprecate getStartupModules() and getLegacyModules().
These are no longer needed. There are no known callers anywhere in
Wikimedia Git or elsewhere indexed by Codesearch, but easy enough
to leave as no-op for one release.
* Remove ResourceLoaderRawFileModule class.
No longer needed. Was created as a hack specifically for the 'mediawiki'
module so that it would not leak global variables in debug mode.
It has no usage anywhere in Wikimedia Git, nor elsewhere in Codesearch.
Remove without deprecation given this was meant to be a 'private' class.
* Introduce (private) getBaseModules(). Previously, this list only existed
locally in getStartupModulesUrl() by merging getStartupModules() and
getLegacyModules(). This value was factored out into its own method.
* Make getStartupModulesUrl() private and rename to getBaseModulesUrl().
It is only used internally to export the 'baseModulesUri' value.
Its name was already confusing before, but it would've been even more
confusing now given it doesn't even call getStartupModules() any more.
Bug: T192623
Change-Id: I14ba282d7b65e99ca54b7c2f77ba6e1adaddd11c
This was added in (r99923; 4d8c7e96ed) while reviewing the
'gadget-preferences' branch in SVN of the Gadgets extension during
development of MediaWiki 1.18, intended for use in a color picker
on Special:Gadgets as part of an experimental feature that was
never completed (r94051).
The module has no usage anywhere in Wikimedia Git, nor in any
third-party hosted repos indexed by MediaWiki Codesearch, nor
anywhere on-wiki at WMF in site scripts (per mwgrep).
Bug: T193826
Bug: T192623
Change-Id: I8ed6c09dc7efd750ad4688b895b2e3f808a0e52b
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
This will make it a lot easier to move files from src/mediawiki/
to src/ without having to enumerate each file because previously
it was included by "src/mediawiki" entirely, but we can't include
"src/" entirely because of the implicitly excluded files.
Bug: T193826
Change-Id: Ib1b1a2e851d2cb8f1426a0d16343adcd6344a14f
* Reduce clutter in src/mediawiki/.
* Make it easier to see from the repo structure which files
belong to this module, and which files not. For example,
'mediawiki.notification.convertmessagebox' and 'mediawiki.notify' are
logically related, but not actually part of this 4-file module.
Bug: T193826
Change-Id: I274323dffa8af1d046beb21d88f633f432a6ebbc
In change Ia1269fd898dabbcf1582618eab46cef97e10a3b1 I want to add
functions that deal with codepoints instead of bytes to these modules,
after which the names wouldn't make sense. Doing this in a separate
commit to make the diffs clearer.
Change-Id: Ia554eb2265248e72b04fce69a662a9db1a5f1275
Was only used by UploadWizard, and no-where else in Wikimedia Git.
UploadWizard has its own copy as of last year. (T144974)
Change-Id: I3d426f67f8ba061d10434469f261cb725bd672d6
addEmbeddedCSS() is a big part of the hot code path that moves a module from
state "loaded" to "ready". Especially on repeat views (where most loads
are cache hits from local storage), this is the main thing that JS spends time
on before running scripts (which must wait for the styles to apply first).
* newStyleTag: Avoid use of jQuery.
Before
- jQuery()
- jQuery#init
- jQuery#before
- jQuery#domManip, jQuery#buildFragment, jQuery#inArray
- Node#insertBefore
- Node#appendChild
After
- Node#insertBefore
- Node#appendChild
* getMarker: Store raw Node instead of jQuery object. Makes it easy for other
code to avoid jQuery. And for those that don't, creating a jQuery object is cheap.
Also use querySelector directly since it's ensured by our feature test.
The only cases jQuery/Sizzle accounts with querySelector is IE8 (already excluded
by our feature test), and Opera 12 (in an edge case that doesn't apply to this
selector).
Before
- jQuery
- jQuery#init
- jQuery#find
- Sizzle
- querySelectorAll
- jQuery#pushStack
After
- querySelector
* addEmbeddedCSS: This was needlessly calling the fairly slow .data() method for
all style tags in all browsers. It should've been guarded by IE<=9 if-statement.
The consumer of this data property already had that check. The setter did not.
Before:
- getMarker
- ..
- newStyleTag
- ..
- jQuery#data
- jQuery#each, jQuery#data, internalData, ..
- fireCallbacks
- ..
After
- getMarker
- newStyleTag
- fireCallbacks
- ..
Change-Id: Ie5b5195d337b5d88f0c2ca69d15b13a4fb9d87e2
From https://developer.mozilla.org/en-US/docs/Web/API/File :
A File object is specific kind of a Blob, and can be used in any
context that a Blob can. In particular, FileReader, URL.createObjectURL(),
createImageBitmap(), and XMLHttpRequest.send() accept both Blobs and Files.
Change-Id: I171f884fc4ada6180e5c605a44b27044fc03f26e
The core implementation will only support wikitext.
Flow will add its own implementation, and it can be used for any talk
page system identifiable by content model.
Bug: T91805
Change-Id: Ic69acafb24aa737536fe3a074e1958690732f0a7
The jQuery Client library is no longer mastered in MediaWiki, and is
instead a proper, published library, which is now tagged as v1.0.0.
Change-Id: Idd19d738b392a5f742fef6f98c885e8c391a5cbf
* Move configuration to /jsduck.json per standard. This way
it can be run as plain '$ jsduck' without needing a maintenance
script or custom Jenkins job. Similar to JSHint, JSCS, Grunt,
and Gem etc.
* Move --processes=0 from maintenace script into config file.
This should've been in the config file all along and serves as
workaround for https://github.com/senchalabs/jsduck/issues/525.
* Use grunt-contrib-copy instead of a symlink for resources.
For local development a symlink works fine, but for publishing
from Jenkins to doc.wikimedia.org the /docs/js/ directory needs
to be standalone. This was previously done with a manual post-build
step that added an additional rsync, but this logic should be
in the repository so that the doc entry point can be simplified
and standardised to 'npm run-script doc' for all projects.
Change-Id: Iaaaac50ee78dd9ff8f24f1ef3a3685ad51cf33b2