Commit graph

110 commits

Author SHA1 Message Date
Timo Tijhof
8d406bbcd6 phpcs: Disable Generic.Files.LineLength for test files
There is a common and reasonable need for longer lines in tests.
The nudge for shorter lines doesn't seem valuable here. The natural
breaks will likely still fall in 80-100 given the enforced practice
for non-test code, e.g. whether through habit, or 80-100 column markers
in text editors, or the finite width of diff and code review
interfaces.

Change-Id: I879479e13551789a67624ce66f0946d2f185e6ee
2022-02-18 18:32:05 +00:00
DannyS712
bad94719a8 RCFilters: Merge mediawiki.rcfilters.filters.dm into ui module
The new module retains the name .ui name so that existing
skin style overrides continue to work. We can consider renaming it
to just "mediawiki.rcfilters.filters" in a future patch.

This does not handle file reorganization, since both of the
modules used package files - instead, in the main script we also
require() the old main script for the .dm module so that its
setup code runs. But, we did need to rename the virtual
config file from the .dm module to not clash with the
virtual config file from the .ui module, since the
latter uses a callback instead of retrieving configuration
variables directly. These can be merged later as well.

Bug: T256836
Change-Id: I5ec0af8b8e6bcdba6b7881f946f777b854a33739
2021-10-09 02:23:13 +00:00
Fomafix
0b56ca7065 mediawiki.String: Add new functions lcFirst and ucFirst
The new functions `lcFirst` and `ucFirst` lowercases/uppercases the
first character of a JavaScript string with support of UTF-16
surrogates for characters out of the Unicode BMP.

Use these new functions at jqueryMsg.

Change-Id: I007b63bfbcc9e4bc7e89f48df9687111bc4db715
2021-09-28 18:16:54 +00:00
Timo Tijhof
9150dee4ee resourceloader: Move tests for startup to startup subdirectory
Change-Id: I9742d2e1518580c7043b649ff049c718c939b7d8
2021-09-10 21:34:09 +00:00
Timo Tijhof
b33dbb2aee resourceloader: Clean up mw.Map tests
* Move to separate file.
* Remove most of the verbose assert messages in favour of just
  a few words that label the asserted value or the call that it
  checks the value of. The actual/expected values are already in
  the UI, and the class/method are already in the formatted test
  name (which includes the module name).

Change-Id: I43ec038abd0946a92f222a859807e252696c33d4
2021-09-10 21:13:12 +00:00
Fomafix
7ebcea3d2e mediawiki.String: Make method codePointAt public as charAt
This change renames the existing method `codePointAt` to `charAt` and
make it public. This method is similar to `String.prototype.charAt()`
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt
but supports Unicode characters outside of the BMP.
The name `codePointAt` would be irritating because the method
`String.prototype.codePointAt()`
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt
returns the code point number of the character instead of the character
as string.

Use this method to fix in the module 'mediawiki.jqueryMsg' the
functions `int`, `ucfirst` and `lcfirst` for strings with a character
outside of the Unicode BMP as first character.

Also add tests and use the usual Unicode syntax in the tests.

Bug: T285174
Change-Id: I4343e628e846de44cfdf0405261fa1a8d7ffbed3
2021-06-26 12:57:14 +00:00
Petr Pchelko
76d200b83f Add baseline MW REST API client for frontend
Bug: T268680
Change-Id: Ib09bf6b1e8cbfb3c51cfed24fc2e1e5bfc14a6eb
2020-12-09 23:05:15 +00:00
Timo Tijhof
274c4232b9 mediawiki.page.startup: Merge with mediawiki.page.ready module
The distinction between the two was lost several years years ago
when the "position top" queue ceased to be a thing. Since then,
the two have been loaded and executed together in the same batch,
and are doing similar things.

mediawiki.page.ready is publicly used in several places
as dependendency, but mediawiki.page.startup is entirely internal
to core, which makes it the easier one of the two to dissolve.

Keep an alias for two weeks for cache compat to avoid console
warnings about unknown modules. Although even some cache still
refers to it, this is harmless since the errors are recoverable
and the correct module was also loaded by the cached pages
already.

Bug: T260210
Change-Id: Ic418c23a7400abba22fd07b17f173d3c5f1d1d10
2020-08-14 01:35:15 +00:00
Thalia
837a63d503 Re-enable some tests for mw.widgets.TableWidget
Separate out assertions into different tests, and only skip those
that don't pass.

