User talk:Evad37/duplinks-alt.js
This script has a documentation page at User:Evad37/duplinks-alt. |
Implementation for source editing mode
[edit]I didn't realize that this script, and the original, only work in the VisualEditor until I read a a post on the talk page to the original script. I don’t use the VisualEditor. Would it be possible to implement source editor support for this? I think this script is extremely useful, but I can’t use it since I only edit using the source editor. Interqwark talk contribs 02:27, 17 June 2018 (UTC)
- I don't know what you mean, these scripts have existed since before VisualEditor was even invented - Evad37 [talk] 05:54, 17 June 2018 (UTC)
- As it's long after this was posted, possibly not of great use to the original questioner, but probably worth putting on record. Last year, without having seen this earlier discussion, I described the usefulness of this script with the Visual Editor on the user page; it is much easier to remove duplicates this way than in edit mode. So, even if Interqwark uses the source editor for most purposes, it's worth using the visual editor for finding and fixing duplicate links.
There is one issue, either a quirk (if it can't be fixed) or a bug (if it can): when used with the visual editor, removing any link within a paragraph removes the highlight on all other duplicates within that paragraph. Not a major issue, either remember all the links in a paragraph, or repeat the highlighting, but if it is easily fixed, I'd suggest that it's worth it. Best wishes, Pol098 (talk) 10:29, 18 September 2020 (UTC)
- As it's long after this was posted, possibly not of great use to the original questioner, but probably worth putting on record. Last year, without having seen this earlier discussion, I described the usefulness of this script with the Visual Editor on the user page; it is much easier to remove duplicates this way than in edit mode. So, even if Interqwark uses the source editor for most purposes, it's worth using the visual editor for finding and fixing duplicate links.
Feature request
[edit]Is there any way to set it so that it automatically runs when you load a page in mainspace, rather than needing to hit the button? I'll draft a line of code in a second, but I was wondering if that were a possibility to be included. Thanks, --DannyS712 (talk) 03:14, 29 January 2019 (UTC)
- @Evad37: Like:
if (mw.config.get( 'wgNamespaceNumber' ) == 0) run();
else var portletlink = mw.util.addPortletLink('p-tb', '#', 'Highlight duplicate links', 'ca-findduplicatelinks');
- Thoughts? --DannyS712 (talk) 03:18, 29 January 2019 (UTC)
- This should be possible to do as an option. I've got a few other script things I'm working on at the moment, so I'm not sure when I'll get around to it. - Evad37 [talk] 00:27, 7 February 2019 (UTC)
- @Evad37 I've implemented this in User:Aaron Liu/sandbox.js. What do you think? Note that I made it so there's no toast (mw.notify) if the option to automatically highlight them is enabled. Should I change the option name for highlighting duplinks? It's currently autoDuplinks. Note that I've also replaced most
var
s withlet
s Aaron Liu (talk) 21:19, 27 December 2023 (UTC)
- @Evad37 I've implemented this in User:Aaron Liu/sandbox.js. What do you think? Note that I made it so there's no toast (mw.notify) if the option to automatically highlight them is enabled. Should I change the option name for highlighting duplinks? It's currently autoDuplinks. Note that I've also replaced most
- This should be possible to do as an option. I've got a few other script things I'm working on at the moment, so I'm not sure when I'll get around to it. - Evad37 [talk] 00:27, 7 February 2019 (UTC)
"ISBN" article links in refs
[edit]This tool detects links to the article ISBN in references as duplicates. Personally I would prefer if only the first entry in a reference list linked to that article, but it might be easier for now if the tool were configured to ignore links to ISBN within <ref> tags, perhaps. —Hugh (talk) 03:34, 14 February 2019 (UTC)
Request or suggestion
[edit]This tool shows duplicate links in a box. However, I would suggest or request that is there any way to highlight the duplicate links with yellow background while the first link with orange background. I think highlighting the links is far better than showing them in a box. Thank you. Empire AS Talk! 13:51, 8 August 2020 (UTC)
- @Empire AS: You can add custom styles to your common.css page, using like the following: The colour names orange and yellow can replace with any Web color name (or hex triplet). - Evad37 [talk] 08:04, 28 August 2020 (UTC)
.duplicated-link { background:orange; border:0; } .duplicate-link { background:yellow; border:0; }
- Evad37, Thank you.Empire AS Talk! 08:07, 28 August 2020 (UTC)
Suggestion
[edit]Hello! So my suggestion is to have the tool ignore {{citation needed}} templates. These usually aren't something where removing the duplicate link would need to be done (unless of course there's a lot of that template in the article in which case it just gets replaced with a maintenance template), and also removing the duplicate link from the template requires actually removing the template (unless there's a parameter which disables the link to the template that I"m not aware of). An example of this is on Mannheim Steamroller. ― Blaze The WolfTalkBlaze Wolf#6545 19:10, 1 November 2021 (UTC)
Not working?
[edit]Hello there @Evad37, I'm trying to use your script here, but not sure it's actually working the way it should. Every single thing which is linked has a box around it. So, I'm not sure why it is highlighting every single link instead of the repeated links? Coldstreamer20 (talk) 17:18, 16 December 2021 (UTC)
Query about odd glitch
[edit]G'day Evad37. Weird glitch with the script. It was working ok yesterday, but today when I click on it, it highlights ALL the links in the lead and repeats the lead and infobox below that. Each time I click on it it adds another lead and infobox... Very strange... On Uskok--class torpedo boat. Peacemaker67 (click to talk to me) 04:43, 25 June 2022 (UTC)
- This has been happening to me as well. It seems to be particularly common on articles that have a topicon (Template:Good article, Template:Featured article, Template:Pp, etc.), although that might just be a coïncidence. Extraordinary Writ (talk) 07:38, 27 June 2022 (UTC)
- Evad37 same here ... it is duplicating the entire lead. Like Extraordinary Writ says, happening on a featured article (Palladian architecture). SandyGeorgia (Talk) 14:11, 2 July 2022 (UTC)
- I tested it at Palladian architecture, and as noted by Extraordinary Writ, the error seems to be coming from the Featured article template. [1] SandyGeorgia (Talk) 14:17, 2 July 2022 (UTC)
- See query at Village pump (technical) SandyGeorgia (Talk) 04:01, 5 July 2022 (UTC)
Interface-protected edit request on 5 July 2022
[edit]This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
This is regarding the issue reported in #Query about odd glitch above. Would an int-admin be kind enough to make the fix suggested by NguoiDungKhongDinhDanh at Wikipedia:Village pump (technical)#Glitches on Featured and good articles when using scripts? Evad37 hasn't edited in several months, so it doesn't look like he'll be able to fix this anytime soon: this is a widely used script, so it'd be good to get this taken care of. Thanks in advance! Extraordinary Writ (talk) 05:06, 5 July 2022 (UTC)
- On hold giving @Evad37: a chance to look at their own script. — xaosflux Talk 13:20, 6 July 2022 (UTC)
- Evad37 hasn't edited since January, so I don't think we'll be hearing from him anytime soon. Extraordinary Writ (talk) 03:00, 8 July 2022 (UTC)
- On hold giving @Evad37: a chance to look at their own script. — xaosflux Talk 13:20, 6 July 2022 (UTC)
- Done — xaosflux Talk 00:12, 11 July 2022 (UTC)
- And it seems to be working again—thank you Xaosflux! Extraordinary Writ (talk) 00:25, 11 July 2022 (UTC)
- Yes! Thank you, SandyGeorgia (Talk) 00:32, 11 July 2022 (UTC)
glitch?
[edit]I'm trying to find some links that might be removed at Jack Smith (lawyer) and the script is telling me there are no duplicates, but I'm seeing at least two. Valereee (talk) 15:39, 21 November 2022 (UTC)
- @Valereee: I confirm the script isn't working properly. SLBedit (talk) 16:10, 2 February 2023 (UTC)
Script detecting multiple "Citation needed" and other similar tags as duplicate links
[edit]Hi Evad37. If an article have multiple {{Citation needed}}, {{Better source needed}}, or other similar citation-related tags, the script detects them as duplicate links. Would you please fix/improve the script to ignore/bypass those tags? --Mann Mann (talk) 03:18, 9 May 2023 (UTC)
No install button?
[edit]Can we make this work with the gadget for installing scripts, which displays the blue install button, instead of having one to edit their js pages? Piotrus at Hanyang| reply here 04:02, 31 May 2024 (UTC)
Update for mw:Heading HTML changes
[edit]This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
As reported at Wikipedia:Village pump (technical)#Broken template in Vector 2010, this script does not work correctly following the MediaWiki changes described at mw:Heading HTML changes.
To fix it, it should be sufficient to replace this line:
if (this.nodeName.toLowerCase() == 'h2') {
with this:
if ( $(this).is('h2, .mw-heading2') ) {
I pinged the author, @Evad37, previously, but it seems they're not very active these days. Matma Rex talk 17:03, 18 June 2024 (UTC)
- Done (of course if Evad37 doesn't want this they can do as they please). — xaosflux Talk 18:07, 18 June 2024 (UTC)