This page looks best with JavaScript enabled

Use cases for Extension:CustomLogs

 ·  ☕ 15 min read

At EMWCon 2019, I wrote my first MediaWiki extension, CustomLogs. Its purpose is to make configuration of new (“custom”) log types possible without needing to write any additional PHP code - instead all you need to do is configure a LocalSettings parameter and then edit some display pages in the MediaWiki namespace (though technically the second part is optional, as it’s just for i18n). Specific documentation is available at the extension repository linked earlier.

The general purpose of this extension is to allow JavaScript gadgets to write custom log types to your wiki, but why would this be useful? In this post I’ll go over a couple of the specific use cases on Leaguepedia. Both of these use cases are related to the gadget refreshOverview, whose current code I’ll include at the end of this post. The important thing to know about it is that it deals with cache management, which I previously wrote about last year.

(Note: All code in this post was originally written by me for Leaguepedia and is licensed under CC BY-SA 3.0.)

The ro-news log

A screenshot of the News RefreshOverview Discord webhook

The ro-news log is written to whenever someone refreshes cache for a news item (big surprise there). This generally correlates to someone adding a news item to the wiki, which in turn generally correlates to a news item happening, and so I’m able to generate a roughly real-time log of news.

Add a once-a-minute cron task on a server and a Discord webhook, and we have a channel announcing League of Legends news in semi-realtime! This could also create tweets, or post to anywhere that can listen to webhooks.

Normally, I’d now show you all of the code that does this, but since this is a use-cases post, I’ll hold off on that til the end, and instead move on to the next log type.

The ro-tournament log

The ro-tournament log is used for an entirely different purpose: cache updates! Woohoo! (Wait, isn’t that what RefreshOverview is for? Yes, but, this is for…even more cache updates!!!!)

You may remember last year I wrote a post about some of the complexities of caching on the wiki. Let’s just quickly go over this one. First, there’s the human input via a JavaScript gadget (RefreshOverview) which takes advantage PHP extension (CustomLogs) which writes to the ro-tournament log. I then have a crontab (does this count as bash?) running on a server listening, once an hour in this case, to run a Python script. So that’s three (or four) languages literally to make sure the most recent version of a page is updating. I cry.

(To be honest, it’s not at all surprising to me that cache management is this complicated, given how things are set up. But I still cry.)

Anyway, so. Why do I need this much hassle? Simply, there are too many cache updates that take too long to make the human wait for them to finish before turning the RefreshOverview button green and saying “ok, everything is good.” The overview page for several tournaments actually stores cargo, to the Standings table, in many cases; this requires not just a purge but a blank edit to update. The blank edit isn’t super important to happen in realtime, and it’s very slow (think 30 seconds rather than 5). There’s also several additional pages to purge cache of that can be done at the same time - low priority, will take a while to do, may as well delegate it to my crontab if I’m already putting this much machinery in place.

The ro-tournament log also helps us keep track that new editors are remembering to press the RO button when doing tournament data entry, which can sometimes be a problem; and it also gives editors an in-your-face reminder about this part of the editing process by showing up in recent changes constantly. (Both logs are helpful for this of course, but there are many more new editors updating tournaments than news.)

Conclusion

It’s always best to have as simple an infrastructure as you can, and “third-party” (i.e. off-wiki in this context) code is always going to complicate things. But often there’s no substitute - or at least no good one - for moving certain tasks off wiki, and CustomLogs can be a great, low-effort way to let cron events hook into your editors’ gadget tools, without needing to write a line of PHP.

Code

ro-news

First, here’s code for the ro-news webhook:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
with open('webhook_leona.txt') as f:
    webhook_url = f.read().strip()

webhook = DiscordWebhook(url=webhook_url)


def run(site: EsportsClient, logs):
    for log in logs:
        if log['type'] != 'ro-news':
            continue
        if 'custom-1' in log['params'].keys():
            send_event(log['params']['custom-1'], log['params']['custom-2'])


