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
This commit is contained in:
Bartosz Dziewoński 2018-02-08 22:22:34 +01:00
parent 0c712ce564
commit 777336288b
6 changed files with 33 additions and 23 deletions

View file

@ -20,16 +20,16 @@
"resources/src/mediawiki.special",
"resources/src/mediawiki.toolbar",
"resources/src/mediawiki.widgets",
"resources/src/mediawiki.widgets.visibleByteLimit",
"resources/src/mediawiki.widgets.visibleLengthLimit",
"resources/src/jquery/jquery.accessKeyLabel.js",
"resources/src/jquery/jquery.byteLength.js",
"resources/src/jquery/jquery.byteLimit.js",
"resources/src/jquery/jquery.checkboxShiftClick.js",
"resources/src/jquery/jquery.colorUtil.js",
"resources/src/jquery/jquery.confirmable.js",
"resources/src/jquery/jquery.footHovzer.js",
"resources/src/jquery/jquery.getAttrs.js",
"resources/src/jquery/jquery.hidpi.js",
"resources/src/jquery/jquery.lengthLimit.js",
"resources/src/jquery/jquery.localize.js",
"resources/src/jquery/jquery.makeCollapsible.js",
"resources/src/jquery/jquery.spinner.js",

View file

@ -161,8 +161,8 @@ return [
'targets' => [ 'desktop', 'mobile' ],
],
'jquery.byteLimit' => [
'scripts' => 'resources/src/jquery/jquery.byteLimit.js',
'dependencies' => 'mediawiki.String',
'dependencies' => 'jquery.lengthLimit',
'deprecated' => 'Use "jquery.lengthLimit" instead.',
'targets' => [ 'desktop', 'mobile' ],
],
'jquery.checkboxShiftClick' => [
@ -268,6 +268,11 @@ return [
],
'targets' => [ 'desktop', 'mobile' ],
],
'jquery.lengthLimit' => [
'scripts' => 'resources/src/jquery/jquery.lengthLimit.js',
'dependencies' => 'mediawiki.String',
'targets' => [ 'desktop', 'mobile' ],
],
'jquery.localize' => [
'scripts' => 'resources/src/jquery/jquery.localize.js',
],
@ -1065,7 +1070,7 @@ return [
],
'dependencies' => [
'mediawiki.RegExp',
'jquery.byteLimit',
'jquery.lengthLimit',
],
'messages' => [
'htmlform-chosen-placeholder',
@ -1427,7 +1432,7 @@ return [
'mediawiki.editfont.styles',
'jquery.textSelection',
'oojs-ui-core',
'mediawiki.widgets.visibleByteLimit',
'mediawiki.widgets.visibleLengthLimit',
'mediawiki.api',
],
],
@ -2101,7 +2106,7 @@ return [
'mediawiki.special.movePage' => [
'scripts' => 'resources/src/mediawiki.special/mediawiki.special.movePage.js',
'dependencies' => [
'mediawiki.widgets.visibleByteLimit',
'mediawiki.widgets.visibleLengthLimit',
'mediawiki.widgets',
],
],
@ -2315,7 +2320,7 @@ return [
],
'mediawiki.legacy.protect' => [
'scripts' => 'resources/src/mediawiki.legacy/protect.js',
'dependencies' => 'jquery.byteLimit',
'dependencies' => 'jquery.lengthLimit',
'messages' => [ 'protect-unchain-permissions' ]
],
// Used in the web installer. Test it after modifying this definition!
@ -2481,12 +2486,17 @@ return [
'targets' => [ 'desktop', 'mobile' ],
],
'mediawiki.widgets.visibleByteLimit' => [
'dependencies' => 'mediawiki.widgets.visibleLengthLimit',
'deprecated' => 'Use "mediawiki.widgets.visibleLengthLimit" instead.',
'targets' => [ 'desktop', 'mobile' ]
],
'mediawiki.widgets.visibleLengthLimit' => [
'scripts' => [
'resources/src/mediawiki.widgets.visibleByteLimit/mediawiki.widgets.visibleByteLimit.js'
'resources/src/mediawiki.widgets.visibleLengthLimit/mediawiki.widgets.visibleLengthLimit.js'
],
'dependencies' => [
'oojs-ui-core',
'jquery.byteLimit',
'jquery.lengthLimit',
'mediawiki.String',
],
'targets' => [ 'desktop', 'mobile' ]

View file

@ -1,18 +1,18 @@
/**
* @class jQuery.plugin.byteLimit
* @class jQuery.plugin.lengthLimit
*/
( function ( $, mw ) {
var
eventKeys = [
'keyup.byteLimit',
'keydown.byteLimit',
'change.byteLimit',
'mouseup.byteLimit',
'cut.byteLimit',
'paste.byteLimit',
'focus.byteLimit',
'blur.byteLimit'
'keyup.lengthLimit',
'keydown.lengthLimit',
'change.lengthLimit',
'mouseup.lengthLimit',
'cut.lengthLimit',
'paste.lengthLimit',
'focus.lengthLimit',
'blur.lengthLimit'
].join( ' ' ),
trimByteLength = require( 'mediawiki.String' ).trimByteLength;
@ -166,6 +166,6 @@
/**
* @class jQuery
* @mixins jQuery.plugin.byteLimit
* @mixins jQuery.plugin.lengthLimit
*/
}( jQuery, mediaWiki ) );

View file

@ -45,12 +45,12 @@ return [
'scripts' => [
'tests/qunit/suites/resources/startup.test.js',
'tests/qunit/suites/resources/jquery/jquery.accessKeyLabel.test.js',
'tests/qunit/suites/resources/jquery/jquery.byteLimit.test.js',
'tests/qunit/suites/resources/jquery/jquery.color.test.js',
'tests/qunit/suites/resources/jquery/jquery.colorUtil.test.js',
'tests/qunit/suites/resources/jquery/jquery.getAttrs.test.js',
'tests/qunit/suites/resources/jquery/jquery.hidpi.test.js',
'tests/qunit/suites/resources/jquery/jquery.highlightText.test.js',
'tests/qunit/suites/resources/jquery/jquery.lengthLimit.test.js',
'tests/qunit/suites/resources/jquery/jquery.localize.test.js',
'tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js',
'tests/qunit/suites/resources/jquery/jquery.tabIndex.test.js',
@ -103,12 +103,12 @@ return [
],
'dependencies' => [
'jquery.accessKeyLabel',
'jquery.byteLimit',
'jquery.color',
'jquery.colorUtil',
'jquery.getAttrs',
'jquery.hidpi',
'jquery.highlightText',
'jquery.lengthLimit',
'jquery.localize',
'jquery.makeCollapsible',
'jquery.tabIndex',

View file

@ -1,7 +1,7 @@
( function ( $, mw ) {
var simpleSample, U_20AC, poop, mbSample;
QUnit.module( 'jquery.byteLimit', QUnit.newMwEnvironment() );
QUnit.module( 'jquery.lengthLimit', QUnit.newMwEnvironment() );
// Simple sample (20 chars, 20 bytes)
simpleSample = '12345678901234567890';