���ѧۧݧ�ӧ�� �ާ֧ߧ֧էا֧� - ���֧էѧܧ�ڧ��ӧѧ�� - /home/rickpfrv/wiki.craftaro.com/resources/src/mediawiki.widgets/mw.widgets.NamespaceInputWidget.js
���ѧ٧ѧ�
/*! * MediaWiki Widgets - NamespaceInputWidget class. * * @copyright 2011-2015 MediaWiki Widgets Team and others; see AUTHORS.txt * @license The MIT License (MIT); see LICENSE.txt */ ( function () { /** * Namespace input widget. Displays a dropdown box with the choice of available namespaces. * * @class * @extends OO.ui.DropdownInputWidget * * @constructor * @param {Object} [config] Configuration options * @cfg {string|null} [includeAllValue] Value for "all namespaces" option, if any * @cfg {boolean} [userLang=false] Display namespaces in user language * @cfg {number[]} [exclude] List of namespace numbers to exclude from the selector */ mw.widgets.NamespaceInputWidget = function MwWidgetsNamespaceInputWidget( config ) { // Configuration initialization config = $.extend( {}, config, { options: this.constructor.static.getNamespaceDropdownOptions( config ) } ); // Parent constructor mw.widgets.NamespaceInputWidget.parent.call( this, config ); // Initialization this.$element.addClass( 'mw-widget-namespaceInputWidget' ); }; /* Setup */ OO.inheritClass( mw.widgets.NamespaceInputWidget, OO.ui.DropdownInputWidget ); /* Static methods */ /** * Get a list of namespace options, sorted by ID. * * @param {Object} [config] Configuration options * @return {Object[]} Dropdown options */ mw.widgets.NamespaceInputWidget.static.getNamespaceDropdownOptions = function ( config ) { var options, exclude = config.exclude || [], mainNamespace = mw.config.get( 'wgNamespaceIds' )[ '' ]; var namespaces = config.userLang ? require( './data.json' ).formattedNamespaces : mw.config.get( 'wgFormattedNamespaces' ); // eslint-disable-next-line no-jquery/no-map-util options = $.map( namespaces, function ( name, ns ) { if ( ns < mainNamespace || exclude.indexOf( Number( ns ) ) !== -1 ) { return null; // skip } ns = String( ns ); if ( ns === String( mainNamespace ) ) { name = mw.msg( 'blanknamespace' ); } return { data: ns, label: name }; } ).sort( function ( a, b ) { // wgFormattedNamespaces is an object, and so technically doesn't have to be ordered return a.data - b.data; } ); if ( config.includeAllValue !== null && config.includeAllValue !== undefined ) { options.unshift( { data: config.includeAllValue, label: mw.msg( 'namespacesall' ) } ); } return options; }; }() );
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | ���֧ߧ֧�ѧ�ڧ� ����ѧߧڧ��: 0.2 |
proxy
|
phpinfo
|
���ѧ����ۧܧ