X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=js%2Feuphorik.js;h=6ed19637883039b35f131eb332900e2f652905c0;hb=01922222ac686c2507052c0cc1d755495145d154;hp=27ec5bb064b3f80fc6025699cb54e1ad172820bd;hpb=2faefc542de20cfcc0220b5c7fd7982dd0fbbfd4;p=euphorik.git diff --git a/js/euphorik.js b/js/euphorik.js index 27ec5bb..6ed1963 100755 --- a/js/euphorik.js +++ b/js/euphorik.js @@ -21,19 +21,27 @@ var conf = { "bigsmile" : [/:D/g, /:-D/g], "clin" : [/;\)/g, /;-\)/g], "cool" : [/8\)/g, /8-\)/g], - "eheheh" : [/:P/g, /:-P/g], - "oh" : [/:o/g, /:O/g], + "eheheh" : [/:P/g, /:-P/g], + "lol" : [/\[-lol\]/g], + "spliff" : [/\[-spliff\]/g], + "oh" : [/:o/g, /:O/g], + "heink" : [/\[-heink\]/g], + "hum" : [/\[-hum\]/g], + "boh" : [/\[-boh\]/g], + "sniff" : [/:\(/g, /:-\(/g], + "triste" : [/\[-triste\]/g], "pascontent" : [/>\(/g, />\(/g], - "sniff" : [/:\(/g, /:-\(/g], - "argn" : [/\[:argn\]/g], - "bunny" : [/\[:lapin\]/g], - "chat" : [/\[:chat\]/g], - "renne" : [/\[:renne\]/g], - "lol" : [/\[:lol\]/g], - "spliff" : [/\[:spliff\]/g], - "star" : [/\[:star\]/g], - "triste" : [/\[:triste\]/g], - "kirby" : [/\[:kirby\]/g] + "argn" : [/\[-argn\]/g], + "redface" : [/\[-redface\]/g], + "bunny" : [/\[-lapin\]/g], + "chat" : [/\[-chat\]/g], + "renne" : [/\[-renne\]/g], + "star" : [/\[-star\]/g], + "kirby" : [/\[-kirby\]/g], + "slurp" : [/\[-slurp\]/g], + "agreed" : [/\[-agreed\]/g], + "dodo" : [/\[-dodo\]/g], + "bn" : [/\[-bn\]/g] } } @@ -297,7 +305,8 @@ Formateur.prototype.traiterLiensConv = function(M) } /** - * FIXME : Cette méthode est attrocement lourde ! A optimiser. + * FIXME : Cette méthode est attrocement lourde ! A optimiser. + * moyenne su échantillon : 234ms */ Formateur.prototype.traiterSmiles = function(M) { @@ -418,6 +427,7 @@ Client.prototype.resetDonneesPersonnelles = function() this.nickFormat = "nick" this.pagePrincipale = 1 + this.ekMaster = false // les conversations, une conversation est un objet possédant les attributs suivants : // - racine (entier) @@ -663,10 +673,10 @@ Client.prototype.connexion = function(messageJson) Client.prototype.deconnexion = function() { - this.flush() + this.flush() + this.delCookie() this.setStatut(statutType.deconnected) // deconnexion this.resetDonneesPersonnelles() - this.delCookie () } Client.prototype.chargerDonnees = function(data) @@ -698,6 +708,7 @@ Client.prototype.chargerDonnees = function(data) // les conversations thisClient.conversations = data["conversations"] + thisClient.ekMaster = data["ek_master"] } this.dernierMessageErreur = data["error_message"] } @@ -760,6 +771,39 @@ Client.prototype.majMenu = function() } } +Client.prototype.ban = function(userId, minutes) +{ + var thisClient = this + + // par défaut un ban correspond à 3 jours + if (typeof(minutes) == "undefined") + minutes = 60 * 24 * 3 + + jQuery.ajax({ + type: "POST", + url: "request", + dataType: "json", + data: this.util.jsonVersAction( + { + "action" : "ban", + "cookie" : thisClient.cookie, + "duration" : minutes, + "user_id" : userId + }), + success: + function(data) + { + if (data["reply"] == "error") + thisClient.util.messageDialogue(data["error_message"]) + } + }) +} + +Client.prototype.kick = function(userId) +{ + this.ban(userId, 15) +} + /////////////////////////////////////////////////////////////////////////////////////////////////// function initialiserListeStyles(client) @@ -781,12 +825,6 @@ jQuery.noConflict() jQuery(document).ready( function() { - /* FIXME : ce code pose problème sur konqueror, voir : http://www.kde-forum.org/thread.php?threadid=17993 - var p = new DOMParser(); - var doc = p.parseFromString("\n", "text/xml") - var s = new XMLSerializer() - alert(s.serializeToString(doc)) */ - var util = new Util() var client = new Client(util) var pages = new Pages() @@ -798,12 +836,7 @@ jQuery(document).ready( initialiserListeStyles(client) // TODO : pourquoi jQuery(document).unload ne fonctionne pas ? - jQuery(window).unload( - function() - { - client.flush(false) - } - ) + jQuery(window).unload(function(){client.flush(false)}) jQuery("#menu .minichat").click(function(){ pages.afficherPage("minichat") }) jQuery("#menu .profile").click(function(){ pages.afficherPage("profile") })