Change-Id: Ica79e9dd9f4bd0fe83147f124ab7167e03f6f68e
2020-06-03 16:50:11 +01:00
Thalia
2a68d8ffd7 Introduce table widget, upstreamed from the Graph extension
Upstream TableWidget, TableWidgetModel, RowWidget, RowWidgetModel,
and their related styles and messages from the Graph extension.

The table widget was used in the Graph extension's visual editor
module, but does not actually depend on visual editor. Reassign
the widgets to the mw.widgets namespace, and rename CSS classes
and messages accordingly. Also use mw.msg instead of ve.msg.

Bug: T251611
Change-Id: I3ccabc1473dd56570afddf93f5e3a928f0835b9c
2020-05-05 20:12:51 +01:00
Timo Tijhof
eabf8afbd8 mediawiki.jqueryMsg: Refactor test suite to not make any API requests
This test was an awful, awful, mess. (And I take full responsibility.)
Changing the global user language mid-way into execution is in no way
supported by ResourceLoader and this test was going through great
lengths to fool mw.loader about what's really going on.

Basically, all we're doing is get a list of instructions on what tests
to run, get comparison values based how the PHP side proceses these
(for parity comparison), and then run the assertions.

The mw.language singleton already has support for multiple languages,
and mediawiki.jqueryMsg already supports injecting data and constructing
new instances for each test case. Make use of that :)

Instead of calling ResourceLoaderLanguageDataModule::getData by
trying to hot load the same module repeatedly from load.php,
just export this data using 'packageFiles'.

The mediawiki.jqueryMsg QUnit suite previously took 4s to run locally
and now only 0.1s (145ms). This is not only significant for this
particular module, but also for QUnit in general as Headless Chrome
only took about 7s to run all of MediaWiki core's test suites prior
to this change, which is now down to ~3s. (MacBook Pro)

For WMF CI:

* Before (master commit):
  - mediawiki.jqueryMsg.test: ~2.1s (2135ms)
  - MediaWiki core total: ~4.8s
* After (this patch):
  - mediawiki.jqueryMsg.test: ~0.015s (15ms)
  - MediaWiki core total: ~3.6s

Bug: T250045
Bug: T225730
Change-Id: I5f1067feb0a43d63bfc5e7fff5110285a5e433c8
2020-04-23 21:59:50 +01:00
Timo Tijhof
8decad60a6 qunit: Load qunitjs directly instead of via load.php
Much less indirection this way, making the test runner a bit easier
to reason about (maintenance-wise) and easier to debug for developers.
Minification doesn't help here anyway (quite the opposite).

This also means the legacy option to load a module synchronously
from ResourceLoader\ClientHtml can be removed. This option existed
solely to bootstrap the QUnit test runner, and can be removed in a
subsequent commit.

Bug: T250045
Change-Id: I73985048382e9cc754753ed84f04d25214c07599
2020-04-23 21:47:46 +01:00
Timo Tijhof
851eb4b9c8 qunit: Use "test.*" module names only for actual test suites
This will make it easy to later allow the user to select which
component's specs to load and run (via CLI and GUI), e.g. for
an entire extension. We currently only have very narrow or very
wide selection mechanisms ('module' param for 1 module,
'rerun' for 1 test case, 'filter' param for global pattern match).

Bug: T250045
Depends-On: I55fe27e1c74972fcb3cdafefdc78e10e24f95b80
Change-Id: I5c01f720d787c3847228de511ce913284786ad66
2020-04-22 21:11:12 +00:00
Timo Tijhof
d00a6b079f Remove unused jquery.getAttrs module
Bug: T245894
Change-Id: I6bc344b4753a8ff47890e178636ababbb2886ce7
2020-02-24 17:12:12 +00:00
Timo Tijhof
d05dfe4736 qunit: Remove use of jquery.getAttrs
Bug: T245894
Change-Id: I0c95f23d7501b6255b2264028163a10f88e1b74b
2020-02-24 16:38:34 +00:00
Bartosz Dziewoński
6dbd2b8122 Fix display of diffs on Special:JavascriptTest
When something loaded the module 'mediawiki.diff.styles' on
Special:JavaScriptTest (this happens e.g. with VisualEditor),
the diffs generated for failing tests were grotesquely stretched
and useless. Add some style overrides to restore sanity.

