MediaWiki

Gadget-ve-linebreak.js

From Dogcraft Wiki

Revision as of 15:03, 4 November 2022 by Domino (talk | contribs)

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (โŒ˜-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (โŒ˜-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
	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+enter' ),
			pc: new ve.ui.Trigger( 'ctrl+shift+enter' )
		}
	);
This page was last modified on 4 November 2022, at 15:03. (18 months ago)