X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=js%2Feuphorik.js;h=9dd3357430bc42ef212ad0f18cc23ea77bd945d5;hp=433c0bca25454745bab0b483d4bc4eaef60c038d;hb=de3bc0dbc72f81a21e14c421c7fb5a96bdeb057f;hpb=288706fac9732d0dbf55fc9e3291e2dda69f1fcd diff --git a/js/euphorik.js b/js/euphorik.js index 433c0bc..9dd3357 100755 --- a/js/euphorik.js +++ b/js/euphorik.js @@ -1,6 +1,8 @@ // coding: utf-8 -/** +/** + * Contient la base javascript pour le site euphorik.ch. + * Chaque page possède son propre fichier js nommé "page.js". * Auteur : GBurri * Date : 6.11.2007 */ @@ -38,15 +40,17 @@ var conf = { String.prototype.trim = function() { - return this.replace(/^\s+|\s+$/g,""); + return this.replace(/^\s+|\s+$/g, ""); } + String.prototype.ltrim = function() { - return this.replace(/^\s+/,""); + return this.replace(/^\s+/, ""); } + String.prototype.rtrim = function() { - return this.replace(/\s+$/,""); + return this.replace(/\s+$/, ""); } String.prototype.dump = function() @@ -60,12 +64,16 @@ String.prototype.dump = function() } /////////////////////////////////////////////////////////////////////////////////////////////////// - -function Util(serializer) + +/** + * Cette classe regroupe des fonctions utilitaires (helpers). + */ +function Util() { if(typeof XMLSerializer != "undefined") this.serializer = new XMLSerializer() - + + // fermeture des dialogues d jQuery("#info .fermer").click(function(){ jQuery("#info").slideUp(50) }) @@ -73,7 +81,10 @@ function Util(serializer) /** * Affiche une boite de dialogue avec un message à l'intérieur. - * + * @param message le message (string) + * @param type voir 'messageType'. par défaut messageType.informatif + * @param les boutons sous la forme d'un objet ou les clefs sont les labels des boutons + * et les valeurs les fonctions executées lorsqu'un bouton est activé. */ Util.prototype.messageDialogue = function(message, type, boutons) { @@ -102,11 +113,9 @@ Util.prototype.messageDialogue = function(message, type, boutons) } var messageType = {informatif: 0, question: 1, erreur: 2} -/* obsolète -Util.prototype.log = function(str) -{ -}*/ - +/** + * Transforme un document XML en string. + */ Util.prototype.serializeXML = function(documentXML) { if (this.serializer) @@ -765,8 +774,7 @@ jQuery.noConflict() // le main jQuery(document).ready( function() - { - + { var util = new Util() var client = new Client(util) var pages = new Pages()