User:Suffusion of Yellow/mobile-force-desktop-edit.js

/* * Retarget mobile edit links to the desktop site. * Works for all users, for testing/debugging purposes. * Actual script will only have any effect on logged-out users. * * INSTALL IN YOUR minerva.js, NOT YOUR common.js! */ $(function {	// Redirect all enwiki edit links to desktop site	var editLinkRE = /^https:\/\/en(?:\.m)?\.wikipedia\.org\/w\/index.php(?:\?|.*&)action=edit/;	$('a[href*="action=edit"]')		.each(function { if (editLinkRE.test(this.href)) { this.host = "en.wikipedia.org"; this.search += "&mobileaction=toggle_view_desktop";

if (this.search.indexOf("editintro") == -1) this.search += "&editintro=User:Suffusion_of_Yellow/Mobile_IP_editintro"; }		});

// Remove existing click handlers from edit links. // If any are added later, prevent them from excuting. $('#ca-edit, .mw-editsection a, .edit-link, .minerva-talk-add-button') .off("click") .on("click", function(event) {		event.stopImmediatePropagation;	});

// Change editing inputboxes to submit to desktop site $('form.commentbox, form.createbox').each(function {		$(this).attr("action", "https://en.wikipedia.org/w/index.php");

$('').appendTo(this);

if(!this.editintro) $('').appendTo(this); });

// Click the "read as wiki page" button on talk pages $('.minerva-talk-full-page-button').click;

// It's possible we got here first. Try to detect when MobileFrontend is // done tampering with the page, then try again. if (typeof window.MutationObserver !== 'undefined') { new MutationObserver(function {			$('.minerva-talk-full-page-button').click;		}).observe(document.getElementById('content'), {			childList: true		}); }

// If all else fails, hide the edit link after the overlay opens, // and force them to log in. Taken from pt:MediaWiki:Mobile.js. mw.util.addCSS("a.mw-ui-button.anonymous { display: none; }"); });