2014-04-22 02:13:42 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor UserInterface MWLanguageSearchWidget class.
|
|
|
|
*
|
|
|
|
* @copyright 2011-2014 VisualEditor Team and others; see AUTHORS.txt
|
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*global mw */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an ve.ui.MWLanguageSearchWidget object.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.ui.LanguageSearchWidget
|
|
|
|
*
|
|
|
|
* @constructor
|
|
|
|
* @param {Object} [config] Configuration options
|
|
|
|
*/
|
|
|
|
ve.ui.MWLanguageSearchWidget = function VeUiMWLanguageSearchWidget( config ) {
|
|
|
|
// Parent constructor
|
|
|
|
ve.ui.LanguageSearchWidget.call( this, config );
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
|
|
|
OO.inheritClass( ve.ui.MWLanguageSearchWidget, ve.ui.LanguageSearchWidget );
|
|
|
|
|
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
/**
|
2014-05-14 15:46:16 +00:00
|
|
|
* @inheritdoc
|
2014-04-22 02:13:42 +00:00
|
|
|
*/
|
|
|
|
ve.ui.MWLanguageSearchWidget.prototype.getLanguages = function () {
|
2014-04-24 23:54:58 +00:00
|
|
|
return mw.language.getData( mw.config.get( 'wgUserLanguage' ), 'languageNames' ) ||
|
|
|
|
$.uls.data.getAutonyms();
|
2014-04-22 02:13:42 +00:00
|
|
|
};
|