MediaWiki
Gadget-ve-linebreak.js
From Dogcraft Wiki
No edit summary |
No edit summary |
||
Line 26: | Line 26: | ||
'myBreak', // Command name | 'myBreak', // Command name | ||
{ | { | ||
mac: new ve.ui.Trigger( ' | mac: new ve.ui.Trigger( 'shift+enter' ), | ||
pc: new ve.ui.Trigger( ' | pc: new ve.ui.Trigger( 'shift+enter' ) | ||
} | } | ||
); | ); |
Revision as of 14:45, 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( 'shift+enter' ),
pc: new ve.ui.Trigger( 'shift+enter' )
}
);
This page was last modified on 4 November 2022, at 14:45. (18 months ago)