Jump to content

User talk:Evad37/TimestampDiffs.js

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Evad37 (talk | contribs) at 01:57, 5 January 2021 (moved discussion from my talk). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

TimestampDiffs broken

Hey Evad. User:Evad37/TimestampDiffs seems to be broken with the Wikipedia:Comments in Local Time gadget, which produces the following broken HTML:

<span class="localcomments" timestamp="1609083791472" title="<span class='tsdiffs-timestamp tsdiffs-unlinked'>15:43, 27 December 2020 (UTC)</span>" style="font-size: 95%; white-space: nowrap;">Yesterday, 3:43 pm (UTC+0)</span>

Without TimestampDiffs:

<span class="localcomments" timestamp="1609083786525" title="15:43, 27 December 2020 (UTC)" style="font-size: 95%; white-space: nowrap;">Yesterday, 3:43 pm (UTC+0)</span>

As a secondary issue, having the script enab;ed seems to cause clicking on an anchored (eg section title) link to the page to scroll to the top of the page right after loading finishes. ProcrastinatingReader (talk) 22:17, 28 December 2020 (UTC)[reply]

Yeah, they're both trying to modify the HTML around timestamps, but the gadget gets to run first, and then this script isn't (yet) smart enough to recognise those changes, or to only act on actual text and not html tag attributes. The second problem is probably also related to the "dumb" way this script is adding the diff links. - Evad37 [talk] 00:43, 29 December 2020 (UTC)[reply]
@ProcrastinatingReader: Should be fixed now - Evad37 [talk] 02:53, 29 December 2020 (UTC)[reply]
Works now. Thanks very much Evad! ProcrastinatingReader (talk) 14:11, 29 December 2020 (UTC)[reply]
@Evad37 now I get a pop-up on pages that don't exist - viewing https://en.wikipedia.org/wiki/Wikipedia:Copyright_problems/2020_December_23 (which doesn't exist) notifies me that the script failed to load because there weren't any revisions. Would it be possible to stop earlier if the page doesn't exist? DannyS712 (talk) 07:00, 30 December 2020 (UTC)[reply]
@DannyS712:  Fixed - Evad37 [talk] 09:03, 30 December 2020 (UTC)[reply]
Maybe this is a bit far, but is it possible for the script to (for archive pages) search the original page instead? Since on an archive the edits were actually made on the parent page. Example: Wikipedia talk:Edit warring/Archives/2017/May, the script can't detect any of the diffs on this page, presumably because the edits were never made there? ProcrastinatingReader (talk) 11:47, 4 January 2021 (UTC)[reply]