Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
/* 
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@C..................c@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.........:..:o8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@8o::::::......::::::C@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O.:...::::.::...@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@888...::o@8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@C....:8@@@o::.:.O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@C..:.o8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@8c...:C@@@@C:.:..@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@8:...:C@@@@@@@@@@@OCoCCO@@@@@8oooooCO8@@@@@@@@8OoooO@@@@@@o:...:ooooc....cO@@@@@@@@@ooo@@@@@@@ooooooCO@@@@Coc@@@8ooooCCC8@@@@@@ooooooooO@@@
@@@@@@@@@@@O....cO@@@@@@@@@O...:...:o@@@o..:::...o8@@@@8:..:::..c@@@@c.::......:.::8@@@@@@@@@8c.:.O@@@@@8...:::..:@@@.:.@@@o..:::...o8@@@8.:..:::cC@@@
@@@@@@@@@@8c....O@@@@@@@@o.:c8@@@@:..O@@:..8@@@C...O@O:.:C@@@@o..C8@C:....ooo:.....8@@@@@@@@C.:Cc.c8@@@@C..o@@@:.:8@O..c@@@...8@@@C:.:C@@o..C@@@@@@@@@
@@@@@@@@@@C.....8@@@@@@@@...@@@@@@:..8@8...@@@@8c..C@...8@@@@@o..C8@:....:@@@@8:....O@@@@@@O.:o@C..O@@@8c:.:.::..c@8C..C@@O...@@@@Oc..C@8c......C8@@@@
@@@@@@@@@@o.....@@@@@@@@8...@@@@@8.:.@@C..c@@@@o..o8@:..8@@@@@:.:O@@..::.o@@@@@O....cO@@@@C:.:CCo:.C8@@Cc.:cccoC8@@Oc.cO@@C..c@@@@o..o8@o::cOO88@@@@@@
@@@@@@@@@@....:c@@@@@@@@@c.:cCOo:..c8@8c..oCo:...8@@@c:.:oCCc:.:C@@8.....O@@@@@@:....c@@@c..COCOCo.:O@@c.:O@@@@@@@@C..C@@@c.:oCoc...8@@8:.:oCCCC8@@@@@
@@@@@@@@@8 ...:C@@@@@@@@@@Cc....:c8@@@O:.....:cCO@@@@@Oo:...:cO@@@@C....c8@@@@@@c.....@@C..:@@@@@O. o@O:.:@@@@@@@@Oc.:O@@O:......coO@@@C..:.....8@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    Fonction "TodoRapide" by [[Utilisateur:Micthev|мɨƇ†ɦΣ√]]        @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@* [[Utilisateur:Micthev/TodoRapide|Documentation]]                  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@* [[Catégorie:MediaWiki:Fonction Monobook en JavaScript|TodoRapide]]@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@* Une partie de ce script à été pris chez                           @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  [[Utilisateur:Antaya|Antaya]]                                     @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

<source lang="javascript">

 
<nowiki> */


//// Définition des variables ////

var CookieRedirect = "wikipedia.todo.redirectto";
var linkprefix = mw.config.get('wgServer')+mw.config.get('wgScript')+"?title=Utilisateur:";
var encodedUserName = encodeURIComponent(wgUserName);

if(typeof(Todo_emplacement)=='undefined')
{
     var Todo_emplacement = "à faire";
}

if(typeof(Todo_version)=='undefined')
{
     var Todo_version = "2";
}

var pagetodo = "/"+Todo_emplacement;
var pagefait = "/"+Todo_emplacement+"/Fait";
var todopage = encodeURIComponent(pagetodo);
var faitpage = encodeURIComponent(pagefait);
var nbcapture_todo = 0;

//// Cookie ////

function SetCookie(our_cookieName, our_cookieValue, our_hours, our_path, our_domain, our_secure)
{
     var expire = new Date();
     var nHours = our_hours;
     expire.setTime( expire.getTime() + (3600000 * nHours) );
     document.cookie = our_cookieName + "=" + escape(our_cookieValue)
      + ((expire) ? "; expires=" + expire.toGMTString() : "" )
      + ((our_path) ? "; path=" + our_path : "" )
      + ((our_domain) ? "; domain=" + our_domain : "" )
      + ((our_secure) ? "; secure" : "" );
}

