dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move $.byteLength and $.trimByteLength to new module 'mediawiki.String'
[lhc/web/wiklou.git]
/
resources
/
src
/
mediawiki.widgets
/
mw.widgets.TitleInputWidget.js
diff --git
a/resources/src/mediawiki.widgets/mw.widgets.TitleInputWidget.js
b/resources/src/mediawiki.widgets/mw.widgets.TitleInputWidget.js
index
101a606
..
4b1109b
100644
(file)
--- a/
resources/src/mediawiki.widgets/mw.widgets.TitleInputWidget.js
+++ b/
resources/src/mediawiki.widgets/mw.widgets.TitleInputWidget.js
@@
-6,6
+6,8
@@
*/
( function ( $, mw ) {
*/
( function ( $, mw ) {
+ var trimByteLength = require( 'mediawiki.String' ).trimByteLength;
+
/**
* Creates an mw.widgets.TitleInputWidget object.
*
/**
* Creates an mw.widgets.TitleInputWidget object.
*
@@
-15,6
+17,7
@@
* @mixins OO.ui.mixin.LookupElement
*
* @constructor
* @mixins OO.ui.mixin.LookupElement
*
* @constructor
+ * @param {Object} [config] Configuration options
* @cfg {boolean} [suggestions=true] Display search suggestions
* @cfg {RegExp|Function|string} [validate] Perform title validation
*/
* @cfg {boolean} [suggestions=true] Display search suggestions
* @cfg {RegExp|Function|string} [validate] Perform title validation
*/
@@
-129,8
+132,8
@@
// Parent method
value = mw.widgets.TitleInputWidget.parent.prototype.cleanUpValue.call( this, value );
// Parent method
value = mw.widgets.TitleInputWidget.parent.prototype.cleanUpValue.call( this, value );
- return
$.
trimByteLength( this.value, value, this.maxLength, function ( value ) {
- var title = widget.getTitle( value );
+ return trimByteLength( this.value, value, this.maxLength, function ( value ) {
+ var title = widget.get
MW
Title( value );
return title ? title.getMain() : value;
} ).newVal;
};
return title ? title.getMain() : value;
} ).newVal;
};