<?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-friendlywelcome.js</id>
	<title>MediaWiki:Gadget-friendlywelcome.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-friendlywelcome.js"/>
	<link rel="alternate" type="text/html" href="https://wiki.endmyopia.org/index.php?title=MediaWiki:Gadget-friendlywelcome.js&amp;action=history"/>
	<updated>2026-05-06T21:53:50Z</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-friendlywelcome.js&amp;diff=8595&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-friendlywelcome.js&amp;diff=8595&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-8594:rev-8595 --&gt;
&lt;/table&gt;</summary>
		<author><name>NottNott</name></author>
	</entry>
	<entry>
		<id>https://wiki.endmyopia.org/index.php?title=MediaWiki:Gadget-friendlywelcome.js&amp;diff=8594&amp;oldid=prev</id>
		<title>en&gt;Amorymeltzer: Repo at 30b6458: Update Template:W-short</title>
		<link rel="alternate" type="text/html" href="https://wiki.endmyopia.org/index.php?title=MediaWiki:Gadget-friendlywelcome.js&amp;diff=8594&amp;oldid=prev"/>
		<updated>2020-06-08T10:18:10Z</updated>

		<summary type="html">&lt;p&gt;Repo at 30b6458: Update Template:W-short&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;// &amp;lt;nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(function($) {&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 ****************************************&lt;br /&gt;
 *** friendlywelcome.js: Welcome module&lt;br /&gt;
 ****************************************&lt;br /&gt;
 * Mode of invocation:     Tab (&amp;quot;Wel&amp;quot;), or from links on diff pages&lt;br /&gt;
 * Active on:              Any page with relevant user name (userspace,&lt;br /&gt;
 *                         contribs, etc.) and diff pages&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
