MCPcopy
hub / github.com/ollm/OpenComic / fastUpdateEbookPages

Function fastUpdateEbookPages

scripts/reading.js:4466–4499  ·  view source on GitHub ↗
(readingEbook = false, resize = false)

Source from the content-addressed store, hash-verified

4464}
4465
4466async function fastUpdateEbookPages(readingEbook = false, resize = false)
4467{
4468 if(!readingIsEbook) return;
4469
4470 let ebookConfig = await getEbookConfig(readingEbook);
4471
4472 for(let index in imagesData)
4473 {
4474 imagesData[index].width = ebookConfig.width;
4475 imagesData[index].height = ebookConfig.height;
4476 imagesData[index].aspectRatio = ebookConfig.width / ebookConfig.height;
4477 }
4478
4479 if(resize)
4480 {
4481 disposeImages();
4482 calculateView();
4483 stayInLine();
4484 }
4485
4486 if(_ebook)
4487 {
4488 _ebook.updateConfig(ebookConfig);
4489 render.setEbookConfigChanged(ebookConfig);
4490
4491 let iframes = template._contentRight().querySelectorAll('oc-img iframe');
4492
4493 for(let i = 0, len = iframes.length; i < len; i++)
4494 {
4495 let iframe = iframes[i];
4496 await _ebook.applyConfigToHtml(iframe.contentDocument);
4497 }
4498 }
4499}
4500
4501var hasGenerateEbookPages = false;
4502

Callers 1

resizedFunction · 0.85

Calls 4

getEbookConfigFunction · 0.85
disposeImagesFunction · 0.85
calculateViewFunction · 0.85
stayInLineFunction · 0.85

Tested by

no test coverage detected