MediaWiki
Gadget-ve-linebreak.js
From Dogcraft Wiki
(Created page with "mw.libs.ve.addPlugin( function ( target ) { ve.ui.commandRegistry.register( new ve.ui.Command( // Command name 'myBreak', // Type and name of the action to execute...") |
No edit summary |
||
Line 1: | Line 1: | ||
ve.ui.commandRegistry.register( | ve.ui.commandRegistry.register( | ||
new ve.ui.Command( | new ve.ui.Command( | ||
Line 31: | Line 30: | ||
} | } | ||
); | ); | ||
Revision as of 14:44, 4 November 2022
ve.ui.commandRegistry.register(
new ve.ui.Command(
// Command name
'myBreak',
// Type and name of the action to execute
'content', 'insert', // Calls the ve.ui.ContentAction#insert method
{
// Extra arguments for the action
args: [
// Content to insert
[
{ type: 'break' },
{ type: '/break' }
],
// Annotate content to match surrounding annotations?
true,
// Move cursor to after the new content? (otherwise - select it)
true
],
supportedSelections: [ 'linear' ]
}
)
);
ve.ui.triggerRegistry.register(
'myBreak', // Command name
{
mac: new ve.ui.Trigger( 'cmd+shift+y' ),
pc: new ve.ui.Trigger( 'ctrl+shift+y' )
}
);
This page was last modified on 4 November 2022, at 14:44. (18 months ago)