User talk:Writ Keeper/Scripts/inlineDiffDocs

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Changing the link style and content[edit]

I'm enjoying testing this script out (via importScript('User:Writ Keeper/Scripts/commonHistory.js');) but I'd like to change the wording that is displayed, to make it less eye-catching and also shorter. How would I go about changing the

[inspect diff]

to instead display as

[+]

? Thanks. –Quiddity (talk) 18:05, 28 November 2013 (UTC)[reply]

@Quiddity: Hey, sorry for the delay; I've made it so that the text is configurable now. To change it, you can insert variables into your common.js page (or wherever else you installed the script), right above the line where this script is installed: change the value of inspectText to change the thing that's currently "inspect diff", change the value of hideText to change the thing that's currently "hide diff", and change the value of showText to change the thing that's currently "show diff". This diff should illustrate what I mean; if you copy it exactly, it should give you the +/- you're looking for. Let me know if you have any other issues. Writ Keeper  22:47, 2 December 2013 (UTC)[reply]
Oh, do note though: I only implemented this on the commonHistory.js one; let me know if you need me to extend it to the more specific versions. Writ Keeper  22:50, 2 December 2013 (UTC)[reply]
Fabulous and perfect! I'm currently using commonHistory, but will ping here if more tweaks are desired. Thanks again. –Quiddity (talk) 22:52, 2 December 2013 (UTC)[reply]

Suggest putting this forward as a Gadget[edit]

I just found out about this script, and also found bugzilla:51958 ("Watchlist and recent changes should be able to show diffs inline") where I pointed them towards here. I think it might be a good candidate for a WP:Gadget. Thanks. –Quiddity (talk) 18:39, 28 November 2013 (UTC)[reply]

I think ragesoss and Yunshui suggested making it a gadget when I wrote it for them; others have said that it's too similar to popups (although I personally really hate popups and very much prefer this). I'd be willing to maintain it were it to become a gadget, but it hasn't undergone the kind of thorough testing a gadget requires yet. Writ Keeper  22:58, 2 December 2013 (UTC)[reply]

Integrate it with {{diff}}[edit]

@Writ Keeper:, Is it doable without an intervention in the code? If no, then making it general would be perfect. The easiest solution I come up with is a single line somewhere in the end:

$(".writsCommonHistory").each(function(){$(this)

.replaceWith($('<a href="#" id="' + $(this).attr("id") + '">' + this.innerHTML + '</a>'));

});

Then from templates one can produce this:

<span class="writsCommonHistory" id="32825887">
<b><span style="color:black;">[</span>
<span style="color:#339900;">+</span>
<span style="color:black;">]
</span></b>
</span>

--Dixtosa (talk) 15:38, 16 May 2015 (UTC)[reply]

It has stopped working[edit]

on watchlist. The console is silent. @Writ Keeper--Giorgi Eufshi (talk) 09:07, 24 August 2016 (UTC)[reply]

Hmm, still works for me. Perhaps a script conflict, Giorgi Eufshi? Which skin do you use? Actually, you just don't have it loaded on that account: neither your common.js nor your vector.js have anything in them, so Wikipedia doesn't even try to load it. I'm guessing you forgot to import your script declarations from your old account. Writ Keeper  07:44, 26 August 2016 (UTC)[reply]
Thanks for the reply. Actually, I was having this issue on Wiktionary and thought it would the same here. The problem turned out to be on Wiktionary side. --Giorgi Eufshi (talk) 07:54, 26 August 2016 (UTC)[reply]

hey[edit]

@Writ Keeper: Are these changes supposed to mark individual watchlist entries as visited? Or does it do something else? - NQ (talk) 19:18, 20 October 2016 (UTC)[reply]

They're supposed to. They don't yet. Still working on it, give me a few minutes. Writ Keeper  19:19, 20 October 2016 (UTC)[reply]
I was asking because changing it to "revids : button.id" worked for me. - NQ (talk) 19:23, 20 October 2016 (UTC)[reply]
Hmm, so it does. Thanks! Writ Keeper  19:32, 20 October 2016 (UTC)[reply]

Could we maybe get a variable we could set to not have it mark the page as visited (defaulted however you like)? The "Navigation popups" diff doesn't mark a page as visited. I'd rather do this directly, like by visiting the page or using a gadget that explicitly marks the page as visited. Thanks for your consideration. Stevie is the man! TalkWork 20:19, 20 October 2016 (UTC)[reply]

@Stevietheman: done. Writ Keeper  20:52, 20 October 2016 (UTC)[reply]
Thank you for your quick turnaround on this! Opt-in does indeed make sense for this. Stevie is the man! TalkWork 21:01, 20 October 2016 (UTC)[reply]

