Utilisateur:Zyephyrus/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.
/**
* Hyperlink edition handler
* @author: [[w:fr:User:ManuD]]
*/
if ( window.HyperLinkEdition === undefined ) {
window.HyperLinkEdition = {};
}
/**
* The global Hyperlink Edition object
*/
( function ( mw, $, hle ) {
/**
* Localised collection of labels
*/
hle.labels = {
menu : "Édition",
show : "Avec liens" ,
hide : "Originale"
};
/**
* Name of the cookie that says whether the hyperlink edition is activated
*/
hle.cookie = 'hle-show';
/**
* CSS class that identifies spans without links
*/
hle.noLinkClass = "hl-inactif";
/**
* CSS class that identifies spans with links
*/
hle.linkClass = "hl-actif";
/**
* Determine whether the menu show be displayed
*/
hle.existLinks = function()
{
return $("#content ."+hle.noLinkClass).length > 0;
}
/**
*
*/
hle.setup = function()
{
if(hle.existLinks())
{
var showLinks = (mw.cookie.get(hle.cookie) == 1);
$( '#p-cactions' )
.clone()
.find( 'li' )
.remove()
.end()
.attr( {
'id': 'p-hyperlink-menu',
'class': 'vectorMenu emptyPortlet'
} )
.find( 'span' )
.text( hle.labels.menu )
.end()
.appendTo( '#left-navigation' );
$( mw.util.addPortletLink(
'p-hyperlink-menu',
'#',
hle.labels.show,
'p-hyperlink-show'
))
.toggleClass( 'selected', showLinks )
.click(function (){
HyperLinkEdition.showLinks()
});
$( mw.util.addPortletLink(
'p-hyperlink-menu',
'#',
hle.labels.hide,
'p-hyperlink-hide'
))
.toggleClass( 'selected', !showLinks )
.click(function(){
HyperLinkEdition.hideLinks()
});
if(showLinks)
{
hle.showLinks();
}
}
}
hle.showLinks = function()
{
$("#content ."+hle.noLinkClass).hide();
$("#content ."+hle.linkClass).show();
$("#p-hyperlink-hide").toggleClass( 'selected', false );
$("#p-hyperlink-show").toggleClass( 'selected', true );
mw.cookie.set( hle.cookie, 1, {expires: 7, path: '/'});
}
hle.hideLinks = function()
{
$("#content ."+hle.noLinkClass).show();
$("#content ."+hle.linkClass).hide();
$("#p-hyperlink-hide").toggleClass( 'selected', true );
$("#p-hyperlink-show").toggleClass( 'selected', false );
mw.cookie.set( hle.cookie, 0, {expires: 7, path: '/'});
}
$.when(
mw.loader.using( [ 'mediawiki.util', 'mediawiki.cookie' ] ),
$.ready
).then( function () {
hle.setup();
});
}( mediaWiki, jQuery, window.HyperLinkEdition ) );
/* Ajout onglet pour transclusion
*
* Instructions to install in your Wikisource subdomain:
*
* in your MediaWiki:Common.js, add (and translate in your language) the following lines:
mw.loader.load('//en.wikisource.org/w/index.php?title=User:Beleg Tâl/TranscludedIn.js&action=raw&ctype=text/javascript');
*/
function api_embeddedin(eititle,einamespace) {
eititle = eititle || mw.config.get('wgPageName');
einamespace = einamespace || '0';
var api_url=["/w/api.php?action=query",
"format=json",
"list=embeddedin",
"einamespace="+einamespace,
"eititle="+eititle].join("&");
var result=JSON.parse($.ajax({url:api_url,async:false}).responseText);
return result.query.embeddedin;
}
function embeddedin_run() {
if (mw.config.get('wgCanonicalNamespace')=="Page") {
var linkedNs0=api_embeddedin();
for (var i=0;i<linkedNs0.length;i+=1) {
html='<li id="ca-ns0_'+i+'"><span><a href="'+
mw.util.getUrl( linkedNs0[i].title ) +
'" title="' + linkedNs0[i].title +
'">' + '<img src="//upload.wikimedia.org/wikipedia/commons/thumb/9/92/Open_book_nae_02.svg/25px-Open_book_nae_02.svg.png" width="25" height="14">';
if (linkedNs0.length > 1) html += ' <small>'+(i+1)+'</small>';
html += '</a></span></li>';
$(html).appendTo($("#p-namespaces ul"));
}
}
}
$(document).ready(embeddedin_run);
/* Outils pour
*
* Correspondance de Madame de Sévigné, édition Monmerqué
*
* Auteur: Abecido
*/
function do_jqueryui() {
$( document ).ready(function() {
importScript('Utilisateur:Abecido/pre_init_ab.js') ;
if((mw.config.get('wgAction') == 'edit') | (mw.config.get('wgAction') == 'submit')){
if(mw.config.get('wgCanonicalNamespace') == "Page"){
importScript('Utilisateur:Abecido/pos_ref.js') ;
importScript('Utilisateur:Abecido/theatre.js') ;
importScript('Utilisateur:Abecido/insert_fred.js');
importScript('Utilisateur:Abecido/romains.js');
importScript('Utilisateur:Abecido/section.js');
if(mw.config.get('wgPageName').match("Voltaire_-_Œuvres_complètes_Garnier_tome")){
importScript('Utilisateur:Abecido/typo-tdm-voltaire.js');
importScript('Utilisateur:Abecido/tdm-voltaire.js');
}
}
if(mw.config.get('wgPageName').match("Correspondance_de_Voltaire")){
importScript('Utilisateur:Abecido/newlettre.js');
} else if(mw.config.get('wgPageName').match("De_Callières") ||
mw.config.get('wgPageName').match("Argens.*philosophie")){
importScript('Utilisateur:Abecido/typo-callieres.js');
}
importScript('Utilisateur:Abecido/wikiEd_ab.js');
importScript('Utilisateur:Abecido/ab_div_onoff.js');
}});
}
function checkJqueryUI() {
if (typeof jQuery.ui != 'undefined') {
do_jqueryui();
}
else {
window.setTimeout( checkJqueryUI, 50 );
}
}
checkJqueryUI();
/* OCR */
mw.loader.load('//wikisource.org/w/index.php?title=MediaWiki:GoogleOCR.js&action=raw&ctype=text/javascript');