function GetCookie(cookieName)
{
     var start = document.cookie.indexOf( cookieName + "=" );

     if ( start == -1 ) return "";

     var len = start + cookieName.length + 1;

     if ( ( !start ) && ( cookieName != document.cookie.substring( 0, cookieName.length ) ) )
     {
          return "";
     }

     var end = document.cookie.indexOf( ";", len );

     if ( end == -1 ) end = document.cookie.length;

     return unescape( document.cookie.substring( len, end ) );
}
 
function DeleteCookie(cookieName)
{
     var the_cookieValue = GetCookie(cookieName);

     if ( the_cookieValue )
     {
          SetCookie( cookieName, "", -48, "/", false, false);
     }

}

function Todo()
{
     //// Gestion de l'URL ////

     if (wgTitle == wgUserName+pagetodo && wgAction == "view")
     {
          var new_location = GetCookie( CookieRedirect );
          DeleteCookie( CookieRedirect );

          if( new_location )
          {
               document.location.href = mw.config.get('wgServer')+mw.config.get('wgArticlePath').replace( '$1', new_location );
          }

     }

     else if( wgTitle == wgUserName+pagetodo )
     {
   
          if( wgAction == "edit" && location.href.indexOf("&action=edit&addinmytodo=") != -1)
          {
               var statusRegExp = /&action=edit&addinmytodo=(.*)&mytododetails=(.*)/;
                var todopage = decodeURIComponent( statusRegExp.exec( location.href )[1] );
                var tododetails = decodeURIComponent( statusRegExp.exec( location.href )[2] );
                var summary = "Ajout de [["+todopage+"]] grâce à [[Utilisateur:Micthev/TodoRapide|TodoRapide]]";
                //Modifier le formulaire
                document.getElementById('wpTextbox1').value += "* {{Utilisateur:Micthev/TodoRapide/liste|"+todopage+"|~~~~~}}\n*:"+tododetails+"\n";
               document.getElementById('wpSummary').value = summary;
               //Modification mineure
               document.getElementById('wpMinoredit').checked = true;
               //Soumettre!
               document.getElementById('editform').submit();
          }
 
          if( wgAction == "edit" && location.href.indexOf("&action=edit&TodoPageSource=") != -1)
          {
               var statusRegExp = /&action=edit&TodoPageSource=(.*)&Todomodif=(.*)/;
                var todopage = decodeURIComponent( statusRegExp.exec( location.href )[1] ).replace(/_/g,' ');
               var tododetails = decodeURIComponent( statusRegExp.exec( location.href )[2] ).replace(/\+/g,' ');
                var summary = "Ajout de [["+todopage+"]] grâce à [[Utilisateur:Micthev/TodoRapide|TodoRapide]]";
                //Modifier le formulaire
                document.getElementById('wpTextbox1').value += "{{Utilisateur:Micthev/TodoRapide/liste2|"+todopage+"|~~~~~}}\n"+tododetails+"\n{{Utilisateur:Micthev/TodoRapide/liste2bis|"+todopage+"}}\n";
               document.getElementById('wpSummary').value = summary;
                //Modification mineure
               document.getElementById('wpMinoredit').checked = true;
                //Soumettre!
                document.getElementById('editform').submit();
          }

     }

     if (wgTitle == wgUserName+pagefait && wgAction == "view")
     {
          var new_location = GetCookie( CookieRedirect );
          DeleteCookie( CookieRedirect );

          if( new_location )
          {
               document.location.href = mw.config.get('wgServer')+mw.config.get('wgArticlePath').replace( '$1', new_location );
          }

     }

     else if( wgTitle == wgUserName+pagefait )
     {

          if( wgAction == "edit" && location.href.indexOf("&action=edit&removeinmytodo=") != -1)
          {
               var statusRegExp = /&action=edit&removeinmytodo=(.*)/;
               var todopage = decodeURIComponent( statusRegExp.exec( location.href )[1] );
               var summary = "Marquage de [["+todopage+"]] fait grâce à [[Utilisateur:Micthev/TodoRapide|TodoRapide]]";
               //Modifier le formulaire
               document.getElementById('wpTextbox1').value += "{{#switch:{{{1}}}|"+todopage+"=OK|"+todopage+"_date=~~~~~}}";
               document.getElementById('wpSummary').value = summary;
               //Modification mineure
               document.getElementById('wpMinoredit').checked = true;
               //Soumettre!
               document.getElementById('editform').submit();
          }
     }

     if (Todo_version=="1")
     {
          //// Affichage de l'onglet ////
          var a = document.getElementById("p-cactions");

          if (a && wgNamespaceNumber >= 0)
          {
                var b = a.getElementsByTagName("ul");

                if (b.length > 0)
                {
                     b[0].innerHTML = b[0].innerHTML
                     + '<li id="ca-nstab-user">'
                     + '<a href="javascript:var message = Capture_page()">'
                     + 'ajouter à mon todo</a>'
                     + '</li>';
                }

          }

     }

     //// Affichage du lien ////
     var a = document.getElementById("p-navigation");

     if (a && wgNamespaceNumber >= 0)
     {
          var b = a.getElementsByTagName("ul");

          if (b.length > 0)
          {
               b[0].innerHTML = '<li id="ca-nstab-user">'
               + '<a href="javascript:Todo_Capture()">'
               + 'Ajouter cette page à mon pense-bête</a>'
               + '</li>'
               + b[0].innerHTML;
          }

     }

     //// Lien Marquer comme fait ///
     var c = document.getElementById("TodoRapide");
     var d = c.getElementsByTagName("em");

     if (d.length > 0)
      {
     
          for (i=0; i<=101; i++)
          { 
               d[i].style.visibility = "visible";
               d[i].innerHTML = " • <a href='javascript:Marquerfait(\""+d[i].innerHTML+"\")'>fait ?</a>";
          }

     }

}

