From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.

/** <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: 'timestamp', 'user', 'parsedcomment', 'ids'

			}).done(function(data) {

				var pages = data.query.pages;

				for (var id in pages) {

					var rev = pagesid].revisions0];

					var row = $('<tr></tr>').appendTo(table);

					row.append('<td><a href="/wiki/'+pagesid].title+'?action=raw">'+pagesid].title+'</a></td>')

					   .append('<td><a href="/wiki/User:'+rev.user+'">'+rev.user+'</a></td>')

					   .append('<td><a href="/?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/?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.i18nlang]);

			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) {

				missingc = [];

				for (var msg in JWB.messages.en) {

					if (JWB.messagesc][msg === undefined) {

						missingc].push(msg);

					}

				}

				if (missingc].length === 0) continue;

				langtbl.append('<tr><td rowspan="'+missingc].length+'"><code><a href="/wiki/User:Joeytje50/JWB.js/i18n-'+c+'.js">'+c+'</a></code></td>' + missingc].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.encur + '</td></tr>';

				}, '')); // initialValue = '' to start off with an empty string.

			}

			feed.append(langtbl);

		});

	});

}
From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.

/** <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: 'timestamp', 'user', 'parsedcomment', 'ids'

			}).done(function(data) {

				var pages = data.query.pages;

				for (var id in pages) {

					var rev = pagesid].revisions0];

					var row = $('<tr></tr>').appendTo(table);

					row.append('<td><a href="/wiki/'+pagesid].title+'?action=raw">'+pagesid].title+'</a></td>')

					   .append('<td><a href="/wiki/User:'+rev.user+'">'+rev.user+'</a></td>')

					   .append('<td><a href="/?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/?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.i18nlang]);

			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) {

				missingc = [];

				for (var msg in JWB.messages.en) {

					if (JWB.messagesc][msg === undefined) {

						missingc].push(msg);

					}

				}

				if (missingc].length === 0) continue;

				langtbl.append('<tr><td rowspan="'+missingc].length+'"><code><a href="/wiki/User:Joeytje50/JWB.js/i18n-'+c+'.js">'+c+'</a></code></td>' + missingc].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.encur + '</td></tr>';

				}, '')); // initialValue = '' to start off with an empty string.

			}

			feed.append(langtbl);

		});

	});

}

Videos

Youtube | Vimeo | Bing

Websites

Google | Yahoo | Bing

Encyclopedia

Google | Yahoo | Bing

Facebook