wip: pass form data between web and desktop
This commit is contained in:
1 parent
63b06b7977
commit
f66d17ca84
6 files changed
+68
-8
No files matched your search
@@ -231,6 +231,23 @@ export class Interpreter {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (target.tagName == "FORM") {
|
||||
let formTarget = target;
|
||||
for (let x = 0; x < formTarget.elements.length; x++) {
|
||||
let element = formTarget.elements[x];
|
||||
let name = element.getAttribute("name");
|
||||
if (name != null) {
|
||||
if (element.getAttribute("type") == "checkbox") {
|
||||
// @ts-ignore
|
||||
contents.values[name] = element.checked ? "true" : "false";
|
||||
}
|
||||
else {
|
||||
// @ts-ignore
|
||||
contents.values[name] = element.value ?? element.textContent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (realId == null) {
|
||||
return;
|
||||
}
|
||||
@@ -316,6 +333,7 @@ function serialize_event(event) {
|
||||
}
|
||||
return {
|
||||
value: value,
|
||||
values: {}
|
||||
};
|
||||
}
|
||||
case "click":
|
||||
|
||||
Reference in new issue
Block a user