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

Function openComic

scripts/dom.js:2671–2907  ·  view source on GitHub ↗
(animation = true, path = true, mainPath = true, end = false, fromGoBack = false, fromNextAndPrev = false)

Source from the content-addressed store, hash-verified

2669var readingActive = false, skipNextComic = false, skipPreviousComic = false;
2670
2671async function openComic(animation = true, path = true, mainPath = true, end = false, fromGoBack = false, fromNextAndPrev = false)
2672{
2673 settings.purgeTemporaryFilesEveryTimes(10);
2674 fileManager.revokeAllObjectURL();
2675 reading.render.revokeAllObjectURL();
2676 workers.clean('convertImage');
2677
2678 dom.setCurrentPageVars('reading');
2679
2680 // Start reading comic
2681 if(config.readingStartReadingInFullScreen && !fromNextAndPrev && !fromGoBack)
2682 {
2683 if(!isFullScreen)
2684 fullScreen(true);
2685 }
2686
2687 reading.setIsLoaded(false);
2688 onReading = _onReading = true;
2689
2690 currentPathScrollTop[currentPath === false ? 0 : currentPath] = template.contentRight().children().scrollTop();
2691 currentPath = path;
2692
2693 let now = Date.now();
2694
2695 let startImage = false;
2696 let imagePath = path;
2697 let indexStart = 1;
2698
2699 if(compatible.image(path))
2700 {
2701 startImage = path;
2702 path = p.dirname(path);
2703 }
2704
2705 // Show loadign page
2706 headerPath(path, mainPath, true);
2707
2708 // Load files
2709 let file = fileManager.file(path);
2710 let files = [];
2711
2712 try
2713 {
2714 files = await file.read({filtered: false, sort: {extraKey: 'Reading'}});
2715 }
2716 catch(error)
2717 {
2718 console.error(error);
2719 dom.compressedError(error);
2720
2721 return;
2722 }
2723
2724 let hasMusic = await reading.music.has(files, path);
2725 handlebarsContext.hasMusic = hasMusic;
2726
2727 files = fileManager.filtered(files);
2728

Callers 1

handleDropFunction · 0.70

Calls 9

fullScreenFunction · 0.85
headerPathFunction · 0.85
nextComicFunction · 0.85
previousComicFunction · 0.85
indexPathControlFunction · 0.85
floatingActionButtonFunction · 0.85
generateAppMenuFunction · 0.85
sha1Function · 0.85
registerMethod · 0.80

Tested by

no test coverage detected