X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;ds=inline;f=js%2FpageMinichat.js;h=4068222d560f9895ba05ffe03cbf3aef1b525b26;hb=dc70eed10d6eb26660d02fe8b18eebb2836ef9de;hp=637ff21416a6d9e8f030f6d0dc87e3a2c2cc04e5;hpb=f6158580ec307685d5ac2075ff7a58f205335690;p=euphorik.git diff --git a/js/pageMinichat.js b/js/pageMinichat.js index 637ff21..4068222 100755 --- a/js/pageMinichat.js +++ b/js/pageMinichat.js @@ -1,850 +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