def send_event(text, team):
    embed = DiscordEmbed(
        title=team if team and team.strip() != "" else "News RefreshOverview",
        description=text
    )
    webhook.add_embed(embed)
    webhook.execute()

ro-tournament

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
def run(site: EsportsClient, logs):
    titles = []
    for log in logs:
        if log['type'] != 'ro-tournament':
            continue
        if 'custom-1' in log['params'].keys():
            title = log['params']['custom-1'].replace('Data:', '')
            if title not in titles:
                titles.append(title)
    suffixes = ['Match History', 'Champion Statistics', 'Player Statistics']
    for title in titles:
        # save the standings data saved on the page if any
        site.touch_title(title)
        for suffix in suffixes:
            site.purge_title('{}/{}'.format(title, suffix))

General crontab code

Here’s the code that executes each cron task. Shown is the per-fifteen minutes file, and there are separate, analogous files that run each minute or each hour. For example, while the ro-news webhook runs each minute, the ro-tournament log cache-update script runs hourly.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
from cron_tasks import CronTasks
import tasks.ro_news_webhook as ro_news
import tasks.move_blank_edit as move
import tasks.patrol_namespaces as patrol
import tasks.sprites_cachebreak as sprites_cachebreak

if __name__ == '__main__':
    tasks = CronTasks(
        interval=1,
        wikis=['lol', 'cod-esports', 'valorant-esports',
               'fifa-esports', 'gears-esports', 'halo-esports', 'fortnite-esports']
    )
    tasks.run_plain(sprites_cachebreak.run,
                    ['lol', 'cod-esports', 'valorant-esports', 'fifa-esports',
                     'gears-esports', 'halo-esports', 'fortnite-esports'])
    tasks.run_logs(move.run, ['lol', 'valorant-esports'])
    tasks.run_logs(ro_news.run, ['lol'])
    tasks.run_revs(patrol.run, ['lol', 'cod-esports', 'valorant-esports'])

And here’s cron_tasks.py:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
from river_mwclient.esports_client import EsportsClient
from river_mwclient.auth_credentials import AuthCredentials


class CronTasks(object):
    """Handles scheduling cron tasks that run based on sites' revisions and/or logs

    Initialize with number of minutes and set of wikis to create lists for, then
    run the tasks that you want run with run_logs or run_revs.
    Does NOT support running code that requires seeing both - in cases like that, separate
    the functionality into 2 separate functions.
    The set of wikis you run each individual task on will often be a subset of the total
    set of wikis, so re-specify that for each function defined.
    Use one file per interval because that's convenient for cron scheduling.
    """

    def __init__(self, interval=1, wikis=None):
        self.all_wikis = wikis
        self.all_sites = {}
        self.all_revs = {}
        self.all_logs = {}
        self.all_titles = {}
        for wiki in self.all_wikis:
            credentials = AuthCredentials(user_file="me")
            site = EsportsClient(wiki, credentials=credentials)  # Set wiki
            revs_gen = site.recentchanges_by_interval(interval)
            revs = [_ for _ in revs_gen]
            self.all_titles[wiki] = []
            for rev in revs:
                if rev['title'] not in self.all_titles[wiki]:
                    self.all_titles[wiki].append(rev['title'])
            logs = site.logs_by_interval(interval)
            self.all_sites[wiki] = site
            self.all_revs[wiki] = revs
            self.all_logs[wiki] = logs

    def run_logs(self, fn, wikis, **kwargs):
        self._run_data(fn, wikis, self.all_logs, **kwargs)

    def run_revs(self, fn, wikis, **kwargs):
        self._run_data(fn, wikis, self.all_revs, **kwargs)

    def run_titles(self, fn, wikis, **kwargs):
        self._run_data(fn, wikis, self.all_titles, **kwargs)

    def _run_data(self, fn, wikis, data, **kwargs):
        if wikis is None:
            return
        for wiki in wikis:
            site = self.all_sites[wiki]
            try:
                fn(site, data[wiki], **kwargs)
            except Exception as e:
                site.log_error_script(error=e)
            site.report_all_errors('Cron Errors (%s)' % fn.__module__)

    def run_plain(self, fn, wikis, **kwargs):
        if wikis is None:
            return
        for wiki in wikis:
            site = self.all_sites[wiki]
            try:
                fn(site, **kwargs)
            except Exception as e:
                site.log_error_script(error=e)
            site.report_all_errors('Cron Errors (%s)' % fn.__module__)

