MCPcopy Create free account
hub / github.com/hoothin/UserScripts / updateViewmoreSizeLabel

Function updateViewmoreSizeLabel

Picviewer CE+/Picviewer CE+.user.js:12213–12223  ·  view source on GitHub ↗
(labelNode, baseText, url, strategy, baseTextGetter)

Source from the content-addressed store, hash-verified

12211 }
12212
12213 function updateViewmoreSizeLabel(labelNode, baseText, url, strategy, baseTextGetter) {
12214 if (!labelNode || !url) return;
12215 const initText = typeof baseTextGetter === "function" ? baseTextGetter() : baseText;
12216 labelNode.textContent = initText;
12217 imageSizeFetcher.getSize(url, { strategy: strategy || 'local-only' }).then(size => {
12218 if (size === null) return;
12219 const sizeText = formatBytes(size);
12220 const currentBase = typeof baseTextGetter === "function" ? baseTextGetter() : baseText;
12221 labelNode.textContent = currentBase + " | " + sizeText;
12222 });
12223 }
12224
12225 var viewmoreAutoSizeThrottle = { last: 0 };
12226 function scheduleViewmoreAutoSize(labelNode, baseText, url, baseTextGetter) {

Callers 2

scheduleViewmoreAutoSizeFunction · 0.70
initFunction · 0.70

Calls 3

baseTextGetterFunction · 0.70
formatBytesFunction · 0.70
getSizeMethod · 0.45

Tested by

no test coverage detected