- Add `applyMegabytesOrBytesEnv` to accept size settings in either bytes or MB - Prefer `*_BYTES` when set, otherwise convert `*_MB` to bytes with overflow guard - Add coverage for MB-based environment overrides - Introduce `static/js/upload-popups.js` to lazy-load and cache popup templatesfeat(config): support *_MB env vars for upload size limits - Add `applyMegabytesOrBytesEnv` to accept size settings in either bytes or MB - Prefer `*_BYTES` when set, otherwise convert `*_MB` to bytes with overflow guard - Add coverage for MB-based environment overrides - Introduce `static/js/upload-popups.js` to lazy-load and cache popup templates
10 lines
314 B
JavaScript
10 lines
314 B
JavaScript
window.WBUtils = (() => {
|
|
function renderTemplate(template, data = {}) {
|
|
return String(template).replace(/\{\{\s*([a-zA-Z0-9_]+)\s*\}\}/g, (_, key) => {
|
|
return Object.prototype.hasOwnProperty.call(data, key) ? String(data[key]) : "";
|
|
});
|
|
}
|
|
|
|
return { renderTemplate };
|
|
})();
|