User talk:Writ Keeper/Scripts/previewAndDiff.js
I recommend everyone install this! As the 45th and last president of the United States said, "What do you have to lose?" However, as of today there's a but: about every 5th article I use this on, the "Your changes" section is empty when it shouldn't be i.e. if I then click the standard Show changes button, there's indeed a nonempty diff. I'll give more info on reproducibility when I've got it. Nonetheless, this is still a great feature! EEng 23:14, 24 August 2017 (UTC)
- Hmm, I'll take a look. The actual diff generation code should still work but could probably use a refresher. Do you happen to remember any specific page it didn't work on? Writ Keeper ⚇♔ 02:35, 25 August 2017 (UTC)
- Okay, EEng, I'm hoping the latest changes will have fixed the inconsistency. Let me know if you see any more problems. Writ Keeper ⚇♔ 15:40, 25 August 2017 (UTC)
- Well, I can't say enough how much I appreciate all this. If it recurs I'll try to post a reproducible example. EEng 20:11, 25 August 2017 (UTC)
- AFAICS the "Your changes" section is always shown as empty for Assassination of Abraham Lincoln. I wonder if it has something to do with the fact that it's under Pending Changes protection. EEng 02:34, 26 August 2017 (UTC)
- Aha, I think I fixed it. EEng, I think the issue was that some pages, like Abraham Lincoln, were just too big and it was choking. Switching from GET to POST should fix that, although it might still be a bit slow on big pages. As always, let me know if you have any further issues. (And you're very welcome, working on stuff like this is probably my favorite thing to do on Wikipedia!) Writ Keeper ⚇♔ 03:18, 26 August 2017 (UTC)
- Seems to have done the trick. I'm happily editing away. EEng 13:12, 26 August 2017 (UTC)
- Aha, I think I fixed it. EEng, I think the issue was that some pages, like Abraham Lincoln, were just too big and it was choking. Switching from GET to POST should fix that, although it might still be a bit slow on big pages. As always, let me know if you have any further issues. (And you're very welcome, working on stuff like this is probably my favorite thing to do on Wikipedia!) Writ Keeper ⚇♔ 03:18, 26 August 2017 (UTC)
Shortcut key
[edit]NOTE THAT INSTEAD OF CLICKING THE BUTTON, YOU CAN HIT <CTL><ALT>o (that's the letter oh)
Followon bugs
[edit]These are by no means serious enough to impair the feature's brilliance, but I'm sure you'll want to know.
- When you're doing a "New section" on a talk page, the Your changes is all crazy (it seems to be diffing against the first section of the page). While perhaps puzzling, it's ultimately unimportant since with "New section" there's nothing to useful to diff against anyway. EEng
- I just encountered something similar, for this edit: [1], which ironically was about touting this gadget. This also was about adding a "New section". When I clicked "Show changes", it worked correctly, but when I clicked the new button, the preview was fine, but the changes looked as though I had deleted the top material of the page along with creating a new section. --Tryptofish (talk) 23:45, 2 September 2017 (UTC)
- I get the impression that when an edit begins as an "Undo", the Your changes is sometimes (not often) permanently empty. I can't find an example of of this just now. EEng 00:20, 2 September 2017 (UTC)
- @EEng @Tryptofish: Hey, y'all, sorry for taking a while to get back to this. I see the problem with the "new section" bug, but I don't see any good way to fix it. Is the new button valuable to you for a new section? Because there'll never be anything to diff it against really, and the easiest and neatest way to fix it might be to just remove the button from new section edits. Otherwise, it's tricky, and might lead to a significant slowdown of the script on new-section pages (though it shouldn't affect others significantly). Writ Keeper ⚇♔ 19:40, 5 September 2017 (UTC)
- I definitely find the gadget very helpful in general, and I think you deserve applause for creating it. As for the "new section" bug, I guess disabling it for new sections is still better than not having it at all. But (speaking as an ignoramus about technical stuff), I know that I can get diffs for new sections using the regular "show changes" button – I don't know whether you can make it work that way. Thanks. --Tryptofish (talk) 20:53, 5 September 2017 (UTC)
- @EEng @Tryptofish: Hey, y'all, sorry for taking a while to get back to this. I see the problem with the "new section" bug, but I don't see any good way to fix it. Is the new button valuable to you for a new section? Because there'll never be anything to diff it against really, and the easiest and neatest way to fix it might be to just remove the button from new section edits. Otherwise, it's tricky, and might lead to a significant slowdown of the script on new-section pages (though it shouldn't affect others significantly). Writ Keeper ⚇♔ 19:40, 5 September 2017 (UTC)
- Mr. Keeper, sir, apologize not, these are minor problems and the experience of using this feature is positively orgasmic. A diff for a new section does make sense (empty on the left, new text on the right) and indeed the regular Show changes button does that. But I wouldn't spend more than 15 minutes on it. The only reason it matters is that it confuses neophytes.
- Hint: I think the misbehavior on New Section is related to the occasional misbehavior (described above) on Undo, in that I suspect there's some secret state somewhere related to those two special operations that you're not tapping into. EEng 22:03, 5 September 2017 (UTC)
"Show preview and changes" button gets duplicated
[edit]If I use the "show preview" button, I get an extra "show preview and changes" button tacked on the end. Clicking the "show changes" (or any "show preview and changes" button) resets it to only the one "show preview and changes".
Also, pressing "show preview and changes" causes "show preview" to function the same way—unless I hit "show changes", which resets the whole thing again. Eman235/talk 00:26, 16 January 2019 (UTC)
- Not happening to me. EEng 01:01, 16 January 2019 (UTC)
- Hmm, I can't reproduce this, either. Can you take a screenshot? Writ Keeper ⚇♔ 02:59, 16 January 2019 (UTC)
- Here's a screenshot: [2]
- I should note that I'm using Firefox 60.4.0esr (64-bit). Also, after experimenting a bit more, the behavior of the bug is not always consistent with what I said (the button-duplication bit always happens). I can't quite figure out what the exact behavior is yet. Eman235/talk 06:01, 16 January 2019 (UTC)
- Hmm, I can't reproduce this, either. Can you take a screenshot? Writ Keeper ⚇♔ 02:59, 16 January 2019 (UTC)
Stopped working
[edit]Don't know what is different. I've uninstalled some other scripts, but it could also be some unknown changes to the media software? Huggums537 (talk) 17:10, 8 April 2024 (UTC)