A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.wikipedia.org/wiki/User:V111P/js/smartLinkingLoader.js below:

User:V111P/js/smartLinkingLoader.js - Wikipedia

User:V111P/js/smartLinkingLoader.js

From Wikipedia, the free encyclopedia

Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump.
This code will be executed when previewing this page. Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/* smartLinkingLoader.js
 * v. 2014-07-07
 *
 * This script adds a toolbar button which, when pressed, loads smartLinking.js and calls window.smartLinking().
 *
 * Smart Linking home: http://en.wikipedia.org/wiki/User:V111P/js/Smart_Linking
 */
 
mw.libs.smartLinkingLoader = mw.libs.smartLinkingLoader || {};
mw.libs.smartLinkingLoader.version = 1000;

mw.libs.smartLinkingLoader.smartLinking = function () {
	"use strict";
	if (window.smartLinking) {
		window.smartLinking();
	}
	else {
		$.ajax({
			url: '//en.wikipedia.org/w/index.php?title=User:V111P/js/smartLinking.js'
					+ '&action=raw&ctype=text/javascript&smaxage=86400&maxage=604800',
			dataType: 'script',
			cache: true,
			success: function () {
				if (window.smartLinking)
					window.smartLinking();
				else
					setTimeout(function () {
						if (window.smartLinking)
							window.smartLinking();
					}, 500);
			}
		});
	}
};

mw.libs.smartLinkingLoader.addButton = function () {
	"use strict";
	var buttonId = 'smartLinkingButton';

	if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) == -1
		  || $('#' + buttonId).length > 0 )
		return;

	var addToolbarButtons_scriptUrl = '//en.wikipedia.org/w/index.php?title='
		+ 'User:V111P/js/addToolbarButtons.js&action=raw'
		+ '&ctype=text/javascript'; // [[User:V111P/js/addToolbarButtons.js]]
	var c = ( window.smartLinkingConfig || {} );
	var toolbarButtonProps = {
		id: buttonId,
		tooltip: (c.msgs && c.msgs.scriptName) || 'Smart Linking',
		section: 'main',
		group: 'insert',
		callback: mw.libs.smartLinkingLoader.smartLinking,
		iconUrl: '//upload.wikimedia.org/wikipedia/commons/9/96/Interpage_icon.png',
		iconUrlClassic: '//upload.wikimedia.org/wikipedia/commons/5/5a/Interpage_button.png'
	};

	if (mediaWiki.libs.addToolbarButtons)
		mediaWiki.libs.addToolbarButtons(toolbarButtonProps);
	else {
		var tbs = window.toolbarButtonsToAdd = window.toolbarButtonsToAdd || [];
		tbs.push(toolbarButtonProps);
		$.ajax({
			url: addToolbarButtons_scriptUrl,
			dataType: 'script',
			cache: true
		});
	}

};

if ((window.smartLinkingConfig || {}).addButton !== false)
	mediaWiki.libs.smartLinkingLoader.addButton();

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4