Conflict with Markhurd/hidetopcontrib on Contributions pages[edit]

I love your script, so I was a bit upset when I found it kept User:Markhurd/hidetopcontrib from working on Contributions pages. I wrote a workaround in my common.js to not run commonHistory.js if it's on a Contributions page, so I can continue using your script on all pages except Contributions. I'm not sure exactly what the issue is, but to say that I get highly inaccurate results from hidetopcontrib when both are run on Contributions pages. Stevie is the man! TalkWork 16:50, 21 October 2016 (UTC)[reply]

@Stevietheman: Hi! I wouldn't pretend to know about any of this stuff, but if you were to copy the script to your user subspace and change b = 2; in the script to b = 3;, that should get it working alongside this one, at least I think it does. Just something to try. - NQ (talk) 17:52, 21 October 2016 (UTC)[reply]

Incompatibility with a recent filtering beta feature[edit]

@Writ Keeper:, the buttons show up and are deleted immediately just in case you do not know. --Dixtosa (talk) 16:20, 26 May 2017 (UTC)[reply]

@Dixtosa: Hey, Dixtosa, thanks for the heads up! This should be fixed now. Writ Keeper  14:44, 30 May 2017 (UTC)[reply]

Not working on watchlists anymore[edit]

I have been using User:Writ Keeper/Scripts/commonHistory.js for several months without issues. Some time in the last few days, it stopped working on my Watchlist page, although it still works fine on individual page histories. This is the case even when I commented out all the other scripts in my common.js. I don't see any recent changes to the script, so I'm not sure what happened here. Any ideas? Sondra.kinsey (talk) 17:49, 18 August 2017 (UTC)[reply]

Yep, I'm seeing it too, and it's also been brought to my attention on my talk page. I'd imagine it's a change on Wikipedia's end, but I'm still looking into it. I'll let people know via the thread on my talk page when there's an update. Thanks! Writ Keeper  17:59, 18 August 2017 (UTC)[reply]

Wrapping width bug with new RC[edit]

Hallo. Using commonHistory.js and the new RC filters page, I'm seeing this issue (screenshots: one, two) on all RC & Watchlist rows that are not-grouped (but turning off the preference for "group changes" doesn't fix it). If I un-toggle the width:100% in those screenshots then it displays normally. Let me know if there's anything else I can do to help test/resolve this. Thanks again for the great script(s) :) Quiddity (talk) 20:34, 11 November 2017 (UTC)[reply]

Timing[edit]

The "Inspect edit" text is just the right size and turns up at just the right time to move the "rollback" link in an article history to where the "thank" link was. I've just, for the second time, rollback-ed an edit I was trying to thank the author for because the text jumped just as I clicked it.

I'm not sure I have a great idea on how to fix this, but it is really annoying when it happens! I think I'll change the "Inspect edit" text to something shorter to reduce the likelihood of this happening for me, but I'm sure I can't be the only one. GoldenRing (talk) 14:30, 27 February 2019 (UTC)[reply]

Change request: hooks again and section-watchlist[edit]

Hi! Got another request for a change to commonHistory, sorry about that. My version's at Special:Permalink/979692809, and the diff is here. I added support for User:Enterprisey/section-watchlist, and renamed the hook to the "official" mw.hook name (turns out they already had a standard event for diffs!). Or let me know and I can make the change myself, I guess. Thank you! Enterprisey (talk!) 07:02, 22 September 2020 (UTC)[reply]

Whoops, forgot the ping: Writ Keeper Enterprisey (talk!) 07:02, 22 September 2020 (UTC)[reply]
 Done Looks good, thanks! Writ Keeper  12:28, 22 September 2020 (UTC)[reply]
Hey, Enterprisey, just a heads up: I reverted the part of the change that renamed the hook to "wikipage.diff". There are other actions already registered to that hook, including one related to the core "thanks" extension (specifically "ext.thanks.corethank@cy9fg") that get triggered when I fire that hook, and the thanks event break the script by erroring out and preventing the page from finishing the processing for displaying the diff. Changing the hook name back to the unique one prevents that thanks event from happening and corrects the bug. Thanks, Writ Keeper  15:59, 23 September 2020 (UTC)[reply]
Ah, bit of a shame. Sounds good, and thanks for letting me know. Maybe I'll open a Phab ticket or something. Enterprisey (talk!) 08:01, 24 September 2020 (UTC)[reply]
@Writ Keeper and Enterprisey: I think this is simply because it's returning the DOM element as opposed to a jQuery object. Tried mw.hook('wikipage.diff').fire($(newTable)) and it worked fine for me. Nardog (talk) 16:38, 26 January 2021 (UTC)[reply]