PageSourceSearch

https://quantumconsortium.org/wp-content/plugins/qedc-settings/assets/js/forms/QedcForm.js?ver=1.0.3

js quantumconsortium.org collected 2026-10-01 10:30:51 UTC 1,471 bytes, 55 lines download raw bytes

1class QedcForm {
2    constructor(form, fields, submitBtn) {
3        this.form = form;
4        this.fields = fields;
5        this.submitBtn = submitBtn;
6
7        this.submitBtn.addEventListener('click', (e) => {
8            this.validate(true);
9        });
10
11        this.form.addEventListener('submit', (e) => {
12            let isValid = this.validate(true);
13
14            // Prevent other submit listeners from executing
15            if (!isValid) {
16                e.stopImmediatePropagation();
17            }
18
19            return isValid;
20        });
21    }
22
23    validate(report=true) {
24        let isValid = true;
25        for (const field of this.fields) {
26            if (!field.validate(report)) {
27                isValid = false;
28                // Don't break here; need to validate all fields
29            }
30        }
31        return isValid;
32    }
33}
34
35class QedcSteppedForm extends QedcForm {
36    constructor(form, fields, submitBtn, steps) {
37        super(form, fields, submitBtn);
38        this.steps = steps;
39
40        this.form.addEventListener(this.steps.validateEventName, (e) => {
41            this.validate(true);
42        });
43
44        this.form.addEventListener(this.steps.updateEventName, (e) => {
45            this.updateSubmitBtn();
46        });
47
48        this.updateSubmitBtn();
49    }
50
51    updateSubmitBtn() {
52        // Disable for all steps except last step
53        this.submitBtn.disabled = (this.steps.currentStepIndex !== this.steps.stepEls.length-1);
54    }
55}

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.