Change-Id: I8ac6a2c6e86c6e982fad5d628d3b2c96efc4fbc2
2019-10-24 20:32:46 +00:00
Ammar Abdulhamid
7af7ee7086 Deprecate 'jquery.tabIndex' module
Bug: T234581
Change-Id: I8e1b43ae17b2bdd90f5ce7f0a4907cf94f759b8d
2019-10-18 23:49:28 +00:00
Timo Tijhof
01dae6ff8a jquery.color: Merge $.colorUtil back into this module
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
2019-09-11 05:12:22 +01:00
James D. Forrester
8697ba8354 Deprecate mediawiki.RegExp; move only function to mw.util
Bug: T218339
Change-Id: I1079e99fc22ed7f3159e7fe45581db799ae7259d
2019-09-07 15:34:21 +00:00
Timo Tijhof
f168493b57 mediawiki.util: Merge 'jquery.accessKeyLabel' into this module
Bug: T218339
Change-Id: I7aff1cf5a9526ef54cad33f5333361dba0efb1db
2019-09-06 16:39:42 +00:00
Timo Tijhof
0c7b707a99 resourceloader: Only register 'jquery.qunit' in test context
Change-Id: I0ea4bb73d5b886ea903a19a12bdd464778af0002
2019-07-30 16:00:59 +00:00
Timo Tijhof
2c32b6de09 resources: Remove deprecated 'jquery.hidpi' module
Deprecated in 1.32 and has no further purpose in its current
form as a jQuery plugin for <img srcset>, which we now use
natively without fallback.

The remaining logic for bracketed window.devicePixelRatio is
simple enough to inline as needed without the cruft and overhead
that comes with a centralised approach.

Bug: T202154
Change-Id: I729dfabcbb40a0a794d6b166a584f45a64ac0338
2019-03-05 11:48:46 +00:00
James D. Forrester
dd6c054810 resources: Drop jquery.localize, deprecated in 1.32
Change-Id: Iaab8637cd336ab47c789ebcf1d0610695555095f
2018-10-29 15:06:06 -07:00
Timo Tijhof
25fa7f8338 sinonjs: Update from 1.17.3 to 1.17.7
Upstream Sinon.JS no longer supports the pre-2.x v1.17 branch
anymore but there have been a few post-2.0 releases to address
bugs in v1.17 that we can still benefit from.

https://github.com/sinonjs/sinon/blob/v1.17.7/Changelog.txt

Notable changes include:

* Fix Blob feature test to support running tests on Safari 9.
* Avoid calls to object-local 'hasOwnProperty'.
* Improve error messages and stricter signature/type checks so
  that debugging code is easier when things go wrong.
* Fix various gaps in the XHR mock.
* Misc fixes for Node.js support.

Also remove outdated comment about ie-hacks from Sinon 1.15.

Change-Id: I66d1b461465b92798ad7eb2efcf4df2731cc78a4
2018-10-10 00:21:45 +00:00
Timo Tijhof
75cc8d3e00 mediawiki.hook: Move mw.hook tests to new mediawiki.base.test.js file
Follows-up 3801e54c29.

Also:

* Split the test into smaller more dedicated tests.
* Make minor changes so as to only assert values in the tests'
  outer scope. Assertions within callbacks are an anti-pattern
  that is fragile and can easily miss or mask problems. Using a
  single state observer that is modified by the callbacks makes
  for strict assertions with no implied or untested behaviour.
  Callbacks running in a different order or a different number of
  times now cause assertion failures - instead of causing the
  assertion to not be run, or to be run multiple times, which
  would pass.

Bug: T192623
Change-Id: Ice1560b754f8df29ca583eea19f559020fafaf12
2018-06-23 07:57:27 +00:00
Ed Sanders
55211908dd MediaSearch widget: Bring in ApiResultsQueue tests from upstream
Change-Id: I6508e428c3278edaab208c687abb48870b139154
2018-05-23 23:05:15 +01:00
Timo Tijhof
ecc812f06e mediawiki.api: Merge modules into one
These are all quite tiny and not worth providing separately
to the system as deliverable file bundles.

Mark the other mediawiki.api.* modules as alias to 'mediawiki.api'
for back-compat, with deprecation warning.

