<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.endmyopia.org/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3AGadget-Twinkle.js</id>
	<title>MediaWiki:Gadget-Twinkle.js - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.endmyopia.org/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3AGadget-Twinkle.js"/>
	<link rel="alternate" type="text/html" href="https://wiki.endmyopia.org/index.php?title=MediaWiki:Gadget-Twinkle.js&amp;action=history"/>
	<updated>2026-05-06T21:07:52Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.endmyopia.org/index.php?title=MediaWiki:Gadget-Twinkle.js&amp;diff=8577&amp;oldid=prev</id>
		<title>NottNott: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.endmyopia.org/index.php?title=MediaWiki:Gadget-Twinkle.js&amp;diff=8577&amp;oldid=prev"/>
		<updated>2020-06-12T10:46:06Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:46, 12 June 2020&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key jakeendmy_mw1720-mwnr_:diff::1.12:old-8576:rev-8577 --&gt;
&lt;/table&gt;</summary>
		<author><name>NottNott</name></author>
	</entry>
	<entry>
		<id>https://wiki.endmyopia.org/index.php?title=MediaWiki:Gadget-Twinkle.js&amp;diff=8576&amp;oldid=prev</id>
		<title>en&gt;Amorymeltzer: Repo at a5381651: (noop) Move automenu from warn to fluff</title>
		<link rel="alternate" type="text/html" href="https://wiki.endmyopia.org/index.php?title=MediaWiki:Gadget-Twinkle.js&amp;diff=8576&amp;oldid=prev"/>
		<updated>2020-05-10T16:58:55Z</updated>

		<summary type="html">&lt;p&gt;Repo at a5381651: (noop) Move automenu from warn to fluff&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;/**&lt;br /&gt;
 * +-------------------------------------------------------------------------+&lt;br /&gt;
 * |                  === WARNING: GLOBAL GADGET FILE ===                    |&lt;br /&gt;
 * |                Changes to this page affect many users.                  |&lt;br /&gt;
 * |           Please discuss changes at [[WT:TW]] before editing.           |&lt;br /&gt;
 * +-------------------------------------------------------------------------+&lt;br /&gt;
 *&lt;br /&gt;
 * Imported from github [https://github.com/azatoth/twinkle].&lt;br /&gt;
 * All changes should be made in the repository, otherwise they will be lost.&lt;br /&gt;
 *&lt;br /&gt;
 * ----------&lt;br /&gt;
 *&lt;br /&gt;
 * This is AzaToth's Twinkle, the popular script sidekick for newbies, admins, and&lt;br /&gt;
 * every Wikipedian in between. Visit [[WP:TW]] for more information.&lt;br /&gt;
 */&lt;br /&gt;
