Files
linuxcncWebWASM/web/app/source-assets.mjs

21 lines
630 B
JavaScript

import { WEB_SETTINGS, axisImagePath } from "../workspace/web-settings.mjs";
export const AXIS_ASSET_ROOT = `./${WEB_SETTINGS.assets.axis_images}`;
export function axisAsset(name) {
return axisImagePath(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;
}