Twinkle.welcome = function friendlywelcome() {&lt;br /&gt;
	if (mw.util.getParamValue('friendlywelcome')) {&lt;br /&gt;
		if (mw.util.getParamValue('friendlywelcome') === 'auto') {&lt;br /&gt;
			Twinkle.welcome.auto();&lt;br /&gt;
		} else {&lt;br /&gt;
			Twinkle.welcome.semiauto();&lt;br /&gt;
		}&lt;br /&gt;
	} else {&lt;br /&gt;
		Twinkle.welcome.normal();&lt;br /&gt;
	}&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
Twinkle.welcome.auto = function() {&lt;br /&gt;
	if (mw.util.getParamValue('action') !== 'edit') {&lt;br /&gt;
		// userpage not empty, aborting auto-welcome&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	Twinkle.welcome.welcomeUser();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
Twinkle.welcome.semiauto = function() {&lt;br /&gt;
	Twinkle.welcome.callback(mw.config.get('wgRelevantUserName'));&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
Twinkle.welcome.normal = function() {&lt;br /&gt;
	if (mw.util.getParamValue('diff')) {&lt;br /&gt;
		// check whether the contributors' talk pages exist yet&lt;br /&gt;
		var $oList = $('#mw-diff-otitle2').find('span.mw-usertoollinks a.new:contains(talk)').first();&lt;br /&gt;
		var $nList = $('#mw-diff-ntitle2').find('span.mw-usertoollinks a.new:contains(talk)').first();&lt;br /&gt;
&lt;br /&gt;
		if ($oList.length &amp;gt; 0 || $nList.length &amp;gt; 0) {&lt;br /&gt;
			var spanTag = function(color, content) {&lt;br /&gt;
				var span = document.createElement('span');&lt;br /&gt;
				span.style.color = color;&lt;br /&gt;
				span.appendChild(document.createTextNode(content));&lt;br /&gt;
				return span;&lt;br /&gt;
			};&lt;br /&gt;
&lt;br /&gt;
			var welcomeNode = document.createElement('strong');&lt;br /&gt;
			var welcomeLink = document.createElement('a');&lt;br /&gt;
			welcomeLink.appendChild(spanTag('Black', '['));&lt;br /&gt;
			welcomeLink.appendChild(spanTag('Goldenrod', 'welcome'));&lt;br /&gt;
			welcomeLink.appendChild(spanTag('Black', ']'));&lt;br /&gt;
			welcomeNode.appendChild(welcomeLink);&lt;br /&gt;
&lt;br /&gt;
			if ($oList.length &amp;gt; 0) {&lt;br /&gt;
				var oHref = $oList.attr('href');&lt;br /&gt;
&lt;br /&gt;
				var oWelcomeNode = welcomeNode.cloneNode(true);&lt;br /&gt;
				oWelcomeNode.firstChild.setAttribute('href', oHref + '&amp;amp;' + $.param({&lt;br /&gt;
					'friendlywelcome': Twinkle.getPref('quickWelcomeMode') === 'auto' ? 'auto' : 'norm',&lt;br /&gt;
					'vanarticle': Morebits.pageNameNorm&lt;br /&gt;
				}));&lt;br /&gt;
				$oList[0].parentNode.parentNode.appendChild(document.createTextNode(' '));&lt;br /&gt;
				$oList[0].parentNode.parentNode.appendChild(oWelcomeNode);&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			if ($nList.length &amp;gt; 0) {&lt;br /&gt;
				var nHref = $nList.attr('href');&lt;br /&gt;
&lt;br /&gt;
				var nWelcomeNode = welcomeNode.cloneNode(true);&lt;br /&gt;
				nWelcomeNode.firstChild.setAttribute('href', nHref + '&amp;amp;' + $.param({&lt;br /&gt;
					'friendlywelcome': Twinkle.getPref('quickWelcomeMode') === 'auto' ? 'auto' : 'norm',&lt;br /&gt;
					'vanarticle': Morebits.pageNameNorm&lt;br /&gt;
				}));&lt;br /&gt;
				$nList[0].parentNode.parentNode.appendChild(document.createTextNode(' '));&lt;br /&gt;
				$nList[0].parentNode.parentNode.appendChild(nWelcomeNode);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	if (mw.config.get('wgRelevantUserName')) {&lt;br /&gt;
		Twinkle.addPortletLink(function() {&lt;br /&gt;
			Twinkle.welcome.callback(mw.config.get('wgRelevantUserName'));&lt;br /&gt;
		}, 'Wel', 'friendly-welcome', 'Welcome user');&lt;br /&gt;
	}&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
Twinkle.welcome.welcomeUser = function welcomeUser() {&lt;br /&gt;
	Morebits.status.init(document.getElementById('mw-content-text'));&lt;br /&gt;
	$('#catlinks').remove();&lt;br /&gt;
&lt;br /&gt;
	var params = {&lt;br /&gt;
		value: Twinkle.getPref('quickWelcomeTemplate'),&lt;br /&gt;
		article: mw.util.getParamValue('vanarticle') || '',&lt;br /&gt;
		mode: 'auto'&lt;br /&gt;
	};&lt;br /&gt;
&lt;br /&gt;
	var userTalkPage = mw.config.get('wgFormattedNamespaces')[3] + ':' + mw.config.get('wgRelevantUserName');&lt;br /&gt;
	Morebits.wiki.actionCompleted.redirect = userTalkPage;&lt;br /&gt;
	Morebits.wiki.actionCompleted.notice = 'Welcoming complete, reloading talk page in a few seconds';&lt;br /&gt;
&lt;br /&gt;
	var wikipedia_page = new Morebits.wiki.page(userTalkPage, 'User talk page modification');&lt;br /&gt;
	wikipedia_page.setFollowRedirect(true);&lt;br /&gt;
	wikipedia_page.setCallbackParameters(params);&lt;br /&gt;
	wikipedia_page.load(Twinkle.welcome.callbacks.main);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
Twinkle.welcome.callback = function friendlywelcomeCallback(uid) {&lt;br /&gt;
	if (uid === mw.config.get('wgUserName') &amp;amp;&amp;amp; !confirm('Are you really sure you want to welcome yourself?...')) {&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	var Window = new Morebits.simpleWindow(600, 420);&lt;br /&gt;
	Window.setTitle('Welcome user');&lt;br /&gt;
	Window.setScriptName('Twinkle');&lt;br /&gt;
	Window.addFooterLink('Welcoming Committee', 'WP:WC');&lt;br /&gt;
	Window.addFooterLink('Twinkle help', 'WP:TW/DOC#welcome');&lt;br /&gt;
&lt;br /&gt;
	var form = new Morebits.quickForm(Twinkle.welcome.callback.evaluate);&lt;br /&gt;
&lt;br /&gt;
	form.append({&lt;br /&gt;
		type: 'select',&lt;br /&gt;
		name: 'type',&lt;br /&gt;
		label: 'Type of welcome: ',&lt;br /&gt;
		event: Twinkle.welcome.populateWelcomeList,&lt;br /&gt;
		list: [&lt;br /&gt;
			{ type: 'option', value: 'standard', label: 'Standard welcomes', selected: !mw.util.isIPAddress(mw.config.get('wgRelevantUserName')) },&lt;br /&gt;
			{ type: 'option', value: 'anonymous', label: 'IP user welcomes', selected: mw.util.isIPAddress(mw.config.get('wgRelevantUserName')) },&lt;br /&gt;
			{ type: 'option', value: 'wikiProject', label: 'WikiProject welcomes' },&lt;br /&gt;
			{ type: 'option', value: 'nonEnglish', label: 'Non-English welcomes' }&lt;br /&gt;
		]&lt;br /&gt;
	});&lt;br /&gt;
&lt;br /&gt;
	form.append({&lt;br /&gt;
		type: 'div',&lt;br /&gt;
		id: 'welcomeWorkArea',&lt;br /&gt;
		className: 'morebits-scrollbox'&lt;br /&gt;
	});&lt;br /&gt;
&lt;br /&gt;
	form.append({&lt;br /&gt;
		type: 'input',&lt;br /&gt;
		name: 'article',&lt;br /&gt;
		label: '* Linked article (if supported by template):',&lt;br /&gt;
		value: mw.util.getParamValue('vanarticle') || '',&lt;br /&gt;
		tooltip: 'An article might be linked from within the welcome if the template supports it. Leave empty for no article to be linked.  Templates that support a linked article are marked with an asterisk.'&lt;br /&gt;
	});&lt;br /&gt;
&lt;br /&gt;
	var previewlink = document.createElement('a');&lt;br /&gt;
	$(previewlink).click(function() {&lt;br /&gt;
		Twinkle.welcome.callbacks.preview(result);  // |result| is defined below&lt;br /&gt;
	});&lt;br /&gt;
	previewlink.style.cursor = 'pointer';&lt;br /&gt;
	previewlink.textContent = 'Preview';&lt;br /&gt;
	form.append({ type: 'div', name: 'welcomepreview', label: [ previewlink ] });&lt;br /&gt;
&lt;br /&gt;
	form.append({ type: 'submit' });&lt;br /&gt;
&lt;br /&gt;
	var result = form.render();&lt;br /&gt;
	Window.setContent(result);&lt;br /&gt;
	Window.display();&lt;br /&gt;
&lt;br /&gt;
	// initialize the welcome list&lt;br /&gt;
	var evt = document.createEvent('Event');&lt;br /&gt;
	evt.initEvent('change', true, true);&lt;br /&gt;
	result.type.dispatchEvent(evt);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
Twinkle.welcome.populateWelcomeList = function(e) {&lt;br /&gt;
	var type = e.target.value;&lt;br /&gt;
&lt;br /&gt;
	var container = new Morebits.quickForm.element({ type: 'fragment' });&lt;br /&gt;
&lt;br /&gt;
	if ((type === 'standard' || type === 'anonymous') &amp;amp;&amp;amp; Twinkle.getPref('customWelcomeList').length) {&lt;br /&gt;
		container.append({ type: 'header', label: 'Custom welcome templates' });&lt;br /&gt;
		container.append({&lt;br /&gt;
			type: 'radio',&lt;br /&gt;
			name: 'template',&lt;br /&gt;
			list: Twinkle.getPref('customWelcomeList'),&lt;br /&gt;
			event: function() {&lt;br /&gt;
				e.target.form.article.disabled = false;&lt;br /&gt;
			}&lt;br /&gt;
		});&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	var sets = Twinkle.welcome.templates[type];&lt;br /&gt;
	$.each(sets, function(label, templates) {&lt;br /&gt;
		container.append({ type: 'header', label: label });&lt;br /&gt;
		container.append({&lt;br /&gt;
			type: 'radio',&lt;br /&gt;
			name: 'template',&lt;br /&gt;
			list: $.map(templates, function(properties, template) {&lt;br /&gt;
				return {&lt;br /&gt;
					value: template,&lt;br /&gt;
					label: '{{' + template + '}}: ' + properties.description + (properties.linkedArticle ? '\u00A0*' : ''),  // U+00A0 NO-BREAK SPACE&lt;br /&gt;
					tooltip: properties.tooltip  // may be undefined&lt;br /&gt;
				};&lt;br /&gt;
			}),&lt;br /&gt;
			event: function(ev) {&lt;br /&gt;
				ev.target.form.article.disabled = !templates[ev.target.value].linkedArticle;&lt;br /&gt;
			}&lt;br /&gt;
		});&lt;br /&gt;
	});&lt;br /&gt;
&lt;br /&gt;
	var rendered = container.render();&lt;br /&gt;
	$(e.target.form).find('div#welcomeWorkArea').empty().append(rendered);&lt;br /&gt;
&lt;br /&gt;
	var firstRadio = e.target.form.template[0];&lt;br /&gt;
	firstRadio.checked = true;&lt;br /&gt;
	e.target.form.article.disabled = Object.values(sets)[0][firstRadio.value] ?&lt;br /&gt;
		!Object.values(sets)[0][firstRadio.value].linkedArticle :&lt;br /&gt;
		true;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// A list of welcome templates and their properties and syntax&lt;br /&gt;
&lt;br /&gt;
// The four fields that are available are &amp;quot;description&amp;quot;, &amp;quot;linkedArticle&amp;quot;, &amp;quot;syntax&amp;quot;, and &amp;quot;tooltip&amp;quot;.&lt;br /&gt;
// The three magic words that can be used in the &amp;quot;syntax&amp;quot; field are:&lt;br /&gt;
//   - $USERNAME$  - replaced by the welcomer's username, depending on user's preferences&lt;br /&gt;
//   - $ARTICLE$   - replaced by an article name, if &amp;quot;linkedArticle&amp;quot; is true&lt;br /&gt;
//   - $HEADER$    - adds a level 2 header (most templates already include this)&lt;br /&gt;
&lt;br /&gt;
Twinkle.welcome.templates = {&lt;br /&gt;
	'standard': {&lt;br /&gt;
		'General welcome templates': {&lt;br /&gt;
			'welcome': {&lt;br /&gt;
				description: 'standard welcome',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcome|$USERNAME$|art=$ARTICLE$}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-retro': {&lt;br /&gt;
				description: 'a welcome message with a small list of helpful links',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcome-retro|$USERNAME$|art=$ARTICLE$}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-short': {&lt;br /&gt;
				description: 'a shorter welcome message',&lt;br /&gt;
				syntax: '{{subst:w-short|heading=yes|$EXTRA$}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-personal': {&lt;br /&gt;
				description: 'more personal welcome, including a plate of cookies',&lt;br /&gt;
				syntax: '{{subst:welcome-personal|$USERNAME$}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-graphical': {&lt;br /&gt;
				description: 'colorful welcome message with table of about 20 links',&lt;br /&gt;
				syntax: '$HEADER$ {{subst:welcome-graphical|$EXTRA$}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-menu': {&lt;br /&gt;
				description: 'welcome message with large table of about 60 links',&lt;br /&gt;
				syntax: '{{subst:welcome-menu}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-screen': {&lt;br /&gt;
				description: 'welcome message with clear, annotated table of 10 links',&lt;br /&gt;
				syntax: '$HEADER$ {{subst:welcome-screen}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-belated': {&lt;br /&gt;
				description: 'welcome for users with more substantial contributions',&lt;br /&gt;
				syntax: '{{subst:welcome-belated|$USERNAME$}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome student': {&lt;br /&gt;
				description: 'welcome for students editing as part of an educational class project',&lt;br /&gt;
				syntax: '$HEADER$ {{subst:welcome student|$USERNAME$}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome teacher': {&lt;br /&gt;
				description: 'welcome for course instructors involved in an educational class project',&lt;br /&gt;
				syntax: '$HEADER$ {{subst:welcome teacher|$USERNAME$}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome non-latin': {&lt;br /&gt;
				description: 'welcome for users with a username containing non-Latin characters',&lt;br /&gt;
				syntax: '{{subst:welcome non-latin|$USERNAME$}} ~~~~'&lt;br /&gt;
			}&lt;br /&gt;
		},&lt;br /&gt;
&lt;br /&gt;
		'Problem user welcome templates': {&lt;br /&gt;
			'welcomelaws': {&lt;br /&gt;
				description: 'welcome with information about copyrights, NPOV, the sandbox, and vandalism',&lt;br /&gt;
				syntax: '{{subst:welcomelaws|$USERNAME$}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'first article': {&lt;br /&gt;
				description: 'for someone whose first article did not meet page creation guidelines',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:first article|$ARTICLE$|$USERNAME$}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcometest': {&lt;br /&gt;
				description: 'for someone whose initial efforts appear to be tests',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcometest|$ARTICLE$|$USERNAME$}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomevandal': {&lt;br /&gt;
				description: 'for someone whose initial efforts appear to be vandalism',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcomevandal|$ARTICLE$|$USERNAME$}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomenpov': {&lt;br /&gt;
				description: 'for someone whose initial efforts do not adhere to the neutral point of view policy',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcomenpov|$ARTICLE$|$USERNAME$}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomespam': {&lt;br /&gt;
				description: 'welcome with additional discussion of anti-spamming policies',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcomespam|$ARTICLE$|$USERNAME$}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomeunsourced': {&lt;br /&gt;
				description: 'for someone whose initial efforts are unsourced',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcomeunsourced|$ARTICLE$|$USERNAME$}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomeauto': {&lt;br /&gt;
				description: 'for someone who created an autobiographical article',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcomeauto|$USERNAME$|art=$ARTICLE$}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-COI': {&lt;br /&gt;
				description: 'for someone who has edited in areas where they may have a conflict of interest',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcome-COI|$USERNAME$|art=$ARTICLE$}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-delete': {&lt;br /&gt;
				description: 'for someone who has been removing information from articles',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcome-delete|$ARTICLE$|$USERNAME$}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-image': {&lt;br /&gt;
				description: 'welcome with additional information about images (policy and procedure)',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcome-image|$USERNAME$|art=$ARTICLE$}}'&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
&lt;br /&gt;
	'anonymous': {&lt;br /&gt;
		'Anonymous user welcome templates': {&lt;br /&gt;
			'welcome-anon': {&lt;br /&gt;
				description: 'for anonymous users; encourages creating an account',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcome-anon|art=$ARTICLE$}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-anon-test': {&lt;br /&gt;
				description: 'for anonymous users who have performed test edits',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcome-anon-test|$ARTICLE$|$USERNAME$}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-anon-unconstructive': {&lt;br /&gt;
				description: 'for anonymous users who have vandalized or made unhelpful edits',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcome-anon-unconstructive|$ARTICLE$|$USERNAME$}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-anon-constructive': {&lt;br /&gt;
				description: 'for anonymous users who fight vandalism or edit constructively',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcome-anon-constructive|art=$ARTICLE$}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-anon-delete': {&lt;br /&gt;
				description: 'for anonymous users who have removed content from pages',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcome-anon-delete|$ARTICLE$|$USERNAME$}} ~~~~'&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
&lt;br /&gt;
	'wikiProject': {&lt;br /&gt;
		'WikiProject-specific welcome templates': {&lt;br /&gt;
			'welcome-anatomy': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in anatomy topics',&lt;br /&gt;
				syntax: '{{subst:welcome-anatomy}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-athletics': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in athletics (track and field) topics',&lt;br /&gt;
				syntax: '{{subst:welcome-athletics}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-au': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in Australia topics',&lt;br /&gt;
				syntax: '{{subst:welcome-au}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-bd': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in Bangladesh topics',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcome-bd|$USERNAME$||$EXTRA$|art=$ARTICLE$}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-bio': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in biographical topics',&lt;br /&gt;
				syntax: '{{subst:welcome-bio}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-cal': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in California topics',&lt;br /&gt;
				syntax: '{{subst:welcome-cal}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-conserv': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in conservatism topics',&lt;br /&gt;
				syntax: '{{subst:welcome-conserv}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-cycling': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in cycling topics',&lt;br /&gt;
				syntax: '{{subst:welcome-cycling}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-dbz': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in Dragon Ball topics',&lt;br /&gt;
				syntax: '{{subst:welcome-dbz|$EXTRA$|sig=~~~~}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-et': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in Estonia topics',&lt;br /&gt;
				syntax: '{{subst:welcome-et}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-de': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in Germany topics',&lt;br /&gt;
				syntax: '{{subst:welcome-de}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-in': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in India topics',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcome-in|$USERNAME$|art=$ARTICLE$}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-math': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in mathematical topics',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcome-math|$USERNAME$|art=$ARTICLE$}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-med': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in medicine topics',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcome-med|$USERNAME$|art=$ARTICLE$}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-no': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in Norway topics',&lt;br /&gt;
				syntax: '{{subst:welcome-no}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-pk': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in Pakistan topics',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcome-pk|$USERNAME$|art=$ARTICLE$}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-phys': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in physics topics',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcome-phys|$USERNAME$|art=$ARTICLE$}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-pl': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in Poland topics',&lt;br /&gt;
				syntax: '{{subst:welcome-pl}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-rugbyunion': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in rugby union topics',&lt;br /&gt;
				syntax: '{{subst:welcome-rugbyunion}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-ru': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in Russia topics',&lt;br /&gt;
				syntax: '{{subst:welcome-ru}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-starwars': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in Star Wars topics',&lt;br /&gt;
				syntax: '{{subst:welcome-starwars}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-ch': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in Switzerland topics',&lt;br /&gt;
				linkedArticle: true,&lt;br /&gt;
				syntax: '{{subst:welcome-ch|$USERNAME$|art=$ARTICLE$}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-uk': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in Ukraine topics',&lt;br /&gt;
				syntax: '{{subst:welcome-uk}} ~~~~'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-roads': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in roads and highways topics',&lt;br /&gt;
				syntax: '{{subst:welcome-roads}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcome-videogames': {&lt;br /&gt;
				description: 'welcome for users with an apparent interest in video game topics',&lt;br /&gt;
				syntax: '{{subst:welcome-videogames}}'&lt;br /&gt;
			},&lt;br /&gt;
			'TWA invite': {&lt;br /&gt;
				description: 'invite the user to The Wikipedia Adventure (not a welcome template)',&lt;br /&gt;
				syntax: '{{WP:TWA/InviteTW|signature=~~~~}}'&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
&lt;br /&gt;
	'nonEnglish': {&lt;br /&gt;
		'Non-English welcome templates': {&lt;br /&gt;
			'welcomeen': {&lt;br /&gt;
				description: 'welcome for users whose first language is not listed here',&lt;br /&gt;
				syntax: '{{subst:welcomeen}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomeen-ar': {&lt;br /&gt;
				description: 'welcome for users whose first language appears to be Arabic',&lt;br /&gt;
				syntax: '{{subst:welcomeen-ar}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomeen-sq': {&lt;br /&gt;
				description: 'welcome for users whose first language appears to be Albanian',&lt;br /&gt;
				syntax: '{{subst:welcomeen-sq}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomeen-zh': {&lt;br /&gt;
				description: 'welcome for users whose first language appears to be Chinese',&lt;br /&gt;
				syntax: '{{subst:welcomeen-zh}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomeen-nl': {&lt;br /&gt;
				description: 'welcome for users whose first language appears to be Dutch',&lt;br /&gt;
				syntax: '{{subst:welcomeen-nl}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomeen-fi': {&lt;br /&gt;
				description: 'welcome for users whose first language appears to be Finnish',&lt;br /&gt;
				syntax: '{{subst:welcomeen-fi}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomeen-fr': {&lt;br /&gt;
				description: 'welcome for users whose first language appears to be French',&lt;br /&gt;
				syntax: '{{subst:welcomeen-fr}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomeen-de': {&lt;br /&gt;
				description: 'welcome for users whose first language appears to be German',&lt;br /&gt;
				syntax: '{{subst:welcomeen-de}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomeen-he': {&lt;br /&gt;
				description: 'welcome for users whose first language appears to be Hebrew',&lt;br /&gt;
				syntax: '{{subst:welcomeen-he}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomeen-ja': {&lt;br /&gt;
				description: 'welcome for users whose first language appears to be Japanese',&lt;br /&gt;
				syntax: '{{subst:welcomeen-ja}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomeen-ko': {&lt;br /&gt;
				description: 'welcome for users whose first language appears to be Korean',&lt;br /&gt;
				syntax: '{{subst:welcomeen-ko}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomeen-ml': {&lt;br /&gt;
				description: 'welcome for users whose first language appears to be Malayalam',&lt;br /&gt;
				syntax: '{{subst:welcomeen-ml}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomeen-mr': {&lt;br /&gt;
				description: 'welcome for users whose first language appears to be Marathi',&lt;br /&gt;
				syntax: '{{subst:welcomeen-mr}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomeen-or': {&lt;br /&gt;
				description: 'welcome for users whose first language appears to be Oriya (Odia)',&lt;br /&gt;
				syntax: '{{subst:welcomeen-or}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomeen-pt': {&lt;br /&gt;
				description: 'welcome for users whose first language appears to be Portuguese',&lt;br /&gt;
				syntax: '{{subst:welcomeen-pt}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomeen-ro': {&lt;br /&gt;
				description: 'welcome for users whose first language appears to be Romanian',&lt;br /&gt;
				syntax: '{{subst:welcomeen-ro}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomeen-ru': {&lt;br /&gt;
				description: 'welcome for users whose first language appears to be Russian',&lt;br /&gt;
				syntax: '{{subst:welcomeen-ru}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomeen-es': {&lt;br /&gt;
				description: 'welcome for users whose first language appears to be Spanish',&lt;br /&gt;
				syntax: '{{subst:welcomeen-es}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomeen-sv': {&lt;br /&gt;
				description: 'welcome for users whose first language appears to be Swedish',&lt;br /&gt;
				syntax: '{{subst:welcomeen-sv}}'&lt;br /&gt;
			},&lt;br /&gt;
			'welcomeen-uk': {&lt;br /&gt;
				description: 'welcome for users whose first language appears to be Ukrainian',&lt;br /&gt;
				syntax: '{{subst:welcomeen-uk}}'&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
Twinkle.welcome.getTemplateWikitext = function(type, template, article) {&lt;br /&gt;
	// the iteration is required as the type=standard has two groups&lt;br /&gt;
	var properties;&lt;br /&gt;
	$.each(Twinkle.welcome.templates[type], function(label, templates) {&lt;br /&gt;
		properties = templates[template];&lt;br /&gt;
		if (properties) {&lt;br /&gt;
			return false; // break&lt;br /&gt;
		}&lt;br /&gt;
	});&lt;br /&gt;
	if (properties) {&lt;br /&gt;
		return properties.syntax.&lt;br /&gt;
			replace('$USERNAME$', Twinkle.getPref('insertUsername') ? mw.config.get('wgUserName') : '').&lt;br /&gt;
			replace('$ARTICLE$', article ? article : '').&lt;br /&gt;
			replace(/\$HEADER\$\s*/, '== Welcome ==\n\n').&lt;br /&gt;
			replace('$EXTRA$', '');  // EXTRA is not implemented yet&lt;br /&gt;
	}&lt;br /&gt;
	return '{{subst:' + template + (article ? '|art=' + article : '') + '}}' +&lt;br /&gt;
			(Twinkle.getPref('customWelcomeSignature') ? ' ~~~~' : '');&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
Twinkle.welcome.callbacks = {&lt;br /&gt;
	preview: function(form) {&lt;br /&gt;
		var previewDialog = new Morebits.simpleWindow(750, 400);&lt;br /&gt;
		previewDialog.setTitle('Welcome template preview');&lt;br /&gt;
		previewDialog.setScriptName('Welcome user');&lt;br /&gt;
		previewDialog.setModality(true);&lt;br /&gt;
&lt;br /&gt;
		var previewdiv = document.createElement('div');&lt;br /&gt;
		previewdiv.style.marginLeft = previewdiv.style.marginRight = '0.5em';&lt;br /&gt;
		previewdiv.style.fontSize = 'small';&lt;br /&gt;
		previewDialog.setContent(previewdiv);&lt;br /&gt;
&lt;br /&gt;
		var previewer = new Morebits.wiki.preview(previewdiv);&lt;br /&gt;
		previewer.beginRender(Twinkle.welcome.getTemplateWikitext(form.type.value, form.getChecked('template'), form.article.value), 'User talk:' + mw.config.get('wgRelevantUserName')); // Force wikitext/correct username&lt;br /&gt;
&lt;br /&gt;
		var submit = document.createElement('input');&lt;br /&gt;
		submit.setAttribute('type', 'submit');&lt;br /&gt;
		submit.setAttribute('value', 'Close');&lt;br /&gt;
		previewDialog.addContent(submit);&lt;br /&gt;
&lt;br /&gt;
		previewDialog.display();&lt;br /&gt;
&lt;br /&gt;
		$(submit).click(function() {&lt;br /&gt;
			previewDialog.close();&lt;br /&gt;
		});&lt;br /&gt;
	},&lt;br /&gt;
	main: function(pageobj) {&lt;br /&gt;
		var params = pageobj.getCallbackParameters();&lt;br /&gt;
		var text = pageobj.getPageText();&lt;br /&gt;
&lt;br /&gt;
		// abort if mode is auto and form is not empty&lt;br /&gt;
		if (pageobj.exists() &amp;amp;&amp;amp; params.mode === 'auto') {&lt;br /&gt;
			Morebits.status.info('Warning', 'User talk page not empty; aborting automatic welcome');&lt;br /&gt;
			Morebits.wiki.actionCompleted.event();&lt;br /&gt;
			return;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		var welcomeText = Twinkle.welcome.getTemplateWikitext(params.type, params.value, params.article);&lt;br /&gt;
&lt;br /&gt;
		if (Twinkle.getPref('topWelcomes')) {&lt;br /&gt;
			text = welcomeText + '\n\n' + text;&lt;br /&gt;
		} else {&lt;br /&gt;
			text += '\n' + welcomeText;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		var summaryText = 'Welcome to Wikipedia!';&lt;br /&gt;
		pageobj.setPageText(text);&lt;br /&gt;
		pageobj.setEditSummary(summaryText + Twinkle.getPref('summaryAd'));&lt;br /&gt;
		pageobj.setWatchlist(Twinkle.getPref('watchWelcomes'));&lt;br /&gt;
		pageobj.setCreateOption('recreate');&lt;br /&gt;
		pageobj.save();&lt;br /&gt;
	}&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
Twinkle.welcome.callback.evaluate = function friendlywelcomeCallbackEvaluate(e) {&lt;br /&gt;
	var form = e.target;&lt;br /&gt;
&lt;br /&gt;
	var params = {&lt;br /&gt;
		type: form.type.value,&lt;br /&gt;
		value: form.getChecked('template'),&lt;br /&gt;
		article: form.article.value,&lt;br /&gt;
		mode: 'manual'&lt;br /&gt;
	};&lt;br /&gt;
&lt;br /&gt;
	Morebits.simpleWindow.setButtonsEnabled(false);&lt;br /&gt;
	Morebits.status.init(form);&lt;br /&gt;
&lt;br /&gt;
	var userTalkPage = mw.config.get('wgFormattedNamespaces')[3] + ':' + mw.config.get('wgRelevantUserName');&lt;br /&gt;
	Morebits.wiki.actionCompleted.redirect = userTalkPage;&lt;br /&gt;
	Morebits.wiki.actionCompleted.notice = 'Welcoming complete, reloading talk page in a few seconds';&lt;br /&gt;
&lt;br /&gt;
	var wikipedia_page = new Morebits.wiki.page(userTalkPage, 'User talk page modification');&lt;br /&gt;
	wikipedia_page.setFollowRedirect(true);&lt;br /&gt;
	wikipedia_page.setCallbackParameters(params);&lt;br /&gt;
	wikipedia_page.load(Twinkle.welcome.callbacks.main);&lt;br /&gt;
};&lt;br /&gt;
})(jQuery);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// &amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>en&gt;Amorymeltzer</name></author>
	</entry>
</feed>