From 5933821f4bbcc59090786288ee148377e0ae06f9 Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Fri, 26 Nov 2004 16:30:32 +0000 Subject: [PATCH] render our javascript more general, and documented. --- htdocs/javascript/xorg.js | 49 +++++++++++++++++++++++++++++++++++++++++++++ templates/skin/default.tpl | 4 ++-- templates/skin/espace.tpl | 4 ++-- templates/skin/humlinux.tpl | 4 ++-- templates/skin/linux.tpl | 4 ++-- templates/skin/liteskin.tpl | 4 ++-- templates/skin/nbviolet.tpl | 4 ++-- templates/skin/newxorg.tpl | 4 ++-- templates/skin/oldtimes.tpl | 4 ++-- templates/skin/openweb.tpl | 4 ++-- templates/skin/sharky.tpl | 4 ++-- templates/skin/spectral.tpl | 4 ++-- templates/skin/trapped.tpl | 4 ++-- 13 files changed, 73 insertions(+), 24 deletions(-) diff --git a/htdocs/javascript/xorg.js b/htdocs/javascript/xorg.js index 0709020..63efb48 100644 --- a/htdocs/javascript/xorg.js +++ b/htdocs/javascript/xorg.js @@ -18,6 +18,16 @@ * 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+"
"+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 + */ 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(); +} + +// }}} + diff --git a/templates/skin/default.tpl b/templates/skin/default.tpl index 13a2578..825a9e7 100644 --- a/templates/skin/default.tpl +++ b/templates/skin/default.tpl @@ -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 $ ***************************************************************************} @@ -31,7 +31,7 @@ {/if} {include file=skin/common.bandeau.head.tpl} - + {include file=skin/common.devel.tpl} {if $smarty.session.suid} diff --git a/templates/skin/espace.tpl b/templates/skin/espace.tpl index da4b681..9ad5070 100644 --- a/templates/skin/espace.tpl +++ b/templates/skin/espace.tpl @@ -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 $ ***************************************************************************} @@ -32,7 +32,7 @@ {/if} {include file=skin/common.bandeau.head.tpl} - + {include file=skin/common.devel.tpl} {if $smarty.session.suid} diff --git a/templates/skin/humlinux.tpl b/templates/skin/humlinux.tpl index 3394f5c..c9e7475 100644 --- a/templates/skin/humlinux.tpl +++ b/templates/skin/humlinux.tpl @@ -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 $ ***************************************************************************} @@ -32,7 +32,7 @@ {/if} {include file=skin/common.bandeau.head.tpl} - + {include file=skin/common.devel.tpl} {if $smarty.session.suid} diff --git a/templates/skin/linux.tpl b/templates/skin/linux.tpl index fe7475b..ec45d4f 100644 --- a/templates/skin/linux.tpl +++ b/templates/skin/linux.tpl @@ -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 $ ***************************************************************************} @@ -32,7 +32,7 @@ {/if} {include file=skin/common.bandeau.head.tpl} - + {include file=skin/common.devel.tpl} {if $smarty.session.suid} diff --git a/templates/skin/liteskin.tpl b/templates/skin/liteskin.tpl index baa367a..049fd29 100644 --- a/templates/skin/liteskin.tpl +++ b/templates/skin/liteskin.tpl @@ -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 $ ***************************************************************************} @@ -32,7 +32,7 @@ {/if} {include file=skin/common.bandeau.head.tpl} - + {include file=skin/common.devel.tpl} {if $smarty.session.suid} diff --git a/templates/skin/nbviolet.tpl b/templates/skin/nbviolet.tpl index a97af16..d7c3cbc 100644 --- a/templates/skin/nbviolet.tpl +++ b/templates/skin/nbviolet.tpl @@ -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 $ ***************************************************************************} @@ -32,7 +32,7 @@ {/if} {include file=skin/common.bandeau.head.tpl} - + {include file=skin/common.devel.tpl} {if $smarty.session.suid} diff --git a/templates/skin/newxorg.tpl b/templates/skin/newxorg.tpl index 469172f..d811d9a 100644 --- a/templates/skin/newxorg.tpl +++ b/templates/skin/newxorg.tpl @@ -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 $ ***************************************************************************} @@ -32,7 +32,7 @@ {/if} {include file=skin/common.bandeau.head.tpl} - + {include file=skin/common.devel.tpl} {if $smarty.session.suid} diff --git a/templates/skin/oldtimes.tpl b/templates/skin/oldtimes.tpl index 547d856..f913808 100644 --- a/templates/skin/oldtimes.tpl +++ b/templates/skin/oldtimes.tpl @@ -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 $ ***************************************************************************} @@ -32,7 +32,7 @@ {/if} {include file=skin/common.bandeau.head.tpl} - + {include file=skin/common.devel.tpl} {if $smarty.session.suid} diff --git a/templates/skin/openweb.tpl b/templates/skin/openweb.tpl index 1e4e5bf..8306285 100644 --- a/templates/skin/openweb.tpl +++ b/templates/skin/openweb.tpl @@ -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 $ ***************************************************************************} @@ -31,7 +31,7 @@ {/if} {include file=skin/common.bandeau.head.tpl} - + {include file=skin/common.devel.tpl} {if $smarty.session.suid} diff --git a/templates/skin/sharky.tpl b/templates/skin/sharky.tpl index 6203694..0a762bb 100644 --- a/templates/skin/sharky.tpl +++ b/templates/skin/sharky.tpl @@ -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 $ ***************************************************************************} @@ -32,7 +32,7 @@ {/if} {include file=skin/common.bandeau.head.tpl} - + {include file=skin/common.devel.tpl} {if $smarty.session.suid} diff --git a/templates/skin/spectral.tpl b/templates/skin/spectral.tpl index 26a0116..e70a1b4 100644 --- a/templates/skin/spectral.tpl +++ b/templates/skin/spectral.tpl @@ -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 $ ***************************************************************************} @@ -32,7 +32,7 @@ {/if} {include file=skin/common.bandeau.head.tpl} - + {include file=skin/common.devel.tpl} {if $smarty.session.suid} diff --git a/templates/skin/trapped.tpl b/templates/skin/trapped.tpl index 539f333..006e499 100644 --- a/templates/skin/trapped.tpl +++ b/templates/skin/trapped.tpl @@ -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 $ ***************************************************************************} @@ -32,7 +32,7 @@ {/if} {include file=skin/common.bandeau.head.tpl} - + {include file=skin/common.devel.tpl} {if $smarty.session.suid} -- 2.1.4