Introducing getTitle() in MWTitleInputWidget

A method for getTitle() is added which can return the valid title,
or, it can return null, in case the value isn't a valid title

Bug: 72468
Change-Id: I8a13afc9a66c167fe25010743c0d9e1424133d96
This commit is contained in:
suchetag 2014-10-29 03:42:22 +05:30 committed by Catrope
parent b4e98c1490
commit 9191465039

View file

@ -125,3 +125,15 @@ ve.ui.MWTitleInputWidget.prototype.getLookupMenuItemsFromData = function ( data
return items;
};
/**
* Get template title
*
* @returns {mw.Title|null} Template title if valid or null
*/
ve.ui.MWTitleInputWidget.prototype.getTitle = function () {
var title = this.getValue(),
titleObj = mw.Title.newFromText( title );
return titleObj;
};