Page MenuHomeWickedGov Phorge

dt.ui.MWSignatureContextItem.js
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

dt.ui.MWSignatureContextItem.js

function DtUiMWSignatureContextItem() {
// Parent constructor
DtUiMWSignatureContextItem.super.apply( this, arguments );
}
OO.inheritClass( DtUiMWSignatureContextItem, ve.ui.MWSignatureContextItem );
DtUiMWSignatureContextItem.static.name = 'dtMwSignature';
DtUiMWSignatureContextItem.static.modelClasses = [ require( './dt.dm.MWSignatureNode.js' ) ];
DtUiMWSignatureContextItem.static.label =
OO.ui.deferMsg( 'discussiontools-replywidget-signature-title' );
// Get the formatted, localized, platform-specific shortcut key for the given command
DtUiMWSignatureContextItem.prototype.getShortcutKey = function ( commandName ) {
// Adapted from ve.ui.CommandHelpDialog.prototype.initialize
const commandInfo = ve.ui.commandHelpRegistry.lookup( commandName );
const triggerList = ve.ui.triggerRegistry.lookup( commandInfo.trigger );
const $shortcut = $( '<kbd>' ).addClass( 've-ui-commandHelpDialog-shortcut' ).append(
triggerList[ 0 ].getMessage( true ).map( ve.ui.CommandHelpDialog.static.buildKeyNode )
).find( 'kbd + kbd' ).before( '+' ).end();
return $shortcut;
};
// Add a description saying that typing a signature is not needed here
DtUiMWSignatureContextItem.prototype.renderBody = function () {
this.$body.empty().append( mw.message(
'discussiontools-replywidget-signature-body',
$( '<code>' ).text( '~~~~' ),
this.getShortcutKey( 'undo' )
).parseDom() );
};
ve.ui.contextItemFactory.register( DtUiMWSignatureContextItem );
module.exports = DtUiMWSignatureContextItem;

File Metadata

Mime Type
text/plain
Expires
Aug 16 2026, 13:51 (11 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d7/7a/680fa26ec70a7c8b82e926dc9555
Default Alt Text
dt.ui.MWSignatureContextItem.js (1 KB)

Event Timeline