Refactor /popup to actual booleans - still supports on/off, no worries.

43b08cdd64913afbb333c3e1a8ec81ccf238c6b3

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +18 -13Showing whitespace changes
public/scripts/slash-commands.js+18 -13
@@ -1271,29 +1271,29 @@ export function initDefaultSlashCommands() {
12711271 name: 'large',
12721272 description: 'show large popup',
12731273 typeList: [ARGUMENT_TYPE.BOOLEAN],
12741274 enumList: commonEnumProviders.boolean('onOfftrueFalse')(),
12751275 defaultValue: 'offfalse',
12761276 }),
12771277 SlashCommandNamedArgument.fromProps({
12781278 name: 'wide',
12791279 description: 'show wide popup',
12801280 typeList: [ARGUMENT_TYPE.BOOLEAN],
12811281 enumList: commonEnumProviders.boolean('onOfftrueFalse')(),
12821282 defaultValue: 'offfalse',
12831283 }),
12841284 SlashCommandNamedArgument.fromProps({
12851285 name: 'wider',
12861286 description: 'show wider popup',
12871287 typeList: [ARGUMENT_TYPE.BOOLEAN],
12881288 enumList: commonEnumProviders.boolean('onOfftrueFalse')(),
12891289 defaultValue: 'offfalse',
12901290 }),
12911291 SlashCommandNamedArgument.fromProps({
12921292 name: 'transparent',
12931293 description: 'show transparent popup',
12941294 typeList: [ARGUMENT_TYPE.BOOLEAN],
12951295 enumList: commonEnumProviders.boolean('onOfftrueFalse')(),
12961296 defaultValue: 'offfalse',
12971297 }),
12981298 SlashCommandNamedArgument.fromProps({
12991299 name: 'okButton',
@@ -1310,14 +1310,16 @@ export function initDefaultSlashCommands() {
13101310 name: 'result',
13111311 description: 'if enabled, returns the popup result (as an integer) instead of the popup text. Resolves to 1 for OK and 0/null for cancel or exiting out.',
13121312 typeList: [ARGUMENT_TYPE.BOOLEAN],
13131313 enumList: commonEnumProviders.boolean('onOfftrueFalse')(),
13141314 defaultValue: 'offfalse',
13151315 }),
13161316 ],
13171317 unnamedArgumentList: [
13181318 new SlashCommandArgument.fromProps({
1319- 'text', [ARGUMENT_TYPE.STRING], true,
1319+ description: 'popup text',
1320- ),
1320+ typeList: [ARGUMENT_TYPE.STRING],
1321+ isRequired: true,
1322+ }),
13211323 ],
13221324 helpString: `
13231325 <div>
@@ -1330,6 +1332,9 @@ export function initDefaultSlashCommands() {
13301332 <li>
13311333 <pre><code>/popup large=on wide=on okButton="Confirm" Please confirm this action.</code></pre>
13321334 </li>
1335+ <li>
1336+ <pre><code>/popup okButton="Left" cancelButton="Right" result=true Do you want to go left or right? | /echo 0 means right, 1 means left. Choice: {{pipe}}</code></pre>
1337+ </li>
13331338 </ul>
13341339 </div>
13351340 `,