adding property for the new javascript

This commit is contained in:
Fernando Ontiveros
2025-09-24 16:58:21 -04:00
parent 06497d362e
commit 18e560a1ed

View File

@@ -90961,6 +90961,7 @@ FormDesigner.leftPad = function (string, length, fill) {
this.alt = {label: "title (mouseover)".translate(), value: "", type: "text"};
this.multiple = {label: "multiple".translate(), value: false, type: "hidden"};
this.script = {label: "javascript".translate(), value: "", type: "button", labelButton: "edit...".translate()};
this.newScript = {label: "new javascript".translate(), value: "", type: "button", labelButton: "edit...".translate()};
this.layout = {
label: "layout".translate(), value: "responsive", type: "select", items: [
{value: "responsive", label: "responsive".translate()},
@@ -91196,7 +91197,7 @@ FormDesigner.leftPad = function (string, length, fill) {
this.dataType.type = "hidden";
}
if (type === FormDesigner.main.TypesControl.form) {
this.pf = ["type", "variable", "var_uid", "dataType", "id", "name", "description", "mode", "script",
this.pf = ["type", "variable", "var_uid", "dataType", "id", "name", "description", "mode", "script", "newScript",
"language", "externalLibs", "printable"];
this.id.type = "label";
this.id.required = false;
@@ -93064,6 +93065,18 @@ FormDesigner.leftPad = function (string, length, fill) {
a.editor.setValue(that.properties.get()[property].value.code);
}
}
if (property === "newScript") {
a = new FormDesigner.main.DialogScript();
a.onSave = function () {
that.properties.set(property, {
type: "js",
code: a.editor.getValue()
});
};
if (typeof that.properties.get()[property].value === "object") {
a.editor.setValue(that.properties.get()[property].value.code);
}
}
if (property === "variable") {
a = new FormDesigner.main.DialogCreateVariable(null, FormDesigner.main.TypesControl.form, [], that.properties.get()[property].value);
a.onSave = function (variable) {
@@ -93536,6 +93549,7 @@ FormDesigner.leftPad = function (string, length, fill) {
that.properties.set("description", dynaform.dyn_description);
that.properties.set("mode", "edit");
that.properties.set("script", "");
that.properties.set("newScript", "");
that.properties.set("language", "en");
that.properties.set("externalLibs", "");
that.properties.set("gridStore", false);
@@ -93552,6 +93566,7 @@ FormDesigner.leftPad = function (string, length, fill) {
that.properties.set("description", dynaform.dyn_description);
that.properties.set("mode", form.mode);
that.properties.set("script", form.script);
that.properties.set("newScript", form.newScript);
that.properties.set("language", form.language);
that.properties.set("externalLibs", form.externalLibs);
that.properties.set("gridStore", form.gridStore ? form.gridStore : false);//compatibility with older forms