(animation = true, path = true, mainPath = true, end = false, fromGoBack = false, fromNextAndPrev = false)
| 2669 | var readingActive = false, skipNextComic = false, skipPreviousComic = false; |
| 2670 | |
| 2671 | async 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 |
no test coverage detected