Wikipedia:User scripts/Requests/Archive 4: Difference between revisions
Content deleted Content added
m Archiving 2 discussion(s) from Wikipedia:User scripts/Requests) (bot |
m Replaced deprecated <source> tags with <syntaxhighlight> |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 27:
[[Category:Non-talk pages that are automatically signed]]
Line 77 ⟶ 76:
::::{{re|Jürgen Eissink}} It will work only if "Live updates" button on watchlist is selected. (there seems to be no preferences option to have it selected automatically - it has to be selected every time you open your watchlist, but if you wish I can tweak the script to have it selected every time the watchlist is opened). When the watchlist undergoes a live update (done by the mediawiki software, not by this script), the script just updates the page' HTML title prefixing it with a "(1)" or "(2)" or so on. This number is removed when the window comes into focus (i.e, when you switch over to the tab from another, or if you click anywhere within the window if you were already on it).
::::To install it across all wikis, add <
:::::Okay, that makes sense and now it seems to be working, although so far I've seen updates marked (1) when there were more pages added. So the count seems to be the update and not the number of pages updated, which I'd prefer. A small issue is that when pressing 'Mark all changes as seen' that the counter again appears and will only go away after refreshing the page, which is counterproductive to the initial purpose. I'll keep testing a bit, and while improvements would be welcomed, I thank you for the code! [[User:Jürgen Eissink|Jürgen Eissink]] ([[User talk:Jürgen Eissink|talk]]) 11:40, 19 July 2019 (UTC).
Line 184 ⟶ 183:
Is there a script that removes empty parameters in the cite web template like "df=" that is pretty much always empty? --[[User:Mazewaxie|<strong><span style="color: #606060;">Mazewaxie</span></strong>]] ([[User talk:Mazewaxie|<span style=" color: #606060;">talk</span>]] • [[Special:CentralAuth/Mazewaxie|<span style="color: #606060;">contribs</span>]]) 13:28, 26 August 2019 (UTC)
: <
: where <code>t</code> is the wikitext, which you've hopefully obtained in some previous step.
: Note that this whacks any parameter with one of the four names above (without regard to template name or amount of spacing), just as long as it's blank.
Line 210 ⟶ 209:
:The basic version would look like this:
:<
var PREDATORY_HREFS_RGX = /academicjournals\.com|academicjournals\.net|academicjournals\.org|academicpub\.org|academicresearchjournals\.org|aiac\.org\.au|aicit\.org|alliedacademies\.org|ashdin\.com|aspbs\.com|avensonline\.org|biomedres\.info|biopublisher\.ca|bowenpublishing\.com|ccsenet\.org|cennser\.org|clinmedjournals\.org|cluteinstitute\.com|cpinet\.info|cscanada\.net|davidpublisher\.org|etpub\.com|eujournal\.org|growingscience\.com|hanspub\.org|hoajonline\.com|hrmars\.com|iacsit\.org|iamure\.com|\.idosi\.org|igi-global\.com|iises\.net|imedpub\.com|informaticsjournals\.com|innspub\.net|intechopen\.com|intechweb\.org|interesjournals\.org|ispacs\.com|ispub\.com|julypress\.com|juniperpublishers\.com|kowsarpub\.com|kspjournals\.org|m-hikari\.com|macrothink\.org|mathewsopenaccess\.com|mecs-press\.org|oapublishinglondon\.com|oatext\.com|omicsonline\.org|ospcindia\.org|researchleap\.com|sapub\.org|scholink\.org|scialert\.net|scidoc\.org|sciencedomain\.org|sciencedomains\.org|sciedu\.ca|sciencepg\.com|sciencepub\.net|sciencepubco\.com|sciencepublication\.org|sciencepublishinggroup\.com|scipg\.net|scipress\.com|scirp\.org|scopemed\.com|sersc\.org|sphinxsai\.com|\.ssjournals\.com|thesai\.org|waset\.org|witpress\.com|worldwidejournals\.com|zantworldpress\.com/i;
Line 234 ⟶ 233:
}
});
</syntaxhighlight>
:Hopefully someone else can do the rest and provide customisability you ask for.
:You should definitely simplify the massive regex (for instance, make the .com part common for all .com domains) for better performance. [[User:SD0001|SD0001]] ([[User talk:SD0001|talk]]) 12:43, 6 February 2020 (UTC)
Line 244 ⟶ 243:
:::::::Good to know. Didn't know about /i, but that will be useful. As for removing doi.org, that's desired to pickup "Journal of crap 10.4172/asdf10354" that might not make use of templates. false positives are far and few between, although normally I might add a final <code>...\/</code> at the end to ensure it matches a <code>10.4172/</code> and not just <code>10.4172</code>. Clearly "<code>(PRED_DOIS_RGX.test(this.href))</code>" needs tweaking to look outside hrefs, but to what, I don't yet know.  <span style="font-variant:small-caps; whitespace:nowrap;">[[User:Headbomb|Headbomb]] {[[User talk:Headbomb|t]] · [[Special:Contributions/Headbomb|c]] · [[WP:PHYS|p]] · [[WP:WBOOKS|b]]}</span> 17:21, 6 February 2020 (UTC)
::::::::{{re|Headbomb}} You can check whole reference texts (anything within <ref> tags) by using code like:
::::::::<
$('span.reference-text').each(function() {
if (DOI_RGX.test(this.textContent)) {
$(this).css(CSSRULE);
}
}); </
{{unindent}} {{Re|SD0001}} Well, I don't want this to be restricted to ref tags either. I want to find those wherever on the page they may be.  <span style="font-variant:small-caps; whitespace:nowrap;">[[User:Headbomb|Headbomb]] {[[User talk:Headbomb|t]] · [[Special:Contributions/Headbomb|c]] · [[WP:PHYS|p]] · [[WP:WBOOKS|b]]}</span> 17:56, 6 February 2020 (UTC)
::{{done}} Also, if something could only be detected/highlighted in specific namespaces, that would be good. For instance the current <code>var WIKI_HREFS_RGX</code> should really only be highlighted in main/draft spaces.  <span style="font-variant:small-caps; whitespace:nowrap;">[[User:Headbomb|Headbomb]] {[[User talk:Headbomb|t]] · [[Special:Contributions/Headbomb|c]] · [[WP:PHYS|p]] · [[WP:WBOOKS|b]]}</span> 23:27, 6 February 2020 (UTC)
Line 601 ⟶ 600:
--[[User:MrJaroslavik|MrJaroslavik]] ([[User talk:MrJaroslavik|talk]]) 19:37, 14 May 2020 (UTC)
:I have more at [[:User:Jonesey95/AutoEd/unnamed.js]] (do a Find for "Czech"). – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 22:13, 14 May 2020 (UTC)
== Link ISBN direct to WorldCat ==
Hi, is there a script in existence that, when an {{tl|ISBN}} is linked within a CS1 citation, will link directly to the [[WorldCat]] search/address instead of [[Special:BookSources]]? <span style="background:#F3F3F3; padding:3px 9px 4px">[[User talk:Czar|<span style='font:bold small-caps 1.2em sans-serif;color:#871E8D'>czar</span>]]</span> 15:18, 25 May 2020 (UTC)
== Navbox user script ==
I frequently go through the hassle of filling in navboxes, using subgroups etc. I expected there to be a user script to fill them in but I wasn't able to find one. It would certainly be very useful! — Yours, [[ User:Berrely |<span style="color:black;">'''''Berrely'''''</span>]] • [[User talk:Berrely|<sup>Talk</sup>]]∕[[Special:Contributions/Berrely|<sub>Contribs</sub>]] 19:46, 28 May 2020 (UTC)
== OneClickArchiver for lists ==
Scripts listed in [[Wikipedia:One click archiving]] implement archiving of whole <nowiki>==sections==</nowiki>. To make archiving of entries at [[Wikipedia:Community bulletin board]] easier, it would be nice to have a OneClickArchiver for <code>* Unordered lists</code>. {{small|Pinging {{u|Sm8900}}, who might be interested in such a script.}} —[[User:Andrybak|andrybak]] ([[User talk:Andrybak|talk]]) 00:33, 3 June 2020 (UTC)
|