User talk:Samwilson/CiteTool.js

From Wikidata
Jump to navigation Jump to search

Looking at User:Premeditated/CiteTool.js, the only difference seems to be the addition of this author name string (P2093) support:

            if ( key === 'author' ) {
                for ( var author of val ) {
                	lv.addItem( self.getStringValueSnak( 'P2093', author.join(' ') ) );
                    addedSnakItem = true;
                }
                return;
            }

Is that something we could upstream? @Samwilson, Premeditated: Jean-Fred (talk) 13:08, 27 October 2022 (UTC)[reply]

@Jean-Frédéric, Premeditated: Definitely! This is a good idea, I'll add it in here. Sam Wilson 05:55, 30 October 2022 (UTC)[reply]
@Jean-Frédéric, Premeditated: Done! See what you think. Sam Wilson 07:18, 30 October 2022 (UTC)[reply]
@Samwilson: Nice, I will also recommend to add a .trim() for the string. As sometimes there are some unfortunate spaces from the API data. - Premeditated (talk) 08:31, 1 November 2022 (UTC)[reply]
@Premeditated: Ah, good point. You mean for the individual author components? e.g. it should be author.map( function( a ){ return a.trim(); } ).join( ' ' );? Sam Wilson 08:49, 1 November 2022 (UTC)[reply]
Done. Sam Wilson 01:39, 2 November 2022 (UTC)[reply]
There is now, thanks to User:Nikki, the gadget MediaWiki:Gadget-CiteTool.js. Jean-Fred (talk) 13:05, 23 December 2022 (UTC)[reply]