Utilisateur:Phe/Enhanced index.js
Apparence
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.
// When creating an author page fill field. Always filled, lastname,
// firstname, lastinitial, wikipedia_link, birth/year filled if an
// article is available on wp:en. Try also to avoid duplicate author:
// by creating a redirect if the wikipedia_link is non empty, its title
// is different from the current Author:title and an Author:new_title
// exists.
function add_commons_links(title, text_box)
{
var url = wgServer + wgScriptPath
+ "/api.php?format=xml&action=query&prop=info&titles="
+ encodeURIComponent('File:' + wgTitle);
var request = sajax_init_object();
request.open('GET', url, true);
request.onreadystatechange = function () {
if (request.readyState == 4) {
var xml = request.responseXML;
if (xml == null) return ;
var page = xml.getElementsByTagName( "page" )[0];
if (page.getAttribute("missing") == "")
// FIXME: there is no easy way to locate the djvu link.
alert('Missing local file');
}
};
request.send(null);
}
if ((wgAction == "view" || wgAction == 'submit') && wgNamespaceNumber == 112)
$(document).ready(add_commons_links);