From: Florent Bruneau Date: Thu, 20 Jan 2011 20:49:47 +0000 (+0100) Subject: Coding rules. X-Git-Tag: core/1.1.2~3 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=890974df9846549c2ad49feba5fd4b93d81de0ec;p=platal.git Coding rules. Signed-off-by: Florent Bruneau --- diff --git a/htdocs/javascript/core.js b/htdocs/javascript/core.js index bf0e5d1..bc9463e 100644 --- a/htdocs/javascript/core.js +++ b/htdocs/javascript/core.js @@ -224,46 +224,46 @@ // {{{ function RegExp.escape() RegExp.escape = function(text) { - if (!arguments.callee.sRE) { - var specials = [ - '/', '.', '*', '+', '?', '|', - '(', ')', '[', ']', '{', '}', - '\\', '^' , '$' - ]; - arguments.callee.sRE = new RegExp( - '(\\' + specials.join('|\\') + ')', 'g' - ); - } - return text.replace(arguments.callee.sRE, '\\$1'); + if (!arguments.callee.sRE) { + var specials = [ + '/', '.', '*', '+', '?', '|', + '(', ')', '[', ']', '{', '}', + '\\', '^' , '$' + ]; + arguments.callee.sRE = new RegExp( + '(\\' + specials.join('|\\') + ')', 'g' + ); + } + return text.replace(arguments.callee.sRE, '\\$1'); } // }}} // {{{ PmWiki decoding Nix = { - map: null, - convert: function(a) { - Nix.init(); - var s = ''; - for (i = 0; i < a.length ; i++) { - var b = a.charAt(i); - s += ((b >= 'A' && b <= 'Z') || (b >= 'a' && b <= 'z') ? Nix.map[b] : b); - } - return s; - }, - init: function() { - if (Nix.map != null) - return; - var map = new Array(); - var s='abcdefghijklmnopqrstuvwxyz'; - for (i = 0; i < s.length; i++) - map[s.charAt(i)] = s.charAt((i+13)%26); - for (i=0; i= 'A' && b <= 'Z') || (b >= 'a' && b <= 'z') ? Nix.map[b] : b); + } + return s; + }, + init: function() { + if (Nix.map != null) + return; + var map = new Array(); + var s='abcdefghijklmnopqrstuvwxyz'; + for (i = 0; i < s.length; i++) + map[s.charAt(i)] = s.charAt((i+13)%26); + for (i=0; i