Utente:Nastoshka/TemplateScript.js

Da Wikivoyage.

Nota: dopo aver salvato, potrebbe essere necessario pulire la cache del proprio browser per vedere i cambiamenti.

  • Firefox / Safari: tenere premuto il tasto delle maiuscole e fare clic su Ricarica, oppure premere Ctrl-F5 o Ctrl-R (⌘-R su Mac)
  • Google Chrome: premere Ctrl-Shift-R (⌘-Shift-R su un Mac)
  • Internet Explorer: tenere premuto il tasto Ctrl mentre si fa clic su Refresh, oppure premere Ctrl-F5
  • Opera: svuotare completamente la cache dal menu Strumenti → Preferenze
/* globals $, pathoschild */

// <nowiki>
 const templateScript_myEditingTools = [
 	{	category: 'Editing', 
			name: 'Aggiornare', 
			template: '{{Da aggiornare|anno=|mese=mm}}',
			position: 'after' 
		},
		{ 
			category: 'Editing', 
			name: 'Marker', 
			template: '{{marker|tipo=|nome=|lat=|long=}}',
			position: 'after' 
		},
		{ 
			category: 'Editing', 
			name: 'FillCoords', 
			template: '| lat= | long= | wikidata= ',
			position: 'after' 
		},
		{ category: 'Editing', 
		name: 'wikidataLink', 
		template: '| wikidata= ',
		position: 'after' 
		},
		{ category: 'Editing', 
		name: 'Città', 
		template: '{{Città| nome= | alt= | lat= | long =  | wikidata = | descrizione= }}',
		position: 'after' 
		},
 	];
 	
const templateScript_myUserTools = [
		{
			category: 'Per gli utenti',
			name: 'Benvenuto',
			template: '{{Benvenuto|firma=~~~~}}',
			position: 'after',
			editSummary: 'Benvenuto!',
			forNamespaces: 3
		}
	]
 
 
/**
 * TemplateScript adds configurable templates and scripts to the sidebar, and adds an example regex editor.
 * @see https://meta.wikimedia.org/wiki/TemplateScript
 * @update-token [[File:Pathoschild/templatescript.js]]
 */
$.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType:'script', cache:true }).then(function() {
	pathoschild.TemplateScript.add([
		...templateScript_myUserTools,
		...templateScript_myEditingTools
	]);
});
// </nowiki>