Tutorials & Resources Jump to Chapter Number on Series Page

Discussion in 'Novel Updates Site Discussion' started by Ultrabenosaurus, May 4, 2019.

  1. Ultrabenosaurus

    Ultrabenosaurus Well-Known Member

    Joined:
    Jul 21, 2016
    Messages:
    53
    Likes Received:
    46
    Reading List:
    Link
    So as I'm sure you all know, if you want to go to a certain chapter in a series that isn't near your bookmarked chapter you have to do some maths and some guessing to find the page of the chapter list here on NU. Well I'm too lazy for that.

    I've put a teensy bit of effort into a JavaScript Bookmarklet which will ask you for your desired chapter number and then navigate to almost* the right page. Create a new bookmark in your browser's bookmarks bar, change the URL/target/location to the code below, go to a series on NU, click the bookmarklet and enter a number.

    Code:
    javascript:(function(){if(document.querySelectorAll('h4.seriesother').length>0&&window.location.hostname=="www.novelupdates.com"){if(document.querySelectorAll('div.digg_pagination>a').length>0){var c=window.prompt("Enter a chapter number:");if(c==null||c==""||isNaN(c)){window.alert("No number entered or number not valid!");}else{var d=document.querySelectorAll('div.digg_pagination>a');var n=d[d.length-2].href.split("pg=")[1];p=n-Math.floor(Math.abs(c)/15);p=p<1?1:p;p=p>n?n:p;window.location.href="./?pg="+p+"#myTable";}}else{window.alert("No pagination!");}}else{window.alert("Not a Novel Updates series page!");}})();
    
    *I say almost, because groups who do multi-chapter or bulk releases as a single "chapter" link on NU won't work with this bookmarklet. Also any series that has a lot of side chapters that are numbered separately from normal chapters (e.g. c104 + SS1) will throw the calculation off.

    You can also view the source code here if you want to be sure I'm not doing anything nefarious or stupid, or if you think you can improve it.

    Code:
    javascript:(function(){
        if(document.querySelectorAll('h4.seriesother').length>0&&window.location.hostname=="www.novelupdates.com"){
            if(document.querySelectorAll('div.digg_pagination>a').length>0){
                var c=window.prompt("Enter a chapter number:");
                if(c==null||c==""||isNaN(c)){
                    window.alert("No number entered or number not valid!");
                }else{
                    var d=document.querySelectorAll('div.digg_pagination>a');
                    var n=d[d.length-2].href.split("pg=")[1];
                    p=n-Math.floor(Math.abs(c)/15);
                    p=p<1?1:p;
                    p=p>n?n:p;
                    window.location.href="./?pg="+p+"#myTable";
                }
            }else{
                window.alert("No pagination!");
            }
        }else{
            window.alert("Not a Novel Updates series page!");
        }
    })();
    
     
    Asdq and Astaroth like this.
  2. SoulZer0

    SoulZer0 Heaven Refining

    Joined:
    Oct 25, 2016
    Messages:
    12,478
    Likes Received:
    24,483
    Reading List:
    Link
    Or you can just use chapter listing and scroll down for a few seconds and select which chapter you want.
     
  3. Nyanko

    Nyanko Psychotic Cat Princess

    Joined:
    Oct 23, 2015
    Messages:
    2,138
    Likes Received:
    4,353
    Reading List:
    Link
    What would be a good addition to that function is if it also highlighted your bookmarked chapters
     
    Rizkiv1 likes this.
  4. SoulZer0

    SoulZer0 Heaven Refining

    Joined:
    Oct 25, 2016
    Messages:
    12,478
    Likes Received:
    24,483
    Reading List:
    Link
    Thank you for your hardwork, but,
    Already said it..
     
  5. Rizkiv1

    Rizkiv1 Well-Known Member

    Joined:
    Aug 10, 2017
    Messages:
    56
    Likes Received:
    67
    Reading List:
    Link
    Another feature request?
     
  6. tak

    tak ignorant but well-meant

    Joined:
    Dec 14, 2016
    Messages:
    820
    Likes Received:
    930
    Reading List:
    Link
    It wasn't there when i made the comment. I guess i am too slow at editing pics. Already deleted the unnecessary addition, sorry.
     
  7. Amaruna Myu

    Amaruna Myu ugly squid dokja (●´∀`●)

    Joined:
    Aug 28, 2016
    Messages:
    4,417
    Likes Received:
    4,139
    Reading List:
    Link
    sorry...
    but is this English?
     
  8. Astaroth

    Astaroth empty

    Joined:
    Dec 7, 2015
    Messages:
    5,393
    Likes Received:
    5,255
    Reading List:
    Link
    Maybe not everyone knows what chapter listing is though, I didn't, but @tak included a screenshot which helped way more than simply saying that chapter listing exist whatever that is... (Well now I know, since I saw the screenshot before the post was deleted.)
    It wasn't unnecessary
     
    tak likes this.
  9. Ultrabenosaurus

    Ultrabenosaurus Well-Known Member

    Joined:
    Jul 21, 2016
    Messages:
    53
    Likes Received:
    46
    Reading List:
    Link
    I'm not forcing you to use it if you prefer wasting time scrolling around and guessing. Honestly I find it much easier and quicker to click a button and type a number, rather than searching for a needle in a haystack.
    [​IMG]
     
    Astaroth likes this.
  10. SoulZer0

    SoulZer0 Heaven Refining

    Joined:
    Oct 25, 2016
    Messages:
    12,478
    Likes Received:
    24,483
    Reading List:
    Link
    No need to apologise.... It was a joke, rather than asking you to delete it... I was just kidding. No need to delete it. In fact, yours was more helpful since you had included a picture.
     
    AliceShiki, Astaroth and tak like this.
  11. tak

    tak ignorant but well-meant

    Joined:
    Dec 14, 2016
    Messages:
    820
    Likes Received:
    930
    Reading List:
    Link
    sorry my mood is terrible, IRL stuff.
    Screenshot_20190504-181951_1.jpg
     
    Astaroth and SoulZer0 like this.
  12. SoulZer0

    SoulZer0 Heaven Refining

    Joined:
    Oct 25, 2016
    Messages:
    12,478
    Likes Received:
    24,483
    Reading List:
    Link
    tak likes this.
  13. Asdq

    Asdq RSS FEED SECT! I WANT YOU FOR THE RSS ARMY!

    Joined:
    Aug 9, 2017
    Messages:
    756
    Likes Received:
    410
    Reading List:
    Link
    I liked.
     
  14. SoulZer0

    SoulZer0 Heaven Refining

    Joined:
    Oct 25, 2016
    Messages:
    12,478
    Likes Received:
    24,483
    Reading List:
    Link
    Okay, good job for you.
     
  15. tak

    tak ignorant but well-meant

    Joined:
    Dec 14, 2016
    Messages:
    820
    Likes Received:
    930
    Reading List:
    Link
    no worries, not your fault.:blob_patpat: i overreacted
     
  16. Ultrabenosaurus

    Ultrabenosaurus Well-Known Member

    Joined:
    Jul 21, 2016
    Messages:
    53
    Likes Received:
    46
    Reading List:
    Link
    Don't worry, I won't again bother sharing anything I find useful here, clearly you and @tak have already got the best possible solutions for everything.
     
  17. SoulZer0

    SoulZer0 Heaven Refining

    Joined:
    Oct 25, 2016
    Messages:
    12,478
    Likes Received:
    24,483
    Reading List:
    Link
    Oh well, if my reply came off as sarcastic, I apologise. I wasn't trying to undermine your work. I simply remind that another alternative exists.

    Thanks for sharing.
     
  18. tak

    tak ignorant but well-meant

    Joined:
    Dec 14, 2016
    Messages:
    820
    Likes Received:
    930
    Reading List:
    Link
    Sorry, there was some IRL problem so i just looked at the post i'm tagged in, i didn't scroll up. Yesterday, I just read the pic is helpful so i posted it again. I didn't read that you don't find that way harder, or that your novel have >2000 chapters. Your script is helpful for those novels with a lot of chapters, and someone appreciated your hard work. Considering some NUF members are lurkers, there might be some that find your script helpful but didn't comment.