(e, pname, ptype)
| 9033 | } |
| 9034 | return `${curl}${curlHeaders}${curlData}${curlForm}`; |
| 9035 | } |
| 9036 | onAddRemoveFileInput(e, pname, ptype) { |
| 9037 | if (e.target.tagName.toLowerCase() !== 'button') { |
| 9038 | return; |
| 9039 | } |
| 9040 | if (e.target.classList.contains('file-input-remove-btn')) { |
| 9041 | // Remove File Input Set |
| 9042 | const el = e.target.closest('.input-set'); |
| 9043 | el.remove(); |
| 9044 | return; |
| 9045 | } |
| 9046 | const el = e.target.closest('.file-input-container'); |
| 9047 | |
| 9048 | // Add File Input Set |
| 9049 | |
| 9050 | // Container |
| 9051 | const newInputContainerEl = document.createElement('div'); |
| 9052 | newInputContainerEl.setAttribute('class', 'input-set row'); |
| 9053 | |
| 9054 | // File Input |
| 9055 | const newInputEl = document.createElement('input'); |
| 9056 | newInputEl.type = 'file'; |
| 9057 | newInputEl.style = 'width:200px; margin-top:2px;'; |
| 9058 | newInputEl.setAttribute('data-pname', pname); |
| 9059 | newInputEl.setAttribute('data-ptype', ptype.includes('form-urlencode') ? 'form-urlencode' : 'form-data'); |
| 9060 | newInputEl.setAttribute('data-array', 'false'); |
| 9061 | newInputEl.setAttribute('data-file-array', 'true'); |
| 9062 | |
| 9063 | // Remover Button |
| 9064 | const newRemoveBtnEl = document.createElement('button'); |
| 9065 | newRemoveBtnEl.setAttribute('class', 'file-input-remove-btn'); |
| 9066 | newRemoveBtnEl.innerHTML = '✕'; |
| 9067 | newInputContainerEl.appendChild(newInputEl); |
| 9068 | newInputContainerEl.appendChild(newRemoveBtnEl); |
| 9069 | el.insertBefore(newInputContainerEl, e.target); |
| 9070 | // el.appendChild(newInputContainerEl); |
| 9071 | } |
| 9072 | clearResponseData() { |
| 9073 | this.responseUrl = ''; |
no test coverage detected