// &amp;lt;nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/* global Morebits */&lt;br /&gt;
&lt;br /&gt;
(function (window, document, $) { // Wrap with anonymous function&lt;br /&gt;
&lt;br /&gt;
// Check if account is experienced enough to use Twinkle&lt;br /&gt;
if (!Morebits.userIsInGroup('autoconfirmed') &amp;amp;&amp;amp; !Morebits.userIsInGroup('confirmed')) {&lt;br /&gt;
	return;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
var Twinkle = {};&lt;br /&gt;
window.Twinkle = Twinkle;  // allow global access&lt;br /&gt;
&lt;br /&gt;
// for use by custom modules (normally empty)&lt;br /&gt;
Twinkle.initCallbacks = [];&lt;br /&gt;
Twinkle.addInitCallback = function twinkleAddInitCallback(func) {&lt;br /&gt;
	Twinkle.initCallbacks.push(func);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
Twinkle.defaultConfig = {};&lt;br /&gt;
/**&lt;br /&gt;
 * This holds the default set of preferences used by Twinkle.&lt;br /&gt;
 * It is important that all new preferences added here, especially admin-only ones, are also added to&lt;br /&gt;
 * |Twinkle.config.sections| in twinkleconfig.js, so they are configurable via the Twinkle preferences panel.&lt;br /&gt;
 * For help on the actual preferences, see the comments in twinkleconfig.js.&lt;br /&gt;
 *&lt;br /&gt;
 * Formerly Twinkle.defaultConfig.twinkle and Twinkle.defaultConfig.friendly&lt;br /&gt;
 */&lt;br /&gt;
Twinkle.defaultConfig = {&lt;br /&gt;
	// General&lt;br /&gt;
	summaryAd: ' ([[WP:TW|TW]])',&lt;br /&gt;
	deletionSummaryAd: ' ([[WP:TW|TW]])',&lt;br /&gt;
	protectionSummaryAd: ' ([[WP:TW|TW]])',&lt;br /&gt;
	userTalkPageMode: 'tab',&lt;br /&gt;
	dialogLargeFont: false,&lt;br /&gt;
	disabledModules: [],&lt;br /&gt;
	disabledSysopModules: [],&lt;br /&gt;
&lt;br /&gt;
	// ARV&lt;br /&gt;
	spiWatchReport: 'yes',&lt;br /&gt;
&lt;br /&gt;
	// Block&lt;br /&gt;
	defaultToPartialBlocks: false,&lt;br /&gt;
	blankTalkpageOnIndefBlock: false,&lt;br /&gt;
&lt;br /&gt;
	// Fluff (revert and rollback)&lt;br /&gt;
	autoMenuAfterRollback: false,&lt;br /&gt;
	openTalkPage: [ 'agf', 'norm', 'vand' ],&lt;br /&gt;
	openTalkPageOnAutoRevert: false,&lt;br /&gt;
	markRevertedPagesAsMinor: [ 'vand' ],&lt;br /&gt;
	watchRevertedPages: [ 'agf', 'norm', 'vand', 'torev' ],&lt;br /&gt;
	offerReasonOnNormalRevert: true,&lt;br /&gt;
	confirmOnFluff: false,&lt;br /&gt;
	showRollbackLinks: [ 'diff', 'others' ],&lt;br /&gt;
&lt;br /&gt;
	// DI (twinkleimage)&lt;br /&gt;
	notifyUserOnDeli: true,&lt;br /&gt;
	deliWatchPage: 'default',&lt;br /&gt;
	deliWatchUser: 'default',&lt;br /&gt;
&lt;br /&gt;
	// PROD&lt;br /&gt;
	watchProdPages: true,&lt;br /&gt;
	markProdPagesAsPatrolled: false,&lt;br /&gt;
	prodReasonDefault: '',&lt;br /&gt;
	logProdPages: false,&lt;br /&gt;
	prodLogPageName: 'PROD log',&lt;br /&gt;
&lt;br /&gt;
	// CSD&lt;br /&gt;
	speedySelectionStyle: 'buttonClick',&lt;br /&gt;
	watchSpeedyPages: [ 'g3', 'g5', 'g10', 'g11', 'g12' ],&lt;br /&gt;
	markSpeedyPagesAsPatrolled: false,&lt;br /&gt;
&lt;br /&gt;
	// these next two should probably be identical by default&lt;br /&gt;
	welcomeUserOnSpeedyDeletionNotification: [ 'db', 'g1', 'g2', 'g3', 'g4', 'g6', 'g10', 'g11', 'g12', 'g13', 'g14', 'a1', 'a2', 'a3', 'a5', 'a7', 'a9', 'a10', 'a11', 'f1', 'f2', 'f3', 'f7', 'f9', 'f10', 'u3', 'u5', 't2', 't3', 'p1', 'p2' ],&lt;br /&gt;
	notifyUserOnSpeedyDeletionNomination: [ 'db', 'g1', 'g2', 'g3', 'g4', 'g6', 'g10', 'g11', 'g12', 'g13', 'g14', 'a1', 'a2', 'a3', 'a5', 'a7', 'a9', 'a10', 'a11', 'f1', 'f2', 'f3', 'f7', 'f9', 'f10', 'u3', 'u5', 't2', 't3', 'p1', 'p2' ],&lt;br /&gt;
	warnUserOnSpeedyDelete: [ 'db', 'g1', 'g2', 'g3', 'g4', 'g6', 'g10', 'g11', 'g12', 'g13', 'g14', 'a1', 'a2', 'a3', 'a5', 'a7', 'a9', 'a10', 'a11', 'f1', 'f2', 'f3', 'f7', 'f9', 'f10', 'u3', 'u5', 't2', 't3', 'p1', 'p2' ],&lt;br /&gt;
	promptForSpeedyDeletionSummary: [],&lt;br /&gt;
	deleteTalkPageOnDelete: true,&lt;br /&gt;
	deleteRedirectsOnDelete: true,&lt;br /&gt;
	deleteSysopDefaultToDelete: false,&lt;br /&gt;
	speedyWindowHeight: 500,&lt;br /&gt;
	speedyWindowWidth: 800,&lt;br /&gt;
	logSpeedyNominations: false,&lt;br /&gt;
	speedyLogPageName: 'CSD log',&lt;br /&gt;
	noLogOnSpeedyNomination: [ 'u1' ],&lt;br /&gt;
&lt;br /&gt;
	// Unlink&lt;br /&gt;
	unlinkNamespaces: [ '0', '10', '100', '118' ],&lt;br /&gt;
&lt;br /&gt;
	// Warn&lt;br /&gt;
	defaultWarningGroup: '1',&lt;br /&gt;
	combinedSingletMenus: false,&lt;br /&gt;
	showSharedIPNotice: true,&lt;br /&gt;
	watchWarnings: true,&lt;br /&gt;
	oldSelect: false,&lt;br /&gt;
	customWarningList: [],&lt;br /&gt;
&lt;br /&gt;
	// XfD&lt;br /&gt;
	xfdWatchDiscussion: 'default',&lt;br /&gt;
	xfdWatchList: 'no',&lt;br /&gt;
	xfdWatchPage: 'default',&lt;br /&gt;
	xfdWatchUser: 'default',&lt;br /&gt;
	xfdWatchRelated: 'default',&lt;br /&gt;
	markXfdPagesAsPatrolled: true,&lt;br /&gt;
&lt;br /&gt;
	// Hidden preferences&lt;br /&gt;
	revertMaxRevisions: 50,&lt;br /&gt;
	batchMax: 5000,&lt;br /&gt;
	batchdeleteChunks: 50,&lt;br /&gt;
	batchProtectChunks: 50,&lt;br /&gt;
	batchundeleteChunks: 50,&lt;br /&gt;
	proddeleteChunks: 50,&lt;br /&gt;
&lt;br /&gt;
	// Formerly defaultConfig.friendly:&lt;br /&gt;
&lt;br /&gt;
	// Tag&lt;br /&gt;
	groupByDefault: true,&lt;br /&gt;
	watchTaggedPages: true,&lt;br /&gt;
	watchMergeDiscussions: true,&lt;br /&gt;
	markTaggedPagesAsMinor: false,&lt;br /&gt;
	markTaggedPagesAsPatrolled: true,&lt;br /&gt;
	tagArticleSortOrder: 'cat',&lt;br /&gt;
	customTagList: [],&lt;br /&gt;
	customFileTagList: [],&lt;br /&gt;
	customRedirectTagList: [],&lt;br /&gt;
&lt;br /&gt;
	// Welcome&lt;br /&gt;
	topWelcomes: false,&lt;br /&gt;
	watchWelcomes: true,&lt;br /&gt;
	welcomeHeading: 'Welcome',&lt;br /&gt;
	insertHeadings: true,&lt;br /&gt;
	insertUsername: true,&lt;br /&gt;
	insertSignature: true,  // sign welcome templates, where appropriate&lt;br /&gt;
	quickWelcomeMode: 'norm',&lt;br /&gt;
	quickWelcomeTemplate: 'welcome',&lt;br /&gt;
	customWelcomeList: [],&lt;br /&gt;
	customWelcomeSignature: true,&lt;br /&gt;
&lt;br /&gt;
	// Talkback&lt;br /&gt;
	markTalkbackAsMinor: true,&lt;br /&gt;
	insertTalkbackSignature: true,  // always sign talkback templates&lt;br /&gt;
	talkbackHeading: 'New message from ' + mw.config.get('wgUserName'),&lt;br /&gt;
	adminNoticeHeading: 'Notice',&lt;br /&gt;
	mailHeading: &amp;quot;You've got mail!&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Shared&lt;br /&gt;
	markSharedIPAsMinor: true&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// now some skin dependent config.&lt;br /&gt;
switch (mw.config.get('skin')) {&lt;br /&gt;
	case 'vector':&lt;br /&gt;
		Twinkle.defaultConfig.portletArea = 'right-navigation';&lt;br /&gt;
		Twinkle.defaultConfig.portletId = 'p-twinkle';&lt;br /&gt;
		Twinkle.defaultConfig.portletName = 'TW';&lt;br /&gt;
		Twinkle.defaultConfig.portletType = 'menu';&lt;br /&gt;
		Twinkle.defaultConfig.portletNext = 'p-search';&lt;br /&gt;
		break;&lt;br /&gt;
	case 'timeless':&lt;br /&gt;
		Twinkle.defaultConfig.portletArea = '#page-tools .sidebar-inner';&lt;br /&gt;
		Twinkle.defaultConfig.portletId = 'p-twinkle';&lt;br /&gt;
		Twinkle.defaultConfig.portletName = 'Twinkle';&lt;br /&gt;
		Twinkle.defaultConfig.portletType = null;&lt;br /&gt;
		Twinkle.defaultConfig.portletNext = 'p-userpagetools';&lt;br /&gt;
		break;&lt;br /&gt;
	default:&lt;br /&gt;
		Twinkle.defaultConfig.portletArea = null;&lt;br /&gt;
		Twinkle.defaultConfig.portletId = 'p-cactions';&lt;br /&gt;
		Twinkle.defaultConfig.portletName = null;&lt;br /&gt;
		Twinkle.defaultConfig.portletType = null;&lt;br /&gt;
		Twinkle.defaultConfig.portletNext = null;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Twinkle.getPref = function twinkleGetPref(name) {&lt;br /&gt;
	if (typeof Twinkle.prefs === 'object' &amp;amp;&amp;amp; Twinkle.prefs[name] !== undefined) {&lt;br /&gt;
		return Twinkle.prefs[name];&lt;br /&gt;
	}&lt;br /&gt;
	// Old preferences format, used before twinkleoptions.js was a thing&lt;br /&gt;
	if (typeof window.TwinkleConfig === 'object' &amp;amp;&amp;amp; window.TwinkleConfig[name] !== undefined) {&lt;br /&gt;
		return window.TwinkleConfig[name];&lt;br /&gt;
	}&lt;br /&gt;
	if (typeof window.FriendlyConfig === 'object' &amp;amp;&amp;amp; window.FriendlyConfig[name] !== undefined) {&lt;br /&gt;
		return window.FriendlyConfig[name];&lt;br /&gt;
	}&lt;br /&gt;
	return Twinkle.defaultConfig[name];&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * **************** Twinkle.addPortlet() ****************&lt;br /&gt;
 *&lt;br /&gt;
 * Adds a portlet menu to one of the navigation areas on the page.&lt;br /&gt;
 * This is necessarily quite a hack since skins, navigation areas, and&lt;br /&gt;
 * portlet menu types all work slightly different.&lt;br /&gt;
 *&lt;br /&gt;
 * Available navigation areas depend on the skin used.&lt;br /&gt;
 * Monobook:&lt;br /&gt;
 *  &amp;quot;column-one&amp;quot;, outer div class &amp;quot;portlet&amp;quot;, inner div class &amp;quot;pBody&amp;quot;. Existing portlets: &amp;quot;p-cactions&amp;quot;, &amp;quot;p-personal&amp;quot;, &amp;quot;p-logo&amp;quot;, &amp;quot;p-navigation&amp;quot;, &amp;quot;p-search&amp;quot;, &amp;quot;p-interaction&amp;quot;, &amp;quot;p-tb&amp;quot;, &amp;quot;p-coll-print_export&amp;quot;&lt;br /&gt;
 *  Special layout of p-cactions and p-personal through specialized styles.&lt;br /&gt;
 * Vector:&lt;br /&gt;
 *  &amp;quot;mw-panel&amp;quot;, outer div class &amp;quot;portal&amp;quot;, inner div class &amp;quot;body&amp;quot;. Existing portlets/elements: &amp;quot;p-logo&amp;quot;, &amp;quot;p-navigation&amp;quot;, &amp;quot;p-interaction&amp;quot;, &amp;quot;p-tb&amp;quot;, &amp;quot;p-coll-print_export&amp;quot;&lt;br /&gt;
 *  &amp;quot;left-navigation&amp;quot;, outer div class &amp;quot;vectorTabs&amp;quot; or &amp;quot;vectorMenu&amp;quot;, inner div class &amp;quot;&amp;quot; or &amp;quot;menu&amp;quot;. Existing portlets: &amp;quot;p-namespaces&amp;quot;, &amp;quot;p-variants&amp;quot; (menu)&lt;br /&gt;
 *  &amp;quot;right-navigation&amp;quot;, outer div class &amp;quot;vectorTabs&amp;quot; or &amp;quot;vectorMenu&amp;quot;, inner div class &amp;quot;&amp;quot; or &amp;quot;menu&amp;quot;. Existing portlets: &amp;quot;p-views&amp;quot;, &amp;quot;p-cactions&amp;quot; (menu), &amp;quot;p-search&amp;quot;&lt;br /&gt;
 *  Special layout of p-personal portlet (part of &amp;quot;head&amp;quot;) through specialized styles.&lt;br /&gt;
 * Modern:&lt;br /&gt;
 *  &amp;quot;mw_contentwrapper&amp;quot; (top nav), outer div class &amp;quot;portlet&amp;quot;, inner div class &amp;quot;pBody&amp;quot;. Existing portlets or elements: &amp;quot;p-cactions&amp;quot;, &amp;quot;mw_content&amp;quot;&lt;br /&gt;
 *  &amp;quot;mw_portlets&amp;quot; (sidebar), outer div class &amp;quot;portlet&amp;quot;, inner div class &amp;quot;pBody&amp;quot;. Existing portlets: &amp;quot;p-navigation&amp;quot;, &amp;quot;p-search&amp;quot;, &amp;quot;p-interaction&amp;quot;, &amp;quot;p-tb&amp;quot;, &amp;quot;p-coll-print_export&amp;quot;&lt;br /&gt;
 *&lt;br /&gt;
 * @param String navigation -- id of the target navigation area (skin dependant, on vector either of &amp;quot;left-navigation&amp;quot;, &amp;quot;right-navigation&amp;quot;, or &amp;quot;mw-panel&amp;quot;)&lt;br /&gt;
 * @param String id -- id of the portlet menu to create, preferably start with &amp;quot;p-&amp;quot;.&lt;br /&gt;
 * @param String text -- name of the portlet menu to create. Visibility depends on the class used.&lt;br /&gt;
 * @param String type -- type of portlet. Currently only used for the vector non-sidebar portlets, pass &amp;quot;menu&amp;quot; to make this portlet a drop down menu.&lt;br /&gt;
 * @param Node nextnodeid -- the id of the node before which the new item should be added, should be another item in the same list, or undefined to place it at the end.&lt;br /&gt;
 *&lt;br /&gt;
 * @return Node -- the DOM node of the new item (a DIV element) or null&lt;br /&gt;
 */&lt;br /&gt;
Twinkle.addPortlet = function(navigation, id, text, type, nextnodeid) {&lt;br /&gt;
	// sanity checks, and get required DOM nodes&lt;br /&gt;
	var root = document.getElementById(navigation) || document.querySelector(navigation);&lt;br /&gt;
	if (!root) {&lt;br /&gt;
		return null;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	var item = document.getElementById(id);&lt;br /&gt;
	if (item) {&lt;br /&gt;
		if (item.parentNode &amp;amp;&amp;amp; item.parentNode === root) {&lt;br /&gt;
			return item;&lt;br /&gt;
		}&lt;br /&gt;
		return null;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	var nextnode;&lt;br /&gt;
	if (nextnodeid) {&lt;br /&gt;
		nextnode = document.getElementById(nextnodeid);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// verify/normalize input&lt;br /&gt;
	var skin = mw.config.get('skin');&lt;br /&gt;
	if (skin !== 'vector' || (navigation !== 'left-navigation' &amp;amp;&amp;amp; navigation !== 'right-navigation')) {&lt;br /&gt;
		type = null; // menu supported only in vector's #left-navigation &amp;amp; #right-navigation&lt;br /&gt;
	}&lt;br /&gt;
	var outerDivClass, innerDivClass;&lt;br /&gt;
	switch (skin) {&lt;br /&gt;
		case 'vector':&lt;br /&gt;
			// XXX: portal doesn't work&lt;br /&gt;
			if (navigation !== 'portal' &amp;amp;&amp;amp; navigation !== 'left-navigation' &amp;amp;&amp;amp; navigation !== 'right-navigation') {&lt;br /&gt;
				navigation = 'mw-panel';&lt;br /&gt;
			}&lt;br /&gt;
			outerDivClass = navigation === 'mw-panel' ? 'portal' : type === 'menu' ? 'vectorMenu' : 'vectorTabs';&lt;br /&gt;
			break;&lt;br /&gt;
		case 'modern':&lt;br /&gt;
			if (navigation !== 'mw_portlets' &amp;amp;&amp;amp; navigation !== 'mw_contentwrapper') {&lt;br /&gt;
				navigation = 'mw_portlets';&lt;br /&gt;
			}&lt;br /&gt;
			outerDivClass = 'portlet';&lt;br /&gt;
			break;&lt;br /&gt;
		case 'timeless':&lt;br /&gt;
			outerDivClass = 'mw-portlet';&lt;br /&gt;
			innerDivClass = 'mw-portlet-body';&lt;br /&gt;
			break;&lt;br /&gt;
		default:&lt;br /&gt;
			navigation = 'column-one';&lt;br /&gt;
			outerDivClass = 'portlet';&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Build the DOM elements.&lt;br /&gt;
	var outerDiv = document.createElement('div');&lt;br /&gt;
	outerDiv.setAttribute('role', 'navigation');&lt;br /&gt;
	outerDiv.setAttribute('aria-labelledby', id + '-label');&lt;br /&gt;
	outerDiv.className = outerDivClass + ' emptyPortlet';&lt;br /&gt;
	outerDiv.id = id;&lt;br /&gt;
	if (nextnode &amp;amp;&amp;amp; nextnode.parentNode === root) {&lt;br /&gt;
		root.insertBefore(outerDiv, nextnode);&lt;br /&gt;
	} else {&lt;br /&gt;
		root.appendChild(outerDiv);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	var h5 = document.createElement('h3');&lt;br /&gt;
	h5.id = id + '-label';&lt;br /&gt;
	var ul = document.createElement('ul');&lt;br /&gt;
&lt;br /&gt;
	if (outerDivClass === 'vectorMenu') {&lt;br /&gt;
&lt;br /&gt;
		// add invisible checkbox to keep menu open when clicked&lt;br /&gt;
		// similar to the p-cactions (&amp;quot;More&amp;quot;) menu&lt;br /&gt;
		var chkbox = document.createElement('input');&lt;br /&gt;
		chkbox.className = 'vectorMenuCheckbox';&lt;br /&gt;
		chkbox.setAttribute('type', 'checkbox');&lt;br /&gt;
		chkbox.setAttribute('aria-labelledby', id + '-label');&lt;br /&gt;
		outerDiv.appendChild(chkbox);&lt;br /&gt;
&lt;br /&gt;
		var span = document.createElement('span');&lt;br /&gt;
		span.appendChild(document.createTextNode(text));&lt;br /&gt;
		h5.appendChild(span);&lt;br /&gt;
&lt;br /&gt;
		var a = document.createElement('a');&lt;br /&gt;
		a.href = '#';&lt;br /&gt;
&lt;br /&gt;
		$(a).click(function(e) {&lt;br /&gt;
			e.preventDefault();&lt;br /&gt;
		});&lt;br /&gt;
&lt;br /&gt;
		h5.appendChild(a);&lt;br /&gt;
		outerDiv.appendChild(h5);&lt;br /&gt;
&lt;br /&gt;
		ul.className = 'menu';&lt;br /&gt;
		outerDiv.appendChild(ul);&lt;br /&gt;
&lt;br /&gt;
	} else {&lt;br /&gt;
&lt;br /&gt;
		h5.appendChild(document.createTextNode(text));&lt;br /&gt;
		outerDiv.appendChild(h5);&lt;br /&gt;
		if (innerDivClass) {&lt;br /&gt;
			var innerDiv = document.createElement('div');&lt;br /&gt;
			innerDiv.className = innerDivClass;&lt;br /&gt;
			innerDiv.appendChild(ul);&lt;br /&gt;
			outerDiv.appendChild(innerDiv);&lt;br /&gt;
		} else {&lt;br /&gt;
			outerDiv.appendChild(ul);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return outerDiv;&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * **************** Twinkle.addPortletLink() ****************&lt;br /&gt;
 * Builds a portlet menu if it doesn't exist yet, and add the portlet link.&lt;br /&gt;
 * @param task: Either a URL for the portlet link or a function to execute.&lt;br /&gt;
 */&lt;br /&gt;
Twinkle.addPortletLink = function(task, text, id, tooltip) {&lt;br /&gt;
	if (Twinkle.getPref('portletArea') !== null) {&lt;br /&gt;
		Twinkle.addPortlet(Twinkle.getPref('portletArea'), Twinkle.getPref('portletId'), Twinkle.getPref('portletName'), Twinkle.getPref('portletType'), Twinkle.getPref('portletNext'));&lt;br /&gt;
	}&lt;br /&gt;
	var link = mw.util.addPortletLink(Twinkle.getPref('portletId'), typeof task === 'string' ? task : '#', text, id, tooltip);&lt;br /&gt;
	$('.client-js .skin-vector #p-cactions').css('margin-right', 'initial');&lt;br /&gt;
	if (typeof task === 'function') {&lt;br /&gt;
		$(link).click(function (ev) {&lt;br /&gt;
			task();&lt;br /&gt;
			ev.preventDefault();&lt;br /&gt;
		});&lt;br /&gt;
	}&lt;br /&gt;
	if ($.collapsibleTabs) {&lt;br /&gt;
		$.collapsibleTabs.handleResize();&lt;br /&gt;
	}&lt;br /&gt;
	return link;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * **************** General initialization code ****************&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
var scriptpathbefore = mw.util.wikiScript('index') + '?title=',&lt;br /&gt;
	scriptpathafter = '&amp;amp;action=raw&amp;amp;ctype=text/javascript&amp;amp;happy=yes';&lt;br /&gt;
&lt;br /&gt;
// Retrieve the user's Twinkle preferences&lt;br /&gt;
$.ajax({&lt;br /&gt;
	url: scriptpathbefore + 'User:' + encodeURIComponent(mw.config.get('wgUserName')) + '/twinkleoptions.js' + scriptpathafter,&lt;br /&gt;
	dataType: 'text'&lt;br /&gt;
})&lt;br /&gt;
	.fail(function () {&lt;br /&gt;
		mw.notify('Could not load twinkleoptions.js');&lt;br /&gt;
	})&lt;br /&gt;
	.done(function (optionsText) {&lt;br /&gt;
&lt;br /&gt;
		// Quick pass if user has no options&lt;br /&gt;
		if (optionsText === '') {&lt;br /&gt;
			return;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		// Twinkle options are basically a JSON object with some comments. Strip those:&lt;br /&gt;
		optionsText = optionsText.replace(/(?:^(?:\/\/[^\n]*\n)*\n*|(?:\/\/[^\n]*(?:\n|$))*$)/g, '');&lt;br /&gt;
&lt;br /&gt;
		// First version of options had some boilerplate code to make it eval-able -- strip that too. This part may become obsolete down the line.&lt;br /&gt;
		if (optionsText.lastIndexOf('window.Twinkle.prefs = ', 0) === 0) {&lt;br /&gt;
			optionsText = optionsText.replace(/(?:^window.Twinkle.prefs = |;\n*$)/g, '');&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		try {&lt;br /&gt;
			var options = JSON.parse(optionsText);&lt;br /&gt;
			if (options) {&lt;br /&gt;
				if (options.twinkle || options.friendly) { // Old preferences format&lt;br /&gt;
					Twinkle.prefs = $.extend(options.twinkle, options.friendly);&lt;br /&gt;
				} else {&lt;br /&gt;
					Twinkle.prefs = options;&lt;br /&gt;
				}&lt;br /&gt;
				// v2 established after unification of Twinkle/Friendly objects&lt;br /&gt;
				Twinkle.prefs.optionsVersion = Twinkle.prefs.optionsVersion || 1;&lt;br /&gt;
			}&lt;br /&gt;
		} catch (e) {&lt;br /&gt;
			mw.notify('Could not parse twinkleoptions.js');&lt;br /&gt;
		}&lt;br /&gt;
	})&lt;br /&gt;
	.always(function () {&lt;br /&gt;
		$(Twinkle.load);&lt;br /&gt;
	});&lt;br /&gt;
&lt;br /&gt;
// Developers: you can import custom Twinkle modules here&lt;br /&gt;
// For example, mw.loader.load(scriptpathbefore + &amp;quot;User:UncleDouggie/morebits-test.js&amp;quot; + scriptpathafter);&lt;br /&gt;
&lt;br /&gt;
Twinkle.load = function () {&lt;br /&gt;
	// Don't activate on special pages other than those on the whitelist so that&lt;br /&gt;
	// they load faster, especially the watchlist.&lt;br /&gt;
	var specialPageWhitelist = [ 'Block', 'Contributions' ]; // wgRelevantUserName defined for non-sysops on Special:Block&lt;br /&gt;
	if (Morebits.userIsSysop) {&lt;br /&gt;
		specialPageWhitelist = specialPageWhitelist.concat([ 'DeletedContributions', 'Prefixindex' ]);&lt;br /&gt;
	}&lt;br /&gt;
	if (mw.config.get('wgNamespaceNumber') === -1 &amp;amp;&amp;amp;&lt;br /&gt;
		specialPageWhitelist.indexOf(mw.config.get('wgCanonicalSpecialPageName')) === -1) {&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Prevent clickjacking&lt;br /&gt;
	if (window.top !== window.self) {&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Set custom Api-User-Agent header, for server-side logging purposes&lt;br /&gt;
	Morebits.wiki.api.setApiUserAgent('Twinkle/2.0 (' + mw.config.get('wgDBname') + ')');&lt;br /&gt;
&lt;br /&gt;
	// Load all the modules in the order that the tabs should appear&lt;br /&gt;
	var twinkleModules = [&lt;br /&gt;
		// User/user talk-related&lt;br /&gt;
		'arv', 'warn', 'block', 'welcome', 'shared', 'talkback',&lt;br /&gt;
		// Deletion&lt;br /&gt;
		'speedy', 'prod', 'xfd', 'image',&lt;br /&gt;
		// Maintenance&lt;br /&gt;
		'protect', 'tag',&lt;br /&gt;
		// Misc. ones last&lt;br /&gt;
		'diff', 'unlink', 'fluff', 'deprod', 'batchdelete', 'batchprotect', 'batchundelete'&lt;br /&gt;
	];&lt;br /&gt;
	// Don't load modules users have disabled&lt;br /&gt;
	var disabledModules = Twinkle.getPref('disabledModules').concat(Twinkle.getPref('disabledSysopModules'));&lt;br /&gt;
	twinkleModules.filter(function(mod) {&lt;br /&gt;
		return disabledModules.indexOf(mod) === -1;&lt;br /&gt;
	}).forEach(function(module) {&lt;br /&gt;
		Twinkle[module]();&lt;br /&gt;
	});&lt;br /&gt;
	Twinkle.config.init(); // Can't turn off&lt;br /&gt;
&lt;br /&gt;
	// Run the initialization callbacks for any custom modules&lt;br /&gt;
	Twinkle.initCallbacks.forEach(function (func) {&lt;br /&gt;
		func();&lt;br /&gt;
	});&lt;br /&gt;
	Twinkle.addInitCallback = function (func) {&lt;br /&gt;
		func();&lt;br /&gt;
	};&lt;br /&gt;
&lt;br /&gt;
	// Increases text size in Twinkle dialogs, if so configured&lt;br /&gt;
	if (Twinkle.getPref('dialogLargeFont')) {&lt;br /&gt;
		mw.util.addCSS('.morebits-dialog-content, .morebits-dialog-footerlinks { font-size: 100% !important; } ' +&lt;br /&gt;
			'.morebits-dialog input, .morebits-dialog select, .morebits-dialog-content button { font-size: inherit !important; }');&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Hide the lingering space if the TW menu is empty&lt;br /&gt;
	if (mw.config.get('skin') === 'vector' &amp;amp;&amp;amp; Twinkle.getPref('portletType') === 'menu' &amp;amp;&amp;amp; $('#p-twinkle').length === 0) {&lt;br /&gt;
		$('#p-cactions').css('margin-right', 'initial');&lt;br /&gt;
	}&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}(window, document, jQuery)); // End wrap with anonymous function&lt;br /&gt;
&lt;br /&gt;
// &amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>en&gt;Amorymeltzer</name></author>
	</entry>
</feed>