projects
/
euphorik.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove the weekly troll.
[euphorik.git]
/
js
/
chat
/
commandes.js
diff --git
a/js/chat/commandes.js
b/js/chat/commandes.js
index
372f195
..
871e22b
100644
(file)
--- 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 <http://www.gnu.org/licenses/>.
//
// You should have received a copy of the GNU General Public License
// along with Euphorik. If not, see <http://www.gnu.org/licenses/>.
-
+
/*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 :
* /<commande> <paramètres>
/*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 :
* /<commande> <paramètres>
- *
+ *
* Voici les commandes supportées :
* /nick <nouveau nick>
* Modifie le nick courant
* Voici les commandes supportées :
* /nick <nouveau 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;
this.pageMinichat = pageMinichat;
this.util = util;
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,
// 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(n
om
, commande) {
- thisCommandes.texteAide += "<li><span class=\"usage\">" + thisCommandes.formater.
traitementComplet(commande.usage) + "</span> : " + thisCommandes.formater.traitementComplet
(commande.description) + "</li>";
+ function(n
ame
, commande) {
+ thisCommandes.texteAide += "<li><span class=\"usage\">" + thisCommandes.formater.
completeProcessing(commande.usage) + "</span> : " + thisCommandes.formater.completeProcessing
(commande.description) + "</li>";
}
);
this.texteAide += "</ul></div>";
}
);
this.texteAide += "</ul></div>";
@@
-53,14
+53,14
@@
euphorik.Commandes.liste = {
description : "Change le nick courant",
usage : "/nick <nouveau nick>",
exec : function(args, client) {
description : "Change le nick courant",
usage : "/nick <nouveau nick>",
exec : function(args, client) {
-
+
if (args.length === 0) {
return [euphorik.Commandes.statut.erreur_commande, 'Utilisation de la commande : ' + this.usage];
}
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);
client.nick = args[0];
$("form#posterMessage input.nick").val(client.nick);
-
+
return [euphorik.Commandes.statut.ok, ''];
}
},
return [euphorik.Commandes.statut.ok, ''];
}
},
@@
-88,33
+88,33
@@
euphorik.Commandes.liste = {
*/
euphorik.Commandes.prototype.exec = function(chaine) {
chaine = chaine.trim();
*/
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 fragments = chaine.split(/\s+/);
if (fragments.length === 0 || fragments[0].charAt(0) != '/') {
return [euphorik.Commandes.statut.pas_une_commande, ''];
}
-
- var
nomCommand
e = fragments[0].slice(1);
+
+ var
commandNam
e = fragments[0].slice(1);
var args = fragments.slice(1);
var args = fragments.slice(1);
-
- if (
nomCommand
e === "") {
+
+ if (
commandNam
e === "") {
return [euphorik.Commandes.statut.erreur_commande, 'La commande est vide'];
}
// commandes spéciales pour afficher l'aide : "?", "h", "help", "aide"
return [euphorik.Commandes.statut.erreur_commande, 'La commande est vide'];
}
// commandes spéciales pour afficher l'aide : "?", "h", "help", "aide"
- if (
nomCommande === "?" || nomCommande === "h" || nomCommande === "help" || nomCommand
e === "aide") {
+ if (
commandName === "?" || commandName === "h" || commandName === "help" || commandNam
e === "aide") {
this.util.messageDialog(
this.texteAide,
euphorik.Util.messageType.informatif,
this.util.messageDialog(
this.texteAide,
euphorik.Util.messageType.informatif,
- {"
fermer
" : function(){}},
+ {"
close
" : function(){}},
false,
-1
);
return [euphorik.Commandes.statut.ok, ''];
}
false,
-1
);
return [euphorik.Commandes.statut.ok, ''];
}
-
- if (euphorik.Commandes.liste.hasOwnProperty(
nomCommand
e)) {
- return euphorik.Commandes.liste[
nomCommand
e].exec(args, this.client, this.pageMinichat);
+
+ if (euphorik.Commandes.liste.hasOwnProperty(
commandNam
e)) {
+ return euphorik.Commandes.liste[
commandNam
e].exec(args, this.client, this.pageMinichat);
}
}
-
- return [euphorik.Commandes.statut.erreur_commande, 'La commande /' +
nomCommand
e + ' est inconnue'];
+
+ return [euphorik.Commandes.statut.erreur_commande, 'La commande /' +
commandNam
e + ' est inconnue'];
};
};