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

Function loadIndexPage

scripts/dom.js:564–1100  ·  view source on GitHub ↗
(animation = true, path = false, content = false, keepScroll = false, mainPath = false, fromGoBack = false, notAutomaticBrowsing = false, fromSetOfflineMode = false, fromGoForwards = false)

Source from the content-addressed store, hash-verified

562var currentPath = false, currentPathScrollTop = [];
563
564async function loadIndexPage(animation = true, path = false, content = false, keepScroll = false, mainPath = false, fromGoBack = false, notAutomaticBrowsing = false, fromSetOfflineMode = false, fromGoForwards = false)
565{
566 onReading = _onReading = false;
567
568 fileManager.revokeAllObjectURL();
569 reading.render.revokeAllObjectURL();
570 workers.clean('convertImage');
571
572 scroll.reset();
573 reading.hideContent();
574 reading.music.pause();
575
576 setWindowTitle();
577
578 const isOpds = fileManager.isOpds(path);
579
580 currentPathScrollTop[currentPath === false ? 0 : currentPath] = isOpds ? template.contentRight().find('.opds-browse-content').scrollTop() : template.contentRight().children().scrollTop();
581
582 for(let _path in currentPathScrollTop)
583 {
584 if(_path != 0 && !new RegExp('^'+pregQuote(_path)).test(path))
585 delete currentPathScrollTop[_path];
586 }
587
588 if(currentPathScrollTop[path === false ? 0 : path])
589 keepScroll = currentPathScrollTop[path === false ? 0 : path];
590
591 const _indexLabel = prevIndexLabel = (indexLabel || {});
592 indexLabel = false;
593
594 currentPath = path;
595
596 handlebarsContext.serverLastError = false;
597
598 let contentRightIndex = template.contentRightIndex();
599
600 if(_indexLabel.opds || isOpds)
601 {
602 if(!template._contentLeft().querySelector('.menu-list'))
603 dom.loadIndexContentLeft(animation);
604
605 if(!path)
606 {
607 dom.fromLibrary(true);
608 dom.indexPathControl(false);
609
610 generateAppMenu();
611
612 dom.setCurrentPageVars('index', _indexLabel);
613 dom.floatingActionButton(false);
614
615 handlebarsContext.headerTitle = false;
616 handlebarsContext.headerTitlePath = false;
617
618 // OPDS
619 await opds.home();
620 }
621 else

Callers 2

reloadIndexFunction · 0.85
goStartPathFunction · 0.85

Calls 15

setWindowTitleFunction · 0.85
pregQuoteFunction · 0.85
generateAppMenuFunction · 0.85
indexPathControlFunction · 0.85
isEmptyFunction · 0.85
metadataPathNameFunction · 0.85
selectMenuItemFunction · 0.85
orderByFunction · 0.85
calculateVisibleItemsFunction · 0.85
getFolderThumbnailsFunction · 0.85
sha1Function · 0.85
floatingActionButtonFunction · 0.85

Tested by

no test coverage detected