X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;ds=inline;f=js%2Feuphorik.js;h=ca84a024d8f95274f8bea346f7417c0e18dbbcfd;hb=65a4c4e621c5cfc52f20097db8ede10714a7c0f6;hp=1b78ba8294365fa1a2cf0e6dbc9cae9e5cd7fd73;hpb=84a86204f1f87a6b898975bc1d817130c7168a7c;p=euphorik.git
diff --git a/js/euphorik.js b/js/euphorik.js
index 1b78ba8..ca84a02 100755
--- a/js/euphorik.js
+++ b/js/euphorik.js
@@ -90,7 +90,10 @@ function Util(formateur)
$("#info").slideUp(50)
})
+ $("body").append('
').append('')
+
this.formateur = formateur
+ this.bulleActive = true
}
var messageType = {informatif: 0, question: 1, erreur: 2}
@@ -140,19 +143,25 @@ Util.prototype.messageDialogue = function(message, type, boutons, formate)
*/
Util.prototype.infoBulle = function(message, element)
{
- var virerMess = function()
+ var thisUtil = this
+
+ var cacherBulle = function()
{
- $("#flecheBulle").remove()
- $("#messageBulle").remove()
+ $("#flecheBulle").hide()
+ $("#messageBulle").hide()
}
- element.click(virerMess)
-
element.hover(
function(e)
{
- f = $('').appendTo("body")
- m = $('').appendTo("body")
+ if (!thisUtil.bulleActive)
+ return
+
+ var m = $("#messageBulle")
+ var f = $("#flecheBulle")
+
+ $("p", m).html(message)
+
var positionFleche = {
left : element.offset().left + element.width() / 2 - f.width() / 2,
top : element.offset().top - f.height()
@@ -173,8 +182,8 @@ Util.prototype.infoBulle = function(message, element)
m.css("top", positionMessage.top).css("left", positionMessage.left).show()
f.css("top", positionFleche.top).css("left", positionFleche.left).show()
},
- virerMess
- )
+ cacherBulle
+ ).click(cacherBulle)
}
/**
@@ -522,6 +531,8 @@ Client.prototype.resetDonneesPersonnelles = function()
this.email = ""
this.css = $("link#cssPrincipale").attr("href")
this.nickFormat = "nick"
+ this.viewTimes = true
+ this.viewTooltips = true
this.cookie = undefined
this.pagePrincipale = 1
@@ -667,6 +678,8 @@ Client.prototype.getJSONProfile = function()
"email" : this.email,
"css" : this.css,
"nick_format" : this.nickFormat,
+ "view_times" : this.viewTimes,
+ "view_tooltips" : this.viewTooltips,
"main_page" : this.pagePrincipale < 1 ? 1 : this.pagePrincipale,
"conversations" : this.getJSONConversations()
}
@@ -808,12 +821,16 @@ Client.prototype.chargerDonnees = function(data)
this.email = data["email"]
this.setCss(data["css"])
this.nickFormat = data["nick_format"]
+ this.viewTimes = data["view_times"]
+ this.viewTooltips = data["view_tooltips"]
// la page de la conversation principale
this.pagePrincipale = data["main_page"] == undefined ? 1 : data["main_page"]
// les conversations
this.conversations = data["conversations"]
+
+ this.majBulle()
}
}
@@ -850,6 +867,10 @@ Client.prototype.flush = function(async)
thisClient.util.messageDialogue(data["error_message"])
ok = false
}
+ else
+ {
+ thisClient.majBulle()
+ }
}
}
)
@@ -886,6 +907,14 @@ Client.prototype.majMenu = function()
}
}
+/**
+ * Met à jour l'affichage des infos bulles en fonction du profile.
+ */
+Client.prototype.majBulle = function()
+{
+ this.util.bulleActive = this.viewTooltips
+}
+
Client.prototype.slap = function(userId, raison)
{
var thisClient = this