Discussion MediaWiki:Common.js

Dernier commentaire : il y a 14 ans par Al Maghi dans le sujet redirection vers le css et le js personnalisés

Code update of de:wikt:MediaWiki:If-search.js modifier

Note that de:wikt:MediaWiki:If-search.js has been updated: Important fix for an upcoming DOM change, plus some optimizations! Please update your code or consider just importing the script instead, like described at de:wikt:MediaWiki:If-search.js/import. -- Best regards, Melancholie 4 mars 2009 à 05:21 (CET)Répondre

Note that the change has gone live now, your search URL is index.php/searchterm instead of Special:Search now (nonetheless still working, but wrong), thus please update/import the script! --- Best regards, Melancholie 26 mars 2009 à 07:19 (CET)Répondre
Thanks for the notification. I'll update the script. But the script de:wikt:MediaWiki:If-search.js use wgScriptPath in the following source line :
$(f).action = wgScriptPath+"iki/"+oSEAp+x+$(i).value;
but should use wgArticlePath instead of wgScriptPath+"iki/" :
$(f).action = wgArticlePath.replace("$1", oSEAp+x+$(i).value);
Best regards. -- ◄ • David L • discuter • ► 28 mars 2009 à 13:00 (CET)Répondre

redirection vers le css et le js personnalisés modifier

/*
 * Description: Redirects from /User:UserName/skin.js or .css to the user's actual skin page
 * Maintainer: Cacycle, Al Maghi
 */
if (wgArticleId == 0 && wgUserName) {
  var slash = wgPageName.indexOf('/');
  var norm = wgPageName.substr(0, slash) + wgPageName.substr(slash).toLowerCase();
  var test = 'Utilisateur:' + wgUserName.replace(/ /g, '_') + '/skin.';
  var ext = null;
  if (norm == test + 'js') ext = 'js';
  else if (norm == test + 'css') ext = 'css';
  if (ext != null) window.location.href = window.location.href.replace(/\/skin.(css|js)/i, '/' + skin + '.' + ext);
}

Cdlt, --Al Maghi 23 novembre 2009 à 09:10 (CET)Répondre

Revenir à la page « Common.js ».