X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;ds=sidebyside;f=js%2Feuphorik.js;h=a5116ceadf80c10d8d5256ec4b4d37102550ea74;hb=e56ca5b899d3b39c76a9056077729c04c695666b;hp=1b78ba8294365fa1a2cf0e6dbc9cae9e5cd7fd73;hpb=84a86204f1f87a6b898975bc1d817130c7168a7c;p=euphorik.git
diff --git a/js/euphorik.js b/js/euphorik.js
index 1b78ba8..a5116ce 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()
}
@@ -758,7 +771,7 @@ Client.prototype.enregistrement = function(login, password)
Client.prototype.connexion = function(messageJson)
{
- ;;; dumpObj(messageJson)
+ ;; dumpObj(messageJson)
thisClient = this
jQuery.ajax(
{
@@ -770,7 +783,7 @@ Client.prototype.connexion = function(messageJson)
success:
function(data)
{
- ;;; dumpObj(data)
+ ;; dumpObj(data)
if (data["reply"] == "error")
thisClient.util.messageDialogue(data["error_message"])
else
@@ -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()
}
}
@@ -833,7 +850,7 @@ Client.prototype.flush = function(async)
var thisClient = this
var ok = true
- ;;; dumpObj(this.getJSONProfile())
+ ;; dumpObj(this.getJSONProfile())
jQuery.ajax(
{
async: async,
@@ -844,12 +861,16 @@ Client.prototype.flush = function(async)
success:
function(data)
{
- ;;; dumpObj(data)
+ ;; dumpObj(data)
if (data["reply"] == "error")
{
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
@@ -999,7 +1028,7 @@ PageEvent.prototype.waitEvent = function(funSend, funReceive)
for (v in poulpe)
dataToSend[v] = poulpe[v]
- ;;; dumpObj(dataToSend)
+ ;; dumpObj(dataToSend)
this.attenteCourante = jQuery.ajax({
type: "POST",
@@ -1009,7 +1038,7 @@ PageEvent.prototype.waitEvent = function(funSend, funReceive)
success:
function(data)
{
- ;;; dumpObj(data)
+ ;; dumpObj(data)
funReceive(data)
@@ -1047,7 +1076,7 @@ function initialiserListeStyles(client)
}
// charge dynamiquement le script de debug
-;;; jQuery.ajax({async : false, url : "js/debug.js", dataType : "script"})
+;; jQuery.ajax({async : false, url : "js/debug.js", dataType : "script"})
// le main
$(document).ready(