Utente:Salvatore Ingala/commandline.js: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
m aggiornamenti
m aggiornamento: potenziata fixformat
Riga 15:
"letteratura", "LGBT", "lingue", "linguistica", "matematica", "meccanica", "medicina", "metal", "mitologia", "motociclismo", "musei", "musica", "nautica", "neopaganesimo", "numismatica", "nuoto", "paleontologia", "pallacanestro", "pallamano", "pallanuoto", "pallavolo", "pattinaggio", "pesca sportiva", "piante", "politica", "Pokémon", "psicologia", "pugilato", "punk", "radio", "religione", "rock", "rugby", "scacchi", "scienza", "scherma", "sci",
"skeleton", "sociologia", "sport", "stadi", "storia", "subacquea", "teatro", "telecomunicazioni", "televisione", "tennis", "tiro con l'arco", "trasporti", "turismo", "vela", "videogiochi", "vini","voci comuni", "wrestling", "zoologia");
 
 
if (typeof(fixformat_list) == 'undefined'){
//nessuna sostituzione impostata, usa quelle standard
fixformat_list = new Array(
[/\’/g, "'"],
[/ '([\w\ ]+)' /g, ' "$1" '],
[/“/g,'"'],
[/”/g,'"'],
[/–/g, '-'],
[/,,/g, ','],
[/ m2 /g, ' m² '],
[/a' /g, "à "],
[/([^p])o' /g, "$1ò "],
[/u' /g, "ù "],
[/i' /g, "ì "],
[/ anzich(è|e')/g, "anziché"],
[/ affinch(è|e')/g, "affinché"],
[/ bench(è|e')/g, " benché"],
[/ cioé/g, " cioè"],
[/ Dè /g, " De' "],
[/ dè /g, " de' "],
[/ dò/g, " do"],
[/E' /g, "È "],
[/É /g, "È "],
[/ e' /g, " è "],
[/ é/g, " è"],
[/ fà /g, " fa "],
[/ fè /g, " fe' "],
[/ Frà /g, " Fra' "],
[/ fù /g, " fu "],
[/ mò /g, " mo' "],
[/ nè /g, " né "],
[/ ne' /g, " né "],
[/ nonch(è|e')/g, " nonché"],
[/ pè /g, " pe' "],
[/ perch(è|e')/g, " perché"],
[/ per(ó|o') /g,' però '],
[/ piu' /g, " più "],
[/ pò/g, " po'"],
[/ poich(è|e') /g, " poiché "],
[/ propio/g, " proprio"],
[/ (puo|puo') /gi,' può '],
[/ quì /gi, " qui "],
[/ quà /gi, " qua "],
[/ qual'è /gi, " qual è"],
[/ sà /gi, " sa "],
[/ sè /gi, " sé "],
[/si' /g, "sì"],
[/ sò /g, " so "],
[/ sù /g, " su "],
[/ tr(è|e'|é) /g, " tre "],
[/ sucessivo /gi, " successivo "],
[/</g,'<'],
[/>/g,'>'],
[/&/g,'&'],
[/"/g,'"'],
[/à/g,'à'],
[/è/g,'è'],
[/é/g,'é'],
[/ì/g,'ì'],
[/¡/g,'¡'],
[/¢/g,'¢'],
[/£/g,'£'],
[/¥/g,'¥'],
[/´/g,"'"],
[/±/g,'±'],
[/×/g,'×'],
[/÷/g,'÷'],
[/µ/g,'µ'],
[/°/g,'°'],
[/¼/g,'¼'],
[/½/g,'½'],
[/¾/g,'¾'],
[/¹/g,'¹'],
[/²/g,'²'],
[/³/g,'³'],
[/§/g,'§'],
[/<\/?(b|strong)>/gi, "'''"],
[/<\/?(i|em|var)>/gi, "''"],
[/<br>\n\n/g,'\n\n'],
[/<br>/gi,'<br />'],
[/\n<hr[ \/]*>\n/gi, '\n----\n'],
[/ +<hr[ \/]*> +/gi, '\n----\n'],
[/<hr ([^>\/]+?)>/gi,'<hr $1 />'],
[/\n *<h1> *([^<]+?) *<\/h1> *\n/gi, "\n= $1 =\n"],
[/\n *<h2> *([^<]+?) *<\/h1> *\n/gi, "\n== $1 ==\n"],
[/\n *<h3> *([^<]+?) *<\/h1> *\n/gi, "\n=== $1 ===\n"],
[/\n *<h4> *([^<]+?) *<\/h1> *\n/gi, "\n==== $1 ====\n"],
[/\n *<h5> *([^<]+?) *<\/h1> *\n/gi, "\n===== $1 =====\n"],
[/\n *<h6> *([^<]+?) *<\/h1> *\n/gi, "\n====== $1 =======\n"]
);
}
 
if (typeof(fixformat_subject) == 'undefined') fixformat_subject = 'correzioni automatiche; ';
 
//Funzioni di Timendum
Riga 218 ⟶ 313:
//Sostituzioni automatiche
function cmd_fixformat(){
if ((wpTextbox1 = document.getElementById("wpTextbox1")) == null) return;
var form = document.editform;
if (typeof(fixformat_list) == 'undefined') return;
var txt = form.wpTextbox1;
for (i = 0; i < fixformat_list.length; i++)
if (txt==null) return;
wpTextbox1.value = wpTextbox1.value.replace(fixformat_list[i][0], fixformat_list[i][1]);
txt.value = txt.value
TimenSA(fixformat_subject); TimenME();
.replace(/\’/g, "'")
.replace(/ '([\w\ ]+)' /g, ' "$1" ')
.replace(/“/g,'"')
.replace(/”/g,'"')
.replace(/–/g, '-')
.replace(/,,/g, ',')
.replace(/ m2 /g, ' m² ')
.replace(/a' /g, "à ")
.replace(/([^p])o' /g, "$1ò ")
.replace(/u' /g, "ù ")
.replace(/i' /g, "ì ")
.replace(/ anzich(è|e')/g, "anziché")
.replace(/ affinch(è|e')/g, "affinché")
.replace(/ bench(è|e')/g, " benché")
.replace(/ cioé/g, " cioè")
.replace(/ Dè /g, " De' ")
.replace(/ dè /g, " de' ")
.replace(/ dò/g, " do")
.replace(/E' /g, "È ")
.replace(/É /g, "È ")
.replace(/ e' /g, " è ")
.replace(/ é/g, " è")
.replace(/ fà /g, " fa ")
.replace(/ fè /g, " fe' ")
.replace(/ Frà /g, " Fra' ")
.replace(/ fù /g, " fu ")
.replace(/ mò /g, " mo' ")
.replace(/ nè /g, " né ")
.replace(/ ne' /g, " né ")
.replace(/ nonch(è|e')/g, " nonché")
.replace(/ pè /g, " pe' ")
.replace(/ perch(è|e')/g, " perché")
.replace(/ per(ó|o') /g,' però ')
.replace(/ piu' /g, " più ")
.replace(/ pò/g, " po'")
.replace(/ poich(è|e') /g, " poiché ")
.replace(/ propio/g, " proprio")
.replace(/ (puo|puo') /gi,' può ')
.replace(/ quì /gi, " qui ")
.replace(/ quà /gi, " qua ")
.replace(/ qual'è /gi, " qual è")
.replace(/ sà /gi, " sa ")
.replace(/ sè /gi, " sé ")
.replace(/si' /g, "sì")
.replace(/ sò /g, " so ")
.replace(/ sù /g, " su ")
.replace(/ tr(è|e'|é) /g, " tre ")
.replace(/ sucessivo /gi, " successivo ")
.replace(/</g,'<')
.replace(/>/g,'>')
.replace(/&/g,'&')
.replace(/"/g,'"')
.replace(/à/g,'à')
.replace(/è/g,'è')
.replace(/é/g,'é')
.replace(/ì/g,'ì')
.replace(/¡/g,'¡')
.replace(/¢/g,'¢')
.replace(/£/g,'£')
.replace(/¥/g,'¥')
.replace(/´/g,"'")
.replace(/±/g,'±')
.replace(/×/g,'×')
.replace(/÷/g,'÷')
.replace(/µ/g,'µ')
.replace(/°/g,'°')
.replace(/¼/g,'¼')
.replace(/½/g,'½')
.replace(/¾/g,'¾')
.replace(/¹/g,'¹')
.replace(/²/g,'²')
.replace(/³/g,'³')
.replace(/§/g,'§')
.replace(/<\/?(b|strong)>/gi, "'''")
.replace(/<\/?(i|em|var)>/gi, "''")
.replace(/<br>\n\n/g,'\n\n')
.replace(/<br>/gi,'<br />')
.replace(/\n<hr[ \/]*>\n/gi, '\n----\n')
.replace(/ +<hr[ \/]*> +/gi, '\n----\n')
.replace(/<hr ([^>\/]+?)>/gi,'<hr $1 />')
.replace(/\n *<h1> *([^<]+?) *<\/h1> *\n/gi, "\n= $1 =\n")
.replace(/\n *<h2> *([^<]+?) *<\/h1> *\n/gi, "\n== $1 ==\n")
.replace(/\n *<h3> *([^<]+?) *<\/h1> *\n/gi, "\n=== $1 ===\n")
.replace(/\n *<h4> *([^<]+?) *<\/h1> *\n/gi, "\n==== $1 ====\n")
.replace(/\n *<h5> *([^<]+?) *<\/h1> *\n/gi, "\n===== $1 =====\n")
.replace(/\n *<h6> *([^<]+?) *<\/h1> *\n/gi, "\n====== $1 =======\n")
;
TimenSA("formattazione; "); TimenMe();
}