MOD replace 'formateur' by 'formater'
authorGreg Burri <greg.burri@gmail.com>
Tue, 27 Jan 2009 08:41:15 +0000 (08:41 +0000)
committerGreg Burri <greg.burri@gmail.com>
Tue, 27 Jan 2009 08:41:15 +0000 (08:41 +0000)
15 files changed:
index.yaws
js/client.js
js/euphorik.js
js/formater.js [new file with mode: 0644]
js/formateur.js [deleted file]
js/pageAbout.js
js/pageAdmin.js
js/pageMinichat/commandes.js
js/pageMinichat/conversation.js
js/pageMinichat/conversations.js
js/pageMinichat/message.js
js/pageMinichat/pageMinichat.js
js/pageProfile.js
js/pageRegister.js
js/util.js

index 7fbddfc..87f40e2 100755 (executable)
@@ -5,7 +5,7 @@
  out(A) ->
    {header, {content_type, 
       case string:str((A#arg.headers)#headers.user_agent, "MSIE") of
  out(A) ->
    {header, {content_type, 
       case string:str((A#arg.headers)#headers.user_agent, "MSIE") of
-         0 -> "text/html"; %"application/xhtml+xml"; % TODO : jquery.lightbox ne support pas application/xhtml+xml
+         0 -> "text/html"; %"application/xhtml+xml"; % TODO : jquery.lightbox does not support application/xhtml+xml
          _ -> "text/html"
       end
    }}.
          _ -> "text/html"
       end
    }}.
@@ -16,8 +16,8 @@
 <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>euphorik.ch</title>
 <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>euphorik.ch</title>
-   <erl>
-      % prédéfinit la feuille de style
+   <erl>\r
+      % set the stylesheet
       out(A) -> 
          CSS = case euphorik_bd:css_from_user_cookie(yaws_api:find_cookie_val("cookie", A)) of
             undefined -> "styles/1/euphorik.css";
       out(A) -> 
          CSS = case euphorik_bd:css_from_user_cookie(yaws_api:find_cookie_val("cookie", A)) of
             undefined -> "styles/1/euphorik.css";
@@ -25,7 +25,7 @@
          end,
          {ehtml, {link ,
             [
          end,
          {ehtml, {link ,
             [
-               {id, "cssPrincipale" },
+               {id, "mainCss" },
                {rel, "stylesheet"},
                {href, CSS},
                {type, "text/css"},
                {rel, "stylesheet"},
                {href, CSS},
                {type, "text/css"},
@@ -49,7 +49,7 @@
    <script type="text/javascript" src="js/communication.js" prod="delete"></script>
    <script type="text/javascript" src="js/conf.js" prod="delete"></script>
    <script type="text/javascript" src="js/util.js" prod="delete"></script>
    <script type="text/javascript" src="js/communication.js" prod="delete"></script>
    <script type="text/javascript" src="js/conf.js" prod="delete"></script>
    <script type="text/javascript" src="js/util.js" prod="delete"></script>
-   <script type="text/javascript" src="js/formateur.js" prod="delete"></script>
+   <script type="text/javascript" src="js/formater.js" prod="delete"></script>
    <script type="text/javascript" src="js/pages.js" prod="delete"></script>
    <script type="text/javascript" src="js/client.js" prod="delete"></script>
 
    <script type="text/javascript" src="js/pages.js" prod="delete"></script>
    <script type="text/javascript" src="js/client.js" prod="delete"></script>
 
index c378075..9ea6ea0 100644 (file)
@@ -53,7 +53,7 @@ euphorik.Client.prototype.resetDonneesPersonnelles = function() {
    this.login = "";\r
    this.password = "";\r
    this.email = "";\r
    this.login = "";\r
    this.password = "";\r
    this.email = "";\r
-   this.css = $("link#cssPrincipale").attr("href");\r
+   this.css = $("link#mainCss").attr("href");\r
    this.chatOrder = "reverse";\r
    this.nickFormat = "nick";\r
    this.viewTimes = true;\r
    this.chatOrder = "reverse";\r
    this.nickFormat = "nick";\r
    this.viewTimes = true;\r
@@ -77,7 +77,7 @@ euphorik.Client.prototype.setCss = function(css) {
    }\r
 \r
    this.css = css;\r
    }\r
 \r
    this.css = css;\r
-   $("link#cssPrincipale").attr("href", this.css);\r
+   $("link#mainCss").attr("href", this.css);\r
    if (this.autoflush) {\r
       this.flush(true);\r
    }\r
    if (this.autoflush) {\r
       this.flush(true);\r
    }\r
index c1253b9..4706eb8 100755 (executable)
@@ -25,8 +25,8 @@ var euphorik = {};
 $(document).ready(
    function() { 
       var fragment = new Fragment();
 $(document).ready(
    function() { 
       var fragment = new Fragment();
-      var formateur = new euphorik.Formateur();
-      var util = new euphorik.Util(formateur); 
+      var formateur = new euphorik.Formater();
+      var util = new euphorik.Util(formater); 
       var communication = new euphorik.Communication(
          function(data) { util.messageDialogue(data.error_message); },
          function() { util.showWaitBar(); },
       var communication = new euphorik.Communication(
          function(data) { util.messageDialogue(data.error_message); },
          function() { util.showWaitBar(); },
@@ -64,11 +64,11 @@ $(document).ready(
       // TODO : simplifier et pouvoir créer des liens par exemple : <span class="lien" href="conditions">Conditions d'utilisation</span>
       $("#footer .conditions").click(function(){ pages.afficherPage("conditions_utilisation"); });
       
       // TODO : simplifier et pouvoir créer des liens par exemple : <span class="lien" href="conditions">Conditions d'utilisation</span>
       $("#footer .conditions").click(function(){ pages.afficherPage("conditions_utilisation"); });
       
-      pages.ajouterPage(new euphorik.PageMinichat(client, formateur, util, communication), true);
-      pages.ajouterPage(new euphorik.PageAdmin(client, formateur, util, communication));
-      pages.ajouterPage(new euphorik.PageProfile(client, formateur, util));
-      pages.ajouterPage(new euphorik.PageRegister(client, formateur, util));
-      pages.ajouterPage(new euphorik.PageAbout(client, formateur, util, communication));
+      pages.ajouterPage(new euphorik.PageMinichat(client, formater, util, communication), true);
+      pages.ajouterPage(new euphorik.PageAdmin(client, formater, util, communication));
+      pages.ajouterPage(new euphorik.PageProfile(client, formater, util));
+      pages.ajouterPage(new euphorik.PageRegister(client, formater, util));
+      pages.ajouterPage(new euphorik.PageAbout(client, formater, util, communication));
       pages.ajouterPage("conditions_utilisation");
       
       pages.afficherPage();
       pages.ajouterPage("conditions_utilisation");
       
       pages.afficherPage();
diff --git a/js/formater.js b/js/formater.js
new file mode 100644 (file)
index 0000000..eec87f8
--- /dev/null
@@ -0,0 +1,176 @@
+// coding: utf-8\r
+// Copyright 2008 Grégory Burri\r
+//\r
+// This file is part of Euphorik.\r
+//\r
+// Euphorik is free software: you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation, either version 3 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// Euphorik is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.\r
+\r
+\r
+/**\r
+  * Objet permettant de formater du texte par exemple pour la substitution des liens dans les\r
+  * message par "[url]".\r
+  * TODO : améliorer l'efficacité des méthods notamment lié au smiles.\r
+  */\r
+euphorik.Formater = function() {\r
+   this.smiles = euphorik.conf.smiles;\r
+   this.protocoles = "http|https|ed2k";\r
+   \r
+   this.regexUrl = new RegExp("(?:(?:" + this.protocoles + ")://|www\\.)[^ ]*", "gi");\r
+   this.regexImg = new RegExp("^.*?\\.(gif|jpg|png|jpeg|bmp|tiff)$", "i");\r
+   this.regexDomaine = new RegExp("^(?:(?:" + this.protocoles + ")://)(.*?)(?:$|/).*$", "i");\r
+   this.regexTestProtocoleExiste = new RegExp("^(?:" + this.protocoles + ")://.*$", "i");\r
+   this.regexNomProtocole = new RegExp("^(.*?)://");\r
+};\r
+\r
+/**\r
+  * Formate un pseudo saise par l'utilisateur.\r
+  * @param pseudo le pseudo brut\r
+  * @return le pseudo filtré\r
+  */\r
+euphorik.Formater.prototype.filtrerInputPseudo = function(pseudo) {\r
+   return pseudo.replace(/\{|\}/g, "").trim();\r
+};\r
+\r
+euphorik.Formater.prototype.getSmilesHTML = function() {\r
+   var XHTML = "";\r
+   objectEach(this.smiles, function(nom) {\r
+      XHTML += "<img class=\"" + nom + "\" src=\"img/smileys/" + nom + ".gif\" alt =\"" + nom + "\" />";\r
+   });\r
+   return XHTML;\r
+};\r
+\r
+/**\r
+  * Formatage complet d'un texte.\r
+  * @m le message\r
+  * @pseudo facultatif, permet de contruire le label des images sous la forme : "<Pseudo> : <Message>"\r
+  */\r
+euphorik.Formater.prototype.traitementComplet = function(m, pseudo) {\r
+   return this.traiterLiensConv(this.traiterSmiles(this.traiterURL(this.traiterWikiSyntaxe(this.remplacerBalisesHTML(m)), pseudo)));\r
+};\r
+\r
+/**\r
+  * Transforme les liens en entités clickables.\r
+  * Un lien vers une conversation permet d'ouvrire celle ci, elle se marque comme ceci dans un message :\r
+  * "{5F}" ou 5F est la racine de la conversation.\r
+  * Ce lien sera transformer en <span class="lienConv">{5F}</span> pouvant être clické pour créer la conv 5F.\r
+  */\r
+euphorik.Formater.prototype.traiterLiensConv = function(m) {\r
+   return m.replace(\r
+      /\{\w+\}/g,\r
+      function(lien) {\r
+         return "<span class=\"lienConv\">" + lien + "</span>";\r
+      }\r
+   );\r
+};\r
+\r
+/**\r
+  * FIXME : Cette méthode est attrocement lourde ! A optimiser.\r
+  * moyenne sur échantillon : 234ms\r
+  */\r
+euphorik.Formater.prototype.traiterSmiles = function(m) {  \r
+   objectEach(this.smiles, function(nom, smiles) {\r
+      for (var i = 0; i < smiles.length; i++) {\r
+         m = m.replace(smiles[i], "<img src=\"img/smileys/" + nom + ".gif\" alt =\"" + nom + "\"  />");\r
+      }\r
+   });\r
+   return m;\r
+};\r
+\r
+euphorik.Formater.prototype.remplacerBalisesHTML = function(m) {\r
+   return m.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");\r
+};\r
+\r
+euphorik.Formater.prototype.traiterURL = function(m, pseudo) {\r
+   var thisFormater = this;\r
+   var traitementUrl = function(url) {    \r
+      // si ya pas de protocole on rajoute "http://"\r
+      if (!thisFormater.regexTestProtocoleExiste.test(url)) {\r
+         url = "http://" + url;\r
+      }\r
+      var extension = thisFormater.getShort(url);\r
+      return "<a " + (extension[1] ? "title=\"" + (pseudo ? thisFormater.traiterPourFenetreLightBox(pseudo, url) + ": " : "") +  thisFormateur.traiterPourFenetreLightBox(m, url) + "\"" + " rel=\"lightbox\"" : "") + " href=\"" + url + "\" >[" + extension[0] + "]</a>";\r
+   };\r
+   return m.replace(this.regexUrl, traitementUrl);\r
+};\r
+\r
+/**\r
+  * Formatage en utilisant un sous-ensemble des règles de Textile : http://en.wikipedia.org/wiki/Textile_(markup_language).\r
+  * par exemple _italic_ devient <i>italic</i>.\r
+  */\r
+euphorik.Formater.prototype.traiterWikiSyntaxe = function(m) {\r
+   return m.replace(\r
+      /(?:^| )_(.*?)_(?:$| )/g,\r
+      function(texte, capture) {\r
+         return '<em class="leger">' + capture + '</em>';\r
+      }\r
+   ).replace(\r
+      /(?:^| )\*(.*?)\*(?:$| )/g,\r
+      function(texte, capture) {\r
+         return '<em class="fort">' + capture + '</em>';\r
+      }\r
+   );\r
+};\r
+\r
+/**\r
+  * Renvoie une version courte de l'url.\r
+  * par exemple : http://en.wikipedia.org/wiki/Yakov_Smirnoff devient en.wikipedia.org\r
+  */\r
+euphorik.Formater.prototype.getShort = function(url) {\r
+   var estUneImage = false;\r
+   var versionShort = null;\r
+   var rechercheImg = this.regexImg.exec(url);\r
+   \r
+   if (rechercheImg) {\r
+      versionShort = rechercheImg[1].toLowerCase();\r
+      if (versionShort === "jpeg") {\r
+         versionShort = "jpg"; // jpeg -> jpg\r
+      }\r
+      estUneImage = true;\r
+   } else {\r
+      var rechercheDomaine = this.regexDomaine.exec(url);\r
+      if (rechercheDomaine && rechercheDomaine.length >= 2) {\r
+         versionShort = rechercheDomaine[1];\r
+      } else {\r
+         var nomProtocole = this.regexNomProtocole.exec(url);\r
+         if (nomProtocole && nomProtocole.length >= 2) {\r
+            versionShort = nomProtocole[1];\r
+         }\r
+      }\r
+   }\r
+   \r
+   return [versionShort ? versionShort : "url", estUneImage];\r
+ };\r
\r
+euphorik.Formater.prototype.supprimerSmiles = function(m) {\r
+   objectEach(this.smiles, function(nom, smiles) {\r
+      for (var i = 0; i < smiles.length; i++) {\r
+         m = m.replace(smiles[i], "");\r
+      }\r
+   });\r
+   return m;\r
+};\r
+\r
+/**\r
+  * Traite les pseudo et messages à être affiché dans le titre d'une image visualisé avec lightbox.\r
+  * Supprime les smiles pour pas qu'ils puissent être remplacés par la fonction 'traiterSmiles'.\r
+  * TODO : trouver un moyen pour que les smiles puissent être conservés\r
+  */\r
+euphorik.Formater.prototype.traiterPourFenetreLightBox = function(M, urlCourante) {\r
+   var thisFormater = this;\r
+   var traitementUrl = function(url) {\r
+      return "[" + thisFormater.getShort(url)[0] + (urlCourante === url ? "*" : "") + "]";\r
+   };\r
+   \r
+   return this.remplacerBalisesHTML(this.supprimerSmiles(M)).replace(this.regexUrl, traitementUrl);\r
+};\r
diff --git a/js/formateur.js b/js/formateur.js
deleted file mode 100644 (file)
index eba6c5a..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-// coding: utf-8\r
-// Copyright 2008 Grégory Burri\r
-//\r
-// This file is part of Euphorik.\r
-//\r
-// Euphorik is free software: you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation, either version 3 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// Euphorik is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.\r
-\r
-\r
-/**\r
-  * Objet permettant de formater du texte par exemple pour la substitution des liens dans les\r
-  * message par "[url]".\r
-  * TODO : améliorer l'efficacité des méthods notamment lié au smiles.\r
-  */\r
-euphorik.Formateur = function() {\r
-   this.smiles = euphorik.conf.smiles;\r
-   this.protocoles = "http|https|ed2k";\r
-   \r
-   this.regexUrl = new RegExp("(?:(?:" + this.protocoles + ")://|www\\.)[^ ]*", "gi");\r
-   this.regexImg = new RegExp("^.*?\\.(gif|jpg|png|jpeg|bmp|tiff)$", "i");\r
-   this.regexDomaine = new RegExp("^(?:(?:" + this.protocoles + ")://)(.*?)(?:$|/).*$", "i");\r
-   this.regexTestProtocoleExiste = new RegExp("^(?:" + this.protocoles + ")://.*$", "i");\r
-   this.regexNomProtocole = new RegExp("^(.*?)://");\r
-};\r
-\r
-/**\r
-  * Formate un pseudo saise par l'utilisateur.\r
-  * @param pseudo le pseudo brut\r
-  * @return le pseudo filtré\r
-  */\r
-euphorik.Formateur.prototype.filtrerInputPseudo = function(pseudo) {\r
-   return pseudo.replace(/\{|\}/g, "").trim();\r
-};\r
-\r
-euphorik.Formateur.prototype.getSmilesHTML = function() {\r
-   var XHTML = "";\r
-   objectEach(this.smiles, function(nom) {\r
-      XHTML += "<img class=\"" + nom + "\" src=\"img/smileys/" + nom + ".gif\" alt =\"" + nom + "\" />";\r
-   });\r
-   return XHTML;\r
-};\r
-\r
-/**\r
-  * Formatage complet d'un texte.\r
-  * @m le message\r
-  * @pseudo facultatif, permet de contruire le label des images sous la forme : "<Pseudo> : <Message>"\r
-  */\r
-euphorik.Formateur.prototype.traitementComplet = function(m, pseudo) {\r
-   return this.traiterLiensConv(this.traiterSmiles(this.traiterURL(this.traiterWikiSyntaxe(this.remplacerBalisesHTML(m)), pseudo)));\r
-};\r
-\r
-/**\r
-  * Transforme les liens en entités clickables.\r
-  * Un lien vers une conversation permet d'ouvrire celle ci, elle se marque comme ceci dans un message :\r
-  * "{5F}" ou 5F est la racine de la conversation.\r
-  * Ce lien sera transformer en <span class="lienConv">{5F}</span> pouvant être clické pour créer la conv 5F.\r
-  */\r
-euphorik.Formateur.prototype.traiterLiensConv = function(m) {\r
-   return m.replace(\r
-      /\{\w+\}/g,\r
-      function(lien) {\r
-         return "<span class=\"lienConv\">" + lien + "</span>";\r
-      }\r
-   );\r
-};\r
-\r
-/**\r
-  * FIXME : Cette méthode est attrocement lourde ! A optimiser.\r
-  * moyenne sur échantillon : 234ms\r
-  */\r
-euphorik.Formateur.prototype.traiterSmiles = function(m) {  \r
-   objectEach(this.smiles, function(nom, smiles) {\r
-      for (var i = 0; i < smiles.length; i++) {\r
-         m = m.replace(smiles[i], "<img src=\"img/smileys/" + nom + ".gif\" alt =\"" + nom + "\"  />");\r
-      }\r
-   });\r
-   return m;\r
-};\r
-\r
-euphorik.Formateur.prototype.remplacerBalisesHTML = function(m) {\r
-   return m.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");\r
-};\r
-\r
-euphorik.Formateur.prototype.traiterURL = function(m, pseudo) {\r
-   var thisFormateur = this;\r
-   var traitementUrl = function(url) {    \r
-      // si ya pas de protocole on rajoute "http://"\r
-      if (!thisFormateur.regexTestProtocoleExiste.test(url)) {\r
-         url = "http://" + url;\r
-      }\r
-      var extension = thisFormateur.getShort(url);\r
-      return "<a " + (extension[1] ? "title=\"" + (pseudo ? thisFormateur.traiterPourFenetreLightBox(pseudo, url) + ": " : "") +  thisFormateur.traiterPourFenetreLightBox(m, url) + "\"" + " rel=\"lightbox\"" : "") + " href=\"" + url + "\" >[" + extension[0] + "]</a>";\r
-   };\r
-   return m.replace(this.regexUrl, traitementUrl);\r
-};\r
-\r
-/**\r
-  * Formatage en utilisant un sous-ensemble des règles de Textile : http://en.wikipedia.org/wiki/Textile_(markup_language).\r
-  * par exemple _italic_ devient <i>italic</i>.\r
-  */\r
-euphorik.Formateur.prototype.traiterWikiSyntaxe = function(m) {\r
-   return m.replace(\r
-      /(?:^| )_(.*?)_(?:$| )/g,\r
-      function(texte, capture) {\r
-         return '<em class="leger">' + capture + '</em>';\r
-      }\r
-   ).replace(\r
-      /(?:^| )\*(.*?)\*(?:$| )/g,\r
-      function(texte, capture) {\r
-         return '<em class="fort">' + capture + '</em>';\r
-      }\r
-   );\r
-};\r
-\r
-/**\r
-  * Renvoie une version courte de l'url.\r
-  * par exemple : http://en.wikipedia.org/wiki/Yakov_Smirnoff devient en.wikipedia.org\r
-  */\r
-euphorik.Formateur.prototype.getShort = function(url) {\r
-   var estUneImage = false;\r
-   var versionShort = null;\r
-   var rechercheImg = this.regexImg.exec(url);\r
-   \r
-   if (rechercheImg) {\r
-      versionShort = rechercheImg[1].toLowerCase();\r
-      if (versionShort === "jpeg") {\r
-         versionShort = "jpg"; // jpeg -> jpg\r
-      }\r
-      estUneImage = true;\r
-   } else {\r
-      var rechercheDomaine = this.regexDomaine.exec(url);\r
-      if (rechercheDomaine && rechercheDomaine.length >= 2) {\r
-         versionShort = rechercheDomaine[1];\r
-      } else {\r
-         var nomProtocole = this.regexNomProtocole.exec(url);\r
-         if (nomProtocole && nomProtocole.length >= 2) {\r
-            versionShort = nomProtocole[1];\r
-         }\r
-      }\r
-   }\r
-   \r
-   return [versionShort ? versionShort : "url", estUneImage];\r
- };\r
\r
-euphorik.Formateur.prototype.supprimerSmiles = function(m) {\r
-   objectEach(this.smiles, function(nom, smiles) {\r
-      for (var i = 0; i < smiles.length; i++) {\r
-         m = m.replace(smiles[i], "");\r
-      }\r
-   });\r
-   return m;\r
-};\r
-\r
-/**\r
-  * Traite les pseudo et messages à être affiché dans le titre d'une image visualisé avec lightbox.\r
-  * Supprime les smiles pour pas qu'ils puissent être remplacés par la fonction 'traiterSmiles'.\r
-  * TODO : trouver un moyen pour que les smiles puissent être conservés\r
-  */\r
-euphorik.Formateur.prototype.traiterPourFenetreLightBox = function(M, urlCourante) {\r
-   var thisFormateur = this;\r
-   var traitementUrl = function(url) {\r
-      return "[" + thisFormateur.getShort(url)[0] + (urlCourante === url ? "*" : "") + "]";\r
-   };\r
-   \r
-   return this.remplacerBalisesHTML(this.supprimerSmiles(M)).replace(this.regexUrl, traitementUrl);\r
-};\r
index 733f77e..7fde6f7 100644 (file)
 // You should have received a copy of the GNU General Public License\r
 // along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.\r
 \r
 // You should have received a copy of the GNU General Public License\r
 // along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.\r
 \r
-euphorik.PageAbout = function(client, formateur, util, communication) {\r
+euphorik.PageAbout = function(client, formater, util, communication) {\r
    this.nom = "about";\r
    \r
    this.client = client;\r
    this.nom = "about";\r
    \r
    this.client = client;\r
-   this.formateur = formateur;\r
+   this.formateur = formater;\r
    this.util = util;
    this.communication = communication;\r
 };\r
    this.util = util;
    this.communication = communication;\r
 };\r
index 9ed847e..9ce1620 100644 (file)
 /*jslint laxbreak:true */
 
 
 /*jslint laxbreak:true */
 
 
-euphorik.PageAdmin = function(client, formateur, util, communication) {
+euphorik.PageAdmin = function(client, formater, util, communication) {
    this.nom = "admin";
    
    this.client = client;
    this.nom = "admin";
    
    this.client = client;
-   this.formateur = formateur;
+   this.formater = formateur;
    this.util = util;
    this.communication = communication;
    
    this.util = util;
    this.communication = communication;
    
@@ -62,7 +62,7 @@ euphorik.PageAdmin.prototype.charger = function() {
    var thisPage = this;
    
    // la liste des trolls proposés par les ekMasters
    var thisPage = this;
    
    // la liste des trolls proposés par les ekMasters
-   this.trolls = new euphorik.Trolls(this.client, this.util, this.formateur, this.communication);
+   this.trolls = new euphorik.Trolls(this.client, this.util, this.formater, this.communication);
    
    this.waitEvent();
    
    
    this.waitEvent();
    
@@ -134,8 +134,8 @@ euphorik.PageAdmin.prototype.majIPs = function() {
                '</span>|';
             ip.users.each(function(j, user) {
                XHTML += (j > 0 ? ", " : "") +
                '</span>|';
             ip.users.each(function(j, user) {
                XHTML += (j > 0 ? ", " : "") +
-                  '<span class="pseudo">' + thisPageAdmin.formateur.traitementComplet(user.nick) + '</span>' +
-                  (user.login === "" ? "" : '<span class="login">(' + thisPageAdmin.formateur.traitementComplet(user.login) + ')</span>');
+                  '<span class="pseudo">' + thisPageAdmin.formater.traitementComplet(user.nick) + '</span>' +
+                  (user.login === "" ? "" : '<span class="login">(' + thisPageAdmin.formater.traitementComplet(user.login) + ')</span>');
             });
             XHTML += '<span class="deban">débannir</span></div>';
          });
             });
             XHTML += '<span class="deban">débannir</span></div>';
          });
@@ -213,10 +213,10 @@ euphorik.Troll = function(content, author) {
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-euphorik.Trolls = function(client, util, formateur, communication) {
+euphorik.Trolls = function(client, util, formater, communication) {
    this.client = client;
    this.util = util;
    this.client = client;
    this.util = util;
-   this.formateur = formateur;
+   this.formater = formater;
    this.communication = communication;
    this.dernierTroll = 0;
    
    this.communication = communication;
    this.dernierTroll = 0;
    
@@ -234,8 +234,8 @@ euphorik.Trolls.prototype.ajouterTrollEvent = function(data) {
       
       XHTML +=
          '<div id="troll' + trollId + '" class="troll">' +
       
       XHTML +=
          '<div id="troll' + trollId + '" class="troll">' +
-         '<span class="content">' + thisTrolls.formateur.traitementComplet(troll.content, troll.author) + '</span>' +
-         '<span class="author"> - ' + thisTrolls.formateur.traitementComplet(troll.author) + '</span>' +
+         '<span class="content">' + thisTrolls.formater.traitementComplet(troll.content, troll.author) + '</span>' +
+         '<span class="author"> - ' + thisTrolls.formater.traitementComplet(troll.author) + '</span>' +
          (trollData.author_id === thisTrolls.client.id ? '<span class="editTroll">éditer</span><span class="delTroll">Supprimer</span>' : '') +
          '</div>';
    });
          (trollData.author_id === thisTrolls.client.id ? '<span class="editTroll">éditer</span><span class="delTroll">Supprimer</span>' : '') +
          '</div>';
    });
@@ -305,7 +305,7 @@ euphorik.Trolls.prototype.ajouterTrollEvent = function(data) {
 
 euphorik.Trolls.prototype.modifierTrollEvent = function(data) {
    var thisTrolls = this;
 
 euphorik.Trolls.prototype.modifierTrollEvent = function(data) {
    var thisTrolls = this;
-   $("#trolls #troll" + data.troll_id + " .content").html(thisTrolls.formateur.traitementComplet(data.content, thisTrolls.trolls[data.troll_id].author));
+   $("#trolls #troll" + data.troll_id + " .content").html(thisTrolls.formater.traitementComplet(data.content, thisTrolls.trolls[data.troll_id].author));
    $("#trolls #troll" + data.troll_id + " a[@rel*=lightbox]").lightBox();
    thisTrolls.trolls[data.troll_id].content = data.content;
 };
    $("#trolls #troll" + data.troll_id + " a[@rel*=lightbox]").lightBox();
    thisTrolls.trolls[data.troll_id].content = data.content;
 };
index 3609e0d..a8ee986 100644 (file)
   *  /nick <nouveau nick>
   *  Modifie le pseudo courant
   */
   *  /nick <nouveau nick>
   *  Modifie le pseudo courant
   */
-euphorik.Commandes = function(client, pageMinichat, util, formateur) {
+euphorik.Commandes = function(client, pageMinichat, util, formater) {
    var thisCommandes = this;
 
    this.client = client;
    this.pageMinichat = pageMinichat;
    this.util = util;
    var thisCommandes = this;
 
    this.client = client;
    this.pageMinichat = pageMinichat;
    this.util = util;
-   this.formateur = formateur;
+   this.formater = formater;
    
    // construction du texte d'aide (liste des commandes) de manière statique
    this.texteAide = "<div id=\"aideCommandes\"><h1>Commandes</h1><ul>";
    objectEach(
       euphorik.Commandes.liste,
       function(nom, commande) {
    
    // construction du texte d'aide (liste des commandes) de manière statique
    this.texteAide = "<div id=\"aideCommandes\"><h1>Commandes</h1><ul>";
    objectEach(
       euphorik.Commandes.liste,
       function(nom, commande) {
-         thisCommandes.texteAide += "<li><span class=\"usage\">" + thisCommandes.formateur.traitementComplet(commande.usage) + "</span> : " + thisCommandes.formateur.traitementComplet(commande.description) + "</li>";
+         thisCommandes.texteAide += "<li><span class=\"usage\">" + thisCommandes.formater.traitementComplet(commande.usage) + "</span> : " + thisCommandes.formater.traitementComplet(commande.description) + "</li>";
       }
    );
    this.texteAide += "</ul></div>";
       }
    );
    this.texteAide += "</ul></div>";
index 60b22a6..635f50a 100644 (file)
@@ -35,7 +35,7 @@ euphorik.Conversation = function(conversations, num) {
    this.id = Math.floor(Math.random() * 1000000).toString(36);\r
    \r
    this.util = this.conversations.util;\r
    this.id = Math.floor(Math.random() * 1000000).toString(36);\r
    \r
    this.util = this.conversations.util;\r
-   this.formateur = this.conversations.formateur;\r
+   this.formater = this.conversations.formater;\r
    this.client = this.conversations.client;\r
    \r
    this.idDernierMessageAffiche = 0;\r
    this.client = this.conversations.client;\r
    \r
    this.idDernierMessageAffiche = 0;\r
@@ -107,7 +107,7 @@ euphorik.Conversation.prototype.getMessageReduit = function() {
   * @racine un message représentant la racine de la conversation, vaut undefined pour la conversation générale\r
   */\r
 euphorik.Conversation.prototype.setRacine = function(racineElement) {\r
   * @racine un message représentant la racine de la conversation, vaut undefined pour la conversation générale\r
   */\r
 euphorik.Conversation.prototype.setRacine = function(racineElement) {\r
-   this.racine = new euphorik.Message(this.client, this.formateur, racineElement);\r
+   this.racine = new euphorik.Message(this.client, this.formater, racineElement);\r
 };\r
 \r
 /**\r
 };\r
 \r
 /**\r
index 378c2a2..a63dcb9 100644 (file)
@@ -21,9 +21,9 @@
 /**\r
   * Représente l'ensemble des conversations affichés.\r
   */\r
 /**\r
   * Représente l'ensemble des conversations affichés.\r
   */\r
-euphorik.Conversations = function(client, formateur, util, fragment) {\r
+euphorik.Conversations = function(client, formater, util, fragment) {\r
    this.client = client;\r
    this.client = client;\r
-   this.formateur = formateur;\r
+   this.formater = formater;\r
    this.util = util;\r
    this.fragment = fragment;\r
    \r
    this.util = util;\r
    this.fragment = fragment;\r
    \r
@@ -250,7 +250,7 @@ euphorik.Conversations.prototype.ajouterMessage = function(element, numConversat
    var message = \r
       new euphorik.Message(\r
          this.client,\r
    var message = \r
       new euphorik.Message(\r
          this.client,\r
-         this.formateur,\r
+         this.formater,\r
          element\r
       );\r
    \r
          element\r
       );\r
    \r
@@ -380,7 +380,7 @@ euphorik.Conversations.prototype.rafraichirMessages = function(vider) {
          "new_troll" :\r
             function(data) {\r
                thisConversations.trollIdCourant = data.troll_id;\r
          "new_troll" :\r
             function(data) {\r
                thisConversations.trollIdCourant = data.troll_id;\r
-               $("#trollCourant .troll").html(thisConversations.formateur.traitementComplet(data.content)).unbind("click").click(\r
+               $("#trollCourant .troll").html(thisConversations.formater.traitementComplet(data.content)).unbind("click").click(\r
                   function() {\r
                      thisConversations.ouvrirConversation(data.message_id);\r
                   }\r
                   function() {\r
                      thisConversations.ouvrirConversation(data.message_id);\r
                   }\r
index 417f330..c24be1d 100644 (file)
@@ -27,9 +27,9 @@ euphorik.Reponse = function(id, pseudo, login) {
 /**\r
   * Représente un message.\r
   */\r
 /**\r
   * Représente un message.\r
   */\r
-euphorik.Message = function(client, formateur, element) {\r
+euphorik.Message = function(client, formater, element) {\r
    this.client = client;\r
    this.client = client;\r
-   this.formateur = formateur;\r
+   this.formater = formater;\r
    \r
    this.id = element.id;\r
    this.auteurId = element.user_id;\r
    \r
    this.id = element.id;\r
    this.auteurId = element.user_id;\r
@@ -120,9 +120,9 @@ euphorik.Message.prototype.XHTML = function(messagePair, pre) {
       \r
    // construit l'identifiant de la personne\r
    var identifiant = \r
       \r
    // construit l'identifiant de la personne\r
    var identifiant = \r
-      this.client.nickFormat === "nick" || this.login === "" ? this.formateur.traitementComplet(this.pseudo) : \r
-      (this.client.nickFormat === "login" ? this.formateur.traitementComplet(this.login) : \r
-      this.formateur.traitementComplet(this.pseudo) + "<span class=\"login\">(" + this.formateur.traitementComplet(this.login) +")</span>" );\r
+      this.client.nickFormat === "nick" || this.login === "" ? this.formater.traitementComplet(this.pseudo) : \r
+      (this.client.nickFormat === "login" ? this.formater.traitementComplet(this.login) : \r
+      this.formater.traitementComplet(this.pseudo) + "<span class=\"login\">(" + this.formater.traitementComplet(this.login) +")</span>" );\r
 \r
    var XHTMLrepondA = "";\r
    var debut = true;\r
 \r
    var XHTMLrepondA = "";\r
    var debut = true;\r
@@ -130,7 +130,7 @@ euphorik.Message.prototype.XHTML = function(messagePair, pre) {
       if (!debut) {\r
          XHTMLrepondA += ", ";\r
       }\r
       if (!debut) {\r
          XHTMLrepondA += ", ";\r
       }\r
-      XHTMLrepondA += thisMessage.formateur.traitementComplet(rep.pseudo);\r
+      XHTMLrepondA += thisMessage.formater.traitementComplet(rep.pseudo);\r
       debut = false;\r
    });\r
    if (XHTMLrepondA) {\r
       debut = false;\r
    });\r
    if (XHTMLrepondA) {\r
@@ -150,6 +150,6 @@ euphorik.Message.prototype.XHTML = function(messagePair, pre) {
          "</span>" + \r
          "<span class=\"delimitationEntete\"></span>" +\r
          XHTMLrepondA +\r
          "</span>" + \r
          "<span class=\"delimitationEntete\"></span>" +\r
          XHTMLrepondA +\r
-         "<span class=\"contenu\">" + this.formateur.traitementComplet(this.contenu, this.pseudo) + "</span>" +\r
+         "<span class=\"contenu\">" + this.formater.traitementComplet(this.contenu, this.pseudo) + "</span>" +\r
       "</div>";\r
 };\r
       "</div>";\r
 };\r
index 032ce41..c1276c7 100755 (executable)
  
 /*jslint laxbreak:true */
 
  
 /*jslint laxbreak:true */
 
-euphorik.PageMinichat = function(client, formateur, util, communication) {
+euphorik.PageMinichat = function(client, formater, util, communication) {
    this.nom = "minichat";
    
    this.client = client;
    this.nom = "minichat";
    
    this.client = client;
-   this.formateur = formateur;
+   this.formater = formater;
    this.util = util;
    this.communication = communication;
    this.util = util;
    this.communication = communication;
-   this.commandes = new euphorik.Commandes(this.client, this, this.util, this.formateur);
+   this.commandes = new euphorik.Commandes(this.client, this, this.util, this.formater);
    
    // permet d'éviter d'envoyer plusieurs messages simultanément en pressant
    // rapidement sur "enter" par exemple
    
    // permet d'éviter d'envoyer plusieurs messages simultanément en pressant
    // rapidement sur "enter" par exemple
@@ -66,7 +66,7 @@ euphorik.PageMinichat.prototype.charger = function() {
    $("#posterMessage input.pseudo").val(this.client.pseudo);
    
    // cet appel ne doit pas être fait avant l'appel à 'charger'
    $("#posterMessage input.pseudo").val(this.client.pseudo);
    
    // cet appel ne doit pas être fait avant l'appel à 'charger'
-   this.conversations = new euphorik.Conversations(this.client, this.formateur, this.util, this.fragment);   
+   this.conversations = new euphorik.Conversations(this.client, this.formater, this.util, this.fragment);   
    
    this.chargerConversationsFragment();
    
    
    this.chargerConversationsFragment();
    
@@ -120,12 +120,12 @@ euphorik.PageMinichat.prototype.charger = function() {
    // <smiles>
    $("body").append('<div id="smiles"></div>');
    // affichage des smiles
    // <smiles>
    $("body").append('<div id="smiles"></div>');
    // affichage des smiles
-   $("#smiles").append(this.formateur.getSmilesHTML()).children().each(
+   $("#smiles").append(this.formater.getSmilesHTML()).children().each(
       function(i) {
          var opacityBase = $(this).css("opacity");
          $(this).click(
             function() {
       function(i) {
          var opacityBase = $(this).css("opacity");
          $(this).click(
             function() {
-               thisPage.util.replaceSelection($("form#posterMessage input.message")[0], thisPage.formateur.smiles[$(this).attr("class")][0].source.replace(/\\/g, ""));
+               thisPage.util.replaceSelection($("form#posterMessage input.message")[0], thisPage.formater.smiles[$(this).attr("class")][0].source.replace(/\\/g, ""));
             }
          ).hover(
             function() { $(this).animate({opacity: 1}, 200); },
             }
          ).hover(
             function() { $(this).animate({opacity: 1}, 200); },
@@ -229,7 +229,7 @@ euphorik.PageMinichat.prototype.envoyerMessage = function(message) {
    var pseudo = $("form#posterMessage input.pseudo").val();
 
    // (un pseudo vide est autorisé)
    var pseudo = $("form#posterMessage input.pseudo").val();
 
    // (un pseudo vide est autorisé)
-   pseudo = this.formateur.filtrerInputPseudo(pseudo);
+   pseudo = this.formater.filtrerInputPseudo(pseudo);
    
    if (pseudo === euphorik.conf.pseudoDefaut) {
       this.util.messageDialogue("Le pseudo ne peut pas être " + euphorik.conf.pseudoDefaut);
    
    if (pseudo === euphorik.conf.pseudoDefaut) {
       this.util.messageDialogue("Le pseudo ne peut pas être " + euphorik.conf.pseudoDefaut);
index d772317..7f3a64b 100755 (executable)
 // You should have received a copy of the GNU General Public License\r
 // along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.\r
 \r
 // You should have received a copy of the GNU General Public License\r
 // along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.\r
 \r
-euphorik.PageProfile = function(client, formateur, util) {\r
+euphorik.PageProfile = function(client, formater, util) {\r
    this.nom = "profile";\r
    \r
    this.client = client;\r
    this.nom = "profile";\r
    \r
    this.client = client;\r
-   this.formateur = formateur;\r
+   this.formateur = formater;\r
    this.util = util;\r
 };\r
 \r
    this.util = util;\r
 };\r
 \r
@@ -64,7 +64,7 @@ euphorik.PageProfile.prototype.chargerProfile = function() {
 \r
    $("form#profile button").click(\r
       function() {\r
 \r
    $("form#profile button").click(\r
       function() {\r
-         thisPage.client.pseudo = thisPage.formateur.filtrerInputPseudo($("form#profile input.pseudo").val());\r
+         thisPage.client.pseudo = thisPage.formate.filtrerInputPseudo($("form#profile input.pseudo").val());\r
          thisPage.client.email = $("form#profile input.email").val();\r
          thisPage.client.chatOrder = $("form#profile select#chatOrder option:selected").attr("value");\r
          thisPage.client.nickFormat = $("form#profile select#affichagePseudo option:selected").attr("value");\r
          thisPage.client.email = $("form#profile input.email").val();\r
          thisPage.client.chatOrder = $("form#profile select#chatOrder option:selected").attr("value");\r
          thisPage.client.nickFormat = $("form#profile select#affichagePseudo option:selected").attr("value");\r
index e28e3d3..0179573 100755 (executable)
 // You should have received a copy of the GNU General Public License\r
 // along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.\r
 \r
 // You should have received a copy of the GNU General Public License\r
 // along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.\r
 \r
-euphorik.PageRegister = function(client, formateur, util) {\r
+euphorik.PageRegister = function(client, formater, util) {\r
    this.nom = "register";\r
    \r
    this.client = client;\r
    this.nom = "register";\r
    \r
    this.client = client;\r
-   this.formateur = formateur;\r
+   this.formater = formater;\r
    this.util = util;\r
 };\r
 \r
    this.util = util;\r
 };\r
 \r
index 7ba8e60..80d1b54 100644 (file)
   *  - afficher une boite de message\r
   *  - afficher une bulle d'aide lié à un élément\r
   *  - manipuler le curseur et réaliser des sélections sur des zones de saisie (<input>)\r
   *  - afficher une boite de message\r
   *  - afficher une bulle d'aide lié à un élément\r
   *  - manipuler le curseur et réaliser des sélections sur des zones de saisie (<input>)\r
-  * @formateur permet de formater les messages affichés à l'aide de messageDialogue (facultatif), voir "formateur.js".\r
+  * @formateur permet de formater les messages affichés à l'aide de messageDialogue (facultatif), voir "formater.js".\r
   */\r
   */\r
-euphorik.Util = function (formateur) {\r
+euphorik.Util = function (formater) {\r
    $("#info .fermer").click(function() {\r
       $("#info").slideUp(50);\r
    });\r
    \r
    $("body").append('<div id="flecheBulle"></div>').append('<div id="messageBulle"><p></p></div>');\r
    \r
    $("#info .fermer").click(function() {\r
       $("#info").slideUp(50);\r
    });\r
    \r
    $("body").append('<div id="flecheBulle"></div>').append('<div id="messageBulle"><p></p></div>');\r
    \r
-   this.formateur = formateur;\r
+   this.formateur = formater;\r
    this.bulleActive = true;\r
 };\r
 \r
    this.bulleActive = true;\r
 };\r
 \r
@@ -61,7 +61,7 @@ euphorik.Util.prototype.messageDialogue = function(message, type, boutons, forma
    var fermer = function() { $("#info").slideUp(100); };\r
    fermer();\r
 \r
    var fermer = function() { $("#info").slideUp(100); };\r
    fermer();\r
 \r
-   $("#info .message").html(!thisUtil.formateur || !formate ? message : thisUtil.formateur.traitementComplet(message));\r
+   $("#info .message").html(!thisUtil.formater || !formate ? message : thisUtil.formateur.traitementComplet(message));\r
    \r
    switch(type) {\r
       case euphorik.Util.messageType.informatif : $("#info #icone").attr("class", "information"); break;\r
    \r
    switch(type) {\r
       case euphorik.Util.messageType.informatif : $("#info #icone").attr("class", "information"); break;\r