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
+ this.regexProtocolName = 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
+ * Formate un nick saise par l'utilisateur.\r
+ * @param nick le nick brut\r
+ * @return le nick filtré\r
*/\r
-euphorik.Formater.prototype.filtrerInputPseudo = function(pseudo) {\r
- return pseudo.replace(/\{|\}/g, "").trim();\r
+euphorik.Formater.prototype.filtrerInputPseudo = function(nick) {\r
+ return nick.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
+ objectEach(this.smiles, function(name) {\r
+ XHTML += "<img class=\"" + name + "\" src=\"img/smileys/" + name + ".gif\" alt =\"" + name + "\" />";\r
});\r
return XHTML;\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
+ * @nick 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
+euphorik.Formater.prototype.traitementComplet = function(m, nick) {\r
+ return this.traiterLiensConv(this.traiterSmiles(this.traiterURL(this.traiterWikiSyntaxe(this.remplacerBalisesHTML(m)), nick)));\r
};\r
\r
/**\r
* moyenne sur échantillon : 234ms\r
*/\r
euphorik.Formater.prototype.traiterSmiles = function(m) { \r
- objectEach(this.smiles, function(nom, smiles) {\r
+ objectEach(this.smiles, function(name, 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
+ m = m.replace(smiles[i], "<img src=\"img/smileys/" + name + ".gif\" alt =\"" + name + "\" />");\r
}\r
});\r
return m;\r
return m.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);\r
};\r
\r
-euphorik.Formater.prototype.traiterURL = function(m, pseudo) {\r
+euphorik.Formater.prototype.traiterURL = function(m, nick) {\r
var thisFormater = this;\r
var traitementUrl = function(url) { \r
// si ya pas de protocole on rajoute "http://"\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
+ return "<a " + (extension[1] ? "title=\"" + (nick ? thisFormater.traiterPourFenetreLightBox(nick, url) + ": " : "") + thisFormateur.traiterPourFenetreLightBox(m, url) + "\"" + " rel=\"lightbox\"" : "") + " href=\"" + url + "\" >[" + extension[0] + "]</a>";\r
};\r
return m.replace(this.regexUrl, traitementUrl);\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
+ function(texte, c1, c2, c3) {\r
+ return '<em>' + c1 + c2 + c3 + '</em>';\r
}\r
).replace(\r
/(?:^| )\*(.*?)\*(?:$| )/g,\r
- function(texte, capture) {\r
- return '<em class="fort">' + capture + '</em>';\r
+ function(texte, c1, c2, c3) {\r
+ return '<strong>' + c1 + c2 + c3 + '</strong>';\r
}\r
);\r
};\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
+ var protocolName = this.regexProtocolName.exec(url);\r
+ if (protocolName && protocolName.length >= 2) {\r
+ versionShort = protocolName[1];\r
}\r
}\r
}\r
};\r
\r
euphorik.Formater.prototype.supprimerSmiles = function(m) {\r
- objectEach(this.smiles, function(nom, smiles) {\r
+ objectEach(this.smiles, function(name, smiles) {\r
for (var i = 0; i < smiles.length; i++) {\r
m = m.replace(smiles[i], "");\r
}\r
};\r
\r
/**\r
- * Traite les pseudo et messages à être affiché dans le titre d'une image visualisé avec lightbox.\r
+ * Traite les nick 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