X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=js%2Feuphorik.js;h=b36fbbbe2d85108cbcad7866d67d8ff8c753214e;hb=81b3e94e62dd60087d71efc42004f8222d9e1e7a;hp=2b885ab0ab2fedf4444232da30dfee4d422545c2;hpb=9d95f5af441fda194444405983e4d110c2514680;p=euphorik.git diff --git a/js/euphorik.js b/js/euphorik.js index 2b885ab..b36fbbb 100755 --- a/js/euphorik.js +++ b/js/euphorik.js @@ -748,8 +748,11 @@ Client.prototype.flush = function(async) Client.prototype.majMenu = function() { + // TODO : à virer : ne plus changer de style de display ... spa beau .. ou trouver une autre méthode var displayType = this.css == "css/3/euphorik.css" ? "block" : "inline" //this.client + $("#menu .admin").css("display", this.ekMaster ? "none" : "inline") + // met à jour le menu if (this.statut == statutType.auth_registered) { @@ -771,7 +774,33 @@ Client.prototype.majMenu = function() } } -Client.prototype.ban = function(userId, minutes) + +Client.prototype.slap = function(userId, raison) +{ + var thisClient = this + + jQuery.ajax({ + type: "POST", + url: "request", + dataType: "json", + data: this.util.jsonVersAction( + { + "action" : "slap", + "cookie" : thisClient.cookie, + "user_id" : userId, + "reason" : raison + }), + success: + function(data) + { + if (data["reply"] == "error") + thisClient.util.messageDialogue(data["error_message"]) + } + }) +} + + +Client.prototype.ban = function(userId, raison, minutes) { var thisClient = this @@ -788,7 +817,8 @@ Client.prototype.ban = function(userId, minutes) "action" : "ban", "cookie" : thisClient.cookie, "duration" : minutes, - "user_id" : userId + "user_id" : userId, + "reason" : raison }), success: function(data) @@ -799,9 +829,9 @@ Client.prototype.ban = function(userId, minutes) }) } -Client.prototype.kick = function(userId) +Client.prototype.kick = function(userId, raison) { - this.ban(userId, 15) + this.ban(userId, raison, 15) } /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -837,6 +867,7 @@ $(document).ready( $(window).unload(function(){client.flush(false)}) $("#menu .minichat").click(function(){ pages.afficherPage("minichat") }) + $("#menu .admin").click(function(){ pages.afficherPage("admin") }) $("#menu .profile").click(function(){ pages.afficherPage("profile") }) $("#menu .logout").click(function(){ util.messageDialogue("Êtes-vous sur de vouloir vous délogger ?", messageType.question, @@ -853,6 +884,7 @@ $(document).ready( $("#menu .about").click(function(){ pages.afficherPage("about") }) pages.ajouterPage(new PageMinichat(client, formateur, util)) + pages.ajouterPage(new PageAdmin(client, formateur, util)) pages.ajouterPage(new PageProfile(client, formateur, util)) pages.ajouterPage(new PageRegister(client, formateur, util)) pages.ajouterPage(new PageAbout(client, formateur, util))