From 49cc747de57875d0fc835de7623835e46f7146f4 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 21 Jun 2005 02:27:39 +0000 Subject: [PATCH] * Moved some JavaScript functions out of head.html and into a new wclib.js file, which can be included and cached. This will form the basis for a new WebCit JavaScript function library. --- webcit/ChangeLog | 6 +++++- webcit/iconbar.c | 2 +- webcit/static/head.html | 24 +----------------------- webcit/static/menuExpandable3.js | 29 ----------------------------- webcit/static/wclib.js | 29 +++++++++++++++++++++++++++++ 5 files changed, 36 insertions(+), 54 deletions(-) delete mode 100644 webcit/static/menuExpandable3.js create mode 100644 webcit/static/wclib.js diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 148b7a9ed..fd9b15818 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,9 @@ $Log$ +Revision 619.8 2005/06/21 02:27:37 ajc +* Moved some JavaScript functions out of head.html and into a new wclib.js + file, which can be included and cached. This will form the basis for a + new WebCit JavaScript function library. + Revision 619.7 2005/06/20 20:38:50 ajc * The main stylesheet is now in a separate file in the static/ directory. Something we did recently must have fixed the caching problem, because it's @@ -2631,4 +2636,3 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix - diff --git a/webcit/iconbar.c b/webcit/iconbar.c index 3e77abf04..7341a1032 100644 --- a/webcit/iconbar.c +++ b/webcit/iconbar.c @@ -300,7 +300,7 @@ void do_iconbar(void) { "
  • " "customize this menu" + ">customize this menu" "
  • \n" ); diff --git a/webcit/static/head.html b/webcit/static/head.html index 5574cc624..93b8ea326 100644 --- a/webcit/static/head.html +++ b/webcit/static/head.html @@ -8,28 +8,6 @@ - - - + diff --git a/webcit/static/menuExpandable3.js b/webcit/static/menuExpandable3.js deleted file mode 100644 index d898aa622..000000000 --- a/webcit/static/menuExpandable3.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * menuExpandable3.js - implements an expandable menu based on a HTML list - * Author: Dave Lindquist (http://www.gazingus.org) - */ - -if (!document.getElementById) - document.getElementById = function() { return null; } - -function initializeMenu(menuId, actuatorId) { - var menu = document.getElementById(menuId); - var actuator = document.getElementById(actuatorId); - - if (menu == null || actuator == null) return; - - //if (window.opera) return; // I'm too tired - - actuator.parentNode.style.backgroundImage = "url(/static/plus.gif)"; - actuator.onclick = function() { - var display = menu.style.display; - this.parentNode.style.backgroundImage = - (display == "block") ? "url(/static/plus.gif)" : "url(/static/minus.gif)"; - menu.style.display = (display == "block") ? "none" : "block"; - - return false; - } -} - - - diff --git a/webcit/static/wclib.js b/webcit/static/wclib.js new file mode 100644 index 000000000..b78b5473a --- /dev/null +++ b/webcit/static/wclib.js @@ -0,0 +1,29 @@ +// +// $Id$ +// +// JavaScript function library for WebCit +// +// + + +// +// This code handles the popups for instant messages. +// + +var browserType; + +if (document.layers) {browserType = "nn4"} +if (document.all) {browserType = "ie"} +if (window.navigator.userAgent.toLowerCase().match("gecko")) { + browserType= "gecko" +} + +function hide_page_popup() { + if (browserType == "gecko" ) + document.poppedLayer = eval('document.getElementById(\'page_popup\')'); + else if (browserType == "ie") + document.poppedLayer = eval('document.all[\'page_popup\']'); + else + document.poppedLayer = eval('document.layers[\'`page_popup\']'); +document.poppedLayer.style.visibility = "hidden"; +} -- 2.39.2