<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="nl">
	<id>https://infvo.nl/basis/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3ATutorial-QuickRC.js</id>
	<title>MediaWiki:Tutorial-QuickRC.js - Bewerkingsoverzicht</title>
	<link rel="self" type="application/atom+xml" href="https://infvo.nl/basis/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3ATutorial-QuickRC.js"/>
	<link rel="alternate" type="text/html" href="https://infvo.nl/basis/index.php?title=MediaWiki:Tutorial-QuickRC.js&amp;action=history"/>
	<updated>2026-05-13T02:44:10Z</updated>
	<subtitle>Bewerkingsoverzicht voor deze pagina op de wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>https://infvo.nl/basis/index.php?title=MediaWiki:Tutorial-QuickRC.js&amp;diff=1058&amp;oldid=prev</id>
		<title>Eelco: Nieuwe pagina aangemaakt met &#039;/**  * Tutorial script: QuickRC (&quot;Quick Recent Changes&quot;)  *  * A tutorial user script which adds a &quot;Quick changelog&quot; link to the page skin&#039;s  * toolbox, and when cl...&#039;</title>
		<link rel="alternate" type="text/html" href="https://infvo.nl/basis/index.php?title=MediaWiki:Tutorial-QuickRC.js&amp;diff=1058&amp;oldid=prev"/>
		<updated>2019-12-21T09:10:13Z</updated>

		<summary type="html">&lt;p&gt;Nieuwe pagina aangemaakt met &amp;#039;/**  * Tutorial script: QuickRC (&amp;quot;Quick Recent Changes&amp;quot;)  *  * A tutorial user script which adds a &amp;quot;Quick changelog&amp;quot; link to the page skin&amp;#039;s  * toolbox, and when cl...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nieuwe pagina&lt;/b&gt;&lt;/p&gt;&lt;div&gt;/**&lt;br /&gt;
 * Tutorial script: QuickRC (&amp;quot;Quick Recent Changes&amp;quot;)&lt;br /&gt;
 *&lt;br /&gt;
 * A tutorial user script which adds a &amp;quot;Quick changelog&amp;quot; link to the page skin&amp;#039;s&lt;br /&gt;
 * toolbox, and when clicked it pops up a dialog with up to 25 recent edits.&lt;br /&gt;
 *&lt;br /&gt;
 * Demonstrates:&lt;br /&gt;
 * - Use of the API&lt;br /&gt;
 * - Use of jQuery&lt;br /&gt;
 * - Use of ResourceLoader and some of the default modules that come with it&lt;br /&gt;
 * - Use of localization&lt;br /&gt;
 *&lt;br /&gt;
 * (Be bold and improve it!)&lt;br /&gt;
 *&lt;br /&gt;
 * Authors:&lt;br /&gt;
 * Erik Moeller, 2011, public domain&lt;br /&gt;
 * Brion Vibber, 2012, public domain&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
