X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=js%2FpageMinichat.js;h=c118c5415e72986b189e5bbafa2c363926d6418a;hb=21e31d4ff2078d18734c98b87a53869f4fa81828;hp=8d914b439797053e37c45b11723ce9272a769b3d;hpb=0864f5fa5ccd1ce99e88c08d25a2f8ea18525d56;p=euphorik.git
diff --git a/js/pageMinichat.js b/js/pageMinichat.js
index 8d914b4..c118c54 100755
--- a/js/pageMinichat.js
+++ b/js/pageMinichat.js
@@ -14,14 +14,13 @@ function PageMinichat(client, formateur, util)
PageMinichat.prototype.contenu = function()
{
-// \
return '\
-
\
\
@@ -41,8 +40,10 @@ PageMinichat.prototype.charger = function()
this.util.setCaretToEnd(jQuery("form input.message")[0])
+ //
+ jQuery("body").append("")
// affichage des smiles
- jQuery("#smiles").html(this.formateur.getSmilesHTML()).children().each(
+ jQuery("#smiles").append(this.formateur.getSmilesHTML()).children().each(
function(i)
{
var opacityBase = jQuery(this).css("opacity")
@@ -72,12 +73,28 @@ PageMinichat.prototype.charger = function()
)
}
)
+ jQuery("form button.smiles").hover(
+ function(e)
+ {
+ var offset = jQuery(e.target).offset()
+ jQuery("#smiles").css("top", offset.top).css("left", offset.left).show()
+ },
+ function(e){}
+ )
+ jQuery("#smiles").hover(
+ function(){},
+ function(e)
+ {
+ jQuery("#smiles").hide()
+ }
+ )
+ //
- /// événements
- jQuery("form button.return").click(
+ // événements
+ var nouveauMessage =
function()
- {
- // captcha anti bot
+ {
+ // captcha anti bot
if (jQuery("form input.captcha").val() != "") return
thisPage.envoyerMessage(
@@ -87,9 +104,19 @@ PageMinichat.prototype.charger = function()
jQuery("form input.message")[0].focus()
}
+
+ jQuery("form").keypress(
+ function(e)
+ {
+ if (e.which == 13) // return
+ nouveauMessage()
+ }
)
+
+ jQuery("form button.return").click(nouveauMessage)
+
// interdiction de submiter le formulaire
- jQuery("form").submit(function(){return false})
+ jQuery("form").submit(function(){ return false})
jQuery("input.pseudo").click(
function()
@@ -105,6 +132,8 @@ PageMinichat.prototype.decharger = function()
{
//alert(this.attenteCourante)
this.messages.stopAttenteCourante()
+
+ jQuery("body #smiles").remove()
}
PageMinichat.prototype.getJSONMessage = function(pseudo, message, repondA)