X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=js%2Fchat%2Fcommandes.js;h=871e22bbc511c865a6e53782316b30ce2aa1548a;hp=5aec5d5ee9f78cb73e53aea3d0d7f100c8155c9e;hb=81393a74d648e4830dc8c7c562fa203f50a105f6;hpb=24ed7a141aa345454300dd260bbabae3a9f92408
diff --git a/js/chat/commandes.js b/js/chat/commandes.js
index 5aec5d5..871e22b 100644
--- a/js/chat/commandes.js
+++ b/js/chat/commandes.js
@@ -15,14 +15,14 @@
//
// You should have received a copy of the GNU General Public License
// along with Euphorik. If not, see .
-
+
/*jslint laxbreak:true */
/**
* Permet d'executer des commandes tapées par l'utilisateur.
* les commandes sont entrées directement dans la ligne de saisie du message sous la forme :
* /
- *
+ *
* Voici les commandes supportées :
* /nick
* Modifie le nick courant
@@ -34,13 +34,13 @@ euphorik.Commandes = function(client, pageMinichat, util, formater) {
this.pageMinichat = pageMinichat;
this.util = util;
this.formater = formater;
-
+
// construction du texte d'aide (liste des commandes) de manière statique
this.texteAide = "Commandes
";
objectEach(
euphorik.Commandes.liste,
function(name, commande) {
- thisCommandes.texteAide += "- " + thisCommandes.formater.traitementComplet(commande.usage) + " : " + thisCommandes.formater.traitementComplet(commande.description) + "
";
+ thisCommandes.texteAide += "- " + thisCommandes.formater.completeProcessing(commande.usage) + " : " + thisCommandes.formater.completeProcessing(commande.description) + "
";
}
);
this.texteAide += "
";
@@ -53,14 +53,14 @@ euphorik.Commandes.liste = {
description : "Change le nick courant",
usage : "/nick ",
exec : function(args, client) {
-
+
if (args.length === 0) {
return [euphorik.Commandes.statut.erreur_commande, 'Utilisation de la commande : ' + this.usage];
}
-
+
client.nick = args[0];
$("form#posterMessage input.nick").val(client.nick);
-
+
return [euphorik.Commandes.statut.ok, ''];
}
},
@@ -88,15 +88,15 @@ euphorik.Commandes.liste = {
*/
euphorik.Commandes.prototype.exec = function(chaine) {
chaine = chaine.trim();
-
+
var fragments = chaine.split(/\s+/);
if (fragments.length === 0 || fragments[0].charAt(0) != '/') {
return [euphorik.Commandes.statut.pas_une_commande, ''];
}
-
+
var commandName = fragments[0].slice(1);
var args = fragments.slice(1);
-
+
if (commandName === "") {
return [euphorik.Commandes.statut.erreur_commande, 'La commande est vide'];
}
@@ -111,10 +111,10 @@ euphorik.Commandes.prototype.exec = function(chaine) {
);
return [euphorik.Commandes.statut.ok, ''];
}
-
+
if (euphorik.Commandes.liste.hasOwnProperty(commandName)) {
return euphorik.Commandes.liste[commandName].exec(args, this.client, this.pageMinichat);
}
-
+
return [euphorik.Commandes.statut.erreur_commande, 'La commande /' + commandName + ' est inconnue'];
};