function buildVariablesSubmenu() {
subMenuOptionsTitleH3.innerText = `Variáveis`;
let body = ``;
body += `
`;
body += ``;
body += `
`;
body += ` `;
body += `
`;
body += `
`;
body += `
`;
let allWorkspaceComponents = $(
`input[type="hidden"][name="${WORKSPACE_COMPONENTS_NAME}"]`
);
// Place after manipulation
body += ``;
body += `
Disponíveis
`;
body += ``;
for (let i = 0; i < variables.length; i++) {
body += ``;
body += ``;
body += `
`;
body += ` `;
body += `
`;
body += `
`;
body += ` `;
body += `
`;
body += `
`;
}
body += `
`;
// Value attribution manipulation
body += ``;
body += `
Atribuir
`;
body += ``;
body += ``;
body += ` `;
body += `
`;
body += `
`;
body += ` `;
body += `
`;
body += `
`;
body += `
`;
subMenuOptionsBody.innerHTML = body;
subMenuOptions.style.display = 'inline';
}
function positionVariableAfter(variableIndex) {
let placeAfter = $(`#placeVariableAfter${variableIndex} :selected`).val();
if (placeAfter !== "") {
addVariableToMain({
id: universalId.next(),
variable: variables[variableIndex],
afterComponentWithId: placeAfter,
});
} else {
addVariableToMain({
id: universalId.next(),
variable: variables[variableIndex],
});
}
subMenuOptions.style.display = "none";
}
function attributeVariable() {
let variableToBeAttributed = document.getElementById("variableToBeAttributed");
attributeValueToMain({
id: universalId.next(),
variable: variables[variableToBeAttributed.value],
});
hideSubMenu();
}