Move $.byteLength and $.trimByteLength to new module 'mediawiki.String'
authorBartosz Dziewoński <matma.rex@gmail.com>
Mon, 19 Feb 2018 20:23:36 +0000 (21:23 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Thu, 22 Feb 2018 05:05:17 +0000 (21:05 -0800)
commitf19c9021a466f414065db6f74257efc702325110
tree49cc9ca2e9fa2e96e840048b47dd0597dafe4bfd
parenta63770525dca7e271719d8f00ce0e2ced226c411
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
14 files changed:
maintenance/jsduck/categories.json
resources/Resources.php
resources/src/jquery/jquery.byteLength.js
resources/src/jquery/jquery.byteLimit.js
resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
resources/src/mediawiki.widgets.visibleByteLimit/mediawiki.widgets.visibleByteLimit.js
resources/src/mediawiki.widgets/mw.widgets.TitleInputWidget.js
resources/src/mediawiki/mediawiki.String.js [new file with mode: 0644]
resources/src/mediawiki/mediawiki.Title.js
resources/src/mediawiki/mediawiki.inspect.js
tests/qunit/QUnitTestResources.php
tests/qunit/suites/resources/jquery/jquery.byteLength.test.js [deleted file]
tests/qunit/suites/resources/mediawiki/mediawiki.String.byteLength.test.js [new file with mode: 0644]
tests/qunit/suites/resources/mediawiki/mediawiki.String.trimByteLength.test.js [new file with mode: 0644]