For faster navigation, this Iframe is preloading the Wikiwand page for Utilisateur:Dr Brains/SourceCliquable.js.

Utilisateur:Dr Brains/SourceCliquable.js

/*******************************

Dans les commentaires d'une balise <source> ou <syntaxhighlight>

Rendu des liens (internes/externes/modèles) cliquables (le rendu des liens externes pourrait être amélioré)

Rendu du texte en gras 

Rendu du texte en italique 


importScript('Utilisateur:Dr Brains/monobook.js');

*********************************/
//<nowiki>



///////////////////////////////////////////// TEST //////////////////////////////////////

/******************************************
* [[Utilisateur:Dr Brains/SourceCliquable.js]]
* [[Utilisateur:Dr Brains/SourceCliquable.js|SourceCliquable]]
* [http://fr.wikipedia.org/wiki/Utilisateur:Dr_Brains/SourceCliquable.js ext]
* ((!))
* ((ébauche|économie))
* Texte normal, '''Texte gras''', texte normal.
*******************************************/

//////////////////////////////////////////////////////////////////////////////////
// [[Utilisateur:Dr Brains/SourceCliquable.js]]                                 //
// [[Utilisateur:Dr Brains/SourceCliquable.js|SourceCliquable]]                 //
// [http://fr.wikipedia.org/wiki/Utilisateur:Dr_Brains/SourceCliquable.js ext]  //
// ((!))                                                                        //
// ((ébauche|économie))                                                         //
// Texte normal, '''Texte gras''', ''texte italique''.                          //
//////////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////// TEST //////////////////////////////////////

function SyntaxHighlightLiensCliquables(){
    var SiteURL = mw.config.get('wgServer') + "/wiki/";
    var Spans = document.getElementsByTagName("span");
    for(i=0;i<Spans.length;i++){
        if ($(Spans[i]).hasClass("coMULTI") || $(Spans[i]).hasClass("co1") || Spans[i].className.match(/^diff/) ){
              var Inside = Spans[i].innerHTML;
              // Liens internes
              Inside = Inside.replace(/\[\[:?([^\|\]]*)(?:\|([^\|\]]+))?\]\]/g, function(match, article, title, offset, s) {
                  return "<b><a href=\"" + SiteURL + article + "\">" + ((title) ? title : article) + "</a></b>";
              });
              // Liens externes
              Inside = Inside.replace(/\[(((?:[^\]])|(?:[^ ]))+)/g, "<a href=\"$1\">$1</a>");
              // Modèles
              Inside = Inside.replace(/\{\{([^\}\|]+)(\|[^\}]+)?\}\}/g, "<b><a href=\"" + SiteURL + "Template:$1\">(($1$2))</a></b>"); 
              // Texte gras
              Inside = Inside.replace(/'''((?:[^']|'(?!''))+)'''/g, "'''<b>$1</b>'''");
              // importScript()
              Inside = Inside.replace(/importScript\('((?:[^'])+)/g, "importScript\('<a href=\"" + SiteURL + "$1\">$1</a>");
              // obtenir()
              Inside = Inside.replace(/obtenir\('((?:[^'])+)/g, "obtenir\('<a href=\"" + SiteURL + "MediaWiki:Gadget-$1.js\">$1</a>");

              Spans[i].innerHTML = Inside;
        }else{
              continue;
        }
    }
}
$(SyntaxHighlightLiensCliquables);


function DiffLiensCliquables(){
    var DiffCases = document.getElementsByTagName("td");
    for(i=0;i<DiffCases.length;i++){
        if (DiffCases[i].className.match(/^diff/) ){
              var Inside = DiffCases[i].innerHTML;
              Inside = Inside.replace(/\[\[:?([^\|\]]*)(?:\|([^\|\]]+))?\]\]/g, function(match, article, title, offset, s) {              // Liens internes
                  return " <b><a href=\"" + SiteURL + article + "\"> " + ((title) ? title : article) + " </a></b> ";
              });
              Inside = Inside.replace(/\[http/g, " <b><a href=\"http");                                                                   // Liens externes 
              Inside = Inside.replace(/\ ext]/g, "\">Lien externe</a></b> ");                                                             // (doivent finir par " ext]")

              Inside = Inside.replace(/\{\{([^\}\|]+)(\|[^\}]+)?\}\}/g, " <b><a href=\"" + SiteURL + "Template:$1\"> (($1$2)) </a></b> ");  // Modèles
              Inside = Inside.replace(/'''((?:[^']|'(?!''))+)'''/g, "<b>$1</b>");                                                         // Texte gras
              Inside = Inside.replace(/''((?:[^']|'(?!''))+)''/g, "<i>$1</i>");                                                           // Texte italique
              DiffCases[i].innerHTML = Inside;
        }else{
              continue;
        }
    }
}
$(DiffLiensCliquables);
//</nowiki>
{{bottomLinkPreText}} {{bottomLinkText}}
Utilisateur:Dr Brains/SourceCliquable.js
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?