From: x2000habouzit Date: Thu, 13 Jul 2006 11:44:31 +0000 (+0000) Subject: push the horrible javascript line into a separate js. X-Git-Tag: xorg/0.9.11~440 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=33ec1a8f07866328210a55a7c1673689e1ec60a8;p=platal.git push the horrible javascript line into a separate js. git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@460 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/htdocs/javascript/wiki.js b/htdocs/javascript/wiki.js new file mode 100644 index 0000000..7ff04a6 --- /dev/null +++ b/htdocs/javascript/wiki.js @@ -0,0 +1,29 @@ +Nix = { + "map": null, + "convert": function(a) { + Nix.init(); + var s=''; + 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 < s.length; i++) { + map[s.charAt(i).toUpperCase()] = s.charAt((i + 13) % 26).toUpperCase(); + } + Nix.map = map; + }, + "decode": function(a) { + document.write(Nix.convert(a)); + } +}; + diff --git a/htdocs/wiki.php b/htdocs/wiki.php index 6969be1..bb8615e 100644 --- a/htdocs/wiki.php +++ b/htdocs/wiki.php @@ -31,13 +31,14 @@ new_skinned_page('wiki.tpl', Env::has('response') ? AUTH_MDP : AUTH_PUBLIC); if ($globals->wiki->wikidir) { $wikisite = 'xorg'; - require_once("wiki.inc.php"); + require_once 'wiki.inc.php'; $page->changeTpl($wiki_template); } -if (!Env::get('action')) - $page->assign('xorg_extra_header', "\n"); - +if (!Env::get('action')) { + $page->addJsLink('javascript/wiki.js'); +} + wiki_assign_auth(); $page->addCssLink('css/wiki.css');