MediaWiki:Gadget-autowelcome.js

This is an old revision of this page, as edited by Alex (talk | contribs) at 17:12, 17 October 2024. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

After saving, you may need to bypass your browser's cache to see the changes. For further information, see Wikipedia:Bypass your cache.

  • In most Windows and Linux browsers: Hold down Ctrl and press F5.
  • In Safari: Hold down ⇧ Shift and click the Reload button.
  • In Chrome and Firefox for Mac: Hold down both ⌘ Cmd+⇧ Shift and press R.
/** * autowelcome.js - from https://runescape.wiki/w/User:Quarenon/autowelcome.js * * Automatically insert the welcome notice code when editing a new user talk page. * * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program.  If not, see <http://www.gnu.org/licenses/>. */// <nowiki>$(function() {	if (mw.config.get('wgCanonicalNamespace') == 'User_talk' &&		!mw.config.get('wgTitle').match(/([0-9]{1,3}\.){3}[0-9]{1,3}/) && // don't welcome IPv4		!mw.config.get('wgTitle').match(/([0-9A-F]{1,4}:){7}[0-9A-F]{1,4}/) && // don't welcome IPv6		mw.config.get('wgAction') == 'edit' &&		mw.config.get('wgArticleId') === 0 &&		mw.config.get('wgTitle').split('.').length != 4 &&		mw.config.get('wgTitle').indexOf('/') == -1 &&		!document.getElementsByClassName('mw-logline-block').length	) {		$('#wpTextbox1').val((typeof(window.autoWelcomeText) == 'undefined') ? '{{Welcome}}\n\n-- ~~~~' : window.autoWelcomeText);		$('#wpSummary,#wpSummaryEnhanced').val((typeof(window.autoWelcomeSummary) == 'undefined') ? 'Welcome!' : window.autoWelcomeSummary);	}})// </nowiki>