X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;ds=inline;f=js%2Feuphorik.js;h=8892035084063f08d89910e0964dbee0d1e1f216;hb=f55ef9d6bc7352e2dffe18ded028a5a2e0cc3936;hp=3b17bf58cc98df397313e3a649c35100a4d49f27;hpb=0864f5fa5ccd1ce99e88c08d25a2f8ea18525d56;p=euphorik.git
diff --git a/js/euphorik.js b/js/euphorik.js
index 3b17bf5..8892035 100755
--- a/js/euphorik.js
+++ b/js/euphorik.js
@@ -40,7 +40,8 @@ var conf = {
"kirby" : [/\[-kirby\]/g],
"slurp" : [/\[-slurp\]/g],
"agreed" : [/\[-agreed\]/g],
- "dodo" : [/\[-dodo\]/g]
+ "dodo" : [/\[-dodo\]/g],
+ "bn" : [/\[-bn\]/g]
}
}
@@ -304,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)
{
@@ -335,7 +337,7 @@ Formateur.prototype.traiterURL = function(M, pseudo)
if (!thisFormateur.regexTestProtocoleExiste.test(url))
url = "http://" + url
var extension = thisFormateur.getShort(url)
- return "[" + extension[0] + "]"
+ return "[" + extension[0] + "]"
}
return M.replace(this.regexUrl, traitementUrl)
}
@@ -425,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)
@@ -670,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)
@@ -705,6 +708,7 @@ Client.prototype.chargerDonnees = function(data)
// les conversations
thisClient.conversations = data["conversations"]
+ thisClient.ekMaster = data["ek_master"]
}
this.dernierMessageErreur = data["error_message"]
}
@@ -767,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)
@@ -778,8 +815,6 @@ function initialiserListeStyles(client)
}
)
}
-
-jQuery.noConflict()
// charge dynamiquement le script de debug
;;; jQuery.ajax({async : false, url : "js/debug.js", dataType : "script"})
@@ -799,12 +834,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") })