2014-11-06 01:18:37 +00:00
|
|
|
/*!
|
2014-11-22 01:40:00 +00:00
|
|
|
* VisualEditor UserInterface MWInternalLinkMenuOptionWidget class
|
2014-11-06 01:18:37 +00:00
|
|
|
*
|
|
|
|
* @copyright 2011-2014 VisualEditor Team and others; see http://ve.mit-license.org
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2014-11-20 01:02:44 +00:00
|
|
|
* Creates a ve.ui.MWInternalLinkMenuOptionWidget object.
|
2014-11-06 01:18:37 +00:00
|
|
|
*
|
|
|
|
* @class
|
2014-11-20 01:02:44 +00:00
|
|
|
* @extends ve.ui.MWLinkMenuOptionWidget
|
2014-11-06 01:18:37 +00:00
|
|
|
*
|
|
|
|
* @constructor
|
|
|
|
* @param {Object} [config] Configuration options
|
|
|
|
* @cfg {string} [pagename] Pagename to return the names of internal pages
|
|
|
|
*/
|
2014-11-22 01:40:00 +00:00
|
|
|
ve.ui.MWInternalLinkMenuOptionWidget = function VeUiMWInternalLinkMenuOptionWidget( config ) {
|
2014-11-21 13:00:50 +00:00
|
|
|
// Config initialization
|
2014-11-06 01:18:37 +00:00
|
|
|
config = config || {};
|
|
|
|
|
|
|
|
// Properties
|
|
|
|
this.pagename = config.pagename;
|
|
|
|
|
|
|
|
// Parent constructor
|
2014-11-22 01:40:00 +00:00
|
|
|
ve.ui.MWLinkMenuOptionWidget.call( this, $.extend( { label: this.pagename, href: mw.util.getUrl( this.pagename ) }, config ) );
|
2014-11-06 01:18:37 +00:00
|
|
|
|
|
|
|
// Style based on link cache information
|
|
|
|
ve.init.platform.linkCache.styleElement( this.pagename, this.$link );
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2014-11-20 01:02:44 +00:00
|
|
|
OO.inheritClass( ve.ui.MWInternalLinkMenuOptionWidget, ve.ui.MWLinkMenuOptionWidget );
|