Really, my crontab code alone could be a relatively involved post of its own, but I wrote it a very, very long time ago and would prefer to refactor it pretty significantly first - each individual task should be subclassing a CronTask class, and the class that executes should be called something like CronTaskManager instead. But…it works right now….

RefreshOverview

Finally, as promised, here’s the current version of refreshOverview.js:

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
// <nowiki>
$(function () {	
	var dataDiv = document.getElementById('data-ns-pageinfo');
	if (! dataDiv) return;
	var $dataDiv = $(dataDiv);
	var overviewPage = $dataDiv.attr('data-overviewpage');
	// add refresh data link
	$(mw.util.addPortletLink('p-views', 'javascript:;', 'Refresh Overview', 'ca-refresh-overview', 'Refresh event overview page', '2')).click(function() {
		$('body').css('cursor', 'wait');
		var a = new mw.Api();
		
		function getWikitextFromTemplateAndSave() {
			if (! flPages.length ) return $.Deferred().resolve();
			var thisFlPage = flPages.pop();
			var thisFlTemplate = flTemplates.pop();
			console.log(thisFlPage);
			return a.postWithToken('csrf',{
				action : 'expandtemplates',
				prop : 'wikitext',
				text : '{{' + thisFlTemplate + '}}'
			}).then(function(data) {
				saveWikitext(data.expandtemplates.wikitext, thisFlPage);
			}, raiseError).then(getWikitextFromTemplateAndSave);
		}
		
		function saveWikitext(wikitext, thisFlPage) {
			if (! wikitext) {
				console.log('wikitext was empty');
				return $.Deferred().resolve();
			}
			console.log('saving wikitext...');
			return a.postWithToken('csrf',{
				action : 'edit',
				title : thisFlPage,
				text : wikitext,
				summary : 'Auto update via Refresh Overview',
				tags: 'refresh_overview'
			}).then(function(data) {
				console.log('saved wikitext to ' + thisFlPage);
			}, raiseError);
		}
		
		// update pickban
		function getPBData() {
			if (! $dataDiv.attr('data-pickban')) return $.Deferred().resolve();
			console.log('Fetching Pick/Ban Data...');
			return a.get({
				action : 'parse',
				text : '{{' + '#invoke:PickBanScore|main|page=' + overviewPage + '}}',
				prop : 'text'
			}).then(function(data) {
				var str = data.parse.text['*'];
				if (str.includes('Lua error')) {
					window.reportError("Error updating pick-ban, it's likely that the order doesn't match the MatchSchedule!");
					return $.Deferred().reject();
				}
				console.log(str);
				var tbl1 = str.split('*****');
				str = tbl1[1];
				console.log(str);
				var tbl = str.split(';');
				for (game in tbl) {
					tbl[game] = tbl[game].split(',');
				}
				return tbl;
			});
		}
		
		function updatePB(tbl) {
			console.log('updatepb');
			if (! tbl || tbl.length == 0 || tbl[0] == '') {
				console.log('No PB to update');
				return $.Deferred().resolve();
			}
			var game = tbl.shift();
			var page = game[0];
			var templatesToChange = [ makeGameDict(game) ];
			while (tbl.length > 0 && tbl[0][0] == page) {
				templatesToChange.push(makeGameDict(tbl.shift()));
			}
			return a.get({
				action : 'query',
				prop : 'revisions',
				titles : page,
				rvprop : 'content'
			}).then(function(data) {
				var content;
				for (p in data.query.pages) {
					content = data.query.pages[p].revisions[0]["*"];
				}
				var listOfTemplates = content.split(/\{\{PicksAndBans(?!\/)/);
				for (i in templatesToChange) {
					var thisgame = templatesToChange[i];
					// don't have to offset by 1 because the first one (0) is before any template
					var template = listOfTemplates[thisgame.N];
					template = template.replace(/\|team1score=\s*\|/, '|team1score=' + thisgame.score1 + ' |')
					template = template.replace(/\|team2score=\s*\|/, '|team2score=' + thisgame.score2 + ' |')
					template = template.replace(/\|winner=(\s*)\|/,'|winner=' + thisgame.winner + ' $1|');
					listOfTemplates[thisgame.N] = template;
					if (thisgame.bestof && thisgame.serieswinner) {
						deleteExtraGames(listOfTemplates, thisgame);
					}
				}
				
				var text = listOfTemplates.join('{{PicksAndBans');
				text = text.replace(/\{\{PicksAndBansDELETE/g,'<!-- -->');
				return a.postWithToken('csrf', {
					action : 'edit',
					title : page,
					text : text,
					summary : 'Updating pick-ban results via RefreshOverview',
					tags: 'refresh_overview'
				}).then(function(data) {
					if (tbl.length == 0) {
						return window.purgeTitle(overviewPage + '/Picks and Bans');
					}
					return updatePB(tbl);
				}, raiseError);
			}, raiseError);
		}
		
		function raiseError(code, data) {
			console.log(data);
			statuscolor = 'gadget-action-fail';
			$('body').css('cursor', '');
			return $.Deferred().reject(code);
		}
		
		function makeGameDict(game) {
			return {
				N : parseInt(game[1]),
				score1 : game[2],
				score2 : game[3],
				winner : game[4],
				bestof : parseInt(game[5]),
				serieswinner : parseInt(game[6])
			}
		}
		
		function deleteExtraGames(listOfTemplates, thisgame) {
			var score1 = parseInt(thisgame.score1);
			var score2 = parseInt(thisgame.score2);
			score1 = score1 ? score1 : 0;
			score2 = score2 ? score2 : 0;
			if (Math.max(score1, score2) > thisgame.bestof / 2) {
				for (j = 1; j <= thisgame.bestof - score1 - score2; j++) {
					var indexToDelete = thisgame.N + j;
					var templateToDelete = listOfTemplates[indexToDelete];
					if (templateToDelete && templateToDelete.match(/game1\s*=\s*Yes/i)) {
						console.log("Won't delete " + indexToDelete + " because it contains a game 1");
					}
					else if (templateToDelete) {
						console.log('Will delete ' + indexToDelete);
						templateToDelete = templateToDelete.replace(/[^\}]*\}\}/,'DELETE');
						listOfTemplates[indexToDelete] = templateToDelete;
					}
					else {
						console.log('Extra games were already deleted');
					}
				}
			}
		}
		
		// timeline update
		function updateTimeline() {
			if (! $dataDiv.attr('data-timeline')) return $.Deferred().resolve();
			console.log('checking timeline...');
			return getWikitext(overviewPage)
			.then(updateWikitextWithTimeline)
			.then(function(newtext) {
				if (! newtext) return $.Deferred().resolve();
				return new mw.Api().postWithToken('csrf', {
					action : 'edit',
					title : overviewPage,
					text : newtext,
					summary : 'Auto update via Refresh Overview',
					tags : 'refresh_overview'
				});
			});
		}
		
		function updateWikitextWithTimeline(wikitext) {
			console.log('getting timeline args...');
			if (! wikitext.includes('AutoTimeline') || ! wikitext.includes('AutoStandings')) return $.Deferred().resolve();
			console.log('timeline can be checked');
			function getAllMatches(str, regex) {
				try {
					return Array.from(str.matchAll(regex)).map(function(m) { return m[1]; });
				}
				catch (e) {
					alert('Please use the latest version of Firefox or Chrome to support str.matchAll.');
					console.error('matchAll not supported by this browser version');
				}
			}
			var standingsTemplates = getAllMatches(wikitext, /AutoStandings((?:.|\n)+?)\}\}/g);
			var timelineTemplates = getAllMatches(wikitext, /(AutoTimeline(?:.|\n)+?)\}\}/g);
			var appendTemplates = standingsTemplates.map(function(tl) {
				// require that the row has a non-empty value (but it might be padded by a space at the start)
				return getAllMatches(tl, /(\|row\d+=(?:.*[^ \n]+))/g);
			});
			console.log(standingsTemplates.length);
			console.log("standingsTemplates.length");
			if (standingsTemplates.length != timelineTemplates.length) {
				window.reportError('Number of standings templates doesn\'t match number of timeline templates!');
				return $.Deferred().reject();
			}
			return a.get({
				action : 'cargoquery',
				tables : 'MatchSchedule',
				where : 'OverviewPage="' + overviewPage + '" AND Winner IS NOT NULL AND IsTiebreaker != "1"',
				fields : 'Tab',
				group_by : 'N_Page, N_TabInPage'
			}).then(function(data) {
				console.log(data.cargoquery.length + ' tabs counted');
				var repl = 'w' + data.cargoquery.length + 'bg';
				var old_data_re = new RegExp('\\|' + repl + '[^\|\n]*\n', 'g');
				var newtext = wikitext;
				for (i in appendTemplates) {
					var rows = appendTemplates[i].map(function(row) { return row.replace('row', repl); });
					var newText = rows.join('\n');
					var newTimeline = timelineTemplates[i].replace(old_data_re, '');
					console.log(newTimeline);
					if (newText != '') {
						newTimeline = newTimeline.replace('AutoTimeline', 'AutoTimeline\n' + newText);
					}
					console.log(newTimeline);
					newtext = newtext.replace(timelineTemplates[i], newTimeline);
				}
				if (newtext == wikitext) return false;
				alert('Updating timeline, might take some time to finish');
				return newtext;
			});
		}
		
		function logAction() {
			console.log('writing custom log...');
			return new mw.Api().postWithToken('csrf', {
				action: 'customlogswrite',
				logtype: 'ro-tournament',
				title: mw.config.get('wgPageName'),
				publish: 1,
				'custom-1': overviewPage,
			});
		}
		
		clearDisplayColor('ca-refresh-overview');
		// make sure to include : before the template name in the attr if needed
		var flTemplates = $dataDiv.attr('data-template-link') ? $dataDiv.attr('data-template-link').split(',') :[];
		var flPages = $dataDiv.attr('data-page-link') ? $dataDiv.attr('data-page-link').split(',') : [];
		var pagesToPurge = $dataDiv.attr('data-extra-purges') ? $dataDiv.attr('data-extra-purges').split(',') : [];
		pagesToPurge.unshift(overviewPage);
		var statuscolor = 'gadget-action-success';
		window.purgeAll(pagesToPurge)
		//.then(window.blankEdit)
		.then(getWikitextFromTemplateAndSave)
		.then(getPBData)
		.then(updatePB)
		.then(updateTimeline)
		.then(logAction)
		.then(function() {
			console.log('Done!');
			$('body').css('cursor', '');
			displayColor(statuscolor, 'ca-refresh-overview');
		})
		['catch'](function(code) {
			console.log('failed rip');
			if (code) console.log(code);
			$('body').css('cursor', '');
			displayColor(statuscolor, 'ca-refresh-overview');
		});
	});
	
});

