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

43b08cdd64913afbb333c3e1a8ec81ccf238c6b3

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +18 -13Ignore whitespace
public/scripts/slash-commands.js+18 -13
@@ -1271,29 +1271,29 @@ export function initDefaultSlashCommands() {
1271 name: 'large',1271 name: 'large',
1272 description: 'show large popup',1272 description: 'show large popup',
1273 typeList: [ARGUMENT_TYPE.BOOLEAN],1273 typeList: [ARGUMENT_TYPE.BOOLEAN],
1274 enumList: commonEnumProviders.boolean('onOff')(),1274 enumList: commonEnumProviders.boolean('trueFalse')(),
1275 defaultValue: 'off',1275 defaultValue: 'false',
1276 }),1276 }),
1277 SlashCommandNamedArgument.fromProps({1277 SlashCommandNamedArgument.fromProps({
1278 name: 'wide',1278 name: 'wide',
1279 description: 'show wide popup',1279 description: 'show wide popup',
1280 typeList: [ARGUMENT_TYPE.BOOLEAN],1280 typeList: [ARGUMENT_TYPE.BOOLEAN],
1281 enumList: commonEnumProviders.boolean('onOff')(),1281 enumList: commonEnumProviders.boolean('trueFalse')(),
1282 defaultValue: 'off',1282 defaultValue: 'false',
1283 }),1283 }),
1284 SlashCommandNamedArgument.fromProps({1284 SlashCommandNamedArgument.fromProps({
1285 name: 'wider',1285 name: 'wider',
1286 description: 'show wider popup',1286 description: 'show wider popup',
1287 typeList: [ARGUMENT_TYPE.BOOLEAN],1287 typeList: [ARGUMENT_TYPE.BOOLEAN],
1288 enumList: commonEnumProviders.boolean('onOff')(),1288 enumList: commonEnumProviders.boolean('trueFalse')(),
1289 defaultValue: 'off',1289 defaultValue: 'false',
1290 }),1290 }),
1291 SlashCommandNamedArgument.fromProps({1291 SlashCommandNamedArgument.fromProps({
1292 name: 'transparent',1292 name: 'transparent',
1293 description: 'show transparent popup',1293 description: 'show transparent popup',
1294 typeList: [ARGUMENT_TYPE.BOOLEAN],1294 typeList: [ARGUMENT_TYPE.BOOLEAN],
1295 enumList: commonEnumProviders.boolean('onOff')(),1295 enumList: commonEnumProviders.boolean('trueFalse')(),
1296 defaultValue: 'off',1296 defaultValue: 'false',
1297 }),1297 }),
1298 SlashCommandNamedArgument.fromProps({1298 SlashCommandNamedArgument.fromProps({
1299 name: 'okButton',1299 name: 'okButton',
@@ -1310,14 +1310,16 @@ export function initDefaultSlashCommands() {
1310 name: 'result',1310 name: 'result',
1311 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.',1311 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.',
1312 typeList: [ARGUMENT_TYPE.BOOLEAN],1312 typeList: [ARGUMENT_TYPE.BOOLEAN],
1313 enumList: commonEnumProviders.boolean('onOff')(),1313 enumList: commonEnumProviders.boolean('trueFalse')(),
1314 defaultValue: 'off',1314 defaultValue: 'false',
1315 }),1315 }),
1316 ],1316 ],
1317 unnamedArgumentList: [1317 unnamedArgumentList: [
1318 new SlashCommandArgument(1318 SlashCommandArgument.fromProps({
1319 'text', [ARGUMENT_TYPE.STRING], true,1319 description: 'popup text',
1320 ),1320 typeList: [ARGUMENT_TYPE.STRING],
1321 isRequired: true,
1322 }),
1321 ],1323 ],
1322 helpString: `1324 helpString: `
1323 <div>1325 <div>
@@ -1330,6 +1332,9 @@ export function initDefaultSlashCommands() {
1330 <li>1332 <li>
1331 <pre><code>/popup large=on wide=on okButton="Confirm" Please confirm this action.</code></pre>1333 <pre><code>/popup large=on wide=on okButton="Confirm" Please confirm this action.</code></pre>
1332 </li>1334 </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>
1333 </ul>1338 </ul>
1334 </div>1339 </div>
1335 `,1340 `,