//// Capture de la page ////

function Capture_page()
{
     var todo_url =  encodeURI(wgPageName);
     var todo_desc = Description();

     if (todo_desc!=null)
     {
          var todo_desc = encodeURI(todo_desc);
          SetCookie( CookieRedirect, wgPageName, 24, "/", false, false );
          document.location.href = linkprefix+encodedUserName+todopage+"&smaxage=0&action=edit&addinmytodo="+todo_url+"&mytododetails="+todo_desc;
     }

}

function Todo_Capture()
{
     if (nbcapture_todo==0)
     {
          nbcapture_todo++; 
          var e = document.getElementById("bodyContent");
          e.innerHTML = '<div id="Todo_entete"><center><table style="background:#DDDDDD;" width="750" border="0" cellpading="0" cellspacing="0"><tr><td>'
          + '<a href="/wiki/Utilisateur:Micthev/TodoRapide"><big><big><big><big><font color="purple"><u><i><b>T<small><small>ODO</small></small>R<small><small>APIDE</small></small></b></i></u></font></big></big></big></big></a></td><td>'
          + 'Ajouter : <b>'
          + wgPageName
          + '</b><br>à mon pense-bête : <b>'
          + '<a href="/wiki/Utilisateur:'
          + wgUserName
          + pagetodo
          + '">Utilisateur:'
          + wgUserName
          + pagetodo
          + '</a></b></td></tr><tr><td colspan="2">Avec les modifications à faire suivantes :</td></tr><tr><td colspan="2" align="center">'
          + '<form enctype="multipart/form-data" action= "/w/index.php"><input type="hidden" name="title" value="Utilisateur:'
          + wgUserName
          + pagetodo
          + '"/><input type="hidden" name="action" value="edit"/><input type="hidden" name="TodoPageSource" value="'
          + wgPageName
          + '"/><textarea style="background:#DDDDDD;" spellcheck="false" name="Todomodif" id="wpTextbox1" cols="80" rows="6" tabindex="1"></textarea><br><br><input type="button" value="Annuler" onclick="javascript:Todo_annul()">&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="OK"></form></td></tr></table></div>'
          + e.innerHTML;
     }

     else
     {
          Todo_annul();
     }

     SetCookie( CookieRedirect, wgPageName, 24, "/", false, false );

}

function Todo_annul()
{
     var f = document.getElementById("Todo_entete");
     f.innerHTML = '';
     nbcapture_todo=0; 
}

//// Marquer comme fait ///

function Marquerfait(marquage)
{
     var marquer = encodeURI(marquage);
     SetCookie( CookieRedirect, wgPageName, 24, "/", false, false );
     document.location.href = linkprefix+encodedUserName+faitpage+"&smaxage=0&action=edit&removeinmytodo="+marquer;
}

//// Message de description ////
 
function Description ()
{
     var todo_desc = prompt ('Avec quelle description ?', '');
     return todo_desc;
}

//// Chargement de la fonction ////

addOnloadHook(Todo);

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