MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / setLabelTexts

Function setLabelTexts

deployments/desktop/static/desktop.js:1248–1261  ·  view source on GitHub ↗
(selector, values)

Source from the content-addressed store, hash-verified

1246 }
1247
1248 function setLabelTexts(selector, values) {
1249 document.querySelectorAll(selector).forEach((element, index) => {
1250 const value = values[index];
1251 if (value === undefined) return;
1252 const node = Array.from(element.childNodes).find((child) => child.nodeType === Node.TEXT_NODE && child.textContent.trim());
1253 if (!node) {
1254 element.appendChild(document.createTextNode(` ${value}`));
1255 return;
1256 }
1257 const prefix = node.previousSibling ? " " : "";
1258 const suffix = node.nextSibling ? " " : "";
1259 node.textContent = `${prefix}${value}${suffix}`;
1260 });
1261 }
1262
1263 function setAttr(selector, attr, value) {
1264 const element = document.querySelector(selector);

Callers 1

applyLocaleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected