@@ -4,9 +4,10 @@ const render = require(p.join(appDir, 'scripts/reading/render.js')),
44 contextMenu = require ( p . join ( appDir , 'scripts/reading/context-menu.js' ) ) ,
55 pageTransitions = require ( p . join ( appDir , 'scripts/reading/page-transitions.js' ) ) ,
66 readingEbook = require ( p . join ( appDir , 'scripts/reading/ebook.js' ) ) ,
7- sidebar = require ( p . join ( appDir , 'scripts/reading/sidebar.js' ) ) ;
7+ sidebar = require ( p . join ( appDir , 'scripts/reading/sidebar.js' ) ) ,
8+ discord = require ( p . join ( appDir , 'scripts/reading/discord.js' ) ) ;
89
9- var images = { } , imagesData = { } , imagesDataClip = { } , imagesPath = { } , imagesNum = 0 , contentNum = 0 , imagesNumLoad = 0 , currentIndex = 1 , imagesPosition = { } , imagesFullPosition = { } , prevImagesFullPosition = { } , foldersPosition = { } , indexNum = 0 , imagesDistribution = [ ] , currentPageXY = { x : 0 , y : 0 } , currentMousePosition = { pageX : 0 , pageY : 0 } ;
10+ var images = { } , imagesData = { } , imagesDataClip = { } , imagesPath = { } , imagesNum = 0 , contentNum = 0 , imagesNumLoad = 0 , currentIndex = 1 , imagesPosition = { } , imagesFullPosition = { } , prevImagesFullPosition = { } , foldersPosition = { } , indexNum = 0 , imagesDistribution = [ ] , currentPageXY = { x : 0 , y : 0 } , currentMousePosition = { pageX : 0 , pageY : 0 } , currentPage = 0 ;
1011
1112//Calculates whether to add a blank image (If the reading is in double page and do not apply to the horizontals)
1213function blankPage ( index )
@@ -1009,6 +1010,9 @@ function goToImageCL(index, animation = true, fromScroll = false, fromPageRange
10091010 {
10101011 let input = contentLeft . querySelector ( '.simple-slider input' ) ;
10111012 if ( input ) events . goRange ( input , index , false ) ;
1013+
1014+ currentPage = index ;
1015+ reading . discord . updateThrottle ( ) ;
10121016 }
10131017
10141018 const readingLeft = contentLeft . querySelector ( '.reading-left-images' ) ;
@@ -4600,6 +4604,7 @@ async function generateEbookPages(end = false, reset = false, fast = false, imag
46004604 handlebarsContext . ebookLandmarks = ebookPages . landmarks ;
46014605 handlebarsContext . ebookToc = ebookPages . toc ;
46024606 handlebarsContext . ebookPages = imagesNum ;
4607+
46034608 template . loadContentLeft ( 'reading.content.left.ebook.html' , true ) ;
46044609 template . _contentLeft ( ) . firstElementChild . style . height = 'calc(100% - 66px)' ;
46054610 events . eventRange ( ) ;
@@ -5737,7 +5742,7 @@ module.exports = {
57375742 read : read ,
57385743 reload : reload ,
57395744 images : function ( ) { return images } ,
5740- imagesNum : imagesNum ,
5745+ imagesNum : function ( ) { return imagesNum } ,
57415746 indexNum : function ( ) { return indexNum } ,
57425747 contentNum : function ( ) { return contentNum } ,
57435748 imagesNumLoad : imagesNumLoad ,
@@ -5800,6 +5805,8 @@ module.exports = {
58005805 currentImagePage : currentImagePage ,
58015806 currentImageIndex : currentImageIndex ,
58025807 currentPageVisibility : function ( ) { return currentPageVisibility } ,
5808+ totalPages : function ( ) { return imagesNum } ,
5809+ currentPage : function ( ) { return currentPage } ,
58035810 loadBookmarks : loadBookmarks ,
58045811 loadTrackigSites : loadTrackigSites ,
58055812 loadReadingPages : loadReadingPages ,
@@ -5851,4 +5858,5 @@ module.exports = {
58515858 pageTransitions : pageTransitions ,
58525859 render : render ,
58535860 sidebar : sidebar ,
5861+ discord : discord ,
58545862} ;
0 commit comments