projects
/
euphorik.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ADD script permettant la mise à jour de la BD et le rechargement des modules lors...
[euphorik.git]
/
js
/
euphorik.js
diff --git
a/js/euphorik.js
b/js/euphorik.js
index
1b78ba8
..
c796e41
100755
(executable)
--- a/
js/euphorik.js
+++ b/
js/euphorik.js
@@
-31,7
+31,9
@@
var conf = {
\r
nbMessageAffiche : 40, // (par page)
pseudoDefaut : "<nick>",
\r
var conf = {
\r
nbMessageAffiche : 40, // (par page)
pseudoDefaut : "<nick>",
\r
- tempsAffichageMessageDialogue : 4000, // en ms
\r
+ tempsAffichageMessageDialogue : 4000, // en ms
+ tempsKick : 15, // en minute
+ tempsBan : 60 * 24 * 3, // en minutes (3jours)
\r
smiles : {
\r
"smile" : [/:\)/g, /:-\)/g],
\r
"bigsmile" : [/:D/g, /:-D/g],
\r
smiles : {
\r
"smile" : [/:\)/g, /:-\)/g],
\r
"bigsmile" : [/:D/g, /:-D/g],
\r
@@
-90,7
+92,10
@@
function Util(formateur)
$("#info").slideUp(50)
})
$("#info").slideUp(50)
})
+ $("body").append('<div id="flecheBulle"></div>').append('<div id="messageBulle"><p></p></div>')
+
this.formateur = formateur
this.formateur = formateur
+ this.bulleActive = true
}
var messageType = {informatif: 0, question: 1, erreur: 2}
}
var messageType = {informatif: 0, question: 1, erreur: 2}
@@
-140,19
+145,25
@@
Util.prototype.messageDialogue = function(message, type, boutons, formate)
*/
Util.prototype.infoBulle = function(message, element)
{
*/
Util.prototype.infoBulle = function(message, element)
{
- var virerMess = function()
+ var thisUtil = this
+
+ var cacherBulle = function()
{
{
- $("#flecheBulle").
remov
e()
- $("#messageBulle").
remov
e()
+ $("#flecheBulle").
hid
e()
+ $("#messageBulle").
hid
e()
}
}
- element.click(virerMess)
-
element.hover(
function(e)
{
element.hover(
function(e)
{
- f = $('<div id="flecheBulle"></div>').appendTo("body")
- m = $('<div id="messageBulle"><p>' + message + '</p></div>').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()
var positionFleche = {
left : element.offset().left + element.width() / 2 - f.width() / 2,
top : element.offset().top - f.height()
@@
-173,8
+184,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()
},
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
+533,8
@@
Client.prototype.resetDonneesPersonnelles = function()
this.email = ""
\r
this.css = $("link#cssPrincipale").attr("href")
this.nickFormat = "nick"
this.email = ""
\r
this.css = $("link#cssPrincipale").attr("href")
this.nickFormat = "nick"
+ this.viewTimes = true
+ this.viewTooltips = true
this.cookie = undefined
this.pagePrincipale = 1
this.cookie = undefined
this.pagePrincipale = 1
@@
-667,6
+680,8
@@
Client.prototype.getJSONProfile = function()
"email" : this.email,
"css" : this.css,
"nick_format" : this.nickFormat,
"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()
}
"main_page" : this.pagePrincipale < 1 ? 1 : this.pagePrincipale,
"conversations" : this.getJSONConversations()
}
@@
-758,7
+773,7
@@
Client.prototype.enregistrement = function(login, password)
Client.prototype.connexion = function(messageJson)
{
Client.prototype.connexion = function(messageJson)
{
- ;;
;
dumpObj(messageJson)
+ ;; dumpObj(messageJson)
thisClient = this
jQuery.ajax(
{
thisClient = this
jQuery.ajax(
{
@@
-770,7
+785,7
@@
Client.prototype.connexion = function(messageJson)
success:
function(data)
{
success:
function(data)
{
- ;;
;
dumpObj(data)
+ ;; dumpObj(data)
if (data["reply"] == "error")
thisClient.util.messageDialogue(data["error_message"])
else
if (data["reply"] == "error")
thisClient.util.messageDialogue(data["error_message"])
else
@@
-808,12
+823,16
@@
Client.prototype.chargerDonnees = function(data)
this.email = data["email"]
\r
this.setCss(data["css"])
this.nickFormat = data["nick_format"]
this.email = data["email"]
\r
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"]
// 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
+852,7
@@
Client.prototype.flush = function(async)
var thisClient = this
var ok = true
var thisClient = this
var ok = true
- ;;
;
dumpObj(this.getJSONProfile())
+ ;; dumpObj(this.getJSONProfile())
jQuery.ajax(
{
async: async,
jQuery.ajax(
{
async: async,
@@
-844,12
+863,16
@@
Client.prototype.flush = function(async)
success:
function(data)
{
success:
function(data)
{
- ;;
;
dumpObj(data)
+ ;; dumpObj(data)
if (data["reply"] == "error")
{
thisClient.util.messageDialogue(data["error_message"])
ok = false
}
if (data["reply"] == "error")
{
thisClient.util.messageDialogue(data["error_message"])
ok = false
}
+ else
+ {
+ thisClient.majBulle()
+ }
}
}
)
}
}
)
@@
-886,6
+909,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
Client.prototype.slap = function(userId, raison)
{
var thisClient = this
@@
-916,7
+947,7
@@
Client.prototype.ban = function(userId, raison, minutes)
// par défaut un ban correspond à 3 jours
if (typeof(minutes) == "undefined")
// par défaut un ban correspond à 3 jours
if (typeof(minutes) == "undefined")
- minutes =
60 * 24 * 3
+ minutes =
conf.tempsBan;
jQuery.ajax({
type: "POST",
jQuery.ajax({
type: "POST",
@@
-941,7
+972,7
@@
Client.prototype.ban = function(userId, raison, minutes)
Client.prototype.kick = function(userId, raison)
{
Client.prototype.kick = function(userId, raison)
{
- this.ban(userId, raison,
15
)
+ this.ban(userId, raison,
conf.tempsKick
)
}
///////////////////////////////////////////////////////////////////////////////////////////////////
}
///////////////////////////////////////////////////////////////////////////////////////////////////
@@
-999,7
+1030,7
@@
PageEvent.prototype.waitEvent = function(funSend, funReceive)
for (v in poulpe)
dataToSend[v] = poulpe[v]
for (v in poulpe)
dataToSend[v] = poulpe[v]
- ;;
;
dumpObj(dataToSend)
+ ;; dumpObj(dataToSend)
this.attenteCourante = jQuery.ajax({
type: "POST",
this.attenteCourante = jQuery.ajax({
type: "POST",
@@
-1009,7
+1040,7
@@
PageEvent.prototype.waitEvent = function(funSend, funReceive)
success:
function(data)
{
success:
function(data)
{
- ;;
;
dumpObj(data)
+ ;; dumpObj(data)
funReceive(data)
funReceive(data)
@@
-1047,7
+1078,7
@@
function initialiserListeStyles(client)
}
// charge dynamiquement le script de debug
}
// 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"})
\r
// le main
$(document).ready(
\r
// le main
$(document).ready(