[BREAKING CHANGE] Rename TitleWidget#getTitle to TitleWidget#getMWTitle
authorStephane Bisson <sbisson@wikimedia.org>
Thu, 4 Jan 2018 20:49:15 +0000 (15:49 -0500)
committerSbisson <sbisson@wikimedia.org>
Fri, 5 Jan 2018 18:09:51 +0000 (18:09 +0000)
Rename TitleWidget#getTitle so it won't clash with TitledElement#getTitle

Bug: T184181
Change-Id: I97ff46d8ca60f260af2a0b12e6c053aa91c777d1

resources/src/mediawiki.widgets/mw.widgets.TitleInputWidget.js
resources/src/mediawiki.widgets/mw.widgets.TitleWidget.js

index a78ad82..98d07f3 100644 (file)
                value = mw.widgets.TitleInputWidget.parent.prototype.cleanUpValue.call( this, value );
 
                return $.trimByteLength( this.value, value, this.maxLength, function ( value ) {
-                       var title = widget.getTitle( value );
+                       var title = widget.getMWTitle( value );
                        return title ? title.getMain() : value;
                } ).newVal;
        };
index 5670ce4..0c6385b 100644 (file)
         * @param {string} [value] Value to get a title for
         * @return {mw.Title|null} Title object, or null if value is invalid
         */
-       mw.widgets.TitleWidget.prototype.getTitle = function ( value ) {
+       mw.widgets.TitleWidget.prototype.getMWTitle = function ( value ) {
                var title = value !== undefined ? value : this.getQueryValue(),
                        // mw.Title doesn't handle null well
                        titleObj = mw.Title.newFromText( title, this.namespace !== null ? this.namespace : undefined );
         * @return {boolean} The query is valid
         */
        mw.widgets.TitleWidget.prototype.isQueryValid = function () {
-               return this.validateTitle ? !!this.getTitle() : true;
+               return this.validateTitle ? !!this.getMWTitle() : true;
        };
 
 }( jQuery, mediaWiki ) );