vihanb / PPCG-Design

A redesign of the PPCG website
codegolf.stackexchange.com
35 stars 13 forks source link

Question/Answer HTML Comments that (dis|en)able Userscript Options for page #84

Open addisoncrump opened 8 years ago

addisoncrump commented 8 years ago

There are some questions where it is not appropriate to have specific options of the Userscript enabled. For example, TryItOnline links where the challenge specifies input, such as in this question, you could add a tag at the top of the challenge saying:

<!--PPCG-Design:NO-TIO-->

This would specify that TIO evaluation should not be enabled. Similarly, this could be stacked as such:

<!--PPCG-Design:NO-TIO&NO-LEADERBOARD&GOAT-VOTES-->

This would disable TIO and auto-leaderboard as well as enabling the use of goats over boats. (You may want to disable the modification of more aesthetic options, but this is just a suggestion - take the aspects which you prefer.)

vihanb commented 8 years ago

I'd implement this but comments in the post body are stripped in the HTML

addisoncrump commented 8 years ago

@vihanb http://chat.meta.stackexchange.com/transcript/message/5230543#5230543

vihanb commented 8 years ago

huh really? ok, huh

addisoncrump commented 8 years ago

I've started working on this myself but I have no clue where this would need to go in order to make sure the cookie didn't overwrite it. (See: https://github.com/vihanb/PPCG-Design/issues/85)

addisoncrump commented 8 years ago

It is worth noting that the comment, if placed within the header of the question, would be located at document.getElementByClassName('post-text')[0].firstChild.innerHTML. (I think, but it's located within <p></p> so idrk).

addisoncrump commented 8 years ago

Another point where this would be appropriate is disabling TIO in answers. Useful for answers such as this one (infinite, random output).