User talk:Shubinator/DYKcheck.js

DYK RfC

edit

Legacy JavaScript

edit

Hello! This script has been detected as using deprecated parameters that need to be replaced with the updated version. Examples include addOnloadHook( ... ) needs to be replaced with $( ... ) or $( function() { ... } ) (depending on use); all wgGlobalVariables need to be properly gotten with mw.config.get( 'wgGlobalVariable' ); and addPortletLink needs to be called with mw.util.addPortletLink. Please see MW:ResourceLoader/Legacy JavaScript for details. Thank you. — {{U|Technical 13}} (etc) 22:11, 19 January 2015 (UTC)Reply

0 prose characters

edit

If you, like me, are looking for the solution for the script showing every article as "0 characters" in prose, see User talk:Shubinator#DYKcheck is saying articles have 0 prose characters. (I'm using prosesize until it's resolved.) czar 04:19, 5 June 2017 (UTC)Reply

onttydk?

edit

Just a nit: the variable "onttydk" would probably be better named onttdyk. -- RoySmith (talk) 16:11, 17 November 2019 (UTC)Reply

Weirdness that goes away when I uninstall this script

edit

@Shubinator: Starting earlier today, I started having a problem that goes away when I uninstalled DYKcheck:

Drop-down gadget menus aren't displaying right.

I have Twinkle, MoreMenu, and the AFC Helper Script turned on, among other things. I have the default vector skin with no custom CSS and a custom JavaScript that has one line: // importScript('User:Shubinator/DYKcheck.js'); //DYKcheck tool Until a few minutes ago this line was NOT commented out.

The problem is that MoreMenu sub-menus are "transparent" and sub-menu items cannot be chosen.

Commenting out the DYCheck.js line in my vector.js file, logging out, purging my web browser cookies, quitting and restarting my web browser, and logging back in fixed the problem.

Nothing else I tried, including turning off Twinkle and the AFC Helper Script, worked.

Has anyone else reported this problem? davidwr/(talk)/(contribs) 18:29, 9 February 2021 (UTC)Reply

Disregard, it's being/been fixed, see phab:T273143#6812849.[1] I've added the DYN script back, cleared cookies, rebooted browser, and my problem has not come back. davidwr/(talk)/(contribs) 18:36, 9 February 2021 (UTC)Reply
edit

@Shubinator: DYKcheck will flag an article if it appears on "In the news" as a recent death. theleekycauldron (talkcontribs) (they/them) 05:30, 17 August 2021 (UTC)Reply

Hm, I just checked a couple articles quickly - 2021 Haiti earthquake currently featured on In the News is tagged with {{ITN talk}}, Jerry Harkness currently listed as a recent death is not. Since DYKcheck keys off of that ITN template, I'd expect it to not flag articles that appeared at ITN purely as recent deaths. Are there examples where it is flagging such articles? Shubinator (talk) 04:17, 27 August 2021 (UTC)Reply

Interface-protected edit request on 28 May 2023

edit

Currently, the script isn't really aware of the presence of VisualEditor and the HTML generated when the script is run keeps showing inside the VisualEditor UI when VisualEditor's edit mode is used (since VisualEditor does not reload the page). Due to this, I would suggest the following changes be made to the script to make it work better with VisualEditor.

diff --git a/dykcheck.js b/dykcheck.js
index 05a4f4e..0e152ae 100644
--- a/dykcheck.js
+++ b/dykcheck.js
@@ -1006,6 +1006,14 @@ function addToolbarPortletLink(func, tooltip) {
        });
 }
 
+mw.hook( 've.activationComplete' ).add( function () {
+       $( '[id^="dyk-"]' ).hide();
+} );
+
+mw.hook( 've.deactivationComplete' ).add( function () {
+       $( '[id^="dyk-"]' ).show();
+} )
+
 // Add toolbar portlet links
 if (unlock || (
                (mwConfig.wgAction === 'view' || mwConfig.wgAction === 'submit' || mwConfig.wgAction === 'purge') &&

The changes make sure that the HTML generated by DYKCheck is not shown when the visual editor is loaded by leveraging some of the APIs/Hooks defined at VisualEditor/API. (Ping Shubinator as maintainer of the script) Sohom Datta (talk) 00:46, 28 May 2023 (UTC)Reply

  Not done (as to the immediate edit request for an interface administrator). This user is active and can maintain their own scripts if they choose. Ping to Shubinator. — xaosflux Talk 15:53, 28 May 2023 (UTC)Reply
@Xaosflux I forgot to deactivate the edit request, sorry for the inconvinience caused :( Sohom Datta (talk) 19:33, 28 May 2023 (UTC)Reply
I'm a bit confused as to the repro steps for the issue - is this for article namespace? Shubinator (talk) 04:23, 30 June 2023 (UTC)Reply
@Shubinator The repro steps would be as follows:
  • Open any article
  • Click on "DYK check" on the sidebar
  • Click on "Edit" on the top right corner
If you do not see a "Edit" link, it could be because
  • You do not have VisualEditor enabled in your Beta preferences
(and/or)
  • Your editing mode is set to "Remember last editor" in Editing preferences (for reproing this issue you need to set it to eithier "Always give me Visual editor if possible" or "Show me both editor tabs")
Sohom (talk) 06:41, 30 June 2023 (UTC)Reply