2013-12-20 23:25:24 +00:00
|
|
|
/*!
|
2014-11-23 18:04:00 +00:00
|
|
|
* VisualEditor MediaWiki CommandRegistry registrations.
|
2013-12-20 23:25:24 +00:00
|
|
|
*
|
2015-01-08 23:54:03 +00:00
|
|
|
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
2013-12-20 23:25:24 +00:00
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* MW Command Registrations */
|
|
|
|
|
2014-05-31 04:47:08 +00:00
|
|
|
ve.ui.commandRegistry.register(
|
2014-11-04 22:10:28 +00:00
|
|
|
new ve.ui.Command(
|
2015-07-22 22:13:09 +00:00
|
|
|
'link', 'mwlink', 'open', { supportedSelections: [ 'linear' ] }
|
2014-11-04 22:10:28 +00:00
|
|
|
)
|
2014-05-31 04:47:08 +00:00
|
|
|
);
|
2013-12-20 23:25:24 +00:00
|
|
|
ve.ui.commandRegistry.register(
|
2014-11-04 22:10:28 +00:00
|
|
|
new ve.ui.Command(
|
|
|
|
'gallery', 'window', 'open',
|
2015-07-22 22:13:09 +00:00
|
|
|
{ args: [ 'gallery' ], supportedSelections: [ 'linear' ] }
|
2014-11-04 22:10:28 +00:00
|
|
|
)
|
2013-12-20 23:25:24 +00:00
|
|
|
);
|
|
|
|
ve.ui.commandRegistry.register(
|
2014-11-04 22:10:28 +00:00
|
|
|
new ve.ui.Command(
|
|
|
|
'media', 'window', 'open',
|
2015-07-22 22:13:09 +00:00
|
|
|
{ args: [ 'media' ], supportedSelections: [ 'linear' ] }
|
2014-11-04 22:10:28 +00:00
|
|
|
)
|
2014-04-02 23:29:04 +00:00
|
|
|
);
|
2013-12-20 23:25:24 +00:00
|
|
|
ve.ui.commandRegistry.register(
|
2014-11-04 22:10:28 +00:00
|
|
|
new ve.ui.Command(
|
|
|
|
'reference', 'window', 'open',
|
2015-07-22 22:13:09 +00:00
|
|
|
{ args: [ 'reference' ], supportedSelections: [ 'linear' ] }
|
2014-11-04 22:10:28 +00:00
|
|
|
)
|
2013-12-20 23:25:24 +00:00
|
|
|
);
|
|
|
|
ve.ui.commandRegistry.register(
|
2014-11-04 22:10:28 +00:00
|
|
|
new ve.ui.Command(
|
|
|
|
'transclusion', 'window', 'open',
|
2015-07-22 22:13:09 +00:00
|
|
|
{ args: [ 'transclusion' ], supportedSelections: [ 'linear' ] }
|
2014-11-04 22:10:28 +00:00
|
|
|
)
|
2013-12-20 23:25:24 +00:00
|
|
|
);
|
|
|
|
ve.ui.commandRegistry.register(
|
2014-11-04 22:10:28 +00:00
|
|
|
new ve.ui.Command(
|
|
|
|
'alienExtension', 'window', 'open',
|
2015-07-22 22:13:09 +00:00
|
|
|
{ args: [ 'alienExtension' ], supportedSelections: [ 'linear' ] }
|
2014-11-04 22:10:28 +00:00
|
|
|
)
|
2013-12-20 23:25:24 +00:00
|
|
|
);
|
2014-04-02 23:29:04 +00:00
|
|
|
ve.ui.commandRegistry.register(
|
2014-11-04 22:10:28 +00:00
|
|
|
new ve.ui.Command(
|
|
|
|
'meta', 'window', 'open',
|
2015-07-22 22:13:09 +00:00
|
|
|
{ args: [ 'meta' ] }
|
2014-11-04 22:10:28 +00:00
|
|
|
)
|
2014-04-02 23:29:04 +00:00
|
|
|
);
|
|
|
|
ve.ui.commandRegistry.register(
|
2014-11-04 22:10:28 +00:00
|
|
|
new ve.ui.Command(
|
|
|
|
'meta/settings', 'window', 'open',
|
|
|
|
{ args: [ 'meta', { page: 'settings' } ] }
|
|
|
|
)
|
2014-04-02 23:29:04 +00:00
|
|
|
);
|
|
|
|
ve.ui.commandRegistry.register(
|
2014-11-04 22:10:28 +00:00
|
|
|
new ve.ui.Command(
|
|
|
|
'meta/advanced', 'window', 'open',
|
|
|
|
{ args: [ 'meta', { page: 'advancedSettings' } ] }
|
|
|
|
)
|
2014-04-02 23:29:04 +00:00
|
|
|
);
|
|
|
|
ve.ui.commandRegistry.register(
|
2014-11-04 22:10:28 +00:00
|
|
|
new ve.ui.Command(
|
|
|
|
'meta/categories', 'window', 'open',
|
|
|
|
{ args: [ 'meta', { page: 'categories' } ] }
|
|
|
|
)
|
2014-04-02 23:29:04 +00:00
|
|
|
);
|
|
|
|
ve.ui.commandRegistry.register(
|
2014-11-04 22:10:28 +00:00
|
|
|
new ve.ui.Command(
|
|
|
|
'meta/languages', 'window', 'open',
|
|
|
|
{ args: [ 'meta', { page: 'languages' } ] }
|
|
|
|
)
|
2014-04-02 23:29:04 +00:00
|
|
|
);
|
|
|
|
ve.ui.commandRegistry.register(
|
2014-11-04 22:10:28 +00:00
|
|
|
new ve.ui.Command(
|
|
|
|
'heading1', 'format', 'convert',
|
2015-07-22 22:13:09 +00:00
|
|
|
{ args: [ 'mwHeading', { level: 1 } ], supportedSelections: [ 'linear' ] }
|
2014-11-04 22:10:28 +00:00
|
|
|
)
|
2014-04-02 23:29:04 +00:00
|
|
|
);
|
|
|
|
ve.ui.commandRegistry.register(
|
2014-11-04 22:10:28 +00:00
|
|
|
new ve.ui.Command(
|
|
|
|
'heading2', 'format', 'convert',
|
2015-07-22 22:13:09 +00:00
|
|
|
{ args: [ 'mwHeading', { level: 2 } ], supportedSelections: [ 'linear' ] }
|
2014-11-04 22:10:28 +00:00
|
|
|
)
|
2014-04-02 23:29:04 +00:00
|
|
|
);
|
|
|
|
ve.ui.commandRegistry.register(
|
2014-11-04 22:10:28 +00:00
|
|
|
new ve.ui.Command(
|
|
|
|
'heading3', 'format', 'convert',
|
2015-07-22 22:13:09 +00:00
|
|
|
{ args: [ 'mwHeading', { level: 3 } ], supportedSelections: [ 'linear' ] }
|
2014-11-04 22:10:28 +00:00
|
|
|
)
|
2014-04-02 23:29:04 +00:00
|
|
|
);
|
|
|
|
ve.ui.commandRegistry.register(
|
2014-11-04 22:10:28 +00:00
|
|
|
new ve.ui.Command(
|
|
|
|
'heading4', 'format', 'convert',
|
2015-07-22 22:13:09 +00:00
|
|
|
{ args: [ 'mwHeading', { level: 4 } ], supportedSelections: [ 'linear' ] }
|
2014-11-04 22:10:28 +00:00
|
|
|
)
|
2014-04-02 23:29:04 +00:00
|
|
|
);
|
|
|
|
ve.ui.commandRegistry.register(
|
2014-11-04 22:10:28 +00:00
|
|
|
new ve.ui.Command(
|
|
|
|
'heading5', 'format', 'convert',
|
2015-07-22 22:13:09 +00:00
|
|
|
{ args: [ 'mwHeading', { level: 5 } ], supportedSelections: [ 'linear' ] }
|
2014-11-04 22:10:28 +00:00
|
|
|
)
|
2014-04-02 23:29:04 +00:00
|
|
|
);
|
|
|
|
ve.ui.commandRegistry.register(
|
2014-11-04 22:10:28 +00:00
|
|
|
new ve.ui.Command(
|
|
|
|
'heading6', 'format', 'convert',
|
2015-07-22 22:13:09 +00:00
|
|
|
{ args: [ 'mwHeading', { level: 6 } ], supportedSelections: [ 'linear' ] }
|
2014-11-04 22:10:28 +00:00
|
|
|
)
|
2014-04-02 23:29:04 +00:00
|
|
|
);
|
|
|
|
ve.ui.commandRegistry.register(
|
2014-11-04 22:10:28 +00:00
|
|
|
new ve.ui.Command(
|
|
|
|
'preformatted', 'format', 'convert',
|
2015-07-22 22:13:09 +00:00
|
|
|
{ args: [ 'mwPreformatted' ], supportedSelections: [ 'linear' ] }
|
2014-11-04 22:10:28 +00:00
|
|
|
)
|
2014-04-02 23:29:04 +00:00
|
|
|
);
|
2014-10-27 14:26:47 +00:00
|
|
|
ve.ui.commandRegistry.register(
|
2014-11-04 22:10:28 +00:00
|
|
|
new ve.ui.Command( 'insertTable', 'table', 'create',
|
|
|
|
{
|
|
|
|
args: [ {
|
|
|
|
header: true,
|
|
|
|
rows: 3,
|
|
|
|
cols: 4,
|
|
|
|
type: 'mwTable',
|
|
|
|
attributes: { wikitable: true }
|
|
|
|
} ],
|
2015-07-22 22:13:09 +00:00
|
|
|
supportedSelections: [ 'linear' ]
|
2014-11-04 22:10:28 +00:00
|
|
|
}
|
|
|
|
)
|
2014-10-27 14:26:47 +00:00
|
|
|
);
|