Highlights:

* Change mediawiki.api.edit.js to not use mw.user, because that
  causes a circular dependency, given mw.user also depends on
  mediawiki.api.

Bug: T192623
Change-Id: I0afdc8ab50bc1354bb5099bf39923c07eab0b665
2018-05-20 16:51:48 +02:00
Bartosz Dziewoński
777336288b Rename jquery.byteLimit→lengthLimit, mediawiki.widgets.visibleByteLimit→visibleLengthLimit
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
2018-02-23 20:18:02 +01:00
Bartosz Dziewoński
f19c9021a4 Move $.byteLength and $.trimByteLength to new module 'mediawiki.String'
These methods do not belong on the jQuery object. And to resolve
T185948, we need to also add codePointLength and trimCodePointLength,
and this new module seems like a good place to put them.

There is no `mw.String` global, this module has to be used via `require()`.

Deprecations:
* Function `$.byteLength` (from module 'jquery.byteLength') is
  deprecated, use `require( 'mediawiki.String' ).byteLength` instead.
* Function `$.trimByteLength` (from module 'jquery.byteLimit') is
  deprecated, use `require( 'mediawiki.String' ).trimByteLength` instead.
* Module 'jquery.byteLength' is deprecated, use 'mediawiki.String' instead.

Note that `$.fn.byteLimit` and the 'jquery.byteLimit' module are not
deprecated.

Change-Id: I2501a79efee644e5f4a9f5c977fe49c8c05c6eb3
2018-02-21 21:05:17 -08:00
Umherirrender
14d19eb90a resourceloader: Removed tests for deprecated 'position' parameter
This parameter is a no-op for these tests, as such, nothing was being
tested by specifying it in tests. The behaviour 'test' and 'test.top'
was identical.

Bug: T184257
Change-Id: Ia2bb731f00d4b4175f7b75174aeafaca9412329e
2018-02-12 21:39:05 +00:00
Erik Bernhardson
b41f666395 Timeout autoHide notifications based on visible time
On supported browsers handle the auto hide timeout with a
count of cumulative time the page has been visible to the
user. Old functionality can still be accessed, if desired,
by setting the visibleTimeout notification option to false.
On browsers without support for this visibilitychange event
wall clock time (the old behaviour) is used.

Adds a library function functionally similar to setTimeout that
only considers time when the page is visible. This is useful
both for analytics purposes, and when you want to temporarily
put something on screen and be reasonably certain it doesn't
go away until a user has seen it.

Bug: T42322
Change-Id: I7d8ea85602cae9cfc72e0155bc3092049ecafd43
2017-11-08 00:12:30 +01:00
James D. Forrester
e5a906ae07 resources: Remove deprecated 'jquery.autoEllipsis' module
Change-Id: Ib181b814953bac0153dead95a25040ed2d4ca7ca
2017-10-31 17:35:21 -07:00
Moriel Schottlender
c7b6b598ca RCFilters: Convert saved queries from filters to parameters
This will allow us to load them in the backend, and to keep
consistency between RecentChanges and Watchlist if needed.

Added also a 'backup' preference to keep the previous version
before the conversion, in case of mangling of the queries.

Bug: T166908
Change-Id: I8e26b66e43bd16282b7bdb52abc152f92a9c877d
2017-09-29 14:07:11 -04:00
Timo Tijhof
3863dd231f Remove deprecated jquery.mwExtension module
* Deprecated since MediaWiki 1.26.

* Not used anywhere in Wikimedia Git.

* Grafana mw-js-deprecate dashboard shows < 1 hit per day on average
  for any of the jquery.mwExtension properties, during the past 3 weeks.
  Most days 0, some days 18 individual hits.
  By comparison, legacy wikibits before we removed it in May 2017 was down
  to about 6,000/24h (combined), so removal is quite overdue.

Change-Id: Ib66d1844b4fb8d7185b0e6607b9f98c1be632bb5
2017-08-17 18:54:11 -07:00
Moriel Schottlender
85876bbc71 RCFilters: Make frontend URL follow backend rules and add 'urlversion=2'
The backend always merges the query with wiki/user defaults before
it gives us data. The frontend, though, initially assumed that the
state is given strictly by the URL parameters (especially after the
URL shorening commit). This made it so that the frontend state is
incompatible with backend state.

