_ _    _ _____  ___   __                       
 __      _(_) | _(_)___ / ( _ ) / /_   ___ ___  _ __ ___  
 \ \ /\ / / | |/ / | |_ \ / _ \| '_ \ / __/ _ \| '_ ` _ \ 
  \ V  V /| |   <| |___) | (_) | (_) | (_| (_) | | | | | |
   \_/\_/ |_|_|\_\_|____/ \___/ \___(_)___\___/|_| |_| |_|

User:Joeytje50/JWB/feed.js

In the following article, we will explore in detail User:Joeytje50/JWB/feed.js, a topic of great relevance and interest in today's society. Over the years, User:Joeytje50/JWB/feed.js has captured the attention of academics, professionals and the general public, generating multiple debates and reflections around its importance, implications and possible solutions. From various approaches and perspectives, we will examine the different facets of User:Joeytje50/JWB/feed.js, providing an in-depth and critical analysis that will expand our knowledge and understanding of this topic. Without a doubt, User:Joeytje50/JWB/feed.js plays a fundamental role in various aspects of daily life, so it is essential to address it with rigor and seriousness to contribute to the debate and collective reflection.
/** <nowiki>This script generates a list of most recent edits for each of the relevant pages for JWB.
 * This is used to check most recent changes, and whether the git repo needs updating.
 * The git repo is located at https://github.com/Joeytje50/JWB.
 * If you want to use this script as well (idk why but okay), you can install it using:

{{subst:lusc|User:Joeytje50/JWB.js/load.js}}

 * This script is not a subpage of JWB.js because it doesn't affect the actual JWB script itself.
 * </nowiki>
 */
 
if (mw.config.get('wgPageName') === 'User:Joeytje50/JWB') {
	window.JWB = {
		imports: {i18n: {}},
		messages: {},
	};
	$(function() {
		var feed = $('#JWB-feed');
		function getJWBFeed() {
			feed.closest('table').show();
			feed.html('<table class="wikitable"><caption style="cursor:pointer;">JWB recent changes</caption><tr><th>Title</th><th>User</th><th>Date</th><th>Summary</th></tr></table>');
			var table = feed.find('table.wikitable')
							.append('<tr><th colspan="10"><a href="https://github.com/Joeytje50/JWB" target="_blank">Github repo</a></th></tr>');
			var api = new mw.Api();
			api.get({
				action: 'query',
				prop: 'revisions',
				format: 'json',
				titles: ['User:Joeytje50/JWB',
					'User:Joeytje50/JWB/Changelog',
					'User:Joeytje50/JWB.js',
					'User:Joeytje50/JWB.css',
					'User:Joeytje50/JWB.js/load.js',
					'User:Joeytje50/JWB.js/i18n.js',
					'User:Joeytje50/JWB.js/worker.js',
					'User:Joeytje50/RETF.js',
					'User:Joeytje50/RETF'],
				rvprop: 
			}).done(function(data) {
				var pages = data.query.pages;
				for (var id in pages) {
					var rev = pages.revisions;
					var row = $('<tr></tr>').appendTo(table);
					row.append('<td><a href="https://wiki386.com/en/'+pages.title+'?action=raw">'+pages.title+'</a></td>')
					   .append('<td><a href="https://wiki386.com/en/User:'+rev.user+'">'+rev.user+'</a></td>')
					   .append('<td><a href="/w/index.php?diff='+rev.revid+'">'+(new Date(rev.timestamp)).toLocaleDateString("en-US", { year: 'numeric', month: 'long', day: 'numeric' })+'</a></td>')
					   .append('<td>'+rev.parsedcomment+'</td>');
				}
			});
		}
		getJWBFeed();
		table.find('caption').attr('title', 'Refresh').click(getJWBFeed);
	});
	$.getScript('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/i18n.js&action=raw&ctype=text/javascript', function() {
		var langs = ;
		var codes = ;
		for (let lang in JWB.imports.i18n) {
			langs.push(JWB.imports.i18n);
			codes.push(lang);
		}
		$.when.apply($, langs.map(url => $.getScript(url))).done(function() {
			// loaded all i18n files. Check which messages are missing.
			var feed = $('#JWB-feed');
			var langtbl = $('<table class="wikitable"><tr><th>Code</th><th colspan="2">Missing messages</th></tr></table>');
			var missing = {};
			for (var c of codes) {
				missing = ;
				for (var msg in JWB.messages.en) {
					if (JWB.messages === undefined) {
						missing.push(msg);
					}
				}
				if (missing.length === 0) continue;
				langtbl.append('<tr><td rowspan="'+missing.length+'"><code><a href="https://wiki386.com/en/User:Joeytje50/JWB.js/i18n-'+c+'.js">'+c+'</a></code></td>' + missing.reduce((acc, cur) => {
					if (acc.length) { // don't open a new <tr> if this is the first missing message.
						acc += '<tr>';
					}
					return acc + '<td><code>' + cur + '</code></td><td>' + JWB.messages.en + '</td></tr>';
				}, '')); // initialValue = '' to start off with an empty string.
			}
			feed.append(langtbl);
		});
	});
}