render our javascript more general, and documented.
authorx2000habouzit <x2000habouzit>
Fri, 26 Nov 2004 16:30:32 +0000 (16:30 +0000)
committerx2000habouzit <x2000habouzit>
Fri, 26 Nov 2004 16:30:32 +0000 (16:30 +0000)
13 files changed:
htdocs/javascript/xorg.js
templates/skin/default.tpl
templates/skin/espace.tpl
templates/skin/humlinux.tpl
templates/skin/linux.tpl
templates/skin/liteskin.tpl
templates/skin/nbviolet.tpl
templates/skin/newxorg.tpl
templates/skin/oldtimes.tpl
templates/skin/openweb.tpl
templates/skin/sharky.tpl
templates/skin/spectral.tpl
templates/skin/trapped.tpl

index 0709020..63efb48 100644 (file)
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
+
+/***************************************************************************
+ * MISC
+ */
+
+// {{{ function getNow()
+
+/**
+ * function used to print the client's computer datetime on the page
+ */
 function getNow() {
     dt=new Date();
     dy=dt.getDay();
@@ -36,12 +46,37 @@ function getNow() {
     return days[dy]+" "+wd+" "+months[mh]+" "+yr+"<br />"+time;
 }
 
+// }}}
 
+/***************************************************************************
+ * POPUP THINGS
+ */
+
+// {{{ function popWin()
+
+/**
+ * function that pops an anchor
+ * 
+ * @param theNode anchor    the anchor we are talking about
+ * @param w       int       the desired width for the popup
+ * @param h       int       the desired height for the popup
+ */
 function popWin(theNode,w,h) {
     window.open(theNode.href, '_blank',
        'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width='+w+',height='+h);
 }
 
+// }}}
+// {{{ function auto_links()
+
+/**
+ * parses an html file, and update the onclik handlers for anchors that need it.
+ *
+ * anchors :
+ *   - that points to another host are opened in a new window (mimic the target=_new)
+ *   - of class popup(2) or popup_###x### create real popups (no url bar, ...)
+ * This function is designed to be used in <body onload="javascript:auto_links()">
+ */
 function auto_links() {
     nodes = document.getElementsByTagName('a');
     fqdn = document.URL;
@@ -62,3 +97,17 @@ function auto_links() {
     }
 }
 
+// }}}
+
+/***************************************************************************
+ * The real OnLoad
+ */
+
+// {{{ function pa_onload
+
+function pa_onload() {
+    auto_links();
+}
+
+// }}}
+
index 13a2578..825a9e7 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: default.tpl,v 1.20 2004-11-22 10:42:53 x2000habouzit Exp $
+        $Id: default.tpl,v 1.21 2004-11-26 16:30:32 x2000habouzit Exp $
  ***************************************************************************}
 
 <?xml version="1.0" encoding="iso-8859-1"?>
@@ -31,7 +31,7 @@
     {/if}
     {include file=skin/common.bandeau.head.tpl}
   </head>
-  <body onload='auto_links()'>
+  <body onload='pa_onload()'>
     {include file=skin/common.devel.tpl}
 
     {if $smarty.session.suid}
index da4b681..9ad5070 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: espace.tpl,v 1.5 2004-11-22 10:42:53 x2000habouzit Exp $
+        $Id: espace.tpl,v 1.6 2004-11-26 16:30:32 x2000habouzit Exp $
  ***************************************************************************}
 
 <?xml version="1.0" encoding="iso-8859-1"?>
@@ -32,7 +32,7 @@
     {/if}
     {include file=skin/common.bandeau.head.tpl}
   </head>
-  <body onload='auto_links()'>
+  <body onload='pa_onload()'>
     {include file=skin/common.devel.tpl}
 
     {if $smarty.session.suid}
index 3394f5c..c9e7475 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: humlinux.tpl,v 1.6 2004-11-22 10:42:53 x2000habouzit Exp $
+        $Id: humlinux.tpl,v 1.7 2004-11-26 16:30:32 x2000habouzit Exp $
  ***************************************************************************}
 
 <?xml version="1.0" encoding="iso-8859-1"?>
@@ -32,7 +32,7 @@
     {/if}
     {include file=skin/common.bandeau.head.tpl}
   </head>
-  <body onload='auto_links()'>
+  <body onload='pa_onload()'>
     {include file=skin/common.devel.tpl}
 
     {if $smarty.session.suid}
index fe7475b..ec45d4f 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: linux.tpl,v 1.5 2004-11-22 10:42:53 x2000habouzit Exp $
+        $Id: linux.tpl,v 1.6 2004-11-26 16:30:32 x2000habouzit Exp $
  ***************************************************************************}
 
 <?xml version="1.0" encoding="iso-8859-1"?>
@@ -32,7 +32,7 @@
     {/if}
     {include file=skin/common.bandeau.head.tpl}
   </head>
-  <body onload='auto_links()'>
+  <body onload='pa_onload()'>
     {include file=skin/common.devel.tpl}
 
     {if $smarty.session.suid}
