(formname)
| 24 | } |
| 25 | |
| 26 | getOptInCheckbox (formname) { |
| 27 | const container = document.createElement('span') |
| 28 | |
| 29 | const label = this.getHiddenLabel(formname + ' opt-in') |
| 30 | label.setAttribute('for', formname + '-opt-in') |
| 31 | label.textContent = formname + '-opt-in' |
| 32 | |
| 33 | const checkbox = document.createElement('input') |
| 34 | checkbox.setAttribute('type', 'checkbox') |
| 35 | checkbox.setAttribute('style', 'margin: 0 10px 0 0;') |
| 36 | checkbox.setAttribute('id', formname + '-opt-in') |
| 37 | checkbox.classList.add('json-editor-opt-in') |
| 38 | |
| 39 | container.appendChild(checkbox) |
| 40 | container.appendChild(label) |
| 41 | |
| 42 | return { label, checkbox, container } |
| 43 | } |
| 44 | |
| 45 | getOptInSwitch (formname) { |
| 46 | return this.getOptInCheckbox() |
no test coverage detected