X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=js%2FpageMinichat.js;h=4068222d560f9895ba05ffe03cbf3aef1b525b26;hp=31d19ba30399f03b63efc10247585f7c15f394d8;hb=5d9992368bb386d2e606ae037c5478fe10ac70e8;hpb=ac67ff1ae69108b98f190f3da18ced663a84c0da diff --git a/js/pageMinichat.js b/js/pageMinichat.js index 31d19ba..4068222 100755 --- a/js/pageMinichat.js +++ b/js/pageMinichat.js @@ -1,851 +1,292 @@ // coding: utf-8 - -function PageMinichat(client, formateur, util) -{ - this.nom = "minichat" - - this.client = client - this.formateur = formateur - this.util = util - - this.regexMessageTagMatch = /\{.*?\}>/g - this.regexMessageTagReplace = /^(.*?\{.*?\}>)*/ -} - -PageMinichat.prototype.contenu = function() -{ -// \ - return '\ -
\ -\ -' -} - -PageMinichat.prototype.charger = function() -{ - thisPage = this - - jQuery("form input.pseudo").val(this.client.pseudo) - - // cet appel ne doit pas être fait avant l'appel à 'charger' - this.messages = new Messages(this.client, this.formateur, this.util) - - this.messages.rafraichirMessages(true) - - this.util.setCaretToEnd(jQuery("form input.message")[0]) - - // affichage des smiles - jQuery("#smiles").html(this.formateur.getSmilesHTML()).children().each( - function(i) - { - var opacityBase = jQuery(this).css("opacity") - jQuery(this).click( - function(event) - { - thisPage.util.replaceSelection(jQuery("form input.message")[0], thisPage.formateur.smiles[jQuery(this).attr("class")][0].source.replace(/\\/g, "")) - } - ) - .hover( - function() - { - jQuery(this).animate( - { - opacity: 1 - }, 200 - ) - }, - function() - { - jQuery(this).animate( - { - opacity: opacityBase - }, 200 - ) - } - ) - } - ) - - /// événements - jQuery("form button.return").click( - function() - { - // captcha anti bot - if (jQuery("form input.captcha").val() != "") return - - thisPage.envoyerMessage( - jQuery("form input.pseudo").val(), - jQuery("form input.message").val() - ) - - jQuery("form input.message")[0].focus() - } - ) - // interdiction de submiter le formulaire - jQuery("form").submit(function(){return false}) - - jQuery("input.pseudo").click( - function() - { - var input = jQuery("input.pseudo")[0] - if (input.value == conf.pseudoDefaut) - input.value = "" - } - ) -} +// Copyright 2008 Grégory Burri +// +// This file is part of Euphorik. +// +// Euphorik is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Euphorik is distributed in the hope that it will be useful, +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Euphorik. If not, see