messages = {&lt;br /&gt;
    &amp;#039;en&amp;#039;: {&lt;br /&gt;
        &amp;#039;quickchanges-title&amp;#039;: &amp;#039;Hello there!&amp;#039;,&lt;br /&gt;
        &amp;#039;quickchanges-greeting&amp;#039;: &amp;#039;Welcome, $1!&amp;#039;,&lt;br /&gt;
        &amp;#039;quickchanges-intro&amp;#039;: &amp;#039;The following pages have been recently modified:&amp;#039;,&lt;br /&gt;
        &amp;#039;quickchanges-link&amp;#039;: &amp;#039;Quick changelog&amp;#039;,&lt;br /&gt;
        &amp;#039;quickchanges-tooltip&amp;#039;: &amp;#039;Show a quick overview of changes&amp;#039;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;#039;fr&amp;#039;: {&lt;br /&gt;
        &amp;#039;quickchanges-title&amp;#039;: &amp;#039;Bonjour !&amp;#039;,&lt;br /&gt;
        &amp;#039;quickchanges-greeting&amp;#039;: &amp;#039;Bienvenue, $1!&amp;#039;,&lt;br /&gt;
        &amp;#039;quickchanges-intro&amp;#039;: &amp;#039;Ces pages ont été modifiées récemment :&amp;#039;,&lt;br /&gt;
        &amp;#039;quickchanges-link&amp;#039;: &amp;#039;Modifications récentes&amp;#039;&lt;br /&gt;
        // Leave tooltip out to demonstrate fallback behavior&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
mw.messages.set(messages[&amp;#039;en&amp;#039;]);&lt;br /&gt;
var lang = mw.config.get(&amp;#039;wgUserLanguage&amp;#039;);&lt;br /&gt;
if (lang &amp;amp;&amp;amp; lang != &amp;#039;en&amp;#039; &amp;amp;&amp;amp; lang in messages) {&lt;br /&gt;
    mw.messages.set(messages[lang]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Import the jQuery dialog plugin before starting the rest of this script&lt;br /&gt;
mw.loader.using([&amp;#039;jquery.ui&amp;#039;], function() {&lt;br /&gt;
&lt;br /&gt;
    function renderQuickRCDialog( pageLinks ) {&lt;br /&gt;
		var $dialog = $( &amp;#039;&amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&amp;#039; )&lt;br /&gt;
			.html(&lt;br /&gt;
				&amp;#039;&amp;lt;strong&amp;gt;&amp;#039; +&lt;br /&gt;
				mw.message(&amp;#039;quickchanges-greeting&amp;#039;, mw.user.getName()).escaped() +&lt;br /&gt;
				&amp;#039;&amp;lt;/strong&amp;gt; &amp;#039; +&lt;br /&gt;
				mw.message(&amp;#039;quickchanges-intro&amp;#039;).escaped() +&lt;br /&gt;
				&amp;#039;&amp;lt;br/&amp;gt;&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;&amp;#039; +&lt;br /&gt;
				pageLinks.join( &amp;#039;&amp;lt;br /&amp;gt;&amp;lt;li&amp;gt;&amp;#039; ) + &amp;#039;&amp;lt;/ul&amp;gt;&amp;#039;&lt;br /&gt;
			)&lt;br /&gt;
			.dialog({&lt;br /&gt;
				autoOpen: true,&lt;br /&gt;
				title: mw.message(&amp;#039;quickchanges-title&amp;#039;).plain(),&lt;br /&gt;
				width: &amp;#039;70%&amp;#039;,&lt;br /&gt;
				modal: true&lt;br /&gt;
			});&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	function quickRC() {&lt;br /&gt;
		var myPageLinks = [];&lt;br /&gt;
		var myTitles = [];&lt;br /&gt;
&lt;br /&gt;
		// Fetch recent changes from the API by one of jQuery&amp;#039;s AJAX functions&lt;br /&gt;
		jQuery.getJSON(&lt;br /&gt;
			mw.util.wikiScript( &amp;#039;api&amp;#039; ),&lt;br /&gt;
			{&lt;br /&gt;
				&amp;#039;format&amp;#039;: &amp;#039;json&amp;#039;,&lt;br /&gt;
				&amp;#039;action&amp;#039;: &amp;#039;query&amp;#039;,&lt;br /&gt;
				&amp;#039;list&amp;#039;: &amp;#039;recentchanges&amp;#039;,&lt;br /&gt;
				&amp;#039;rclimit&amp;#039; : 25&lt;br /&gt;
			},&lt;br /&gt;
			function( data ) {&lt;br /&gt;
&lt;br /&gt;
				// Build a unique array of links, using the mw.html library to format them.&lt;br /&gt;
				$.each ( data.query.recentchanges , function( index , rc ) {&lt;br /&gt;
					// Don&amp;#039;t link to this title if we&amp;#039;ve seen this title already&lt;br /&gt;
					if ( $.inArray( rc.title, myTitles ) === -1 ) {&lt;br /&gt;
						myPageLinks.push(&lt;br /&gt;
							mw.html.element(&lt;br /&gt;
								&amp;#039;a&amp;#039;, { href: mw.util.getUrl( rc.title ) }, rc.title&lt;br /&gt;
							)&lt;br /&gt;
						);&lt;br /&gt;
					}&lt;br /&gt;
&lt;br /&gt;
					myTitles.push( rc.title );&lt;br /&gt;
				} ) ;&lt;br /&gt;
&lt;br /&gt;
				renderQuickRCDialog( myPageLinks );&lt;br /&gt;
			}&lt;br /&gt;
		);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	$(document).ready( function() {&lt;br /&gt;
&lt;br /&gt;
		// Add a link to the toolbox&lt;br /&gt;
		var link = mw.util.addPortletLink(&lt;br /&gt;
			&amp;#039;p-tb&amp;#039;,&lt;br /&gt;
			&amp;#039;#&amp;#039;,&lt;br /&gt;
			mw.message(&amp;#039;quickchanges-link&amp;#039;).plain(),&lt;br /&gt;
			&amp;#039;t-prettylinkwidget&amp;#039;,&lt;br /&gt;
			mw.message(&amp;#039;quickchanges-tooltip&amp;#039;).plain(),&lt;br /&gt;
			&amp;#039;/&amp;#039;,&lt;br /&gt;
			&amp;#039;#t-whatlinkshere&amp;#039;&lt;br /&gt;
		);&lt;br /&gt;
&lt;br /&gt;
		// Create a jQuery object for this link so that we get&lt;br /&gt;
		// to use jQuery awesomeness like .click() for binding functions to events&lt;br /&gt;
		// and methods like e.preventDefault();&lt;br /&gt;
		$(link).click( function( e ) {&lt;br /&gt;
			// Avoid the browser going to &amp;#039;#&amp;#039;&lt;br /&gt;
			e.preventDefault();&lt;br /&gt;
&lt;br /&gt;
			// Initiate quickRC!&lt;br /&gt;
			quickRC();&lt;br /&gt;
		});&lt;br /&gt;
&lt;br /&gt;
	});&lt;br /&gt;
&lt;br /&gt;
});&lt;/div&gt;</summary>
		<author><name>Eelco</name></author>
	</entry>
</feed>