Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggle option to disable chapter titles everywhere in the app #660

Open
5 tasks done
Palloxin opened this issue Jun 14, 2023 · 3 comments
Open
5 tasks done

Toggle option to disable chapter titles everywhere in the app #660

Palloxin opened this issue Jun 14, 2023 · 3 comments
Labels
Feature Request New feature or request

Comments

@Palloxin
Copy link
Contributor

Palloxin commented Jun 14, 2023

Describe your suggested feature

A toggle option in the settings to hide chapter titles in the app.
Here
IMG_20230614_104855;
Here:
IMG_20230614_104958
Here:
IMG_20230614_105158
Here:
IMG_20230614_105249
Download Queue:
IMG_20230614_105456
Here:
Screenshot_20240612-101302_1_1
Here:
IMG_20230614_105940
[Facultative] I suggest to add in this last image to add a check box to show chapter titles there just in case users want to take a quick peek at titles without unhiding every single titles in the app so this should apply only on this section like this:
IMG_20230614_110310

and on the download progress notification:
IMG_20240116_175022

Why

Titles are spoiler; some like them there, but not everybody for sure.

If one accidentally reads the title of the 400th unread chapter (or more) ahead the current progress (while scrolling the chapter list or download list) by mistake there is the chance that title is a really hard spoiler that can ruin the reading experience like "Bob's death" or "Bob's marriage" etc..
Titles are a kind of summary of the chapter and can really ruin the surprise factor, aka spoilers.

Other details

I noticed that some sources (like FastNovel) don't even have chapters numbered in the chapter list with just the titles so i assume the app itself doesn't number them in the chapter list but it is done by the source. So maybe it would be better if the numbering of chapters is managed by the app.

Acknowledgements

  • I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open or closed issue.
  • I have written a short but informative title.
  • If this is an issue with a source, I should be opening an issue in the sources repository.
  • I have updated the app to version 1.1.14.
  • I will fill out all of the requested information in this form.
@Palloxin Palloxin added the Feature Request New feature or request label Jun 14, 2023
@Palloxin
Copy link
Contributor Author

Palloxin commented Jan 8, 2024

Regarding the chapter titles inside the chapter itself I made a working script that can hide it.

spoooiler = document.querySelector(".next-button");
if(spoooiler) {spoooiler.innerText = "———Next Chapter———"}

chapter = document.querySelector('#LNReader-chapter');
chapter.innerHTML = chapter.innerHTML
//preparatory
.replace(/ /g, ' ')//
.replace(/<title>[^<]*<\/title>/, '')//epubs
.replace(/^(?:(?=<)[^\?\.,A-Z”“]*?<\/?div\b[^>]*>\s*)+/, '')
.replace(/(?<=<\/?(?:p|h[1-9]|div|span(?!>\s+<i>))>)\s+/g, '')//
.replace(/\s+(?=<\/?(?:p|h[1-9]|div|(?<=<\/)span)>)/g, '')//
.replace(/<p><\/p>(?!$)/g, '')//
.replace(/^[\s\n]*/, '<p></p>')//
//
.replace(/<\/h([1-4])><\/?h\1>/, ' ')
.replace(/^((?:<p><\/p>|<(?!(?:p|h[1-4])>)[^>]*>)?[^<]*(?:<input[^>]+>)?(?:\s*<[^>]+>\s*<\/[^>]+>)*)/, '$1π√')//keep $1
.replace(/π√<(h[1-4]|p)>(?:<(?:span|strong|b)>)?(([^C]?Chapter\W+)?(\d{1,4}\b)(\W+(?=\w))?(.+?))(<\/\1>)((?=(.*?<p>))\9((?:\3|\4|\5|\6)(?:\4(?<=\3\4))?\5?\6?\.?)<\/p>)?/i, (_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10) => {
	if(_8 === undefined)
		return `⸙<${_1}><spo>${_2}${_7}⸙`;
	else
		return `⸙<${_1}><spo>${_2}${_7}${_9}<spo>${_10}⸙`})
.replace(/⸙([^⸙]+)⸙/, (_, a) => `${a.replace(/<(h[1-4]|p)>([^]+?)<\/\1>/, '<h1>$2</h1>')}`)
.replace(/π√(<(p|h[1-5])>)([^]+?)(?=<\/\2>)/, (_, a,b,c)=> {
	const bas = c.replace(/(?:<\/?[a-z]+>|\.$)/g, '')
	let dare = reader.chapter.name.includes(bas);
	if(dare) return `${a}<spo>${reader.chapter.name}</spo>`;
	else return `${_}`})
.replace(/π√/, '')
;

This could be a sub-option (checkbox) that the user can choose to activate. Of course it is not perfect but doesn't target wrong text; at most it will not censor the chapter title.
I might come back to edit the code if I can improve it.

@Palloxin
Copy link
Contributor Author

Palloxin commented Jun 12, 2024

A dedicated segment in the settings (maybe Reader) to manage these options would be cool.
There is also this #854 that would fit very well in the settings and overall spoiler-cover feature.

@Palloxin
Copy link
Contributor Author

Palloxin commented Dec 25, 2024

Wuxiaworld and Ranobes also allow to hide titles.
Screens48
It is known spoilerous titles are annoying to users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant