var myButtons = new Array([2,'{{WIP|Jalo}}\\n{{UNESCO\\n|tipoBene = patrimonio\\n|nome = \\n|nomeInglese = \\n|immagine = \\n|anno = \\n|tipologia = Culturali\\n|pericolo= \\n|criterio = (i) (ii) (iii) (iv) (v) (vi) (vii) (viii) (ix) (x) (xi) (xii)\\n|link = \\n|stato = \\n|linkCategoria= \\n}}\\n','','UNESCO tpl',245,''],[2,'{{WIP|Jalo}}\\n{{coord||display=title}}\\n{{UNESCO\\n|tipoBene = patrimonio\\n|nome = \\n|nomeInglese = \\n|immagine = \\n|anno = \\n|tipologia = Culturali\\n|pericolo= \\n|criterio = (i) (ii) (iii) (iv) (v) (vi) (vii) (viii) (ix) (x) (xi) (xii)\\n|link = \\n|stato = \\n|linkCategoria= \\n}}\\n\\n\\n==Collegamenti esterni==\\n\\n*[http://whc.unesco.org/en/list/ Scheda UNESCO]\\n\\n{{Patrimoni Unesco|}}\\n\\n[[Categoria:Patrimoni dell\'umanità in ]]\\n','','UNESCO voce',0,''],[2,'{{Bio\\n|Titolo = \\n|Nome = \\n|Cognome = \\n|PostCognome = \\n|ForzaOrdinamento = \\n|Sesso = \\n|LuogoNascita = \\n|GiornoMeseNascita = \\n|AnnoNascita = \\n|LuogoMorte = \\n|LuogoMorteLink = \\n|GiornoMeseMorte = \\n|AnnoMorte = \\n|Attività = \\n|Nazionalità = \\n|PostNazionalità =\\n|Immagine = \\n|Didascalia =\\n|FineIncipit = \\n|Categorie = \\n}}','','Bio',315,''],[2,'{{Conflitto\\n|nome del conflitto = \\n|parte_di = \\n|immagine = \\n|didascalia = \\n|data = \\n|luogo = \\n|casus = \\n|mutamenti_territoriali = \\n|esito = \\n|schieramento1 = \\n|schieramento2 = \\n|comandante1 = [[Immagine:White flag icon.svg|16px]]\\n|comandante2 = \\n|effettivi1 = \\n|effettivi2 = \\n|perdite1 = \\n|perdite2 = \\n|perdite3 = \\n|note = \\n}}\\n{{Campagnabox conquista spagnola del Perù}}\\n{{Campagnabox Arauco}}\\n{{Campagnabox Guerra civile Inca}}\\n','','Conflitto',0,''],[2,'{{Box successione\\n|carica = \\n|immagine = \\n|periodo = \\n|precedente = \\n|successivo = \\n}}','','Box successione',92,'']);
var myLinks = new Array(['Voce su en.wiki','http://en.wikipedia.org/wiki/%TITOLO%'],['Voce su Commons','http://commons.wikimedia.org/wiki/Image:%TITOLO2%'],['Vecchio Edit-count','http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?user=Jalo&dbname=itwiki_p'],['Bold / No bold','javascript:bolda();'],['Logo / No logo','javascript:noLogo();'],['test','javascript:apostrofi();']);
// Firefox
/*************
*** Regex menu framework
*** by [[m:user:Pathoschild]] <http://meta.wikimedia.org/wiki/User:Pathoschild/Scripts/Regex_menu_framework>
*** - adds a sidebar menu of user-defined scripts.
*************/
importScriptURI('http://meta.wikimedia.org/w/index.php?title=User:Pathoschild/Scripts/Regex_menu_framework.js&action=raw&ctype=text/javascript');
/* menu links */
// In the function below, add more lines like "regexTool('link text','function_name()')" to add
// links to the sidebar menu. The function name is the function defined in rfmscripts() below.
function rmflinks() {
regexTool('Custom regex','custom()'); // a default tool which performs regex input in a dynamic form
regexTool('PostOCR','postOCR()');
regexTool('Apostrofi','apostrofi()');
}
/* scripts */
// Below, define the functions linked to from rmflinks() above. These functions can use any JavaScript,
// but there is a set of simplified tools documented at
// http://meta.wikimedia.org/wiki/User:Pathoschild/Script:Regex_menu_framework .
/* sidebar code for use with P/c's Regex code */
function DNBset() {
var editbox = document.getElementsByName('wpTextbox1')[0];
editbox.value = editbox.value.replace(/\{\{header\n \| title \=.+\n \| author \= \n \| translator \= \n \| section \= \n \| previous \= \n \| next \= \n \| notes \= \n\}\}\n/, '{{subst:DNBset\n |article= \n |previous= \n |next= \n |volume = \n |contributor = \n |wikipedia = \n |extra_notes= \n |from= \n |to= \n |section= \n}}');
}
function postOCR() {
var editbox = document.getElementsByName('wpTextbox1')[0];
editbox.value = editbox.value.replace(/'/g, '’')
.replace(/’’’/g, '\'\'\'')
.replace(/’’/g, '\'\'')
.replace(/E’ /g, 'È ')
.replace(/lP/g, 'll’')
.replace(/I’/g, 'l’')
.replace(/1’/g, 'l’')
.replace(/ :/g, ': ')
.replace(/([dlznt])’ /g, "$1’")
.replace(/[(\[] /g, " $1")
.replace(/ \n/g, '\n')
.replace(/\n\n/g, '<2p>')
.replace(/\n\n\n/g, '<3p>')
.replace(/-\n/g, '')
.replace(/\n/g, ' ')
.replace(/<2p>/g, '\n\n')
.replace(/<3p>/g, '\n\n\n')
.replace(/ ,/g, ", ")
.replace(/ ;/g, "; ")
.replace(/ !/g, "! ")
.replace(/ \?/g, "? ")
.replace(/ \./g, ". ")
.replace(/ :/g, ": ")
;
}
function apostrofi() {
var editbox = document.getElementsByName('wpTextbox1')[0];
editbox.value = editbox.value.replace(/'/g, '’')
.replace(/’’’/g, '\'\'\'')
.replace(/’’/g, '\'\'')
;
}
function dashes() {
var editbox = document.getElementsByName('wpTextbox1')[0];
editbox.value = editbox.value.replace(/--/g, '—')
}
function lines() {
var editbox = document.getElementsByName('wpTextbox1')[0];
editbox.value = editbox.value.replace(/ \n/g, '\n');
editbox.value = editbox.value.replace(/\n\n/g, '<p>');
editbox.value = editbox.value.replace(/-\n/g, '');
editbox.value = editbox.value.replace(/\n/g, ' ');
editbox.value = editbox.value.replace(/<p>/g, '\n\n')
}
function rmTextQual() {
var editbox = document.getElementsByName('wpTextbox1')[0];
editbox.value = editbox.value.replace(/\{\{TextQuality\|\d\d\%\}\}/, '');
}
function trans() {
var editbox = document.getElementsByName('wpTextbox1')[0];
editbox.value = editbox.value.replace(/ translator\w+\=/, ' override_translator = ');
}
function und2ital() {
var editbox = document.getElementsByName('wpTextbox1')[0];
editbox.value = editbox.value.replace(/\_/g, '\'\'');
}
function chapcase() {
var editbox = document.getElementsByName('wpTextbox1')[0];
editbox.value = editbox.value.replace(/CHAPTER/g, '{{sc|Chapter}}');
}
function welcome() {
var headerbox = document.getElementsByName('wpHeaderTextbox')[0];
editbox.value = editbox.value + '{{welcome}}-- ~~' + '~~';
editreason.value = editreason.value + 'welcome';
}
function weliptest() {
var headerbox = document.getElementsByName('wpHeaderTextbox')[0];
editbox.value = editbox.value + '{{subst:' + 'welcomeip}}-- ~~' + '~~\n{{test}}';
editreason.value = editreason.value + 'welcome & test';
}
function similar() {
var editbox = document.getElementsByName('wpTextbox1')[0];
editbox.value = editbox.value.replace(/\{\{header/g, '{{similar|}}\n{{header');
editreason.value = editreason.value + '{{similar}}';
}
//</pre>
|