X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=js%2Feuphorik.js;h=d7ef712c120ce6cf9ed55a3839cdc2fbd7c0a0c0;hp=7af2708220e49117716b02e465d00529b633996e;hb=8875fb445d47bb0925ef46a131a9bc4dec004b49;hpb=a2ee1419f013be953ee768b5b7e95eb423dcf080 diff --git a/js/euphorik.js b/js/euphorik.js index 7af2708..d7ef712 100755 --- a/js/euphorik.js +++ b/js/euphorik.js @@ -183,6 +183,29 @@ Util.prototype.replaceSelection = function(input, replaceString) { } } +Util.prototype.rot13 = function(chaine) +{ + var ACode = 'A'.charCodeAt(0) + var aCode = 'a'.charCodeAt(0) + var MCode = 'M'.charCodeAt(0) + var mCode = 'm'.charCodeAt(0) + var ZCode = 'Z'.charCodeAt(0) + var zCode = 'z'.charCodeAt(0) + + var f = function(ch, pos) { + if (pos == ch.length) + return "" + + var c = ch.charCodeAt(pos); + return String.fromCharCode( + c + + (c >= ACode && c <= MCode || c >= aCode && c <= mCode ? 13 : + (c > MCode && c <= ZCode || c > mCode && c <= zCode ? -13 : 0)) + ) + f(ch, pos + 1) + } + return f(chaine, 0) +} + /////////////////////////////////////////////////////////////////////////////////////////////////// function Pages() @@ -564,6 +587,7 @@ Client.prototype.authentifie = function() Client.prototype.setStatut = function(statut) { + //alert(statut) // conversation en "enum" si en "string" if (typeof(statut) == "string") { @@ -773,7 +797,6 @@ jQuery(document).ready( jQuery(window).unload( function() { - //alert("ok") client.flush(false) } ) @@ -792,10 +815,12 @@ jQuery(document).ready( ) }) jQuery("#menu .register").click(function(){ pages.afficherPage("register") }) + jQuery("#menu .about").click(function(){ pages.afficherPage("about") }) pages.ajouterPage(new PageMinichat(client, formateur, util)) pages.ajouterPage(new PageProfile(client, formateur, util)) pages.ajouterPage(new PageRegister(client, formateur, util)) + pages.ajouterPage(new PageAbout(client, formateur, util)) pages.afficherPage("minichat") } ) \ No newline at end of file