Tutorials & Resources [Userscript: "TOC TouchButton"] shorten previous and next links for smartphone navigation

Discussion in 'Novel Updates Site Discussion' started by sz, Mar 22, 2019.

  1. sz

    sz Well-Known Member

    Joined:
    Mar 8, 2016
    Messages:
    48
    Likes Received:
    46
    Reading List:
    Link
    For anyone interested.
    Many (light) novels blogs hosted on wordpress.com can only use default themes and are using "long" linktexts without a smaller link version. The links can get wordwrapped into the next line.
    Because i got annoyed on my phone of sometimes touching the previous link instead of the next link i made a userscript for myself.

    For now these textparts get replaced and are styled as buttons
    ["Table of Contents", "Index", "ToC"] => "ToC"
    ["Previous Chapter", "Prev", "<- Previous Chapter"] => "-1←"
    ["Next Chapter", "Next", "Next Chapter ->"] => "→+1"

    Name: TOC TouchButton //Can get changed if i have got a better name idea
    Sites: wordpress.com/*
    Desc: Add more Touchfriendly Versions of Previous/Next and Table of Contents links when maxpage width is smaller than 480px
    Scripthome: https://greasyfork.org/scripts/380720-toc-touchbutton

    tested on Firefox with Violentmonkey.
    Feel free to copy and modify the code for other sites

    Known Bug:
    look for a way to detect readerview/android page reload
    onreload with active reader view(firefox mobile) -> loads original version with longText link for reader view
     
    SinCity, Sherrynity and Night Phoenix like this.
  2. Night Phoenix

    Night Phoenix The *Eccentric* Person

    Joined:
    Jul 26, 2017
    Messages:
    829
    Likes Received:
    1,031
    Reading List:
    Link
    Very cool.
     
  3. juniorjawz

    juniorjawz Well-Known Member

    Joined:
    Jul 19, 2016
    Messages:
    6,895
    Likes Received:
    8,231
    Reading List:
    Link
    See, it makes life easier.