index baa367a..049fd29 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: liteskin.tpl,v 1.5 2004-11-22 10:42:53 x2000habouzit Exp $
+        $Id: liteskin.tpl,v 1.6 2004-11-26 16:30:32 x2000habouzit Exp $
  ***************************************************************************}
 
 <?xml version="1.0" encoding="iso-8859-1"?>
@@ -32,7 +32,7 @@
     {/if}
     {include file=skin/common.bandeau.head.tpl}
   </head>
-  <body onload='auto_links()'>
+  <body onload='pa_onload()'>
     {include file=skin/common.devel.tpl}
 
     {if $smarty.session.suid}
index a97af16..d7c3cbc 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: nbviolet.tpl,v 1.5 2004-11-22 10:42:53 x2000habouzit Exp $
+        $Id: nbviolet.tpl,v 1.6 2004-11-26 16:30:32 x2000habouzit Exp $
  ***************************************************************************}
 
 <?xml version="1.0" encoding="iso-8859-1"?>
@@ -32,7 +32,7 @@
     {/if}
     {include file=skin/common.bandeau.head.tpl}
   </head>
-  <body onload='auto_links()'>
+  <body onload='pa_onload()'>
     {include file=skin/common.devel.tpl}
 
     {if $smarty.session.suid}
index 469172f..d811d9a 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: newxorg.tpl,v 1.5 2004-11-22 10:42:53 x2000habouzit Exp $
+        $Id: newxorg.tpl,v 1.6 2004-11-26 16:30:32 x2000habouzit Exp $
  ***************************************************************************}
 
 <?xml version="1.0" encoding="iso-8859-1"?>
@@ -32,7 +32,7 @@
     {/if}
     {include file=skin/common.bandeau.head.tpl}
   </head>
-  <body onload='auto_links()'>
+  <body onload='pa_onload()'>
     {include file=skin/common.devel.tpl}
 
     {if $smarty.session.suid}
index 547d856..f913808 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: oldtimes.tpl,v 1.5 2004-11-22 10:42:53 x2000habouzit Exp $
+        $Id: oldtimes.tpl,v 1.6 2004-11-26 16:30:32 x2000habouzit Exp $
  ***************************************************************************}
 
 <?xml version="1.0" encoding="iso-8859-1"?>
@@ -32,7 +32,7 @@
     {/if}
     {include file=skin/common.bandeau.head.tpl}
   </head>
-  <body onload='auto_links()'>
+  <body onload='pa_onload()'>
     {include file=skin/common.devel.tpl}
 
     {if $smarty.session.suid}
index 1e4e5bf..8306285 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: openweb.tpl,v 1.5 2004-11-22 11:00:53 x2000habouzit Exp $
+        $Id: openweb.tpl,v 1.6 2004-11-26 16:30:32 x2000habouzit Exp $
  ***************************************************************************}
 
 <?xml version="1.0" encoding="iso-8859-1"?>
@@ -31,7 +31,7 @@
     {/if}
     {include file=skin/common.bandeau.head.tpl}
   </head>
-  <body onload='auto_links()'>
+  <body onload='pa_onload()'>
     {include file=skin/common.devel.tpl}
 
     {if $smarty.session.suid}
index 6203694..0a762bb 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: sharky.tpl,v 1.10 2004-11-22 10:42:53 x2000habouzit Exp $
+        $Id: sharky.tpl,v 1.11 2004-11-26 16:30:32 x2000habouzit Exp $
  ***************************************************************************}
 
 <?xml version="1.0" encoding="iso-8859-1"?>
@@ -32,7 +32,7 @@
     {/if}
     {include file=skin/common.bandeau.head.tpl}
   </head>
-  <body onload='auto_links()'>
+  <body onload='pa_onload()'>
     {include file=skin/common.devel.tpl}
 
     {if $smarty.session.suid}
index 26a0116..e70a1b4 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: spectral.tpl,v 1.5 2004-11-22 10:42:53 x2000habouzit Exp $
+        $Id: spectral.tpl,v 1.6 2004-11-26 16:30:32 x2000habouzit Exp $
  ***************************************************************************}
 
 <?xml version="1.0" encoding="iso-8859-1"?>
@@ -32,7 +32,7 @@
     {/if}
     {include file=skin/common.bandeau.head.tpl}
   </head>
-  <body onload='auto_links()'>
+  <body onload='pa_onload()'>
     {include file=skin/common.devel.tpl}
 
     {if $smarty.session.suid}
index 539f333..006e499 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: trapped.tpl,v 1.5 2004-11-22 10:42:53 x2000habouzit Exp $
+        $Id: trapped.tpl,v 1.6 2004-11-26 16:30:32 x2000habouzit Exp $
  ***************************************************************************}
 
 <?xml version="1.0" encoding="iso-8859-1"?>
@@ -32,7 +32,7 @@
     {/if}
     {include file=skin/common.bandeau.head.tpl}
   </head>
-  <body onload='auto_links()'>
+  <body onload='pa_onload()'>
     {include file=skin/common.devel.tpl}
 
     {if $smarty.session.suid}