Skip to content
Snippets Groups Projects

MAINT: refactor set_location

Merged Henrik tom Wörden requested to merge f-location into main
All threads resolved!
Files
16
@@ -29,7 +29,18 @@ function get_formatted_date(split) {
return ((new Date(Date.now() - tzoffset)).toISOString()).split(split)[0];
}
/**
* This function retrieves an html form from the html subdirectory.
*
*/
var getHTMLForm = async function(pageName, variables) {
var site = await connection.get("webinterface/html/forms/" + pageName + ".html", "html");
var htmltext = site.getElementById("caosdb-form").innerHTML;
var req = /\{([0-9a-z-A-Z_]+)\}/g;
return htmltext.replace(req, (match, p1) => {
return variables[p1] || "";
});
}
/**
* AWI Box Loan, refactored code.
Loading