Add cssClass arg to /echo

c9ed91099f218c0973b08de58f71917162808fb2

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +10 -1Ignore whitespace
public/scripts/slash-commands.js+10 -1
@@ -772,6 +772,11 @@ export function initDefaultSlashCommands() {
772772 ],
773773 }),
774774 SlashCommandNamedArgument.fromProps({
775+ name: 'cssClass',
776+ description: 'additional css class to add to the toast message (e.g. for custom styling)',
777+ typeList: [ARGUMENT_TYPE.STRING],
778+ }),
779+ SlashCommandNamedArgument.fromProps({
775780 name: 'timeout',
776781 description: 'time in milliseconds to display the toast message. Set this and \'extendedTimeout\' to 0 to show indefinitely until dismissed.',
777782 typeList: [ARGUMENT_TYPE.NUMBER],
@@ -2181,7 +2186,7 @@ async function generateCallback(args, value) {
21812186
21822187/**
21832188 *
21842189 * @param {{title?: string, severity?: string, cssClass?: string, timeout?: string, extendedTimeout?: string, preventDuplicates?: string, awaitDismissal?: string}} args - named arguments from the slash command
21852190 * @param {string} value - The string to echo (unnamed argument from the slash command)
21862191 * @returns {Promise<string>} The text that was echoed
21872192 */
@@ -2217,6 +2222,10 @@ async function echoCallback(args, value) {
22172222 options.onHidden = () => resolveToastDismissal(value);
22182223 }
22192224
2225+ if (args.cssClass) {
2226+ options.toastClass = args.cssClass;
2227+ }
2228+
22202229 switch (severity) {
22212230 case 'error':
22222231 toastr.error(value, title, options);