Open LoLsAlEd opened 9 years ago
It seems to work just fine with just that. It's easy enough to switch chapter manually, so it doesn't seem to be worth the effort of automating that. You can add extra: [[['.pager']]],
as well, so show the pager is visible to simplify the chapter switching.
Is there any specific other feature you are missing?
Nah not really, I'm pretty happy with how its working.
Thanks anyway.
I decided to make a chapter switcher anyways: ;)
back: function(html, pos) {
try {
return xpath('//a[img[@alt="Previous Page"]]/@href', html);
} catch (e) {
var newChapter = xpath('//select[@name="chapter"]/*[@selected]/preceding-sibling::*[1]/@value', html);
var currChapter = xpath('//select[@name="chapter"]/*[@selected]/@value', html);
return link[pos].replace(currChapter, newChapter);
}
},
next: function(html, pos) {
try {
return xpath('//a[img[@alt="Next Page"]]/@href', html);
} catch (e) {
var newChapter = xpath('//select[@name="chapter"]/*[@selected]/following-sibling::*[1]/@value', html);
var currChapter = xpath('//select[@name="chapter"]/*[@selected]/@value', html);
return link[pos].replace(currChapter, newChapter).replace(/\/[^\/]*$/, "/1");
}
},
The backwards version jumps to the start of the chapter, instead of the end, because I couldn't find a way to determine how many pages a chapter has.
I was able to get the script to load one chapter using this code but unfourtunutly I am not skilled in Javascript, so I have no clue how to fix it and get the rest of the script working.
If someone could help me fix it that would be great.