mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
- Insert suggested text for Hosting and network (HTTPS, sign-in mode, password/lockout rules, Docker) and Additional procedures (common Part 91 procedures; electronic-records date filled in), with [bracketed] blanks for what only the owner knows - A revision can't be adopted while a [blank] is left (Markdown links ok) - Generated sections state HTTPS and the sign-in mode from the config Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
18 lines
530 B
JavaScript
18 lines
530 B
JavaScript
import { Controller } from "@hotwired/stimulus"
|
|
|
|
// Fills a textarea with suggested text (asks before replacing what's there).
|
|
export default class extends Controller {
|
|
static targets = ["field"]
|
|
static values = { text: String }
|
|
|
|
insert(event) {
|
|
event.preventDefault()
|
|
const field = this.fieldTarget
|
|
if (field.value.trim() && !confirm("Replace what's in the box with the suggested text?")) return
|
|
field.value = this.textValue
|
|
field.focus()
|
|
field.setSelectionRange(0, 0)
|
|
field.scrollTop = 0
|
|
}
|
|
}
|