36 lines
1.0 KiB
Python
36 lines
1.0 KiB
Python
from browser import document
|
|
|
|
|
|
def generic_list_getter():
|
|
result = []
|
|
for input_el in document.getElementsByClassName("list-adder-input"):
|
|
result_candidate = input_el.value
|
|
if result_candidate != "":
|
|
result.append(result_candidate)
|
|
return result
|
|
|
|
def label_list_getter():
|
|
result = []
|
|
for row in document.getElementsByClassName("label-list-row"):
|
|
ltype = row.querySelector(".label-type")
|
|
lvalue = row.querySelector(".label-value")
|
|
lother = row.querySelector(".label-value-other")
|
|
|
|
if lother is None:
|
|
continue
|
|
|
|
value = lother.value
|
|
if not value:
|
|
value = lvalue.options[lvalue.selectedIndex].text
|
|
|
|
if not value:
|
|
continue
|
|
|
|
result.append((ltype.textContent, value))
|
|
|
|
kontrastivno = document.getElementById("kontrastivno-input").checked;
|
|
if kontrastivno:
|
|
result.append(("razmerje", "kontrastivno"))
|
|
|
|
return result
|