Hide tags automatically when there are too many tags. Add hide/show tags button to browsing page and reading page.
Hi.
This script show/hide tags by comparing the number of tags of stories to MAX_TAGS_ON_BROWSING_PAGE and MAX_TAGS_ON_READING_PAGE.
if number of tags > MAX_TAGS_ON_BROWSING_PAGE
hide tags
else
show tags
You can change MAX_TAGS_ON_BROWSING_PAGE and MAX_TAGS_ON_READING_PAGE respectively at the config section of the script.
Default setting is
const MAX_TAGS_ON_BROWSING_PAGE = 15;
//If number of tags > 15, hide tags on browsing page.
const MAX_TAGS_ON_READING_PAGE = 0;
//Always hide tags on reading page.
If you want to hide tags always on browsing page, you can change MAX_TAGS_ON_BROWSING_PAGE to 0.
I added explanation comments to the config section for other users.
Change defaults?
Could you add a section which allows the user to specify if they want the tags to be shown or hidden by default? Sometimes I like to browse through chapters, and having a "hide tag" option is really useful there.
I managed to do it myself by editing the code, but for the sake of future users, it might be nice