Utilisateur:Golmote/common.js
Note : après avoir enregistré la page, vous devrez forcer le rechargement complet du cache de votre navigateur pour voir les changements.
Mozilla / Firefox / Konqueror / Safari : maintenez la touche Majuscule (Shift) en cliquant sur le bouton Actualiser (Reload) ou pressez Maj-Ctrl-R (Cmd-R sur Apple Mac) ;
Chrome / Internet Explorer / Opera : maintenez la touche Ctrl en cliquant sur le bouton Actualiser ou pressez Ctrl-F5.mw.loader.load('//fr.wikipedia.org/w/index.php?title=Utilisateur:DreZhsh/DisableAutoEditTalk.js&action=raw&ctype=text/javascript');
mw.loader.load( '//meta.wikimedia.org/w/index.php?title=User:Jon_Harald_Søby/diffedit.js&action=raw&ctype=text/javascript' );
mw.loader.load( '//en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-markblocked.js&action=raw&ctype=text/javascript' );
var whenVE;
(function () {
var veCb = [];
var veTimer;
var checkVE = function () {
if (typeof ve !== 'undefined' && ve.init && ve.init.target) {
veCb.forEach(function (cb) { cb(); });
veCb = [];
} else {
clearTimeout(veTimer);
veTimer = setTimeout(checkVE, 500);
}
};
whenVE = function (callback) {
veCb.push(callback);
checkVE();
};
}());
// Add the special character menu to the inline response form.
whenVE(function () {
if (ve.init.target.toolbarGroups[2].name === 'other') {
ve.init.target.toolbarGroups[2].include.push('specialCharacter');
if (ve.init.target.getSurface()) {
ve.init.target.setupToolbar(ve.init.target.getSurface());
}
}
});
// Add extra replacements to VE
whenVE(function () {
var extraReplacements = [ {
label: 'Noble|+',
regex: true,
matchCase: true,
search: /\[\[(?!(?:[fF]ichier|[fF]ile|[iI]mage|[cC]atégorie):)([^\|\]]+?) ((I)(er|re)|(?=[MDCLXVI]+)M*(?:CM|CD|D?C{0,3})(?:XC|XL|L?X{0,3})(?:IX|IV|V?I{0,3}))(,? [^\s\|\]\(][^\|\]\(]*)??( \([^\|\]\)]+\))[^\S\r\n]*(?:\|[^\S\r\n]*\1(?:[^\S\r\n]+| )(?:\2|\{\{\2\}\}|<abbr>\2<\/abbr>|I[eè]?\4|I\{\{[eè]?\4\}\}|<abbr>I<sup>[eè]?\4<\/sup><\/abbr>|I<sup>[eè]?\4<\/sup>)\5\6[^\S\r\n]*)?\]\]/.source,
replace: '{{noble|$1 $2$5$6|+}}'
}, {
label: 'Noble',
regex: true,
matchCase: true,
search: /\[\[(?!(?:[fF]ichier|[fF]ile|[iI]mage|[cC]atégorie):)([^\|\]]+?) ((I)(er|re)|(?=[MDCLXVI]+)M*(?:CM|CD|D?C{0,3})(?:XC|XL|L?X{0,3})(?:IX|IV|V?I{0,3}))(,? [^\s\|\]\(][^\|\]\(]*)?( \([^\|\]\)]+\))?[^\S\r\n]*(?:\|[^\S\r\n]*\1(?:[^\S\r\n]+| )(?:\2|\{\{\2\}\}|<abbr>\2<\/abbr>|I[eè]?\4|I\{\{[eè]?\4\}\}|<abbr>I<sup>[eè]?\4<\/sup><\/abbr>|I<sup>[eè]?\4<\/sup>)\5[^\S\r\n]*)?\]\]/.source,
replace: '{{noble|$1 $2$5$6}}'
}, {
label: 'Noble|-',
regex: true,
matchCase: true,
search: /\[\[(?!(?:[fF]ichier|[fF]ile|[iI]mage|[cC]atégorie):)([^\|\]]+?) ((I)(er|re)|(?=[MDCLXVI]+)M*(?:CM|CD|D?C{0,3})(?:XC|XL|L?X{0,3})(?:IX|IV|V?I{0,3}))(,? [^\s\|\]\(][^\|\]\(]*)( \([^\|\]\)]+\))?[^\S\r\n]*\|[^\S\r\n]*\1(?:[^\S\r\n]+| )(?:\2|\{\{\2\}\}|<abbr>\2<\/abbr>|I[eè]?\4|I\{\{[eè]?\4\}\}|<abbr>I<sup>[eè]?\4<\/sup><\/abbr>|I<sup>[eè]?\4<\/sup>)[^\S\r\n]*\]\]/.source,
replace: '{{noble|$1 $2$5$6|-}}'
}, {
label: 'Noble|1',
regex: true,
matchCase: true,
search: /\[\[(?!(?:[fF]ichier|[fF]ile|[iI]mage|[cC]atégorie):)([^\|\]]+?) ((I)(er|re)|(?=[MDCLXVI]+)M*(?:CM|CD|D?C{0,3})(?:XC|XL|L?X{0,3})(?:IX|IV|V?I{0,3}))(,? [^\s\|\]][^\|\]]*?)?[^\S\r\n]*\|[^\S\r\n]*\1(?:[^\S\r\n]+| )(?:\2|\{\{\2\}\}|<abbr>\2<\/abbr>|I[eè]?\4|I\{\{[eè]?\4\}\}|<abbr>I<sup>[eè]?\4<\/sup><\/abbr>|I<sup>[eè]?\4<\/sup>)(?:(?!\5[^\S\r\n]*\]\])(?:(,(?:[^\S\r\n]+| )[^\s\|\]][^\|\]]*?)|(?:[^\S\r\n]+| )([^\s\|\]][^\|\]]*?)))[^\S\r\n]*\]\]/.source,
replace: '{{noble|$1 $2$5|$6$7}}'
}, {
label: 'Noble|2',
regex: true,
matchCase: true,
search: /\[\[(?!(?:[fF]ichier|[fF]ile|[iI]mage|[cC]atégorie):)([^\|\]]+)\|[^\S\r\n]*([^\|\]]+?)(?:[^\S\r\n]+| )(?:<abbr>)?(?:\{\{)?((I)(?:<sup>)?(?:\{\{)?(er|re)(?:\}\})?(?:<\/sup>)?|((?=[MDCLXVI]+)M*(?:CM|CD|D?C{0,3})(?:XC|XL|L?X{0,3})(?:IX|IV|V?I{0,3})))(?:\}\})?(?:<\/abbr>)?(,?(?:[^\S\r\n]+| )[^\s\|\]][^\|\]]*?)?[^\S\r\n]*\]\]/.source,
replace: '{{noble|$1|$2 $4$5$6$7}}'
}, {
label: 'Noble-',
regex: true,
matchCase: true,
search: /(?<!\{\{[Nn]oble-?\|(?:[^|}]+\|)*|\{\{)([ʿA-ZÀÂÄĀÃĂÁÅÆÇĆĐÉÈÊËĚĒẾĘĞḤÎÏÍĪḴŁÑÔÖÓÒŌØŒŘŠȘŚÛÜÚŪÙ][ʿA-ZÀÂÄĀÃĂÁÅÆÇĆĐÉÈÊËĚĒẾĘĞḤÎÏÍĪḴŁÑÔÖÓÒŌØŒŘŠȘŚÛÜÚŪÙa-zàâäāãăáåæçćđéèêëěēếęğḥîïíīḵłñôöóòōøœřšșśûüúūù\-]+)(?:[^\S\r\n]+| )(?:(?:<abbr>)?(?:(I)(?:<sup>)?(?:(er|re)\b|\{\{(er|re)\}\})(?:<\/sup>)?|((?=[MDCLXVI]+\b)M*(?:CM|CD|D?C{0,3})(?:XC|XL|L?X{0,3})(?:IX|IV|V?I{0,3})\b))(?:<\/abbr>)?|(?:<abbr>)?\{\{(?:(I)(?:<sup>)?(er|re)\b(?:<\/sup>)?|((?=[MDCLXVI]+\b)M*(?:CM|CD|D?C{0,3})(?:XC|XL|L?X{0,3})(?:IX|IV|V?I{0,3})\b))\}\}(?:<\/abbr>)?)/.source,
replace: '{{noble-|$1 $2$3$4$5$6$7$8}}'
} ];
var findAndReplaceDialog_Initialize = ve.ui.FindAndReplaceDialog.prototype.initialize;
ve.ui.FindAndReplaceDialog.prototype.initialize = function () {
findAndReplaceDialog_Initialize.apply( this, arguments );
var that = this;
var extraButtons = [];
extraReplacements.forEach(function ( extraReplacement ) {
var extraButton = new OO.ui.ButtonWidget( {
label: extraReplacement.label
} );
extraButton.connect( that, { click: function () {
that.findText.setValue( extraReplacement.search );
that.replaceText.setValue( extraReplacement.replace );
if ( extraReplacement.regex ) {
that.regexToggle.setValue( true );
}
if ( extraReplacement.matchCase ) {
that.matchCaseToggle.setValue( true );
}
} } );
extraButtons.push( extraButton );
});
var extraGroup = new OO.ui.ButtonGroupWidget( {
classes: [ 've-ui-findAndReplaceDialog-cell' ],
items: extraButtons
} );
var $extraRow = $( '<div>' ).addClass( 've-ui-findAndReplaceDialog-row' );
this.$body
.append(
$extraRow.append( extraGroup.$element )
);
};
ve.init.target.setupToolbar(ve.init.target.getSurface());
});
$(function () {
$('#differences-prevlink').attr('accesskey', ':');
$('#differences-nextlink').attr('accesskey', '!');
});
mw.loader.load('/w/index.php?title=Utilisateur:Golmote/Gadget-RevertDiff.js&action=raw&ctype=text/javascript');
mw.loader.load('/w/index.php?title=Utilisateur:Golmote/PV.js&action=raw&ctype=text/javascript');
/*
C_helper [ResourceLoader|dependencies=mediawiki.util,mediawiki.api,jquery.ui] | C_helper.js | C_helper_util.js | C_helper_si.js | C_helper_tag.js | C_helper_purge.js | C_helper_dph.js | C_helper_message.js
*/
mw.loader.using(['mediawiki.util','mediawiki.api','jquery.ui'], function () {
mw.loader.getScript('/w/index.php?title=MediaWiki:Gadget-C_helper.js&action=raw&ctype=text/javascript').then(function () {
mw.loader.getScript('/w/index.php?title=MediaWiki:Gadget-C_helper_util.js&action=raw&ctype=text/javascript').then(function () {
mw.loader.load('/w/index.php?title=MediaWiki:Gadget-C_helper_si.js&action=raw&ctype=text/javascript');
mw.loader.load('/w/index.php?title=MediaWiki:Gadget-C_helper_tag.js&action=raw&ctype=text/javascript');
mw.loader.load('/w/index.php?title=MediaWiki:Gadget-C_helper_purge.js&action=raw&ctype=text/javascript');
mw.loader.load('/w/index.php?title=Utilisateur:Golmote/MediaWiki:Gadget-C_helper_dph.js&action=raw&ctype=text/javascript');
mw.loader.load('/w/index.php?title=MediaWiki:Gadget-C_helper_message.js&action=raw&ctype=text/javascript');
});
});
});
// Affiche les informations du parser en bas de page
$(function() {
var bodyContainer = document.querySelector('#bodyContent');
var container = document.createElement('div');
container.id = 'golmote-parser-data';
container.style.fontSize = 'smaller';
container.innerHTML = '<style>.ve-active #golmote-parser-data {display:none;}</style>';
bodyContainer.appendChild(container);
var nodes = document.querySelector('.mw-body-content .mw-parser-output').childNodes;
var l = nodes.length;
var comments = [];
while (l--) {
var lastnode = nodes[l];
if (lastnode.nodeType === Node.ELEMENT_NODE) {
break;
}
if (lastnode.nodeType === Node.TEXT_NODE && lastnode.data.trim() === '') {
continue;
}
if (lastnode.nodeType === Node.COMMENT_NODE && lastnode.data.trim() !== '') {
comments.unshift(lastnode.data.trim());
}
}
if (comments.length) {
var hr = document.createElement('hr');
hr.style.marginTop = '1.5em';
container.appendChild(hr);
for (var i = 0; i < comments.length; i++) {
var pre = document.createElement('pre');
pre.textContent = comments[i];
container.appendChild(pre);
}
}
});