User talk:Enterprisey/diff-permalink

Latest comment: 6 months ago by Enterprisey in topic Bug

Hey, Enterprisey, sorry for the stupid question, but are there instructions somewhere for how I use this script? (Apologies if it'll somehow become obvious next time I try to create a diff!) —valereee (talk) 20:24, 28 November 2020 (UTC)Reply

You have to open Help:Diff page to see it working. AXONOV (talk) 10:26, 1 October 2021 (UTC)Reply

HistoryHelper edit

Meanwhile it's good to copy links on the diff page, it quickly becomes a tedious work when you have to copy a bunch of them. I've wrote HistoryHelper helper for that. Checkout. I also propose to unify link format: .e.g turning the Special:Diff/991198834 into [20:24, November 28, 2020] for readability. Best. AXONOV (talk) 10:30, 1 October 2021 (UTC)Reply

Alexander Davronov, try Bawl. You just dump the full diff URLs in the text input, press preview or submit and they magically become wikilinks. Only downside, it only works in Bawl. So if you want to add diffs within, say, Twinkle, you need another way. Or dump the full URLs in Twinkle and edit the section with Bawl afterwards. Alexis Jazz (talk or ping me) 14:57, 17 April 2022 (UTC)Reply
@Alexis Jazz: Thanks mate, but I'm using Convenient_Discussions already. Additionally my plugin automatically formats bunch of diff urls in very convenient way, so I don't need to waste time on formatting everything. I'm primarily using it for quick openning of disputes. AXONOV (talk) 15:04, 17 April 2022 (UTC)Reply
Alexander Davronov, okay! Btw, here's that link when I paste it: c:User:Jack who built the house/Convenient Discussions. But CD and Bawl, while having overlap in functionality, are very different in presentation. So if you dig the presentation from CD, fully transforming wikitext discussions, there's no alternative that I know of that does that. Alexis Jazz (talk or ping me) 15:12, 17 April 2022 (UTC)Reply

Two minor suggestions edit

Hi @Enterprisey!

  • Check wgCanonicalSpecialPageName instead of wgPageName for the script to work even when imported from, or copied to, non-English wikis. — mw:Manual:Interface/JavaScript#All_pages_(user/page-specific)
  • Use attr(Object) instead of $(,Object), which is more direct, and enjoys greater stability and forward compatibility. The second parameter can sometimes clash with other gadgets or user scripts since there is an ambiguity where calling jQuery plugin/method names from another script takes precedent over setting attributes. — https://api.jquery.com/jquery/#jQuery-html-attributes

Review diff.

--Krinkle (talk) 23:14, 12 October 2021 (UTC)Reply

Done, and thanks for the patch! Enterprisey (talk!) 06:30, 15 October 2021 (UTC)Reply

Please add Opening and closing brackets edit

@Enterprisey since almost always this has to be added inside double square brackets, Please add the 4 characters [ [ and ] ] as suffix and prefix in the text that is shown to copy. See User:NguoiDungKhongDinhDanh/LiveDiffLink.js for example. It gives a link with opening and closing brackets. Venkat TL (talk) 16:57, 4 April 2022 (UTC)Reply

@Venkat TL, I usually add links that include link labels, which are annoying to add when the link already has brackets. Perhaps there should be a preference? Enterprisey (talk!) 19:11, 4 April 2022 (UTC)Reply
@Enterprisey what are link labels? do you not need the 4 sq brackets with link labels? yes, a preference to enable disable the brackets, would be great. Venkat TL (talk) 08:49, 5 April 2022 (UTC)Reply
@Venkat TL, see User:Enterprisey/diff-permalink-2.js. Enterprisey (talk!) 20:36, 5 April 2022 (UTC)Reply
Perfect. Thank you for quickly putting it together. Installed, works as expected. Venkat TL (talk) 06:03, 6 April 2022 (UTC)Reply
For demonstration purposes: Special:Diff/1050007234/1081185408. —⁠andrybak (talk) 17:18, 6 April 2022 (UTC)Reply

Bug edit

Enterprisey, thank you for making this script! It is the only reason I can tolerate grabbing diffs...

Your most recent edit introduced a small bug: the button (interface?) now appears whenever one is viewing a page (e.g. at Foobar) in addition to when one is looking at a diff/old version (e.g. Special:Permalink/1184516459). HouseBlastertalk 01:19, 13 November 2023 (UTC)Reply

Hahaha! I just realized I did that myself and was about to fix it... :p Enterprisey (talk!) 01:20, 13 November 2023 (UTC)Reply