From 09608ab29e1c39ea51b51a5f8669dcde36efb306 Mon Sep 17 00:00:00 2001 From: Greg Burri Date: Tue, 27 Jan 2009 08:41:15 +0000 Subject: [PATCH] MOD replace 'formateur' by 'formater' --- index.yaws | 10 ++++----- js/client.js | 4 ++-- js/euphorik.js | 14 ++++++------- js/{formateur.js => formater.js} | 36 ++++++++++++++++---------------- js/pageAbout.js | 4 ++-- js/pageAdmin.js | 20 +++++++++--------- js/pageMinichat/commandes.js | 6 +++--- js/pageMinichat/conversation.js | 4 ++-- js/pageMinichat/conversations.js | 8 +++---- js/pageMinichat/message.js | 14 ++++++------- js/pageMinichat/pageMinichat.js | 14 ++++++------- js/pageProfile.js | 6 +++--- js/pageRegister.js | 4 ++-- js/util.js | 8 +++---- 14 files changed, 76 insertions(+), 76 deletions(-) rename js/{formateur.js => formater.js} (78%) diff --git a/index.yaws b/index.yaws index 7fbddfc..87f40e2 100755 --- a/index.yaws +++ b/index.yaws @@ -5,7 +5,7 @@ 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 }}. @@ -16,8 +16,8 @@ euphorik.ch - - % prédéfinit la feuille de style + + % 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"; @@ -25,7 +25,7 @@ end, {ehtml, {link , [ - {id, "cssPrincipale" }, + {id, "mainCss" }, {rel, "stylesheet"}, {href, CSS}, {type, "text/css"}, @@ -49,7 +49,7 @@ - + diff --git a/js/client.js b/js/client.js index c378075..9ea6ea0 100644 --- a/js/client.js +++ b/js/client.js @@ -53,7 +53,7 @@ euphorik.Client.prototype.resetDonneesPersonnelles = function() { this.login = ""; this.password = ""; this.email = ""; - this.css = $("link#cssPrincipale").attr("href"); + this.css = $("link#mainCss").attr("href"); this.chatOrder = "reverse"; this.nickFormat = "nick"; this.viewTimes = true; @@ -77,7 +77,7 @@ euphorik.Client.prototype.setCss = function(css) { } this.css = css; - $("link#cssPrincipale").attr("href", this.css); + $("link#mainCss").attr("href", this.css); if (this.autoflush) { this.flush(true); } diff --git a/js/euphorik.js b/js/euphorik.js index c1253b9..4706eb8 100755 --- a/js/euphorik.js +++ b/js/euphorik.js @@ -25,8 +25,8 @@ var euphorik = {}; $(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(); }, @@ -64,11 +64,11 @@ $(document).ready( // TODO : simplifier et pouvoir créer des liens par exemple : Conditions d'utilisation $("#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(); diff --git a/js/formateur.js b/js/formater.js similarity index 78% rename from js/formateur.js rename to js/formater.js index eba6c5a..eec87f8 100644 --- a/js/formateur.js +++ b/js/formater.js @@ -22,7 +22,7 @@ * message par "[url]". * TODO : améliorer l'efficacité des méthods notamment lié au smiles. */ -euphorik.Formateur = function() { +euphorik.Formater = function() { this.smiles = euphorik.conf.smiles; this.protocoles = "http|https|ed2k"; @@ -38,11 +38,11 @@ euphorik.Formateur = function() { * @param pseudo le pseudo brut * @return le pseudo filtré */ -euphorik.Formateur.prototype.filtrerInputPseudo = function(pseudo) { +euphorik.Formater.prototype.filtrerInputPseudo = function(pseudo) { return pseudo.replace(/\{|\}/g, "").trim(); }; -euphorik.Formateur.prototype.getSmilesHTML = function() { +euphorik.Formater.prototype.getSmilesHTML = function() { var XHTML = ""; objectEach(this.smiles, function(nom) { XHTML += "\"""; @@ -55,7 +55,7 @@ euphorik.Formateur.prototype.getSmilesHTML = function() { * @m le message * @pseudo facultatif, permet de contruire le label des images sous la forme : " : " */ -euphorik.Formateur.prototype.traitementComplet = function(m, pseudo) { +euphorik.Formater.prototype.traitementComplet = function(m, pseudo) { return this.traiterLiensConv(this.traiterSmiles(this.traiterURL(this.traiterWikiSyntaxe(this.remplacerBalisesHTML(m)), pseudo))); }; @@ -65,7 +65,7 @@ euphorik.Formateur.prototype.traitementComplet = function(m, pseudo) { * "{5F}" ou 5F est la racine de la conversation. * Ce lien sera transformer en {5F} pouvant être clické pour créer la conv 5F. */ -euphorik.Formateur.prototype.traiterLiensConv = function(m) { +euphorik.Formater.prototype.traiterLiensConv = function(m) { return m.replace( /\{\w+\}/g, function(lien) { @@ -78,7 +78,7 @@ euphorik.Formateur.prototype.traiterLiensConv = function(m) { * FIXME : Cette méthode est attrocement lourde ! A optimiser. * moyenne sur échantillon : 234ms */ -euphorik.Formateur.prototype.traiterSmiles = function(m) { +euphorik.Formater.prototype.traiterSmiles = function(m) { objectEach(this.smiles, function(nom, smiles) { for (var i = 0; i < smiles.length; i++) { m = m.replace(smiles[i], "\"""); @@ -87,19 +87,19 @@ euphorik.Formateur.prototype.traiterSmiles = function(m) { return m; }; -euphorik.Formateur.prototype.remplacerBalisesHTML = function(m) { +euphorik.Formater.prototype.remplacerBalisesHTML = function(m) { return m.replace(//g, ">").replace(/"/g, """); }; -euphorik.Formateur.prototype.traiterURL = function(m, pseudo) { - var thisFormateur = this; +euphorik.Formater.prototype.traiterURL = function(m, pseudo) { + var thisFormater = this; var traitementUrl = function(url) { // si ya pas de protocole on rajoute "http://" - if (!thisFormateur.regexTestProtocoleExiste.test(url)) { + if (!thisFormater.regexTestProtocoleExiste.test(url)) { url = "http://" + url; } - var extension = thisFormateur.getShort(url); - return "[" + extension[0] + "]"; + var extension = thisFormater.getShort(url); + return "[" + extension[0] + "]"; }; return m.replace(this.regexUrl, traitementUrl); }; @@ -108,7 +108,7 @@ euphorik.Formateur.prototype.traiterURL = function(m, pseudo) { * Formatage en utilisant un sous-ensemble des règles de Textile : http://en.wikipedia.org/wiki/Textile_(markup_language). * par exemple _italic_ devient italic. */ -euphorik.Formateur.prototype.traiterWikiSyntaxe = function(m) { +euphorik.Formater.prototype.traiterWikiSyntaxe = function(m) { return m.replace( /(?:^| )_(.*?)_(?:$| )/g, function(texte, capture) { @@ -126,7 +126,7 @@ euphorik.Formateur.prototype.traiterWikiSyntaxe = function(m) { * Renvoie une version courte de l'url. * par exemple : http://en.wikipedia.org/wiki/Yakov_Smirnoff devient en.wikipedia.org */ -euphorik.Formateur.prototype.getShort = function(url) { +euphorik.Formater.prototype.getShort = function(url) { var estUneImage = false; var versionShort = null; var rechercheImg = this.regexImg.exec(url); @@ -152,7 +152,7 @@ euphorik.Formateur.prototype.getShort = function(url) { return [versionShort ? versionShort : "url", estUneImage]; }; -euphorik.Formateur.prototype.supprimerSmiles = function(m) { +euphorik.Formater.prototype.supprimerSmiles = function(m) { objectEach(this.smiles, function(nom, smiles) { for (var i = 0; i < smiles.length; i++) { m = m.replace(smiles[i], ""); @@ -166,10 +166,10 @@ euphorik.Formateur.prototype.supprimerSmiles = function(m) { * Supprime les smiles pour pas qu'ils puissent être remplacés par la fonction 'traiterSmiles'. * TODO : trouver un moyen pour que les smiles puissent être conservés */ -euphorik.Formateur.prototype.traiterPourFenetreLightBox = function(M, urlCourante) { - var thisFormateur = this; +euphorik.Formater.prototype.traiterPourFenetreLightBox = function(M, urlCourante) { + var thisFormater = this; var traitementUrl = function(url) { - return "[" + thisFormateur.getShort(url)[0] + (urlCourante === url ? "*" : "") + "]"; + return "[" + thisFormater.getShort(url)[0] + (urlCourante === url ? "*" : "") + "]"; }; return this.remplacerBalisesHTML(this.supprimerSmiles(M)).replace(this.regexUrl, traitementUrl); diff --git a/js/pageAbout.js b/js/pageAbout.js index 733f77e..7fde6f7 100644 --- a/js/pageAbout.js +++ b/js/pageAbout.js @@ -16,11 +16,11 @@ // You should have received a copy of the GNU General Public License // along with Euphorik. If not, see . -euphorik.PageAbout = function(client, formateur, util, communication) { +euphorik.PageAbout = function(client, formater, util, communication) { this.nom = "about"; this.client = client; - this.formateur = formateur; + this.formateur = formater; this.util = util; this.communication = communication; }; diff --git a/js/pageAdmin.js b/js/pageAdmin.js index 9ed847e..9ce1620 100644 --- a/js/pageAdmin.js +++ b/js/pageAdmin.js @@ -21,11 +21,11 @@ /*jslint laxbreak:true */ -euphorik.PageAdmin = function(client, formateur, util, communication) { +euphorik.PageAdmin = function(client, formater, util, communication) { this.nom = "admin"; this.client = client; - this.formateur = formateur; + this.formater = formateur; 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 - 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(); @@ -134,8 +134,8 @@ euphorik.PageAdmin.prototype.majIPs = function() { '|'; ip.users.each(function(j, user) { XHTML += (j > 0 ? ", " : "") + - '' + thisPageAdmin.formateur.traitementComplet(user.nick) + '' + - (user.login === "" ? "" : ''); + '' + thisPageAdmin.formater.traitementComplet(user.nick) + '' + + (user.login === "" ? "" : ''); }); XHTML += 'débannir'; }); @@ -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.formateur = formateur; + this.formater = formater; this.communication = communication; this.dernierTroll = 0; @@ -234,8 +234,8 @@ euphorik.Trolls.prototype.ajouterTrollEvent = function(data) { XHTML += '
' + - '' + thisTrolls.formateur.traitementComplet(troll.content, troll.author) + '' + - ' - ' + thisTrolls.formateur.traitementComplet(troll.author) + '' + + '' + thisTrolls.formater.traitementComplet(troll.content, troll.author) + '' + + ' - ' + thisTrolls.formater.traitementComplet(troll.author) + '' + (trollData.author_id === thisTrolls.client.id ? 'éditerSupprimer' : '') + '
'; }); @@ -305,7 +305,7 @@ euphorik.Trolls.prototype.ajouterTrollEvent = function(data) { 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; }; diff --git a/js/pageMinichat/commandes.js b/js/pageMinichat/commandes.js index 3609e0d..a8ee986 100644 --- a/js/pageMinichat/commandes.js +++ b/js/pageMinichat/commandes.js @@ -27,20 +27,20 @@ * /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; - this.formateur = formateur; + this.formater = formater; // construction du texte d'aide (liste des commandes) de manière statique this.texteAide = "

