(tag: Tag)
| 471 | 10, |
| 472 | 15, |
| 473 | 30, |
| 474 | 60, |
| 475 | 120, |
| 476 | 300, |
| 477 | 600, |
| 478 | 900, |
| 479 | 1800, |
| 480 | 60 * 60, |
| 481 | 60 * 60 * 2, |
| 482 | 60 * 60 * 6, |
| 483 | ]; |
| 484 | form.addSelect( |
| 485 | I18n.channel.slowmode(), |
| 486 | "rate_limit_per_user", |
| 487 | ["0s", "5s", "10s", "15s", "30s", "1m", "2m", "5m", "10m", "15m", "30m", "1h", "2h", "6h"], |
| 488 | { |
| 489 | defaultIndex: (times.findIndex((_) => _ === this.rate_limit_per_user) + 1 || 1) - 1, |
| 490 | }, |
| 491 | times, |
| 492 | ); |
| 493 | const arcTimes = [60, 60 * 24, 60 * 24 * 3, 60 * 24 * 7]; |
| 494 | form.addSelect( |
| 495 | I18n.channel.hideThreads(), |
| 496 | "default_auto_archive_duration", |
| 497 | ["1h", "24h", "3d", "7d"], |
| 498 | { |
| 499 | defaultIndex: arcTimes.findIndex((_) => _ === (this.defaultAutoArchiveDuration ?? 1440)), |
| 500 | }, |
| 501 | arcTimes, |
| 502 | ); |
| 503 | if (this.isForum()) { |
| 504 | form.addText(I18n.forum.settings.editTags()); |
| 505 | const tags = document.createElement("div"); |
| 506 | tags.classList.add("forumTagSelect"); |
| 507 | const tagSet = new Set<string>(); |
| 508 | const makeTagHTML = (tag: Tag) => { |
| 509 | tagSet.add(tag.id); |
| 510 | let html = tag.makeHTML(); |
| 511 | html.onclick = () => { |
| 512 | const d = new Dialog(I18n.forum.settings.editTag()); |
| 513 | const f = d.options.addForm( |
| 514 | "", |
| 515 | (_, obj) => { |
| 516 | tag.update(obj as tagjson); |
| 517 | const newhtml = tag.makeHTML(); |
nothing calls this directly
no test coverage detected