<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mbwiki.stairwaygames.work/w/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3AGadgets%2FmpEditLinks%2Fmain.js</id>
	<title>MediaWiki:Gadgets/mpEditLinks/main.js - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mbwiki.stairwaygames.work/w/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3AGadgets%2FmpEditLinks%2Fmain.js"/>
	<link rel="alternate" type="text/html" href="https://mbwiki.stairwaygames.work/w/index.php?title=MediaWiki:Gadgets/mpEditLinks/main.js&amp;action=history"/>
	<updated>2026-04-06T19:34:20Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://mbwiki.stairwaygames.work/w/index.php?title=MediaWiki:Gadgets/mpEditLinks/main.js&amp;diff=27396&amp;oldid=prev</id>
		<title>Ais: Created page with &quot;$.when( $.ready ) .then(function(){  	if(!document.getElementById(&#039;mp-container&#039;)) return; /* page is not using IMP */ 	if(!mw.config.get(&#039;wgIsProbablyEditable&#039;)) return; /* user does not have permission to edit the page */ 	 	var rootpage = document.getElementById(&#039;mp-container&#039;).dataset[&#039;rootpage&#039;]; // Get the rootpage passed from the main page module, so we don&#039;t need to make an API call  	/* generate the links here instead of in the wikitext, so that users who can&#039;t...&quot;</title>
		<link rel="alternate" type="text/html" href="https://mbwiki.stairwaygames.work/w/index.php?title=MediaWiki:Gadgets/mpEditLinks/main.js&amp;diff=27396&amp;oldid=prev"/>
		<updated>2025-12-10T07:48:55Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;$.when( $.ready ) .then(function(){  	if(!document.getElementById(&amp;#039;mp-container&amp;#039;)) return; &lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;page is not using IMP: &lt;/span&gt; 	if(!mw.config.get(&amp;#039;wgIsProbablyEditable&amp;#039;)) return; &lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;user does not have permission to edit the page: &lt;/span&gt; 	 	var rootpage = document.getElementById(&amp;#039;mp-container&amp;#039;).dataset[&amp;#039;rootpage&amp;#039;]; // Get the rootpage passed from the main page module, so we don&amp;#039;t need to make an API call  	/* generate the links here instead of in the wikitext, so that users who can&amp;#039;t...&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;$.when( $.ready )&lt;br /&gt;
.then(function(){&lt;br /&gt;
&lt;br /&gt;
	if(!document.getElementById(&amp;#039;mp-container&amp;#039;)) return; /* page is not using IMP */&lt;br /&gt;
	if(!mw.config.get(&amp;#039;wgIsProbablyEditable&amp;#039;)) return; /* user does not have permission to edit the page */&lt;br /&gt;
	&lt;br /&gt;
	var rootpage = document.getElementById(&amp;#039;mp-container&amp;#039;).dataset[&amp;#039;rootpage&amp;#039;]; // Get the rootpage passed from the main page module, so we don&amp;#039;t need to make an API call&lt;br /&gt;
&lt;br /&gt;
	/* generate the links here instead of in the wikitext, so that users who can&amp;#039;t see them don&amp;#039;t have them&lt;br /&gt;
	* in the DOM at all, and screenreaders and search engines don&amp;#039;t get confused */&lt;br /&gt;
	function createLinks(){&lt;br /&gt;
		$(&amp;#039;.mp-box&amp;#039;).each(function(_, el){&lt;br /&gt;
			var params = &amp;#039;?action=edit&amp;#039;;&lt;br /&gt;
			&lt;br /&gt;
			// only add the long preload stuff if the box doesn&amp;#039;t exist, for prettier urls&lt;br /&gt;
			if ( $(el).hasClass(&amp;#039;missing&amp;#039;) ){&lt;br /&gt;
&lt;br /&gt;
				params += &amp;#039;&amp;amp;preload=Template:Main page box/preload&amp;amp;preloadparams[0]=&amp;#039; + el.dataset[&amp;#039;boxId&amp;#039;].charAt(0).toUpperCase() + el.dataset[&amp;#039;boxId&amp;#039;].slice(1); /* preloadparam is box id with first letter capitalized */&lt;br /&gt;
			}&lt;br /&gt;
			&lt;br /&gt;
			$(&amp;#039;&amp;lt;a&amp;gt;&amp;lt;/a&amp;gt;&amp;#039;, {href: mw.util.getUrl(rootpage + &amp;#039;/&amp;#039; + el.dataset[&amp;#039;boxId&amp;#039;]) + params})&lt;br /&gt;
			.msg(&amp;#039;gadget-mpEditLinks-edit-link-text&amp;#039;, rootpage + &amp;#039;/&amp;#039; + el.dataset[&amp;#039;boxId&amp;#039;])&lt;br /&gt;
			.appendTo(&lt;br /&gt;
				$(&amp;#039;&amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&amp;#039;, {&lt;br /&gt;
					class: &amp;#039;mp-edit-link&amp;#039;&lt;br /&gt;
				}).prependTo(el)&lt;br /&gt;
			);&lt;br /&gt;
		});&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	function toggleLinks(){&lt;br /&gt;
		$(&amp;#039;.mp-edit-link&amp;#039;).each(function(_, el){&lt;br /&gt;
			$(el).toggle().css(&amp;#039;display none;&amp;#039;);&lt;br /&gt;
		});&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	$(&amp;#039;&amp;lt;span&amp;gt;&amp;lt;/span&amp;gt;&amp;#039;, {&lt;br /&gt;
		text: mw.msg(&amp;#039;gadget-mpEditLinks-toggle-link-text&amp;#039;),&lt;br /&gt;
		class: &amp;#039;mp-edit-toggle&amp;#039;,&lt;br /&gt;
		on: {click: toggleLinks},&lt;br /&gt;
	}).appendTo($(&amp;#039;#top&amp;#039;));&lt;br /&gt;
&lt;br /&gt;
	createLinks();&lt;br /&gt;
&lt;br /&gt;
});&lt;/div&gt;</summary>
		<author><name>Ais</name></author>
	</entry>
</feed>