20 lines
553 B
JavaScript
20 lines
553 B
JavaScript
export const AXIS_ASSET_ROOT = "/linuxcnc/share/axis/images";
|
|
|
|
export function axisAsset(name) {
|
|
return `${AXIS_ASSET_ROOT}/${name}`;
|
|
}
|
|
|
|
export function appendAxisIcon(document, button, asset, label) {
|
|
const icon = document.createElement("img");
|
|
icon.className = "axis-icon";
|
|
icon.src = axisAsset(asset);
|
|
icon.alt = "";
|
|
icon.setAttribute("aria-hidden", "true");
|
|
icon.title = label;
|
|
const text = document.createElement("span");
|
|
text.className = "button-copy";
|
|
text.textContent = label;
|
|
button.append(icon, text);
|
|
return button;
|
|
}
|