From 22ef1631270f6798262d85eb7c8f95aee65493fd Mon Sep 17 00:00:00 2001 From: Greg Burri Date: Tue, 8 Jul 2008 05:49:45 +0000 Subject: [PATCH] =?utf8?q?ADD=20possibilit=C3=A9=20d'afficher=20une=20bull?= =?utf8?q?e=20d'aide=20sur=20un=20cot=C3=A9=20determin=C3=A9=20d'une=20boi?= =?utf8?q?te?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- css/1/euphorik.css | 21 +++++++- css/2/euphorik.css | 21 +++++++- img/css1/fleche_bulle_bas.png | Bin 0 -> 225 bytes img/css1/fleche_bulle_droite.png | Bin 0 -> 230 bytes img/css1/fleche_bulle_gauche.png | Bin 0 -> 247 bytes ...fleche_bulle.png => fleche_bulle_haut.png} | Bin img/css2/fleche_bulle_bas.png | Bin 0 -> 224 bytes img/css2/fleche_bulle_droite.png | Bin 0 -> 231 bytes img/css2/fleche_bulle_gauche.png | Bin 0 -> 247 bytes ...fleche_bulle.png => fleche_bulle_haut.png} | Bin js/euphorik.js | 51 ++++++++++-------- js/pageMinichat.js | 11 ++-- nbproject/private/private.xml | 4 +- 13 files changed, 76 insertions(+), 32 deletions(-) create mode 100644 img/css1/fleche_bulle_bas.png create mode 100644 img/css1/fleche_bulle_droite.png create mode 100644 img/css1/fleche_bulle_gauche.png rename img/css1/{fleche_bulle.png => fleche_bulle_haut.png} (100%) create mode 100644 img/css2/fleche_bulle_bas.png create mode 100644 img/css2/fleche_bulle_droite.png create mode 100644 img/css2/fleche_bulle_gauche.png rename img/css2/{fleche_bulle.png => fleche_bulle_haut.png} (100%) diff --git a/css/1/euphorik.css b/css/1/euphorik.css index fa02cc0..25b51cf 100755 --- a/css/1/euphorik.css +++ b/css/1/euphorik.css @@ -178,10 +178,27 @@ div#info .boutons div:hover { #flecheBulle { position: absolute; z-index: 50; + display: none +} +.flecheBulleHaut { + background-image: url(../../img/css1/fleche_bulle_haut.png); width: 15px; height: 8px; - background-image: url(../../img/css1/fleche_bulle.png); - display: none +} +.flecheBulleDroite { + background-image: url(../../img/css1/fleche_bulle_droite.png); + width: 8px; + height: 15px; +} +.flecheBulleBas { + background-image: url(../../img/css1/fleche_bulle_bas.png); + width: 15px; + height: 8px; +} +.flecheBulleGauche { + background-image: url(../../img/css1/fleche_bulle_gauche.png); + width: 8px; + height: 15px; } #messageBulle { position: absolute; diff --git a/css/2/euphorik.css b/css/2/euphorik.css index 22a533f..4ba9352 100755 --- a/css/2/euphorik.css +++ b/css/2/euphorik.css @@ -172,10 +172,27 @@ div#info .boutons div:hover { #flecheBulle { position: absolute; z-index: 50; + display: none +} +.flecheBulleHaut { + background-image: url(../../img/css2/fleche_bulle_haut.png); width: 15px; height: 8px; - background-image: url(../../img/css2/fleche_bulle.png); - display: none +} +.flecheBulleDroite { + background-image: url(../../img/css2/fleche_bulle_droite.png); + width: 8px; + height: 15px; +} +.flecheBulleBas { + background-image: url(../../img/css2/fleche_bulle_bas.png); + width: 15px; + height: 8px; +} +.flecheBulleGauche { + background-image: url(../../img/css2/fleche_bulle_gauche.png); + width: 8px; + height: 15px; } #messageBulle { position: absolute; diff --git a/img/css1/fleche_bulle_bas.png b/img/css1/fleche_bulle_bas.png new file mode 100644 index 0000000000000000000000000000000000000000..81e3af8624474e2e7e9e76e65aa533f3cabcbf03 GIT binary patch literal 225 zcmeAS@N?(olHy`uVBq!ia0vp^{6NgX!3HGNE-(EAq!^2X+?^QKos)S9l_?j8gyq+?ov(k}PqJC~?lu z%}vcKVQ?-=O)N=GQ7F$W$xv|j^bH7a~k%O7xqn>opYL_fOpg9bl Lu6{1-oD!M<5qv_c literal 0 HcmV?d00001 diff --git a/img/css1/fleche_bulle_droite.png b/img/css1/fleche_bulle_droite.png new file mode 100644 index 0000000000000000000000000000000000000000..9e58ac0bf6c9b8fbe10c555633485d511df1a29c GIT binary patch literal 230 zcmeAS@N?(olHy`uVBq!ia0vp^96-#^!3HF6a`hPlDaPU;cPEB*=VV?2Ic!PZ?k)`f zL2$v|<&%LToCO|{#S9GG!XV7ZFl&wkP>{XE)7O>#20J?|llZEHuTOzOk|nMYCC>S| zxv6<249-QVi6yBi3gww484B*6z5(HleBwYwj-D=#ArhB+Cv4n3qoo%rIA}z0S^FH~FVdQ&MBb@00I|65C8xG literal 0 HcmV?d00001 diff --git a/img/css1/fleche_bulle_gauche.png b/img/css1/fleche_bulle_gauche.png new file mode 100644 index 0000000000000000000000000000000000000000..85763ee85566fb4f6b270b8d88a7ebb7711f8a49 GIT binary patch literal 247 zcmeAS@N?(olHy`uVBq!ia0vp^96-#^!3HF6a`hPlDaPU;cPEB*=VV?2Ic!PZ?k)`f zL2$v|<&%LToCO|{#S9GG!XV7ZFl&wkP>{XE)7O>#20J?|qxI&gr;Y-JBuiW)N}Tg^ zb5rw57@Uhz6H8K46v{J8G8EiBeFMT9`NV;Wf;?RuLnJQuPCUqaz<}e(oZCvfzuk;A zcKhw5B;rxYxJ`iLou&LN0SEPyle{MB8+mRNR839ZyClnU^0D>Ct9M+JdX->#FhQ&0 jhoI7(7M`LikptX&HDoQzR_IFtO=s|Q^>bP0l+XkKvq?+B literal 0 HcmV?d00001 diff --git a/img/css1/fleche_bulle.png b/img/css1/fleche_bulle_haut.png similarity index 100% rename from img/css1/fleche_bulle.png rename to img/css1/fleche_bulle_haut.png diff --git a/img/css2/fleche_bulle_bas.png b/img/css2/fleche_bulle_bas.png new file mode 100644 index 0000000000000000000000000000000000000000..998c91db150e0d8df0ee73993759fafdcd4a9e7a GIT binary patch literal 224 zcmeAS@N?(olHy`uVBq!ia0vp^{6NgX!3HGNE-(EAq!^2X+?^QKos)S9l_?EOM>SUL6MtNtU=qlsM<- z=BDPAFgO>bCYGe8D3oWGWGJ|M`UZqI@`(c#S$n!ThDcmaPB_4PWRAqY$CJ}l+#av4 zy>Zo0C|lW#S;DhWYZqhBk{^P18Qg+Q7D*rQSml<&EOGK82Q$N>D{XE)7O>#20J?|D^tgx_LD#%$r9Iy66gHf z+|;}h2Ir#G#FEq$h4Rdj3gNM^%ILe Rp9Px6;OXk;vd$@?2>>KULSg^_ literal 0 HcmV?d00001 diff --git a/img/css2/fleche_bulle_gauche.png b/img/css2/fleche_bulle_gauche.png new file mode 100644 index 0000000000000000000000000000000000000000..a94bee8e6e498c94132fd0641b8fc0a9230d6f62 GIT binary patch literal 247 zcmeAS@N?(olHy`uVBq!ia0vp^96-#^!3HF6a`hPlDaPU;cPEB*=VV?2Ic!PZ?k)`f zL2$v|<&%LToCO|{#S9GG!XV7ZFl&wkP>{XE)7O>#20J?|i>{Sf_eG$PWQl7;iF1B# zZfaf$gL6@8Vo7R>LV0FMhJw4NZ$Nk>pEyuakf)1dh{WaIi3fQP7;qe!BfW^Z^aI}% z)k)$)OC1h#Z)kNWxT`Zuz(M`wB(F*OMxGl5Ra2AqF3GZ-eC*=P&@=4|`KAf;ENg0) jS3ER*g5y6q)(wm^%Ejb`?r-}JG@ZfI)z4*}Q$iB};ciP4 literal 0 HcmV?d00001 diff --git a/img/css2/fleche_bulle.png b/img/css2/fleche_bulle_haut.png similarity index 100% rename from img/css2/fleche_bulle.png rename to img/css2/fleche_bulle_haut.png diff --git a/js/euphorik.js b/js/euphorik.js index b72f2d7..de64738 100755 --- a/js/euphorik.js +++ b/js/euphorik.js @@ -31,7 +31,7 @@ var conf = { versionProtocole : 3, // version du protcole nickDefaut : "", - nbMessageAffiche : 40, // (par page) + nbMessageAffiche : 10, // (par page) pseudoDefaut : "", tempsAffichageMessageDialogue : 4000, // en ms tempsKick : 15, // en minute @@ -180,13 +180,19 @@ Util.prototype.afficherBoite = function(boite, cible, positionX, positionY) boite.css("top", positionBoite.top).css("left", positionBoite.left).show() } +var positionBulleType = {haut : 0, droite : 1, bas : 2, gauche : 3} + /** * Affiche un info bulle lorsque le curseur survole l'élément donné. - * FIXME : le width de element ne tient pas compte du padding !? + * @param message le message à afficher + * @param element l'élément DOM sur lesquel afficher la bulle + * @param la position de la bulle, voir positionBulleType. Par défaut à 0 (haut) */ -Util.prototype.infoBulle = function(message, element) +Util.prototype.infoBulle = function(message, element, position) { var thisUtil = this + if (position == undefined) + position = positionBulleType.haut var cacherBulle = function() { @@ -202,6 +208,9 @@ Util.prototype.infoBulle = function(message, element) var m = $("#messageBulle") var f = $("#flecheBulle") + f.removeClass().addClass(position == positionBulleType.haut ? "flecheBulleHaut" : + (position == positionBulleType.droite ? "flecheBulleDroite" : + (position == positionBulleType.bas ? "flecheBulleBas" : "flecheBulleGauche" ))) // remplie le paragraphe de la bulle avec le message $("p", m).html(message) @@ -211,12 +220,20 @@ Util.prototype.infoBulle = function(message, element) m.css("top", 0).css("left", 0) var positionFleche = { - left : element.offset().left + element.innerWidth() / 2 - f.width() / 2, - top : element.offset().top - f.height() + left : position == positionBulleType.haut || position == positionBulleType.bas ? + element.offset().left + element.outerWidth() / 2 - f.width() / 2 : + (position == positionBulleType.gauche ? element.offset().left - f.width() : element.offset().left + element.outerWidth()), + top : position == positionBulleType.gauche || position == positionBulleType.droite ? + element.offset().top + element.outerHeight() / 2 - f.height() / 2 : + (position == positionBulleType.haut ? element.offset().top - f.height() : element.offset().top + element.outerHeight()) } var positionMessage = { - left : element.offset().left + element.width() / 2 - m.width() / 2, - top : element.offset().top - f.height() - m.height() + left : position == positionBulleType.haut || position == positionBulleType.bas ? + element.offset().left + element.width() / 2 - m.width() / 2 : + (position == positionBulleType.gauche ? element.offset().left - f.width() - m.width() : element.offset().left + f.width() + element.outerWidth()), + top : position == positionBulleType.gauche || position == positionBulleType.droite ? + element.offset().top + element.outerHeight() / 2 - m.height() / 2 : + (position == positionBulleType.haut ? element.offset().top - f.height() - m.height() : element.offset().top + f.height() + element.outerHeight()) } var depassementDroit = (positionMessage.left + m.width()) - $("body").width() if (depassementDroit > 0) @@ -549,7 +566,7 @@ Formateur.prototype.getShort = function(url) */ Formateur.prototype.traiterPourFenetreLightBox = function(M, urlCourante) { - thisFormateur = this + var thisFormateur = this var traitementUrl = function(url) { return "[" + thisFormateur.getShort(url)[0] + (urlCourante == url ? "*" : "") + "]" @@ -957,7 +974,7 @@ Client.prototype.flush = function(async) Client.prototype.majMenu = function() { - displayType = "block" + var displayType = "block" $("#menu .admin").css("display", this.ekMaster ? displayType : "none") @@ -1176,24 +1193,14 @@ PageEvent.prototype.waitEvent2 = function(funSend, funsReceive) } /////////////////////////////////////////////////////////////////////////////////////////////////// - -function initialiserListeStyles(client) -{ - $("#menuCss").change( - function() - { - client.setCss("css/" + $("option:selected", this).attr("value") + "/euphorik.css") - } - ) -} -// charge dynamiquement le script de debug +// charge dynamiquement le script de debug (obsolète) ;; jQuery.ajax({async : false, url : "js/debug.js", dataType : "script"}) // le main $(document).ready( function() - { + { var formateur = new Formateur() var util = new Util(formateur) var client = new Client(util) @@ -1202,7 +1209,7 @@ $(document).ready( // connexion vers le serveur (utilise un cookie qui traine) client.connexionCookie() - initialiserListeStyles(client) + $("#menuCss").change(function(){ client.setCss("css/" + $("option:selected", this).attr("value") + "/euphorik.css")}) // FIXME : ne fonctionne pas sous opera // voir : http://dev.jquery.com/ticket/2892#preview diff --git a/js/pageMinichat.js b/js/pageMinichat.js index bd869f0..31c7e31 100755 --- a/js/pageMinichat.js +++ b/js/pageMinichat.js @@ -94,7 +94,7 @@ PageMinichat.prototype.charger = function() this.util.infoBulle("Ouvrir la conversation liée au troll de la semaine", $("#trollCourant .troll")) - this.util.infoBulle("Cliquer sur les messages pour les enlevers de la liste", + this.util.infoBulle("Cliquer sur les messages pour les enlevers de la liste", $("form#posterMessage #repondA").hover( function() { thisPage.util.afficherBoite($(".messages", this), $(this), positionTypeX.centre, positionTypeY.bas) }, function() { $(".messages", this).hide() } @@ -104,7 +104,8 @@ PageMinichat.prototype.charger = function() if ($(e.target).is(".nb")) thisPage.conversations.enleverMessagesRepond() } - ) + ), + positionBulleType.droite ) // @@ -486,7 +487,7 @@ function Conversation(conversations, num) $("#conversations tr").append(XHTML) - this.util.infoBulle("Aller à la première page", $("#" + this.getId() + " .numPage")) + this.util.infoBulle("Aller à la première page", $("#" + this.getId() + " .numPage"), positionBulleType.haut) if (num != 0) { this.util.infoBulle("Créer un lien vers la conversation", $("#" + this.getId() + " .lien")) @@ -516,8 +517,10 @@ Conversation.prototype.majRacine = function() this.messagesParId[this.racine.id] = this.racine var element = $(this.racine.XHTML(true, this.getId())) this.attacherEventsSurMessage(element) - $("#" + this.getId() + " .titre .messageRacine").append(element) + $("#" + this.getId() + " .titre .messageRacine").html(element) } + else // si le message fait déjà parti de la conversation on n'affiche pas la racine + $("#" + this.getId() + " .titre .messageRacine").empty() } Conversation.prototype.enleverMiseEnEvidence = function() diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index c91a7ac..2dd3bff 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -8,8 +8,8 @@ js/pageMinichat.js 245 - 921 - 1170 + 923 + 1172 -- 2.43.0