MCPcopy Index your code
hub / github.com/Threadfin/Threadfin / openPopUp

Function openPopUp

ts/menu_ts.ts:1340–2117  ·  view source on GitHub ↗
(dataType, element)

Source from the content-addressed store, hash-verified

1338}
1339
1340function openPopUp(dataType, element) {
1341
1342 var data: object = new Object();
1343 var id: any
1344 switch (element) {
1345 case undefined:
1346
1347 switch (dataType) {
1348 case "group-title":
1349 if (id == undefined) {
1350 id = -1
1351 }
1352 data = getLocalData("filter", id)
1353 data["type"] = "group-title"
1354 break;
1355
1356 case "custom-filter":
1357 if (id == undefined) {
1358 id = -1
1359 }
1360 data = getLocalData("filter", id)
1361 data["type"] = "custom-filter"
1362 break;
1363
1364 default:
1365 data["id.provider"] = "-"
1366 data["type"] = dataType
1367 id = "-"
1368 break;
1369 }
1370
1371 break
1372
1373 default:
1374 id = element.id
1375 data = getLocalData(dataType, id)
1376 break;
1377 }
1378
1379 var content: PopupContent = new PopupContent()
1380
1381 switch (dataType) {
1382 case "playlist":
1383 content.createHeadline("{{.playlist.playlistType.title}}")
1384 // Type
1385 var text: string[] = ["M3U", "HDHomeRun"]
1386 var values: string[] = ["javascript: openPopUp('m3u')", "javascript: openPopUp('hdhr')"]
1387 var select = content.createSelect(text, values, "", "type")
1388 select.setAttribute("id", "type")
1389 select.setAttribute("onchange", 'javascript: changeButtonAction(this, "next", "onclick")') // changeButtonAction
1390 content.appendRow("{{.playlist.type.title}}", select)
1391
1392 // Interaktion
1393 content.createInteraction()
1394 // Abbrechen
1395 var input = content.createInput("button", "cancel", "{{.button.cancel}}")
1396 input.setAttribute("onclick", 'javascript: showElement("popup", false);')
1397 content.addInteraction(input)

Callers

nothing calls this directly

Calls 15

createHeadlineMethod · 0.95
createSelectMethod · 0.95
appendRowMethod · 0.95
createInputMethod · 0.95
addInteractionMethod · 0.95
descriptionMethod · 0.95
createCheckboxMethod · 0.95
getFilesMethod · 0.95
newXmlTvIdPickerMethod · 0.95
newM3uPickerMethod · 0.95
createCellMethod · 0.95
getLocalDataFunction · 0.70

Tested by

no test coverage detected