PageSourceSearch

https://www.quint-j.co.jp/assets/controllers/envelope_pdf_bulk_exp…1002e66d4d4ffc5d464919929c7b5c3c56481bc8.js

js quint-j.co.jp collected 2026-10-02 02:54:02 UTC 1,443 bytes, 49 lines download raw bytes

1import { Controller } from "@hotwired/stimulus"
2
3export default class extends Controller {
4  static values = { url: String }
5
6  export(event) {
7    event.preventDefault()
8    
9    // Show confirmation dialog
10    if (!confirm('宛名PDF一括エクスポートを開始しますか?処理には時間がかかる場合があります。')) {
11      return
12    }
13
14    // Find the search form
15    const searchForm = document.querySelector('form[data-controller="auto-submit"]')
16    if (!searchForm) {
17      console.error('Search form not found')
18      return
19    }
20
21    // Create FormData from the search form
22    const formData = new FormData(searchForm)
23    
24    // Remove the commit button value if it exists (from search form submit)
25    formData.delete('commit')
26    
27    // Send POST request with search parameters
28    fetch(this.urlValue, {
29      method: 'POST',
30      body: formData,
31      headers: {
32        'X-CSRF-Token': document.querySelector('meta[name="csrf-token"]').getAttribute('content'),
33        'Accept': 'text/html'
34      }
35    })
36    .then(response => {
37      if (response.ok) {
38        // Redirect to progress page or handle success
39        window.location.href = response.url
40      } else {
41        throw new Error(`HTTP error! status: ${response.status}`)
42      }
43    })
44    .catch(error => {
45      console.error('Export failed:', error)
46      alert('エクスポートの開始に失敗しました。')
47    })
48  }
49};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.