$(function() {
	
	var i18n = {
		confirm_not_rumor_resolve: 'Are you sure? This was a "not happening" rumor.'
	}
	
	function pageToDisplay(page) {
		return '<input type="checkbox" name="' + page + '"> ' + page.replace(/.*\/(.*?)$/, '$1');
	}
	
	function getAllRegions() {
		if (! $('#current-portal-list')) return [];
		var list = $('#current-portal-list').attr('data-current-portals');
		if (list == '' || ! list) return [];
		return list.split(',');
	}
	
	function getRegionsText() {
		var buttonList = getAllRegions().map(pageToDisplay);
		if (! buttonList.length) return '';
		return buttonList.join('<br>') + '<br>';
	}
	
	function refreshNewsDataPages(e) {
		e.preventDefault();
		e.stopPropagation();
		var $container = $(this).closest('.news-data-ro');
		var $inner = $(this).closest('.popup-content-inner-action');
		
		// get list of pages to touch
		var pageListTouch = [];
		if ($container.attr('data-to-touch')) {
			pageListTouch = $container.attr('data-to-touch').split(',')
		}
		var touches = pageListTouch.map(window.blankEdit);
		
		// construct full list of pages to purge
		var pageListPurge = $container.attr('data-to-refresh').split(',');
		$container.find('input').each(function() {
			if (this.checked) {
				pageListPurge.push($(this).attr('name'));
				pageListPurge.push($(this).attr('name') + '/Current Rosters');
			}
		});
		var purges = pageListPurge.map(window.purgeTitle);
		
		
		return Promise.all(touches).then(function() {
			return Promise.all(purges);
		}).then(function() {
			return new mw.Api().postWithToken('csrf', {
				action: 'customlogswrite',
				logtype: 'ro-news',
				title: mw.config.get('wgPageName'),
				publish: 1,
				'custom-1': $inner.closest('.news-data-sentence-div').find('.news-data-sentence-wrapper').text(),
				'custom-2': $container.attr('data-ro-team')
			});
		}).then(function() {
			console.log(pageListTouch);
			console.log(pageListPurge);
			console.log('done!');
			displayResultStatus('gadget-action-success', $inner);
		});
	}
	
	$('.news-data-ro').off('click');
	$('.roster-change-data .news-data-ro').click(function(e) {
		e.stopPropagation();
		var $inner = $(this).find('.popup-content-inner-action');
		$inner.click(function(e) { e.stopPropagation(); });
		$inner.html(getRegionsText() + '<button class="submit-ro">RO!</button>');
		$inner.find('.submit-ro').click(refreshNewsDataPages);
		$(this).off('click');
		$(this).click(window.popupButton);
		
		window.popupButton.bind(this)(e);
	});
	
	$('.rumor-data .news-data-ro').click(function(e) {
		e.stopPropagation();
		var $inner = $(this).find('.popup-content-inner-action');
		$inner.click(function(e) { e.stopPropagation(); });
		$inner.html('<button class="submit-ro">RO!</button>');
		$inner.find('.submit-ro').click(function(e) {
			var $button = $(this).closest('.news-data-ro');
			e.stopPropagation();
			e.preventDefault();
			if (
				$button.attr('data-is-no') == 'true' &&
				$button.attr('data-is-over') == 'true' &&
				! confirm(i18n.confirm_not_rumor_resolve)
			) {
				return;
			}
			else {
				refreshNewsDataPages.bind(this)(e);
			}
		});
		$(this).off('click');
		$(this).click(window.popupButton);
		
		window.popupButton.bind(this)(e);
	});
	
	$('.team-members-refresh').click(function(e) {
		e.stopPropagation();
		window.startSpinnerChild(this);
		return window.blankEdit($(this).attr('data-player'))
			.then(function() {
				return window.purgeTitle().then(function() {
					if (confirm('Player refreshed! Would you like to reload?')) {
						location.reload();
					}
					else {
						window.endSpinner();
					}
					return;
				});
			});
	});
});
// </nowiki>
Share on

river
WRITTEN BY
River
River (RheingoldRiver) is a MediaWiki developer and the manager of Leaguepedia. She likes cats.


What's on this Page