(epgMapId: string, xmlTvFileSelect: HTMLSelectElement)
| 2370 | } |
| 2371 | |
| 2372 | function setXmltvChannel(epgMapId: string, xmlTvFileSelect: HTMLSelectElement) { |
| 2373 | |
| 2374 | const xmlTv = new XMLTVFile(); |
| 2375 | const newXmlTvFile = xmlTvFileSelect.value; |
| 2376 | |
| 2377 | // Remove old XMLTV ID selection box |
| 2378 | const xmlTvIdPickerParent = document.getElementById('xmltv-id-picker-container').parentElement as HTMLTableCellElement; |
| 2379 | xmlTvIdPickerParent.innerHTML = ''; |
| 2380 | |
| 2381 | // Create new XMLTV ID selection box |
| 2382 | const tvgId: string = SERVER['xepg']['epgMapping'][epgMapId]['tvg-id']; |
| 2383 | |
| 2384 | const [xmlTvIdContainer, xmlTvIdInput, xmlTvIdDatalist] = xmlTv.newXmlTvIdPicker(newXmlTvFile, tvgId); |
| 2385 | xmlTvIdContainer.setAttribute('id', 'xmltv-id-picker-container'); |
| 2386 | xmlTvIdInput.setAttribute('list', 'xmltv-id-picker-datalist'); |
| 2387 | xmlTvIdInput.setAttribute('name', 'x-mapping'); // Should stay x-mapping as it will be used in donePopupData to make a server request |
| 2388 | xmlTvIdInput.setAttribute('id', 'xmltv-id-picker-input'); |
| 2389 | xmlTvIdInput.setAttribute('onchange', `javascript: this.className = 'changed'; checkXmltvChannel('${epgMapId}', this.value, '${newXmlTvFile}');`); |
| 2390 | xmlTvIdInput.classList.add('changed'); |
| 2391 | xmlTvIdDatalist.setAttribute('id', 'xmltv-id-picker-datalist'); |
| 2392 | |
| 2393 | // Add new XMLTV ID selection box to it's parent |
| 2394 | xmlTvIdPickerParent.appendChild(xmlTvIdContainer); |
| 2395 | |
| 2396 | checkXmltvChannel(epgMapId, xmlTvIdInput.value, newXmlTvFile); |
| 2397 | } |
| 2398 | |
| 2399 | function checkPPV(title, element) { |
| 2400 | var value = (element as HTMLSelectElement).value |
nothing calls this directly
no test coverage detected