decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null;
treesaver.ui.ArticleManager.getCurrentPageNumber() for Page number within article
treesaver.ui.ArticleManager.getCurrentDocumentNumber() for Article index
Both are 1-based indices
Nathan
On Thursday, November 8, 2012 6:22:08 PM UTC+8, Mark Kessler wrote:apparently getting the Page number is simpler than I thought, but you need the treesaver sourceIt is basically exposed at ArticleManager.js componentSo I called:treesaver.ui.ArticleManager.getCurrentPageNumber() for Page number within article
treesaver.ui.ArticleManager.getCurrentDocumentNumber() for Article index
Both are 1-based indices
Thank you, Andrea. That's good to know!I'm not sure if it's a bug but getCurrentPageNumber got some weird behaviorLet's say Article 1 has 3 pages.When I change from Article 2 page 1 back to -> Article 1 page 3, this function return CurrentPageNumber = 1 (which correctly should be 3). It's totally fine if page changed forward though (i.e. from Page 3/Article 1 -> Page 1/Article 2)
It seems this problem was fixed in 0.10 already, so please ignore my previous reply !!! Thank you !