Jump to content

MediaWiki talk:Gadget-geonotice-core.js

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Protected edit request on 6 October 2018

[edit]

Please replace the UK20180930 entry with the following:

UK20181006: /* last 8 chars of ID is date of last amendment in CCYYMMDD format - change this if making major amendment or adding a meetup; leave alone if minor amendment or removing a meetup */ {
  begin: '5 October 2018 17:00 UTC', /* yesterday's date - amend only if the ID was altered */
  end: '21 October 2018 17:00 UTC', /* set this to date of last meetup shown */
  country: 'GB',
  text: 'Interested in having a chat with fellow Wikipedians? There are forthcoming meetups in: [[m:Meetup/London/135|London, 14 October]]; and [[m:Meetup/Oxford/66|Oxford, 21 October]]!' /* try to limit this to four meetups, no more than one per town/city, and no more than four weeks in advance; shorten month names to three letters if four meetups are shown */
},

Thanks. --Redrose64 🌹 (talk) 16:22, 6 October 2018 (UTC)[reply]

Any particular reason I'm pulling the still active one?—CYBERPOWER (Chat) 16:48, 6 October 2018 (UTC)[reply]
Because I don't want two banners both for the same geographic area and both linking London, 14 October. --Redrose64 🌹 (talk) 20:29, 6 October 2018 (UTC)[reply]
 Done I didn't notice that the content was identical to what was already there. :p—CYBERPOWER (Chat) 21:05, 6 October 2018 (UTC)[reply]
It's not completely identical. Oxford, 21 October is added, two dates amended (one of which was, strictly speaking, unnecessary because it's a past date) and the ID is updated so that it redisplays to those who have already dismissed it. --Redrose64 🌹 (talk) 21:38, 6 October 2018 (UTC)[reply]
Close enough.—CYBERPOWER (Chat) 00:51, 7 October 2018 (UTC)[reply]

London is past

[edit]

please amend the string 'Interested in having a chat with fellow Wikipedians? There are forthcoming meetups in: London, 14 October; and Oxford, 21 October!' to read 'Interested in having a chat with fellow Wikipedians? There is a forthcoming meetup in: Oxford, 21 October!' leaving everything else alone. --Redrose64 🌹 (talk) 20:20, 14 October 2018 (UTC)[reply]

 DoneCYBERPOWER (Chat) 20:42, 14 October 2018 (UTC)[reply]

Protected edit request on 4 November 2018

[edit]

Please add the following entry:

UK20181104: /* last 8 chars of ID is date of last amendment in CCYYMMDD format - change this if making major amendment or adding a meetup; leave alone if minor amendment or removing a meetup */ {
  begin: '3 November 2018 17:00 UTC', /* yesterday's date - amend only if the ID was altered */
  end: '18 November 2018 17:00 UTC', /* set this to date of last meetup shown */
  country: 'GB',
  text: 'Interested in having a chat with fellow Wikipedians? There are forthcoming meetups in: [[m:Meetup/London/136|London, 11 November]]; [[m:Meetup/Oxford/66|Oxford, 18 November]]!' /* try to limit this to four meetups, no more than one per town/city, and no more than four weeks in advance; shorten month names to three letters if four meetups are shown */
},

Thanks. --Redrose64 🌹 (talk) 13:31, 4 November 2018 (UTC)[reply]

 Done ~ Amory (utc) 19:22, 4 November 2018 (UTC)[reply]

convert to use json

[edit]

Seems like phab:T198758 has been delivered, anyone want to work on updating this gadget to use that JSON page directly so we can stop relying on a bot copy job? — xaosflux Talk 15:11, 17 January 2022 (UTC)[reply]

  1. Move Wikipedia:Geonotice/list.json to MediaWiki:Gadget-geonotice-list.json
  2. Soft redirect MediaWiki:Gadget-geonotice-list.js and Wikipedia:Geonotice/list.json to MediaWiki:Gadget-geonotice-list.json.
  3. Copy contents of the geonotices list to the json list, but remove the comments (not allowed in json) and
  4. Make this edit to MediaWiki:Gadget-geonotice-core.js.
  5. Modify MediaWiki:Gadgets-definition to look like:
    geonotice-core[ResourceLoader|dependencies=mediawiki.util,mediawiki.storage|package]|geonotice-list.json|geonotice-core.js|geonotice-core.css
    
    That should do it. —TheDJ (talkcontribs) 19:14, 18 January 2022 (UTC)[reply]
@TheDJ: thank you for the steps, in #3 above I'm missing why this is needed? Is that in case Wikipedia:Geonotice/list.json is out of sync while all the change is being processed? — xaosflux Talk 23:57, 18 January 2022 (UTC)[reply]
Note that the bot converts wikitext in the current JSON page to HTML (using the API) while moving it, so the transition is not that straightforward. The gadget needs to be edited so that it uses mw.jQueryMsg to parse the wikitext (it could also use the API – but that would slow down rendering). Courtesy pinging the bot operator: @MusikAnimal. – SD0001 (talk) 04:38, 19 January 2022 (UTC)[reply]
My hope was that we'd have the gadget do all the work. The bot also did some validations such as the country code, coordinates and dates. Since the bot first went live, it looks like there were only two erroneous edits to the configuration [1][2] so this validation logic may not be worth porting to the gadget (and logging with mw.log.warn() for example).
I will be very busy for the next two weeks or so, but whenever the time comes please feel free to disable the task at User:MusikBot II/GeonoticeSync/Run. Thanks to all, and especially to SD0001 for making JSON behind ResourceLoader a reality! MusikAnimal talk 05:33, 19 January 2022 (UTC)[reply]
This can also just be directions to the admins updating the json page. The gadget should likely do some input validation on that data too. — xaosflux Talk 23:11, 19 January 2022 (UTC)[reply]