Jump to content

MediaWiki talk:Gadget-citations.js

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by ~aanzx (talk | contribs) at 15:37, 15 March 2023 (how add gadget on kannada wiki: Reply). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.


Where to get help

Tool documentation describes this widget and how to use it.

To report bugs or ask questions about the citation bot that does the work, see its talk page

To report bugs or ask questions about this widget, discuss it on this very page below.

The gadget source code is available.

Because of WP:EDITSUMMARY, when creating new sections, the gadget edit description is added to the subject heading. Please clean up by hand.

Enabling wikEd breaks Wikipedia:Citation expander

If I have both wikEd and Wikipedia:Citation expander enabled, the Citation expander gadget doesn't work. Disabling wikEd solves this, but then I lose wikEd. Cross-reported at wikEd. Headbomb {t · c · p · b} 05:36, 28 February 2019 (UTC)[reply]

According to The DJ at wikEd, it's because "citation expand doesn't support jQuery.textSelection". Headbomb {t · c · p · b} 05:52, 5 April 2019 (UTC)[reply]

Add keyboard shortcut

In User:Headbomb/citations.js (diff), I have a keyboard shortcut setup for activating citation bot. This functionality should be built in this script, I feel. [Ctrl+Alt+A] will not clash with any other Wikipedia functions or standard shortcuts on Windows/Mac Os/Linux.

Headbomb {t · c · p · b} 18:47, 16 October 2020 (UTC)[reply]

Replace

mw.util.addPortletLink("p-tb", "//citations.toolforge.org/process_page.php?edit=toolbar&slow=1&page="+escPageName, 'Expand citations', 't-citationbot', "Expand citations and fix common formatting errors");

with

mw.util.addPortletLink("p-tb", "//citations.toolforge.org/process_page.php?edit=toolbar&slow=1&page="+escPageName, 'Expand citations', 't-citationbot', "Expand citations and fix common formatting errors", 'a');

On line #26. This will add the shortcut "Alt+Shift+A" (or something equivalent) to trigger Citation bot. This does not clash with anything else on Wikipedia. Headbomb {t · c · p · b} 05:27, 1 June 2022 (UTC)[reply]

Saying this in my own personal capacity (as in, I'm not acting either way) but I'm unconvinced that this is unlikely to clash with anything. Maybe nothing official, but who knows what else folks have done or used in other scripts? It's not clear to me that folks are clamoring for it this? ~ Amory (utc) 22:53, 4 June 2022 (UTC)[reply]
Not sure I like this - while 'a' doesn't appear to be used right now, it seems like a good candidate for a future mass feature, so I don't think putting it on an opt-in gadget is a good idea. — xaosflux Talk 17:48, 6 June 2022 (UTC)[reply]
How about a placeholder key that can be customized on a per-user basis then? Headbomb {t · c · p · b} 18:40, 6 June 2022 (UTC)[reply]
Based on the addPortletLink source, I think a variable set to null in the gadget source (i.e. simply named) could be added here and then you could define the variable in local js. Amorymeltzer? Izno (talk) 08:37, 10 June 2022 (UTC)[reply]
Sure? But that's generically applicable for anything that adds a link. Likewise, it can also just be added locally anyway, no? $(document.getElementById('t-citation')).attr('accesskey', 'a').updateTooltipAccessKeys(); ~ Amory (utc) 00:13, 11 June 2022 (UTC)[reply]
Works for me. Probably works for Headbomb too. Izno (talk) 17:25, 12 June 2022 (UTC)[reply]
  • @Headbomb: not sure if it is coming from some other gadget or script I have, but it seems like my 'a' is already mapped (I don't actually use these, so no clue).
$( '[accesskey=a]' )
<menuitem id="context-copylink" data-l10n-id="main-context-menu-copy-link" oncommand="gContextMenu.copyLink();" accesskey="a" label="Copy Link Location">
 Not done (need more info) @Headbomb: see above, you mentioned a placeholder code, but need to see your proposed code (that should have already been tested elsewhere). Please provide then reactivate the edit request when ready. — xaosflux Talk 12:39, 10 June 2022 (UTC)[reply]
Yeah I don't know enough (see any) .js so it would fall to others to code that. Headbomb {t · c · p · b} 18:29, 10 June 2022 (UTC)[reply]

Does it work with Vector (2022) skin?

I ask because I cannot see it in my sidebar although it is enabled in my preferences Chidgk1 (talk) 06:53, 3 August 2022 (UTC)[reply]

Nope. Something seems to be missing for Vector 2022... But it should be an easy fix. An admin will need to update the gadget first. Specifically, change
if ( $.inArray( mw.config.get( 'skin' ), ['monobook', 'modern', 'vector', 'timeless'] ) !== -1 ) {

to

if ( $.inArray( mw.config.get( 'skin' ), ['monobook', 'modern', 'vector', 'vector-2022', 'timeless'] ) !== -1 ) {

Headbomb {t · c · p · b} 10:30, 3 August 2022 (UTC)[reply]

 Done, thanks. Writ Keeper  14:50, 4 August 2022 (UTC)[reply]

@Chidgk1: Try it now? Headbomb {t · c · p · b} 16:09, 4 August 2022 (UTC)[reply]

When adding Kalki refs via WP:VE, I will use {{cite journal}}, {{cite web}}, {{cite book}} or {{cite news}} since {{cite magazine}} cannot be normally added via VE. Once the edit is saved, the citation should be changed from whatever it is to cite magazine. Kailash29792 (talk) 15:55, 3 February 2023 (UTC)[reply]

how add gadget on kannada wiki

There are too many "date format errors in template". Mostly due to use of kannada numerals or arbitary use of date format in cite & infobox templates. If this can fix issues? I assume this requires some kind of admin rights. If not, how do i activate? రుద్రుడు (talk) 09:42, 15 March 2023 (UTC)[reply]

✓ added gadget to kannada wiki, date format error is separate issue.~aanzx © 15:37, 15 March 2023 (UTC)[reply]