User:Chlod/Scripts/FoldArchives: Difference between revisions

Content deleted Content added
New script
 
Installation: switch install method
 
(4 intermediate revisions by 2 users not shown)
Line 1:
{{Short description|userscriptUserscript that makes archived threads foldable to reduce taken screen space}}
{{Infobox user script
| author = [[User:Chlod|Chlod]]
Line 8:
| browsers = [[Firefox]] (but likely works on all browsers)
}}
'''Fold Archives''' allows the folding ofcollapses archived talk page threads (or any thread with {{T|atop}}/{{T|abot}}) in order to reduce screen space.
 
== Installation ==
To install the script, add this to your [[Special:MyPage/common.js|common.js]] file.
 
<syntaxhighlight lang="js">
=== English Wikipedia ===
<code>mw.loader.load( '//en.wikipedia.org/w/index.php?title=User:Chlod/Scripts/FoldArchives.js&action=raw&ctype=text/javascript' );< /code>/ Backlink: [[User:Chlod/Scripts/FoldArchives.js]]
Edit [[Special:MyPage/common.js]] or [[Special:MyPage/skin.js|Special:MyPage/''skin''.js]] and append this to your scripts page:
</syntaxhighlight>
importScript("User:Chlod/Scripts/FoldArchives.js");
 
=== Other Wikipedia Languages ===
Add this to the common.js file of your account on that wiki:
<code>mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Chlod/Scripts/FoldArchives.js&action=raw&ctype=text/javascript');</code>
 
== Configuration ==
You can enable a transparent-to-dark fade by inserting the following line before importing the script.
<templatestylessyntaxhighlight lang="js">
window.folda_dark = true;
</syntaxhighlight>
</templatestyles>
 
You can override the gradient entirely by inserting the following line before importing the script. Note that you need to use a working CSS background.
<templatestylessyntaxhighlight lang="js">
// Replace this with any value you want.
window.folda_gradient = "linear-gradient(to bottom, transparent 75%, pink 95%, pink)";
</syntaxhighlight>
</templatestyles>
 
You can also set the height of the folded box by inserting the following line before importing the script. Note that you need to include a CSS unit with this value, or else it won't work properly.
<templatestylessyntaxhighlight lang="js">
// Replace this with any value you want.
window.folda_maxHeight = "50vh";
</syntaxhighlight>
</templatestyles>
 
If this script causes conflicts with the classes of other scripts, you can override the class prefix by inserting the following line before importing the script. In most cases, you wouldn't need this though.
<templatestylessyntaxhighlight lang="js">
// Replace this with any value you want.
window.folda_prefix = "someRandomCssClass-";
</syntaxhighlight>
</templatestyles>
 
== Source ==
Line 48 ⟶ 44:
 
== Discussion ==
You may visit my [[User talk:Chlod|talk page]] if you have any concerns. You may also discuss this script specifically using this page's [[User talk:Chlod/Scripts/FoldArchives.js|talk page]].