Commandes

    "; objectEach( euphorik.Commandes.liste, function(nom, commande) { - thisCommandes.texteAide += "
  • " + thisCommandes.formateur.traitementComplet(commande.usage) + " : " + thisCommandes.formateur.traitementComplet(commande.description) + "
  • "; + thisCommandes.texteAide += "
  • " + thisCommandes.formater.traitementComplet(commande.usage) + " : " + thisCommandes.formater.traitementComplet(commande.description) + "
  • "; } ); this.texteAide += "
"; diff --git a/js/pageMinichat/conversation.js b/js/pageMinichat/conversation.js index 60b22a6..635f50a 100644 --- a/js/pageMinichat/conversation.js +++ b/js/pageMinichat/conversation.js @@ -35,7 +35,7 @@ euphorik.Conversation = function(conversations, num) { this.id = Math.floor(Math.random() * 1000000).toString(36); this.util = this.conversations.util; - this.formateur = this.conversations.formateur; + this.formater = this.conversations.formater; this.client = this.conversations.client; this.idDernierMessageAffiche = 0; @@ -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 */ euphorik.Conversation.prototype.setRacine = function(racineElement) { - this.racine = new euphorik.Message(this.client, this.formateur, racineElement); + this.racine = new euphorik.Message(this.client, this.formater, racineElement); }; /** diff --git a/js/pageMinichat/conversations.js b/js/pageMinichat/conversations.js index 378c2a2..a63dcb9 100644 --- a/js/pageMinichat/conversations.js +++ b/js/pageMinichat/conversations.js @@ -21,9 +21,9 @@ /** * Représente l'ensemble des conversations affichés. */ -euphorik.Conversations = function(client, formateur, util, fragment) { +euphorik.Conversations = function(client, formater, util, fragment) { this.client = client; - this.formateur = formateur; + this.formater = formater; this.util = util; this.fragment = fragment; @@ -250,7 +250,7 @@ euphorik.Conversations.prototype.ajouterMessage = function(element, numConversat var message = new euphorik.Message( this.client, - this.formateur, + this.formater, element ); @@ -380,7 +380,7 @@ euphorik.Conversations.prototype.rafraichirMessages = function(vider) { "new_troll" : function(data) { thisConversations.trollIdCourant = data.troll_id; - $("#trollCourant .troll").html(thisConversations.formateur.traitementComplet(data.content)).unbind("click").click( + $("#trollCourant .troll").html(thisConversations.formater.traitementComplet(data.content)).unbind("click").click( function() { thisConversations.ouvrirConversation(data.message_id); } diff --git a/js/pageMinichat/message.js b/js/pageMinichat/message.js index 417f330..c24be1d 100644 --- a/js/pageMinichat/message.js +++ b/js/pageMinichat/message.js @@ -27,9 +27,9 @@ euphorik.Reponse = function(id, pseudo, login) { /** * Représente un message. */ -euphorik.Message = function(client, formateur, element) { +euphorik.Message = function(client, formater, element) { this.client = client; - this.formateur = formateur; + this.formater = formater; this.id = element.id; this.auteurId = element.user_id; @@ -120,9 +120,9 @@ euphorik.Message.prototype.XHTML = function(messagePair, pre) { // construit l'identifiant de la personne var identifiant = - this.client.nickFormat === "nick" || this.login === "" ? this.formateur.traitementComplet(this.pseudo) : - (this.client.nickFormat === "login" ? this.formateur.traitementComplet(this.login) : - this.formateur.traitementComplet(this.pseudo) + "(" + this.formateur.traitementComplet(this.login) +")" ); + this.client.nickFormat === "nick" || this.login === "" ? this.formater.traitementComplet(this.pseudo) : + (this.client.nickFormat === "login" ? this.formater.traitementComplet(this.login) : + this.formater.traitementComplet(this.pseudo) + "(" + this.formater.traitementComplet(this.login) +")" ); var XHTMLrepondA = ""; var debut = true; @@ -130,7 +130,7 @@ euphorik.Message.prototype.XHTML = function(messagePair, pre) { if (!debut) { XHTMLrepondA += ", "; } - XHTMLrepondA += thisMessage.formateur.traitementComplet(rep.pseudo); + XHTMLrepondA += thisMessage.formater.traitementComplet(rep.pseudo); debut = false; }); if (XHTMLrepondA) { @@ -150,6 +150,6 @@ euphorik.Message.prototype.XHTML = function(messagePair, pre) { "" + "" + XHTMLrepondA + - "" + this.formateur.traitementComplet(this.contenu, this.pseudo) + "" + + "" + this.formater.traitementComplet(this.contenu, this.pseudo) + "" + ""; }; diff --git a/js/pageMinichat/pageMinichat.js b/js/pageMinichat/pageMinichat.js index 032ce41..c1276c7 100755 --- a/js/pageMinichat/pageMinichat.js +++ b/js/pageMinichat/pageMinichat.js @@ -18,14 +18,14 @@ /*jslint laxbreak:true */ -euphorik.PageMinichat = function(client, formateur, util, communication) { +euphorik.PageMinichat = function(client, formater, util, communication) { this.nom = "minichat"; this.client = client; - this.formateur = formateur; + this.formater = formater; 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 @@ -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' - 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(); @@ -120,12 +120,12 @@ euphorik.PageMinichat.prototype.charger = function() { // $("body").append('
'); // 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() { - 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); }, @@ -229,7 +229,7 @@ euphorik.PageMinichat.prototype.envoyerMessage = function(message) { 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); diff --git a/js/pageProfile.js b/js/pageProfile.js index d772317..7f3a64b 100755 --- a/js/pageProfile.js +++ b/js/pageProfile.js @@ -16,11 +16,11 @@ // You should have received a copy of the GNU General Public License // along with Euphorik. If not, see . -euphorik.PageProfile = function(client, formateur, util) { +euphorik.PageProfile = function(client, formater, util) { this.nom = "profile"; this.client = client; - this.formateur = formateur; + this.formateur = formater; this.util = util; }; @@ -64,7 +64,7 @@ euphorik.PageProfile.prototype.chargerProfile = function() { $("form#profile button").click( function() { - thisPage.client.pseudo = thisPage.formateur.filtrerInputPseudo($("form#profile input.pseudo").val()); + thisPage.client.pseudo = thisPage.formate.filtrerInputPseudo($("form#profile input.pseudo").val()); thisPage.client.email = $("form#profile input.email").val(); thisPage.client.chatOrder = $("form#profile select#chatOrder option:selected").attr("value"); thisPage.client.nickFormat = $("form#profile select#affichagePseudo option:selected").attr("value"); diff --git a/js/pageRegister.js b/js/pageRegister.js index e28e3d3..0179573 100755 --- a/js/pageRegister.js +++ b/js/pageRegister.js @@ -16,11 +16,11 @@ // You should have received a copy of the GNU General Public License // along with Euphorik. If not, see . -euphorik.PageRegister = function(client, formateur, util) { +euphorik.PageRegister = function(client, formater, util) { this.nom = "register"; this.client = client; - this.formateur = formateur; + this.formater = formater; this.util = util; }; diff --git a/js/util.js b/js/util.js index 7ba8e60..80d1b54 100644 --- a/js/util.js +++ b/js/util.js @@ -23,16 +23,16 @@ * - afficher une boite de message * - afficher une bulle d'aide lié à un élément * - manipuler le curseur et réaliser des sélections sur des zones de saisie () - * @formateur permet de formater les messages affichés à l'aide de messageDialogue (facultatif), voir "formateur.js". + * @formateur permet de formater les messages affichés à l'aide de messageDialogue (facultatif), voir "formater.js". */ -euphorik.Util = function (formateur) { +euphorik.Util = function (formater) { $("#info .fermer").click(function() { $("#info").slideUp(50); }); $("body").append('
').append('

'); - this.formateur = formateur; + this.formateur = formater; this.bulleActive = true; }; @@ -61,7 +61,7 @@ euphorik.Util.prototype.messageDialogue = function(message, type, boutons, forma var fermer = function() { $("#info").slideUp(100); }; fermer(); - $("#info .message").html(!thisUtil.formateur || !formate ? message : thisUtil.formateur.traitementComplet(message)); + $("#info .message").html(!thisUtil.formater || !formate ? message : thisUtil.formateur.traitementComplet(message)); switch(type) { case euphorik.Util.messageType.informatif : $("#info #icone").attr("class", "information"); break; -- 2.43.0