Utilisateur:ThatFeeds/vector.js
Note : après avoir enregistré vos modifications, il se peut que vous deviez forcer le rechargement complet du cache de votre navigateur pour voir les changements.
- Firefox / Safari : Maintenez la touche Maj (Shift) en cliquant sur le bouton Actualiser ou pressez Ctrl-F5 ou Ctrl-R (⌘-R sur un Mac) ;
- Google Chrome : Appuyez sur Ctrl-Maj-R (⌘-Shift-R sur un Mac) ;
- Internet Explorer : Maintenez la touche Ctrl en cliquant sur le bouton Actualiser ou pressez Ctrl-F5 ;
- Opera : Allez dans Menu → Settings (Opera → Préférences sur un Mac) et ensuite à Confidentialité & sécurité → Effacer les données d'exploration → Images et fichiers en cache.
document.write('<script type="text/javascript" src="'
+ 'http://fr.wikisource.org/w/index.php?title=User:Acer11/Trévoux.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
function format1() {
var txt = document.editform.wpTextbox1;
txt.value = typo1(txt.value);
}
function typo1(str){
str = str.replace(/( +)/g, " ");
str = str.replace(/-( *)\n/g, "");
str = str.replace(/( *)\n( *)/g, " ");
str = str.replace(/\.\.\./g, "…");
str = str.replace(/'/g, "’");
return str;
}
function format2() {
var txt = document.editform.wpTextbox1;
txt.value = typo2(txt.value);
}
function typo2(str){
str = str.replace(/\.\.\./g, "…");
str = str.replace(/([^'])'([^'])/g, "$1’$2");
str = str.replace(/oe([uistcdn])/g, "œ$1");
str = str.replace(/\n- */g, "\n— ");
str = str.replace(/ - /g, " — ");
str = str.replace(/( *);( *)/g, " ; ");
str = str.replace(/([^!?(])( *)\!/g, "$1 !");
str = str.replace(/( *):( *)/g, " : ");
str = str.replace(/([^!?(])( *)\?/g, "$1 ?");
str = str.replace(/( *),( *)/g, ", ");
str = str.replace(/([^\n])( *)»/g, "$1 »");
str = str.replace(/«( *)/g, "« ");
return str;
}
/* Notes bas de page*/
function notes(str){
var reg = /<ref>[^<]*<\/ref>/g
var tab = str.match(reg)
str = str.replace(reg,"")
var n = tab.length
var reg2 = new RegExp("#1")
for(i=0; i< n; i++)
{
reg2 = new RegExp("#"+(i+1))
str = str.replace(reg2,tab[i])
}
return str
}
function notesbutton() {
var txt = document.editform.wpTextbox1;
txt.value = notes(txt.value);
}
$(function () {
if(document.forms.editform) {
mw.util.addPortletLink('p-personal', 'javascript:format1()', 'césures', 'ca-format', 'Notes', '', document.getElementById('ca-edit'));
}
});
$(function () {
if(document.forms.editform) {
mw.util.addPortletLink('p-personal', 'javascript:notesbutton()', 'notes', 'ca-format', 'Notes', '', document.getElementById('ca-edit'));
}
});
$(function () {
if(document.forms.editform) {
mw.util.addPortletLink('p-personal', 'javascript:format2()', 'typo', 'ca-format', 'Corrections de la mise en page et de la typographie', '', document.getElementById('ca-edit'));
}
});
var predefinedSummaries = {
"Liste": "",
"Lien": "Lien(s)",
"Index": "Index",
"Catégorie(s)": "Ajout de catégorie(s)",
"ProbCat" : "Correction(s) des catégories",
"Source": "Source manquante",
"Mise en forme": "Mise en forme",
"Compléments": "Compléments (bibliographie, image, etc.)",
"Typographie": "Typographie"
};
$(function () {
var summary = document.getElementById("wpSummary");
if (!summary) return;
var dropdown = document.createElement("select");
dropdown.style.width = "10%";
for (var label in predefinedSummaries) {
var option = document.createElement("option");
option.setAttribute("value", predefinedSummaries[label]);
option.appendChild(document.createTextNode(label));
dropdown.appendChild(option);
}
dropdown.onchange = function () {
summary.value = summary.value.replace(/(\/\*.*?\*\/\s+)?.*/,
"$1" + dropdown.options[dropdown.selectedIndex].value);
};
summary.parentNode.insertBefore(dropdown, summary.nextSibling);
});
// install [[User:Cacycle/wikEdDiff]] enhanced diff view using ajax
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEdDiff.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
/**
* Menu de Gauche
*
* Rajoute des liens
*
* Auteur : FredB.
*/
function nouvelleBoite() {
var l = document.getElementById('column-one');
if (!l) return;
l.innerHTML = l.innerHTML
+ '<div class="portlet" id="p-nbx">'
+ ' <div class="pBody">'
+ ' <ul>'
+ ' <li><a href="http://toolserver.org/~daniel/WikiSense/Contributors.php">Contributeurs</a></li>'
+ ' <li><a href="http://gallica.bnf.fr">Gallica</a></li>'
+ ' <li><a href="http://books.google.com">Google Books</a></li>'
+ ' <li><a href="http://www.archive.org/details/texts">Internet Archive</a></li>'
+ ' <li><a href="http://vs.aka-online.de/cgi-bin/wppagehiststat.pl">Page stats</a></li>'
+ ' <li><a href="http://classiques.uqac.ca/classiques/">Classiques</a></li>'
+ ' </ul>'
+ ' </div>'
+ '</div> ';
}
addOnloadHook(nouvelleBoite);
/**
* Toolbar
*
* Rajoute des boutons dans la barre d'outils
*
*
*
*
*/
/**
* + <includeonly>X</includeonly>
*/
if (mwCustomEditButtons) {
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/f/f9/Button_onlyinclude_green.png",
"speedTip": "noinclude",
"tagOpen": '<includeonly>',
"tagClose": '</includeonly>',
"sampleText": "Insert text here"};
};
/**
* + <section begin=X>
*/
if (mwCustomEditButtons) {
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Progress-0625.svg/20px-Progress-0625.svg.png",
"speedTip": "section begin",
"tagOpen": '<section begin=',
"tagClose": ' />',
"sampleText": ""};
};
/**
* + <section end=X>
*/
if (mwCustomEditButtons) {
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Progress-0750.svg/20px-Progress-0750.svg.png",
"speedTip": "section end",
"tagOpen": '<section end=',
"tagClose": ' />',
"sampleText": ""};
};
/**
* + MATCH
*/
if (mwCustomEditButtons) {
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/9/97/Template_button.png",
"speedTip": "match",
"tagOpen": '==__MATCH__:[[',
"tagClose": ']]==',
"sampleText": ""};
};
if (mwCustomEditButtons) {
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/a/a2/SmallcapsButton.png",
"speedTip": "small caps",
"tagOpen": '{{sc|',
"tagClose": '}}',
"sampleText": ""};
};
if (mwCustomEditButtons) {
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://bits.wikimedia.org/skins-1.5/common/images/button_sig.png",
"speedTip": "latin",
"tagOpen": "''{{lang|la|",
"tagClose": "}}''",
"sampleText": ""};
};
/**
* + Auteur
*/
if (mwCustomEditButtons) {
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/8/83/Button_biocitas.png",
"speedTip": "Auteur",
"tagOpen": '[[Auteur:',
"tagClose": '|]]',
"sampleText": "Insert link here"};
};
/**
* + {{corr}}
*/
if (mwCustomEditButtons) {
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/0/01/Button_no_source.png",
"speedTip": "Corr",
"tagOpen": '{{corr|:',
"tagClose": '|}}',
"sampleText": ""};
};
if (mwCustomEditButtons) {
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/8/8d/Button_no_source_no_license.png",
"speedTip": "subst:corrDiscussion",
"tagOpen": '<section begin="correction"/>{{CorrDiscussion/lst|1=:',
"tagClose": '|2=|3=|ligne=|par=|expl=|endroit=|nombre=}}<section end="correction"/>',
"sampleText": ""};
};
//<pre>
//<nowiki>