However, always merging frontend state with user/wiki defaults can
produce inconsistencies between URLs in the same wiki, preventing
users from sharing them -- and making it potentially break if ever
a wiki default changes.

The solution is to add 'urlversion=2' to all RCFilters-generated
URLs and have the backend recognize this parameter as 'do not
merge with defaults'.

When RCFilters frontend loads, it checks whether the parameter
exists; if it doesn't, it merges whatever it sees with the defaults
just like the backend, then it transforms the URL to represent the
correct full state, and adds 'urlversion=2' to the URL parameters,
making it consistent across accounts and through time for the
next time it will load.

This means several new behaviors over the 'short url' commit:
- Accessing Special:RecentChanges directly (no query) will result
  in one of two things:
  -- If there is a saved query that's set to default:
     The system will load that saved query "straight forward" (as
     if the user clicked that option from the menu) causing, also,
     an ajax re-request from the server (since the server does not
     yet know about saved queries or their potential for being
     the default state.)
  -- If there is no saved query default: The system will load
     user/wiki defaults (like the backend does) and then fix the
     url to represent this state fully (with parameters showing the
     actual state of the filters.
  -- Both cases will also result in adding 'urlversion=2' to
     the end result URL.
- Accessing Special:RecentChanges?urlversion=2 (without any other
  parameters) will result in loading a completely empty filter set
  in RCFilters. We assume that 'urlversion=2' does not load defaults
  even if it is the only parameter in the URL.
- Accessing Special:RecentChanges?hideX=1 (parameter set without
  urlversion=2) will result in the front end taking the requested
  parameters, merging them with user/wiki default (reproducing what
  the backend does) and then adding urlversion=2 to the URL.

In all cases except for the default-saved-query-load case, the initial
load will **not** re-request data from the backend. The backend needs
to adjust to respect urlversion=2 as well (will come in an upcoming
commit) so the state and expectation of both the front- and back-end
are the same.

This commit also factors out URL handing to a separate class (UriProcessor)
and adds unit tests for it.

Bug: T166907
Bug: T166972
Bug: T166974
Change-Id: I0eed3bc0d4fa4810b6301b535c75b6bfbc8b4a5b
2017-06-14 10:50:49 -07:00
Timo Tijhof
74432560be qunit: Remove test for deprecated jquery.placeholder
It's not very useful and needlessly emits deprecation warnings
which unfortunately cannot be surpressed at runtime.

The test just asserts that a no-op function exists.

Change-Id: I2768ba40191a3c0cc7be6202ffa5bed529eabfee
2017-04-13 14:00:24 -07:00
Timo Tijhof
15c0382121 mediawiki.inspect: Simplify getModuleSize() by using module descriptor
Follows-up ce2652c9ec. Also add unit tests.

Change-Id: I26caaf982f0d317028b5b00374dded6995564ece
2017-03-03 14:01:59 -08:00
James D. Forrester
d7212e6cfb startup: Drop JavaScript support for browsers without DOM Level 2
In practice, this means nothing, as the main browsers affected
were Internet Explorer 8 and early versions of Android (before
1.6), which are already Grade C.

Change-Id: I4488402686c8b9fefa0af5fed3c9a4b83cbff798
2017-03-03 00:08:33 +00:00
Moriel Schottlender
570a12df4c RCFilters UI: Add dm.FilterItem unit tests
Change-Id: I7198f38c6ce2a85c0dc5f88d5f2a5c4b43ee4663
2017-02-28 13:19:01 -05:00
Moriel Schottlender
b279eedd59 Split RCFilter's RL modules
Create 'dm' / 'ui' and 'controller' modules for ResourceLoader,
make sure that Special:RecentChanges loads 'ui' module (that
depends on the other two) and yet the qunit tests only load
the dm module.

Bug: T156532
Change-Id: If53a735458703f0bd2c094349edf86f38f05ccd7
2017-02-17 17:34:06 -08:00
Moriel Schottlender
873d3c9ffc Adding new interface for review filters to RecentChanges
Add a new filter experience to Special:RecentChanges with
a drop-down filter menu. Put it behind the rcenhancedfilters
preference, which is hidden for now.

Bug: T149435
Bug: T149452
Bug: T144448
Change-Id: Ic545ff1462998b610d7edae59472ecce2e7d51ea
2017-01-05 01:14:08 +00:00
Timo Tijhof
48e9411828 resourceloader: Move mw.loader qunit tests to a separate file
Change-Id: I867f00b0845664a2b670c460c58bf4f7791e0b38
2016-08-17 14:49:09 -07:00
Timo Tijhof
af9981495e mediawiki.api.edit: Add edit() and create() methods
Doing edits "The Right Way" is non-trivial due there being mulitple strict options that
need to be known and enabled. By default, the API encourages bad behaviour:

* Edit is unexpectedly saved as anon after session becomes invalid.
* Other edits are silently overwritten.
* Accidentally re-creates a deleted page.
* Accidentally creates a new page when an edit was intended (eg. if title was wrong).

Implement abstraction methods for edit and create that handle all this.
Thus guarding JS edits with the same protections as EditPage.

Change-Id: Ic6a35902cbae262971c704b9b8127e54733dac79
2016-06-27 18:08:43 +00:00
jdlrobson
bc4e07b6f6 resourceloader: Implement modern module loading (2/2)
* Send 'module' and 'require' parameters to module closures.
  This depends on Ia925844cc22f143 being deployed one cycle earlier.
* Patch Moment and OOjs to ensure these libraries continue to expose
  their module as globals as well. AMD/UMD-compatible libraries
  only expose a global *OR* an export, not both. We need both
  for back-compat.
* Update pluralRuleParser to make use of module export to allow
  usage via require().

To test, check out the patch and run:
> mw.loader.load('moment');
> mw.loader.require('moment')()
> mw.loader.require('moment')('2011-04-01').fromNow()

Bug: T108655
Change-Id: Idbd054880ee70d659ec760aef8fcb38d0704a394
2016-04-13 15:43:41 +00:00
Timo Tijhof
01ecc3ce5b Upgrade Sinon.JS to 1.17.3
No major changes for us other than a bugfix that makes the
following work as expected:

  var clock = this.sandbox.useFakeTimers();
  setTimeout(function () {
  	clock.tick(10);
  });
  click.tick(1);
  // Expected: 11ms is recorded
  // Actual: 1ms is record

This was broken up until Sinon 1.16.0 (Lolex 1.3.0) because it saved the
"clock.now" value before running any pending timeout callbacks. Then it
unconditionally assigned the "clock.now" value to 'oldNow + ticked', which
discarded ticks made by a callback.

Change-Id: I2775f4c6353aef12ced6dc45e73fe8d4e49c2b68
2016-03-16 17:43:43 +00:00
jhobs
3f4e016873 Upstream isElementInViewport from MobileFrontend
As a useful utility function, we've copied this method several times
across multiple extensions, which is a pretty good sign it should
actually live in core.

Changes:
 * Add `mediawiki.viewport` module
 * Rewrite method to be more robust and accept any viewport
 * Add `mw.viewport` to jsduck categories file
 * Add method for checking if an element is close to the viewport
 * Add unit tests

Bug: T124317
Change-Id: I38eec4f1e568f51e7e212b2b3f10b8da8d36f316
2016-03-02 14:22:14 -08:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
jdlrobson
2b7d281f06 Support Mustache partials in Mustache template module
* Add template partial support which matches the server-side implementation
  and means that we have full mustache support.

https://mustache.github.io/mustache.5.html#Partials

Bug: T97188
Change-Id: Ic752f52669dbffa21c4a514509c3ea1da8ac5d9c
2015-12-21 17:33:40 -08:00
Florian
ffdcafc456 Add mediawiki.api.messages module to easily retrieve a set of messages
Bug: T40280
Change-Id: I6e3fc4beb56c3120702ca291adf6e1521a0bc21f
2015-11-27 15:28:02 +01:00
Timo Tijhof
2905943e54 Implement mw.requestIdleCallback for deferred background tasks
We often use the idiom "window.onload" or "$(window).on('load')".
Since code loads asynchronous, this is problematic because the event won't
always be observed as it may fire before the event handler is attached.

Most tasks also don't really want to wait until the page is loaded (in which
case it would run immediately if the page is already loaded). Rather their intent
is just to defer it to a later point in time – to avoid disrupting user events.

Bug: T111456
Change-Id: Ieba0440c6d83086762c777dfbbc167f1c314a751
2015-11-10 18:48:25 +00:00