y="359.74429"
x="77.082535"
id="tspan2541"
- sodipodi:role="line">formater</tspan></text>
+ sodipodi:role="line">formatter</tspan></text>
</g>
<g
style="display:inline"
<script type="text/javascript" src="js/communication.js" prod="delete"></script>\r
<script type="text/javascript" src="js/conf.js" prod="delete"></script>\r
<script type="text/javascript" src="js/util.js" prod="delete"></script>\r
- <script type="text/javascript" src="js/formater.js" prod="delete"></script>\r
+ <script type="text/javascript" src="js/formatter.js" prod="delete"></script>\r
<script type="text/javascript" src="js/pages.js" prod="delete"></script>\r
<script type="text/javascript" src="js/client.js" prod="delete"></script>\r
\r
out(A) ->\r
Est_ek_master = euphorik_bd:is_ek_master_from_cookie(yaws_api:find_cookie_val("cookie", A)),\r
{ehtml, {'div', [{id, "logo"}] ++ if Est_ek_master -> [{class, "ekMaster"}]; true -> [] end}}.\r
-\r
</erl>\r
<div id="info" style="display:none" ><div id="icone"></div><div class="close" ></div><div class="message" ></div><div class="buttons"></div></div>\r
<div id="waitbar" style="display:none" ><div class="image"></div></div>\r
* /nick <nouveau nick>
* Modifie le nick courant
*/
-euphorik.Commandes = function(client, pageMinichat, util, formater) {
+euphorik.Commandes = function(client, pageMinichat, util, formatter) {
var thisCommandes = this;
this.client = client;
this.pageMinichat = pageMinichat;
this.util = util;
- this.formater = formater;
+ this.formatter = formatter;
// 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(name, commande) {
- thisCommandes.texteAide += "<li><span class=\"usage\">" + thisCommandes.formater.completeProcessing(commande.usage) + "</span> : " + thisCommandes.formater.completeProcessing(commande.description) + "</li>";
+ thisCommandes.texteAide += "<li><span class=\"usage\">" + thisCommandes.formatter.completeProcessing(commande.usage) + "</span> : " + thisCommandes.formatter.completeProcessing(commande.description) + "</li>";
}
);
this.texteAide += "</ul></div>";
this.id = Math.floor(Math.random() * 1000000).toString(36);\r
\r
this.util = this.conversations.util;\r
- this.formater = this.conversations.formater;\r
+ this.formatter = this.conversations.formatter;\r
this.client = this.conversations.client;\r
\r
this.idDernierMessageAffiche = 0;\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.formater, racineElement);\r
+ this.racine = new euphorik.Message(this.client, this.formatter, racineElement);\r
};\r
\r
/**\r
/**\r
* Représente l'ensemble des conversations affichés.\r
*/\r
-euphorik.Conversations = function(client, formater, util, communication, fragment) {\r
+euphorik.Conversations = function(client, formatter, util, communication, fragment) {\r
this.client = client;\r
- this.formater = formater;\r
+ this.formatter = formatter;\r
this.util = util;\r
this.fragment = fragment;\r
\r
var message =\r
new euphorik.Message(\r
this.client,\r
- this.formater,\r
+ this.formatter,\r
element\r
);\r
\r
/**\r
* Représente un message.\r
*/\r
-euphorik.Message = function(client, formater, element) {\r
+euphorik.Message = function(client, formatter, element) {\r
this.client = client;\r
- this.formater = formater;\r
+ this.formatter = formatter;\r
\r
this.id = element.id;\r
this.auteurId = element.user_id;\r
\r
// construit l'identifiant de la personne\r
var identifiant =\r
- this.client.nickFormat === "nick" || this.login === "" ? this.formater.completeProcessing(this.nick) :\r
- (this.client.nickFormat === "login" ? this.formater.completeProcessing(this.login) :\r
- this.formater.completeProcessing(this.nick) + "<span class=\"login\">(" + this.formater.completeProcessing(this.login) +")</span>" );\r
+ this.client.nickFormat === "nick" || this.login === "" ? this.formatter.completeProcessing(this.nick) :\r
+ (this.client.nickFormat === "login" ? this.formatter.completeProcessing(this.login) :\r
+ this.formatter.completeProcessing(this.nick) + "<span class=\"login\">(" + this.formatter.completeProcessing(this.login) +")</span>" );\r
\r
var XHTMLrepondA = "";\r
var debut = true;\r
if (!debut) {\r
XHTMLrepondA += ", ";\r
}\r
- XHTMLrepondA += thisMessage.formater.completeProcessing(rep.nick);\r
+ XHTMLrepondA += thisMessage.formatter.completeProcessing(rep.nick);\r
debut = false;\r
});\r
if (XHTMLrepondA) {\r
"</span>" +\r
"<span class=\"delimitationEntete\"></span>" +\r
XHTMLrepondA +\r
- "<span class=\"contenu\">" + this.formater.completeProcessing(this.contenu, this.nick) + "</span>" +\r
+ "<span class=\"contenu\">" + this.formatter.completeProcessing(this.contenu, this.nick) + "</span>" +\r
"</div>";\r
};\r
// along with Euphorik. If not, see <http://www.gnu.org/licenses/>.
/*jslint laxbreak:true */
-\r
+
// all euphorik is contained in this object
var euphorik = {};
$(document).ready(
function() {
var fragment = new Fragment();
- var formater = new euphorik.Formater();
- var util = new euphorik.Util(formater);
+ var formatter = new euphorik.Formatter();
+ var util = new euphorik.Util(formatter);
var communication = new euphorik.Communication(
function(data) { util.messageDialog(data.error_message); },
function() { util.showWaitBar(); },
$("#menu .register").click(function(){ pages.displayPage("register"); });
$("#menu .about").click(function(){ pages.displayPage("about"); });
- // TODO : simplification : such link[1] should be created and automatically open the right page without\r
- // explicitly add a page.\r
+ // TODO : simplification : such link[1] should be created and automatically open the right page without
+ // explicitly add a page.
// [1] : <a class="pageLink" href="termes_of_use">Terms of use</a>
$("#footer .termsOfUse").click(function(){ pages.displayPage("terms_of_use"); });
- pages.addPage(new euphorik.PageMinichat(client, formater, util, communication), true);
- pages.addPage(new euphorik.PageAdmin(client, formater, util, communication));
- pages.addPage(new euphorik.PageProfile(client, formater, util));
- pages.addPage(new euphorik.PageRegister(client, formater, util));
- pages.addPage(new euphorik.PageAbout(client, formater, util, communication));
+ pages.addPage(new euphorik.PageMinichat(client, formatter, util, communication), true);
+ pages.addPage(new euphorik.PageAdmin(client, formatter, util, communication));
+ pages.addPage(new euphorik.PageProfile(client, formatter, util));
+ pages.addPage(new euphorik.PageRegister(client, formatter, util));
+ pages.addPage(new euphorik.PageAbout(client, formatter, util, communication));
pages.addPage("terms_of_use");
pages.displayPage(); // display the default page
};\r
\r
/**\r
- * Complete fomratting process applied to a text.\r
+ * Complete formatting process applied to a text.\r
* - Remove HTML markups\r
* - Substitutes wiki syntax with HTML\r
* - Replaces URL with 'a' tag\r
};\r
\r
euphorik.Formatter.prototype.traiterURL = function(m, nick) {\r
- var thisFormater = this;\r
+ var thisFormatter = this;\r
var traitementUrl = function(url) { \r
// si ya pas de protocole on rajoute "http://"\r
- if (!thisFormater.regexTestIfProtocolExists.test(url)) {\r
+ if (!thisFormatter.regexTestIfProtocolExists.test(url)) {\r
url = "http://" + url;\r
}\r
- var extension = thisFormater.getShort(url);\r
- return "<a " + (extension[1] ? "title=\"" + (nick ? thisFormater.traiterPourFenetreLightBox(nick, url) + ": " : "") + thisFormateur.traiterPourFenetreLightBox(m, url) + "\"" + " rel=\"lightbox\"" : "") + " href=\"" + url + "\" >[" + extension[0] + "]</a>";\r
+ var extension = thisFormatter.getShort(url);\r
+ return "<a " + (extension[1] ? "title=\"" + (nick ? thisFormatter.traiterPourFenetreLightBox(nick, url) + ": " : "") + thisFormateur.traiterPourFenetreLightBox(m, url) + "\"" + " rel=\"lightbox\"" : "") + " href=\"" + url + "\" >[" + extension[0] + "]</a>";\r
};\r
return m.replace(this.regexUrl, traitementUrl);\r
};\r
* TODO : trouver un moyen pour que les smiles puissent être conservés\r
*/\r
euphorik.Formatter.prototype.traiterPourFenetreLightBox = function(M, urlCourante) {\r
- var thisFormater = this;\r
+ var thisFormatter = this;\r
var traitementUrl = function(url) {\r
- return "[" + thisFormater.getShort(url)[0] + (urlCourante === url ? "*" : "") + "]";\r
+ return "[" + thisFormatter.getShort(url)[0] + (urlCourante === url ? "*" : "") + "]";\r
};\r
\r
return this.remplacerBalisesHTML(this.supprimerSmiles(M)).replace(this.regexUrl, traitementUrl);\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, formater, util, communication) {\r
+euphorik.PageAbout = function(client, formatter, util, communication) {\r
this.name = "about";\r
\r
this.client = client;\r
- this.formater = formater;\r
- this.util = util;
+ this.formatter = formatter;\r
+ this.util = util;\r
this.communication = communication;\r
};\r
\r
/*jslint laxbreak:true */
-euphorik.PageAdmin = function(client, formater, util, communication) {
+euphorik.PageAdmin = function(client, formatter, util, communication) {
this.name = "admin";
this.client = client;
- this.formater = formater;
+ this.formatter = formatter;
this.util = util;
this.communication = communication;
'</span>|';
ip.users.each(function(j, user) {
XHTML += (j > 0 ? ", " : "") +
- '<span class="nick">' + thisPageAdmin.formater.completeProcessing(user.nick) + '</span>' +
- (user.login === "" ? "" : '<span class="login">(' + thisPageAdmin.formater.completeProcessing(user.login) + ')</span>');
+ '<span class="nick">' + thisPageAdmin.formatter.completeProcessing(user.nick) + '</span>' +
+ (user.login === "" ? "" : '<span class="login">(' + thisPageAdmin.formatter.completeProcessing(user.login) + ')</span>');
});
XHTML += '<span class="deban">débannir</span></div>';
});
/*jslint laxbreak:true */
-euphorik.PageMinichat = function(client, formater, util, communication) {
+euphorik.PageMinichat = function(client, formatter, util, communication) {
this.name = "minichat";
this.client = client;
- this.formater = formater;
+ this.formatter = formatter;
this.util = util;
this.communication = communication;
- this.commandes = new euphorik.Commandes(this.client, this, this.util, this.formater);
+ this.commandes = new euphorik.Commandes(this.client, this, this.util, this.formatter);
// permet d'éviter d'envoyer plusieurs messages simultanément en pressant
// rapidement sur "enter" par exemple
$("#posterMessage input.nick").val(this.client.nick);
// cet appel ne doit pas être fait avant l'appel à 'charger'
- this.conversations = new euphorik.Conversations(this.client, this.formater, this.util, this.communication, this.fragment);
+ this.conversations = new euphorik.Conversations(this.client, this.formatter, this.util, this.communication, this.fragment);
this.chargerConversationsFragment();
// <smiles>
$("body").append('<div id="smiles"></div>');
// affichage des smiles
- $("#smiles").append(this.formater.getSmilesHTML()).children().each(
+ $("#smiles").append(this.formatter.getSmilesHTML()).children().each(
function(i) {
var opacityBase = $(this).css("opacity");
$(this).click(
function() {
- thisPage.util.replaceSelection($("form#posterMessage input.message")[0], thisPage.formater.smiles[$(this).attr("class")][0].source.replace(/\\/g, ""));
+ thisPage.util.replaceSelection($("form#posterMessage input.message")[0], thisPage.formatter.smiles[$(this).attr("class")][0].source.replace(/\\/g, ""));
}
).hover(
function() { $(this).animate({opacity: 1}, 200); },
var nick = $("form#posterMessage input.nick").val();
// (un nick vide est autorisé)
- nick = this.formater.formatNick(nick);
+ nick = this.formatter.formatNick(nick);
if (nick === euphorik.conf.defaultNick) {
this.util.messageDialog("Choose a nickname");
// 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, formater, util) {\r
+euphorik.PageProfile = function(client, formatter, util) {\r
this.name = "profile";\r
\r
this.client = client;\r
- this.formater = formater;\r
+ this.formatter = formatter;\r
this.util = util;\r
};\r
\r
\r
$("form#profile button").click(\r
function() {\r
- thisPage.client.nick = thisPage.formater.formatNick($("form#profile input.nick").val());\r
+ thisPage.client.nick = thisPage.formatter.formatNick($("form#profile input.nick").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
// 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, formater, util) {\r
+euphorik.PageRegister = function(client, formatter, util) {\r
this.name = "register";\r
\r
this.client = client;\r
- this.formater = formater;\r
+ this.formatter = formatter;\r
this.util = util;\r
};\r
\r
* - Print a message box to display some information for the user.\r
* - Set a tooltip for a HTML element.\r
* - Some text manipulation for input area.\r
- * @formater An object for string format\r
+ * @formatter An object for string format\r
*/\r
-euphorik.Util = function (formater) {\r
+euphorik.Util = function (formatter) {\r
$("#info .close").click(function() {\r
$("#info").slideUp(50);\r
});\r
\r
$("body").append('<div id="tooltipArrow"></div>').append('<div id="tooltipMessage"><p></p></div>');\r
\r
- this.formater = formater;\r
+ this.formatter = formatter;\r
this.bulleActive = true;\r
};\r
\r
* @message [String] The message.\r
* @type [euphorik.Util.messageType] The message type like 'information' or 'error'. Default is messageType.informatif.\r
* @buttons An object where the properties are the labels and the values are functions which will be executed when a button is clicked.\r
- * @format [bool] The message should be formated. (see 'formater.js')\r
+ * @format [bool] The message should be formated. (see 'formatter.js')\r
* @time The time while the message is displayed. -1 for infinity.\r
*/\r
euphorik.Util.prototype.messageDialog = function(message, type, buttons, format, time) {\r
var close = function() { $("#info").slideUp(100); };\r
close();\r
\r
- $("#info .message").html(!thisUtil.formater || !format ? message : thisUtil.formater.completeProcessing(message));\r
+ $("#info .message").html(!thisUtil.formatter || !format ? message : thisUtil.formatter.completeProcessing(message));\r
\r
switch(type) {\r
case euphorik.Util.messageType.informatif : $("#info #icone").attr("class", "information"); break;\r
% Ce module permet de gérer les données persistantes lié au site d'euphorik.ch.\r
% Il permet d'ajouter des message, de demande les messages sur une page donnée, etc..\r
% Ce module utilise une base mnesia.\r
-% @author G.Burri\r
\r
\r
-module(euphorik_bd).\r
+-author("Greg Burri <greg.burri@gmail.com>").\r
-export([\r
% texte :\r
get_texte/1,\r
% - Mise à jour de la BD\r
% - Backup et restauration\r
% - Copie de la BD à partir d'un autre noeud\r
-%\r
-% @author G.Burri\r
\r
\r
-module(euphorik_bd_admin).\r
+-author("Greg Burri <greg.burri@gmail.com>").\r
-export([\r
version_bd/0,\r
create/0,\r
% along with Euphorik. If not, see <http://www.gnu.org/licenses/>.
%
% Module with some useful stuffs.
-% @author G.Burri
-module(euphorik_common).
+-author("Greg Burri <greg.burri@gmail.com>").
-export([
ceiling/1,
delta_date_ms/2,
%\r
% Module tournant en background s'occupant periodiquement de certaines tâches :\r
% - rechargement des modules lors d'une mise en production\r
-% Date : 05.11.2007\r
-% @author G.Burri\r
\r
\r
-module(euphorik_daemon).\r
+-author("Greg Burri <greg.burri@gmail.com>").\r
-export([start/1, reload_euphorik/0, loop/0]).\r
-include("../include/euphorik_defines.hrl").\r
\r
\r
loop() ->\r
receive\r
- switch -> % permet de substituer le code du process par un nouveau code, voir reload_euphorik\r
+ switch -> % To reload a new code, see 'reload_euphorik/0'.\r
euphorik_daemon:loop()\r
end.\r
\r
% Ce module permet la gestion des conversations du minichat d'euphorik.\r
% Un message (enfant) peut répondre à des messages (ses parents).\r
% Un message (parent) peut avoir plusieurs réponses (enfants)\r
-% @author G.Burri\r
%\r
% Les conversation se compose d'une liste de tuple comprenant la conversation, du premier message de la conversation,\r
% et d'un booleen indiquant s'il y a encore des messages\r
\r
\r
-module(euphorik_minichat_conversation).\r
+-author("Greg Burri <greg.burri@gmail.com>").\r
-export([\r
conversations/4\r
]).\r
% @spec conversation([integer()], [integer()], [integer()]) -> {[int()], [int()]}\r
conversation(Conv, [M | Reste], X) ->\r
Est_deja_traite = any(fun(E) -> E =:= M end, Conv),\r
- if Est_deja_traite ->\r
+ if Est_deja_traite ->\r
conversation(Conv, Reste, X);\r
true ->\r
Enfants = euphorik_bd:enfants_id(M),\r
%\r
% Ce module gére les différents messages envoyés par le client (javascript) via AJAX.\r
% Les messages donnés ainsi que les réponses sont au format JSON.\r
-% @author G.Burri\r
\r
\r
-module(euphorik_protocole).\r
+-author("Greg Burri <greg.burri@gmail.com>").\r
-export([\r
register/2,\r
login/2,\r
% This module responds to JSON requests via 'AJAX'.\r
% It's defined as an Yaws 'appmods' with the url '/request'.\r
% For instance in debug mode 'http://localhost:8090/request' will call the out/1 function.\r
-% @author G.Burri\r
\r
\r
-module(euphorik_requests).\r
+-author("Greg Burri <greg.burri@gmail.com>").\r
-export([out/1]).\r
-include_lib("yaws_api.hrl").\r
-include("../include/euphorik_defines.hrl").\r