X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=js%2FpageMinichat%2FpageMinichat.js;h=333d22db9b8dbef08a490975054f33400f9ff7b7;hp=1213cab224324a0a0a817ac151cb3b13225741b9;hb=5b696161ae91e007fc2e9bd455a14f4363772131;hpb=b0f040b8e5e888579473ea9e83dd76cc5da02d0a diff --git a/js/pageMinichat/pageMinichat.js b/js/pageMinichat/pageMinichat.js index 1213cab..333d22d 100755 --- a/js/pageMinichat/pageMinichat.js +++ b/js/pageMinichat/pageMinichat.js @@ -50,7 +50,7 @@ PageMinichat.prototype.contenu = function() //var messagesXHTML = '' var conversationXHTML = '
' - if (this.client.chatOrder == "reverse") + if (this.client.chatOrder === "reverse") return trollXHTML + formulaireXHTML + conversationXHTML else return trollXHTML + conversationXHTML + formulaireXHTML @@ -58,7 +58,7 @@ PageMinichat.prototype.contenu = function() PageMinichat.prototype.classes = function() { - return this.client.chatOrder == "reverse" ? "orderReverse" : "orderChrono" + return this.client.chatOrder === "reverse" ? "orderReverse" : "orderChrono" } PageMinichat.prototype.charger = function() @@ -159,7 +159,7 @@ PageMinichat.prototype.charger = function() $("form").keypress( function(e) { - if (e.which == 13) // return + if (e.which === 13) // return nouveauMessage() } ) @@ -173,7 +173,7 @@ PageMinichat.prototype.charger = function() function() { var input = $("input.pseudo")[0] - if (input.value == euphorik.conf.pseudoDefaut) + if (input.value === euphorik.conf.pseudoDefaut) input.value = "" } ) @@ -208,14 +208,14 @@ PageMinichat.prototype.envoyerMessage = function(pseudo, message) // (un pseudo vide est autorisé) pseudo = this.formateur.filtrerInputPseudo(pseudo) - if (pseudo == euphorik.conf.nickDefaut) + if (pseudo === euphorik.conf.nickDefaut) { this.util.messageDialogue("Le pseudo ne peut pas être " + euphorik.conf.nickDefaut) return } message = message.trim() - if (message == "") + if (!message) { this.util.messageDialogue("Le message est vide") return @@ -251,7 +251,7 @@ PageMinichat.prototype.envoyerMessage = function(pseudo, message) }, success : function(data, textStatus) { - if(data["reply"] == "ok") + if(data["reply"] === "ok") { // met à jour la classe des messages auquel repond celui ci (c'est un peu de la triche) TODO : ya mieux ? for (var messId in thisPageMinichat.conversations.messagesRepond) @@ -269,7 +269,7 @@ PageMinichat.prototype.envoyerMessage = function(pseudo, message) $("form input.message").val("") thisPageMinichat.conversations.enleverMessagesRepond() } - else if (data["reply"] == "error") + else if (data["reply"] === "error") { thisPageMinichat.util.messageDialogue(data["error_message"]) }