diff --git a/CHANGES b/CHANGES index 73d4bf7a..c40b4a1c 100755 --- a/CHANGES +++ b/CHANGES @@ -1,8 +1,58 @@ -0.97c has no additional changes - it's just 0.97b with some silly errors fixed, and all +This is a roll-up of all the small bugfixes for the last couple of years, especially those that stop Weathermap +working with newer MySQL or PHP versions. There is a more substantial 1.0 release in the works, but I will backport +any simple improvements or fixes to 0.98(abcd) releases. There are also small usability changes aimed at reducing +repeat "error reports" in the forums. + +IMPORTANT NOTE - you may need to reset permissions on your users after upgrading, as I've +finally switched to the "new-style" plugin API that's been around for 5+ years. This handles +permissions differently, unfortunately. + +IMPORTANT NOTE 2: THIS RELEASE DOES NOT WORK WITH CACTI 1.x! You will want version 1.0+ for that. + +0.98b + FIXED - More deprecated features for PHP 7.4 updated + ADDED - SNMPv2c datasource plugin + ADDED - SNMPv3 datasource plugin + +0.98a + FIXED - Works with PHP 7.x and 5.6 - removed all mysql_*() function calls, and use PDO instead + FIXED - Blank line issue with RRDtool 1.5+ + +0.98 + FIXED - MySQL error in table-creation. MySQL 5.6 is fussier. + FIXED - Editor 'delete link' broken + FIXED - KILO was ignored when processing %k in special tokens + FIXED - Various fixes for PHP deprecated or strict-mode warnings + FIXED - Line-ending trimming in 'external script' data source + FIXED - rounding error 'kinks' in angled VIA links + FIXED - Config file path validation issue in editor (CVE-2013-3739) + FIXED - Cloning a templated node in editor retains the template in the clone + FIXED - cacti_use_ifspeed incorrect when interfaces > 20M and ifhighspeed available + FIXED - More PHP 5.3/5.4/strict related errors (split -> explode) + CHANGE - Finally switch to "new-style" plugin API. + CHANGE - Editor data picker improved sort (thanks shd) + CHANGE - (Cacti plugin only) images are written to a temporary file first, to avoid displaying half-written images + CHANGE - Editor no longer uses editor-config.php + ADDED - Weathermap will use anti-aliasing if your GD supports it (php-bundled GD doesn't) (thanks shd) + ADDED - Special token formatting can handle timeticks and time_t formatting (%T and %t respectively) + ADDED - new DATAOUTPUTFILE allows collected data to be written to a file for later use (automatically enabled in Cacti) + ADDED - new wmdata: datasource plugin can read data from files produced by DATAOUTPUTFILE + ADDED - IMAGEOUTPUTFILE and HTMLOUTPUTFILE are honoured in Cacti poller as a location for a second copy of those files. + ADDED - Editor 'tidy link' function replaces Vert & Horiz, and does much nicer job + ADDED - 'retidy' option in editor to recalculate all links previously positioned with 'tidy'. + ADDED - KEYBGCOLOR and KEYOUTLINECOLOR both accept 'none' + ADDED - command-line weathermap has new --no-warn option to disable warnings + ADDED - AICONFILLCOLOR accepts 'none' for drawing giant transparent shapes. + ADDED - Extra warning for Boost users about poller_output + ADDED - if there are actually 0 maps in the database, the 'Weathermaps' tab gives some basic instructions. + ADDED - Cacti data picker in editor tracks most recently used hosts (thanks Zdolny) + ADDED - New permission in Cacti: edit maps. Maps can be edited by authorized users without needing to enable the editor in the source code. + +0.97c had no additional changes - it's just 0.97b with some silly errors fixed, and all the CSS files included with the correct paths. There were also reports of problems with the actual zip file. -0.97b is a special release starting from 0.97a and backporting all the quick bugfixes from the 0.98 code. +0.97b is a special release starting from 0.97a and backporting all the quick bugfixes from the 0.98 code. There are larger structural changes in 0.98 and new features, but these bugfixes were useful enough to warrant a new 0.97 release (especially the mysql schema change). A real 0.98 release will follow in due course. @@ -20,7 +70,7 @@ Thanks to Gerry Eisenhaur and Daniel Ricardo dos Santos respectively for their s FIXED - check-gdbug.php shouldn't complain about empty ob_flush buffers anymore FIXED - SNMP DS should deal better with non-numeric (and blank) return values FIXED - NINK colours were exchanged (thanks Deathwing00!) - FIXED - WriteConfig (i.e. editor) won't 'lose' absolute keyword from + FIXED - WriteConfig (i.e. editor) won't 'lose' absolute keyword from FIXED - fixed some function-name clashes with other plugins FIXED - PHP 5.3/5.4/strict related errors ("Creating default object from empty value") CHANGE - editor snap function improved (snap to *nearest* point) (thanks Andreas Braun) @@ -42,8 +92,8 @@ Thanks to Gerry Eisenhaur and Daniel Ricardo dos Santos respectively for their s FIXED - 'Show Only First' option ignored in Cacti (thanks inko_nick) FIXED - Editor deals with overlapping nodes on different ZORDERS properly. FIXED - "property of non-object in editor.php line 466" while editing map properties (thanks to iNeo) - FIXED - no-data option on command-line didn't work - FIXED - Clone Node was broken in 0.97 + FIXED - no-data option on command-line didn't work + FIXED - Clone Node was broken in 0.97 FIXED - Maps with per-user permissions show up multiple times in map selector FIXED - Removed incorrect warning about imagefilter and USEICONSCALE. FIXED - string escaping bug with editor and direct config changes (thanks uhtred) @@ -94,7 +144,7 @@ Thanks to Gerry Eisenhaur and Daniel Ricardo dos Santos respectively for their s ADDED - SNMP datasource has option to give up on a failing host ADDED - LABELOFFSET supports percentage compass offsets and radial offsets, like NODES does. ADDED - Percentage compass offsets (NODES and LABELOFFSET) support > 100% offsets - + 0.96a FIXED - New z-ordering code did not work correctly on PHP4. This broke (at least) the editor. (thanks toe_cutter) FIXED - \n is no longer treated as a newline in TARGETs (thanks NetAdmin) FIXED - KILO was broken completely between 0.95b and 0.96 (thanks Jethro Binks) @@ -164,7 +214,7 @@ Thanks to Gerry Eisenhaur and Daniel Ricardo dos Santos respectively for their s FIXED - MRTG datasource tried to stat() URLs FIXED - Error reporting for CLI --define was bad. --help text was out of date. FIXED - Editor will honour LABEL from NODE DEFAULT, if it is set. - + 0.95b FIXED - SQL schema issue that upset some mysql versions FIXED - Removed sometime-problem debugging code in editor FIXED - incorrect jquery path in cacti-picker @@ -181,9 +231,9 @@ Thanks to Gerry Eisenhaur and Daniel Ricardo dos Santos respectively for their s CHANGE - Added in a SCALE line in the DEFAULT scale for between 0 and 1. Stops a lot of warnings on low-traffic links. CHANGE - Tweaked node cloning in editor - clone is offset in x and y now. -0.95 KNOWN ISSUE - ININFOURL/OUTINFOURL, INOVERLIBGRAPH/OUTOVERLIBGRAPH are not handled well by the editor. If you edit a map that uses these, +0.95 KNOWN ISSUE - ININFOURL/OUTINFOURL, INOVERLIBGRAPH/OUTOVERLIBGRAPH are not handled well by the editor. If you edit a map that uses these, then the 'in' side of the link will be copied to the 'out' side. New editor will handle this better. - + ADDED - you get a warning if you are using values outside of the defined SCALE now. ADDED - You can add a 'tag' to a SCALE line, to be used in ICON or LABELs later. ADDED - USEICONSCALE - colorize icon images (based on patches from llow) @@ -197,13 +247,13 @@ Thanks to Gerry Eisenhaur and Daniel Ricardo dos Santos respectively for their s ADDED - improved data-source picker in editor: option to aggregate data sources ADDED - Moved data-source picker changes across into the graph-picker for NODEs too. ADDED - SPLITPOS keyword to control position of midpoint in links - ADDED - VIAs can be positioned relative to NODEs (like NODEs can) (thanks again to llow) + ADDED - VIAs can be positioned relative to NODEs (like NODEs can) (thanks again to llow) ADDED - Weathermap has a hook in the map viewing page to allow other plugins to add code there ADDED - .htaccess files bundled with Weathermap to restrict direct access to configs and output ADDED - filenames for output are much less guessable now (may break external references to maps) ADDED - You can use 'DUPLEX half' on a link to make the bandwidth percentage calculate work for half-duplex links - ADDED - ININFOURL/OUTINFOURL, INOVERLIBGRAPH/OUTOVERLIBGRAPH, INNOTES/OUTNOTES + ADDED - ININFOURL/OUTINFOURL, INOVERLIBGRAPH/OUTOVERLIBGRAPH, INNOTES/OUTNOTES allow you to have different urls for the in and out side of links (based on idea from llow) ADDED - OVERLIBGRAPH (and IN/OUT versions) can take multiple URLs separated by spaces (again from idea by llow) ADDED - debug/warning log output contains the map name, and the debug output is marked DEBUG @@ -221,11 +271,11 @@ Thanks to Gerry Eisenhaur and Daniel Ricardo dos Santos respectively for their s FIXED - Cacti Data-source and Graph picker doesn't restrict scrolling or resizing anymore FIXED - weathermap-cacti-rebuild.php to work on both Cacti 0.8.6 and 0.8.7 FIXED - weathermap-cacti-rebuild.php to flat-out fail if Cacti environment is wrong. - FIXED - SNMP DS plugin had a typo that stopped it working at all (and no-one + FIXED - SNMP DS plugin had a typo that stopped it working at all (and no-one noticed for almost a year :-) ). (thanks to Fratissier Christophe for pointing it out) - FIXED - Added some better controls into SNMP DS plugin. You can correctly pull - interface oper/admin status, for example, now. - + FIXED - Added some better controls into SNMP DS plugin. You can correctly pull + interface oper/admin status, for example, now. + 0.941 FIXED - Issue with '-' DS names again. FIXED - Added extra code to help discourage browser caching. FIXED - Removed some extra chatty debugging code from poller_output. @@ -243,7 +293,7 @@ Thanks to Gerry Eisenhaur and Daniel Ricardo dos Santos respectively for their s FIXED - "Full Screen Maps" mode in Cacti Plugin was broken by me adding the "View Only First" mode. FIXED - Imagemaps for horiz/vert format legend were wrong in editor (thanks to Alex Moura for pointing this out) FIXED - Changes for compatibility with Cacti 0.8.7's moved config file. - + 0.93 Added - weathermap-cacti-plugin.php?action=viewmap&id=mapfilename works as well as a map number - useful for crosslinks FIXED - the key_hidezero secret setting hides the zero in a gradient in a classic scale too. CHANGE - the auth realm names for Cacti have been changed to match ReportIt and Aggregate - easier to tell who does what @@ -277,7 +327,7 @@ Thanks to Gerry Eisenhaur and Daniel Ricardo dos Santos respectively for their s FIXED - angled bwlabels have the correct imagemap FIXED - divide-by-zero error for some (?) PHP versions in poller ADDED - Warning for duplicate node or link names - + 0.92 - FIXED weathermap CLI help said --random-data instead of --randomdata FIXED one last php short_tag in poller_common.php - thanks Bernado Diez FIXED a SET in DEFAULT node/link is inherited by all node/links now. @@ -296,7 +346,7 @@ Thanks to Gerry Eisenhaur and Daniel Ricardo dos Santos respectively for their s Added - COMMENTPOS allows you to move the position of comments along the link (like BWLABELPOS) FIXED - strange edge case with gradient SCALE caused div-by-zero (Tiago Giorgetti) CHANGE - The editor doesn't *require* an editor-config.php anymore. It *will* warn you if the defaults aren't enough, however. - + 0.91 - FIXED RRD bug with '-' DS names. This was fixed in 0.9pre3, but somehow slipped through. FIXED KILO bug again (Steve Woodcock) FIXED handling of MRTG html files on remote systems @@ -317,7 +367,7 @@ Thanks to Gerry Eisenhaur and Daniel Ricardo dos Santos respectively for their s FIXED unreported bug where WriteConfig throws away floating point part of SCALEs FIXED another variation of the imagemap sorting bug from 0.81 (Erik van Cutsem) FIXED KILO ignored bug (found/patch by Steve Woodcock) - FIXED unreported bug where WriteConfig throws away HTMLOUTPUTFILE and IMAGEOUTPUTFILE + FIXED unreported bug where WriteConfig throws away HTMLOUTPUTFILE and IMAGEOUTPUTFILE Added facility to use multiple SCALEs in a map. SCALE takes an optional name. NODEs and LINKs can have a USESCALE line. FIXED bugs relating to assumption that 'admin' user always exists, and that users never go away, in the Cacti mgmt tab (adrian marsh) Logging is tidied up a bit under Cacti's poller @@ -334,14 +384,14 @@ Thanks to Gerry Eisenhaur and Daniel Ricardo dos Santos respectively for their s Added - SET command to pass hints into plugins or weathermap core, per-node, per-link or globally. Cleaned up config parser. Can be more fussy. More consistent though. Added - CLI tool takes --define to define SET-style variables - + 0.82 FIXED another variation on ReadFromRRD not detecting NaNs properly (hyland) FIXED SQL error which affects only some MySQL 5s (gundamx) FIXED some minor php errors in setup.php (cigamit) Changed the rrdtool period from now-400 to now-800 to avoid long-poller-cycle problems. Did some more /=>DIRECTORY_SEPARATOR changes - there weren't any problems, but it's a potential one. FIXED if you use the editor and your rrdtool is somewhere other than /usr/bin/rrdtool then you get an incorrect error about checking line 27 of the CLI tool. - + 0.81 - Added a Weathermaps link to the Cacti 'Configuration' side-menu. Removed 'Manage Maps' link in Weathermap tab. (knobdy) File-picker in editor no longer masks on *.conf FIXED sort-order bug for imagemaps (Fran Boon) @@ -349,9 +399,9 @@ Thanks to Gerry Eisenhaur and Daniel Ricardo dos Santos respectively for their s FIXED default bandwidth duplicated field in editor. (qjy2000_cn) FIXED now allow TITLEPOS 0 0 (actually, y=0 is useless, but x=0 might be useful) (knobdy) Editor still won't upload images, but it WILL let you pick from any PNG files in the images/ - folder, and any images already mentioned in the map configuration file for ICON and BACKGROUND + folder, and any images already mentioned in the map configuration file for ICON and BACKGROUND lines. (everyone and their dog) - Similar change for DEFINEFONT. You still have to hand-edit to define the font, but after that, the + Similar change for DEFINEFONT. You still have to hand-edit to define the font, but after that, the editor will let you pick it. Changed the dependency tests to NOT give a warning about particular DLL names. Added more dependency tests for specific functions. @@ -363,7 +413,7 @@ Thanks to Gerry Eisenhaur and Daniel Ricardo dos Santos respectively for their s Fixed error when creating multiple links between nodes in the editor (fozzy) Docs update - More FAQs and config reference improvements/amendments. Added 'Cycle' mode to plugin - automatically cycle between your weathermaps. - + 0.8 - Added ability to have multiple targets for a LINK - aggregate your T1s Added ability to use half an RRD (use '-' as the DS name) - if you have 'in' in one RRD, and 'out' in another Added a tab-seperated file datasource for TARGET lines, so you can draw anything you can dump into a textfile. @@ -392,34 +442,34 @@ Thanks to Gerry Eisenhaur and Daniel Ricardo dos Santos respectively for their s Added config options for HTMLOUTPUTFILE and IMAGEOUTPUTFILE. The idea is to reduce the size of command-lines, and make the map files more self-contained. CLI options still take precedence. - Includes new 'DHTML' editor for the first time. This is still very much + Includes new 'DHTML' editor for the first time. This is still very much in testing - backup any map configs you edit with it first! - Fixed DrawLegend() to not go below a minimum width (it used to use the + Fixed DrawLegend() to not go below a minimum width (it used to use the title length, but that can be too small now) - Added BACKGROUNDCOLOR option: take an R G B like the SCALE lines (request + Added BACKGROUNDCOLOR option: take an R G B like the SCALE lines (request from kbriggs) Ripped out some of the 'live PHP' code to make DrawMap a bit simpler. Added a check for PNG support in CLI command. Added command-line error-checking (Niels is back again) Added a fix for Windows line-endings. Seems that PHP uses Unix-endings even on Win32 - Added LINK DEFAULT and NODE DEFAULT - set the defaults for (nearly) any + Added LINK DEFAULT and NODE DEFAULT - set the defaults for (nearly) any parameter. This also means that most node-affecting and link-affecting parameters are now per-node and per-link. - Added ARROWSTYLE option - there's 'classic' and 'compact' with neater arrowheads. + Added ARROWSTYLE option - there's 'classic' and 'compact' with neater arrowheads. Added LABELOFFSET option to change the relative position of the LABEL when an ICON is also used. Added OVERLIBWIDTH and OVERLIBHEIGHT to allow better OverLib output (Niels B, once more) Switched to using 24bit images internally. This should improve the handling of PNG transparency in ICONs. Improved number and content of error messages. - + 0.6 - Renamed weathermap.php to just 'weathermap' to make it more obviously not a PHP page. Fixed up NODE name regexp (thanks Niels Baggesen) Added warning for non-existent NODES in LINK (thanks again Niels Baggesen) HTML fix for in generated HTML (Niels once more) More HTML fixes to make us a bit more XHTML-like. - You can have an ICON and a LABEL now. LABEL is centred over the + You can have an ICON and a LABEL now. LABEL is centred over the NODE, for the moment. Also, there's a drop shadow effect, to make it easier to read the overlaid text. New config features: LINKFONT, NODEFONT and KEYFONT to control the @@ -429,7 +479,7 @@ Thanks to Gerry Eisenhaur and Daniel Ricardo dos Santos respectively for their s Added ability to customise timestamp and legend text, by adding new text after the KEYPOS and TIMEPOS commands. 0.5a - Fixed totally embarrassing problems with the DS-specification code. - As far as I can figure I never did test it. Oh dear. Thanks to + As far as I can figure I never did test it. Oh dear. Thanks to Jethro Binks for speedy patches. 0.5 - Fixed asymmetric BANDWIDTH bug - thanks rpingar @@ -439,7 +489,7 @@ Thanks to Gerry Eisenhaur and Daniel Ricardo dos Santos respectively for their s Allow for decimals in BANDWIDTH specifications - 1.5M should work now Allow for decimals in SCALE specifications - mainly useful for very small values on big links Brought back sub-1.0 percentages, which got lost somewhere along the line - Added in warning for >100% lines + Added in warning for >100% lines Added TIMEPOS option so *you* get to choose where the timestamp goes, mgb Fixed stupid bug in ReadRRDData - Weathermap should follow the data better now. Thanks to 'cl' @@ -458,9 +508,9 @@ Thanks to Gerry Eisenhaur and Daniel Ricardo dos Santos respectively for their s Added new example config in docs/ directory Moved editor.php out of the way to random-bits Included a copy of auto-overlib.pl, just cos it's handy - + 0.3 - ICON config directive for NODEs added - same effect as jas0420's perl code - Fixed WriteConfig a little - TITLEs are written. + Fixed WriteConfig a little - TITLEs are written. OVERLIBGRAPH config is written for NODES. Fixed bug with OVERLIBGRAPH DHTML and NODEs Added --image-uri option back in from the perl version @@ -471,4 +521,3 @@ Thanks to Gerry Eisenhaur and Daniel Ricardo dos Santos respectively for their s Code tidyup for weathermap.php 0.1 - Initial pre-release version - diff --git a/INSTALL.md b/INSTALL.md index daf086b9..096e71dd 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,3 +1,7 @@ +### Notice +This is a modification of the PHP Network Weathermap plugin for libreNMS, the idea is to migrate to version 0.98a of the original Network Weathermap + +---- ### Prerequisites Network-WeatherMap requires php pear to work. @@ -8,12 +12,14 @@ Network-WeatherMap requires php pear to work. Extract to your LibreNMS plugins directory `/opt/librenms/html/plugins` so you should see something like `/opt/librenms/html/plugins/Weathermap/` The best way to do this is via git. Go to your install directory and then `/opt/librenms/html/plugins` Enter: +#### Original repository `git clone https://github.com/librenms-plugins/Weathermap.git` ### Step 2. Inside the html/plugins directory, change the ownership of the Weathermap directory by typing `chown -R librenms:librenms Weathermap/` Make the configs directory writeable `chmod 775 /opt/librenms/html/plugins/Weathermap/configs` Note if you are using SELinux you need to input the following command `chcon -R -t httpd_cache_t Weathermap/` +#### (Note: In order to make the config writable for set ownership of the config directory to `chown -R www-data:www-data /opt/librenms/html/plugins/Weathermap/configs/` ) ### Step 3. Enable the cron process by editing your current LibreNMS cron file (typically /etc/cron.d/librenms) and add the following: diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..08a45c35 --- /dev/null +++ b/LICENSE @@ -0,0 +1,15 @@ +The MIT License + +Copyright 2005-2020 Howard Jones and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 5fdefa7b..90721af5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,10 @@ -This is modified version of PHP Network Weathermap (orginal README is below) +# Weathermap + +This is a modification of the PHP Network Weathermap plugin for libreNMS, the migrations corresponds to version 0.98a of the original Network Weathermap, see: https://github.com/howardjones/network-weathermap/tree/0.98-php7 + +---- + +This is modified version of PHP Network Weathermap (original README is below) The modified version starts at version 0.1 by Neil Lathwood (neil@lathwood.co.uk) for use as a plugin for LibreNMS and currently includes basic support for picking out nodes and links from your LibreNMS install. See INSTALL for details. @@ -11,7 +17,7 @@ See CHANGES for the most recent updates, listed by version. See COPYING for the license under which php-weathermap is released. There is much more information, tutorials and updates available at: - http://www.network-weathermap.com/ +http://www.network-weathermap.com/ ---- @@ -31,7 +37,11 @@ jquery-latest.min.js is the jQuery javascript library - written by John Resig an http://docs.jquery.com/Licensing Some of the icons used in the editor, and also supplied in the images/ folder are -from the excellent Fam Fam Fam Silk icon collection by Mark James: - http://www.famfamfam.com/lab/icons/silk/ +from the excellent Fam Fam Fam Silk icon collection by Mark James: +http://www.famfamfam.com/lab/icons/silk/ These are released under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/ +http://creativecommons.org/licenses/by/2.5/ + +---- + +Thanks to Edgeuno for the support, visit us at https://edgeuno.com/ diff --git a/TODO b/TODO new file mode 100644 index 00000000..3765ee5d --- /dev/null +++ b/TODO @@ -0,0 +1,528 @@ +Before 0.98 +----------- + +Comments aren't drawn along a link! + + +add %t option to format SNMP TimeTicks + +thumb2 file - 48x48px thumb to show in map management screen. +Include note about timezone stuff in docs +DONE make a (no map yet) thumbnail + + +FIXED/DONE Imagemap seems all wrong in editor?? - write a 'draw imagemap' function + +per-map debugging - needs UI to enable! +map scheduling - needs UI +consolidated map-properties page in UI? (variable settings, plus schedule, plus debug, plus runtime info, etc) + +FONTDEFINE can't tell if GD font is wrong-endian? +Off-by-one in angled VIAs (only in one direction?? - test simple-link-5a.conf) +Change non-scale colour handling to go into another colour table - no 'special' +Winding order problem (I think) with sharp-angled vias - see conf_via3.conf +DONE USESCALE absolute not in WriteConfig +Use the Colour class for all colours. +KEYBG/KEYOUTLINE/KEYTEXTCOLOR per-scale + +Rewrite Cacti integration and editor manual pages + +Move scale stuff into WeatherMapScale + +THIS IS CORRECT poller_output still runs with map-update-period = 0 +entries in weathermap_data are never expired +collect usage_stats into an .xml file next to each map file +standalone version of the cacti map browser +DONE track runtime per map +DONE improve cron string parsing +improve usage_stats to cover non-regexp config +DONE allow IMAGEOUTPUTFILE/HTMLOUTPUTFILE/IMAGEURI to make a copy of the final image in Cacti mode http://forums.cacti.net/viewtopic.php?t=36279 +improve usage_stats to cover things other than keywords +DONE more efficient ReadConfig - 50% of runtime! +SORTOFDONE very simplified link drawing for classical no-via links. +DONE Move imagemap stuff so that each node and link holds it's own imagemap shapes - saves a lot of sorting and searching + +some things from the wishlist: +Some kind of shorthand for 'last non-relative node'? Then the sub chunks WOULD be generic +DONE KEYBGCOLOR none +DONE KEYOUTLINECOLOR none +{node:this_link_a:name} +TAG + {node:tagged:name} +Cacti editor picker - if it's not traffic_in/traffic_out, let you pick the DSes +Editor picker - plugin-supplied picker listings - allow for Zabbix,Zenoss,Cricket,Groundwork,MRTG,Orion,Smokeping,WUG etc to supply useful picker info + + +Before 0.97a +------------ +FIXED BUG - Editor clone doesn't work +FIXED BUG - Show Only First Doesn't Work +FIXED BUG - Editor imagemap has wrong sort order (lower things have priority) +FIXED Quote escaping bug for NOTES? http://forums.cacti.net/viewtopic.php?p=181452#181452 +DONE VIA editing code http://forums.cacti.net/viewtopic.php?t=29423&highlight= + + +Before 0.97 +----------- +DONE No filenames for weathermap_data +DONE Use weathermap_data in dsstats +DONE docs for dsstats +DONE Test groups fully +Add cron settings? +DONE Converter for rrd to dsstats +DONE Add snmp_cache stuff to dsstats +DONE BUG - SPLITPOS with VIASTYLE angled breaks arrow drawing. + +Nudge for link comments? (normal not tangent) + + +PATCHES/Features +---------------- +Browse subdirs for images in editor: +http://forums.cacti.net/about34831.html + +WISHES +------- + +DONE! New ICON recolouring code +DONE! http://forums.cacti.net/about35242.html + +Text Alignment in labels +http://forums.cacti.net/about35264.html + +Some kind of special warning for if ALL the maps fail in a cycle. +Also some sort of highlight to show that the map wasn't updated successfully last time it ran (permissions problems). + +DONE! COMMENTSTYLE center + +KEYBGCOLOR none +KEYOUTLINECOLOR none +{node:this_link_a:name} +TAG + {node:tagged:name} + +POSITION relative to a variable {node:tagged:name} - means evaluating relative positions a lot later + +DONE! define inscalecolor_html as well + +DONE! Use OVERLIBGRAPH, OVERLIBHEIGHT in tag. (glen walker) + +ProcessString for timepos string +(+ some formatted date strings for use elsewhere?) + +Editor off by two? Nodes centered instead of aligning at UR +http://forums.cacti.net/viewtopic.php?t=29616&start=0&postdays=0&postorder=asc&highlight= + +Hide Maps in Cacti Tab? +http://forums.cacti.net/viewtopic.php?p=117591 + +Processing Token - 95th percentile +http://forums.cacti.net/viewtopic.php?p=135555 + +weathermap / smokeping (editor picker) +http://forums.cacti.net/viewtopic.php?t=27516 + +I just want to add a newline to the TIMEPOS output +http://forums.cacti.net/viewtopic.php?t=26885 + +DONE! DS Plugins - pre-load hook. ReadData runs through loop twice - once for recignise, then a pre-Read hook, then all the ReadData. Allows for pre-caching where appropriate (fping, snmp, anything that uses remote calls) + +Multi-line text, plus Mactrack DS +http://forums.cacti.net/viewtopic.php?t=26790 + +Non-percentage scales +http://forums.cacti.net/viewtopic.php?t=16372 + +Node Position as percentage along link? (fake labels etc) + +Cron-style control per-map (to allow for a monthly average map, run once a month) +http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.sbin/cron/lib/entry.c?rev=1.20 + +Image archiving - for animation, previous months monthly reports, etc. + +New Link styles - dotted, dashed, split + +--------------------------------------- + + +Before 0.96 +----------- + +Refresh before viewing graphs? (glenp) +http://forums.cacti.net/viewtopic.php?p=145866#145866 + +Editor placeholder for dynamic icon? (glenp) +http://forums.cacti.net/viewtopic.php?p=145749#145749 + +editor.php security + +rrdtool cdefs + +spaces in filenames/targets where appropriate - quotes, and escaped quotes "([^\"\\]*(?:\\.[^\"\\]*)*)" | (\S+)\s | \s + +more AICONs - NINK, PIE, GAUGE + +(multiline (bw)labels? - interpret \n) + +DONE! ZORDER messes up imagemaps +DONE! external script params - needs spaces in targets +DONE! rrdtool averaging rrdtool graph /dev/null -f "" -s now-30d -e now DEF:in=../rra/atm-sl_traffic_in_5498.rrd:traffic_in:AVERAGE DEF:out=../rra/atm-sl_traffic_in_5498.rrd:traffic_out:AVERAGE VDEF:avg_in=in,AVERAGE VDEF:avg_out=out,AVERAGE PRINT:avg_in:%lf PRINT:avg_out:%lf +DONE! Angled VIAs +DONE! 'none' for SCALE (not gradient) +DONE! COMMENTSTYLE (edge|center) +DONE! contrast for commentcolor (when using 'COMMENTSTYLE center') + +Coverage/Usage stats +WUG DS +Nagios DS +Solarwinds Orion DS +Nabbix DS +RRD xport DS (use rrdtool graph and PRINT in fact) + +FIXED Fix a few docs bugs with unclosed tags - actually this is some kind of processing bug to do with
s + +FIXED BUG imagemap floats +DONE! BUG: ReadData should not be run for links with no nodes (templates) or nodes with no position. +DONE! Documentation for printf tokens! +DONE! multiple instances of same map in Cacti +DONE! -> per-instance SET params in Cacti UI. e.g. a monthly average version +DONE! store the dimensions of the thumbnail (better presentation in Cacti) +DONE! warning for BWLABELPOS when in Parent property. Default parent is __DEFAULT +DONE! Per-map warning count in DB +DONE! Some SETs to suppress warnings? + + +Before 0.95 +----------- +DONE! SCALE tags +DONE! Artificial ICONs +DONE! IN/OUT infourl/notes/overlibgraph stuff - OVERLIBCAPTION missed - check others with editor? +DONE! Negative DS values +DONE! Half-duplex links +DONE! (Reworking of DS plugins to use Null instead of -1) + +Before 0.94 +----------------- +MOSTLYDONE! Boost/poller_output support +DONE! THold DS +DONE! INBWFORMAT/OUTBWFORMAT +DONE! Unidirectional links +DONE! Fixes for Cacti 0.8.7 changes +BUG: RRD line with one NaN and one good value should still be a good line. -> Actual bug is that -1 is a magic value. Switch to NULL for 'no value'! +FIXED BUG: poller_output should degrade when no new updates arrive, somehow. +FIXED BUG: cacti-picker.php needs to include global.php if there is one, in preference to config.php (0.8.7 compat) + +------------------------------------------------------------ +(php-rrdtool support?) +(Editor NG) -> IE6 styling and imagemap updating is totally wrong +Extra DS for WUG, Nagios +USESCALE can use any variable - USESCALE scalename {node:this:cactihost_latency} +Finish Artificial Icons +Editor shows absolute coordinates for relative-positioned nodes... +DONE Colours do wierd things with artificial icons - needs extra colour defs. How to make fit with USESCALE? +RRD CF selection (0.92 patch from Ghozlane Toumi - needs rewrite now) + +----------------- + +Before 0.93 +----------------- + +DONE Editor testing, layout cleanup. +DONE Verify rrdtool DS is OK + +----------------- + +Background image links: http://art.gnome.org/backgrounds/abstract/ +Background image generator: http://splintax.blogspot.com/2006/01/starfish-automatically-generated.html + +FIXED BUG: USESCALE none produces an error - if no scale called 'none' is defined, it is not an error. +FIXED BUG: COMMENTPOS 0 breaks things. LABELPOS 0 probably does too (binary search problem) +FIXED BUG: WriteConfig KEYPOS *STILL* produces invalid config? + +DONE RRD DS should look for lines with valid data *in the named DS*, not ALL valid. + +DONE WriteConfig should optionally just return a string (so the editor can fetch a config chunk) +DONE WriteConfig should optionally write the contents of a variable in place of the normal config (so the editor can update a chunk) + +DONE Work out NODE-drawing code so that the bg colour is known earlier, so artificial icons can use it. + +DONE Finish scale-drawing changes so that the cached image is stored somewhere. + +Editor - make the link offset radio buttons work (what about numeric offsets?) + +Refactor scale/colour picking stuff, so we can get inscalekey/outscalekey early + +Cacti poller_output support (Boost) - lots of reworking + +Editor QuickWin(tm): Upload images +Editor QuickWin(tm): Grid Snap +Editor QuickWin(tm): Node Targets picker + +Error Codes - error code linked to explanatory page on website. Getting tired of explaining the english errors again and again! + +Memory Leaks? + +RRDserv-compatible target? rrdfile.rrd@hostname:portnumber rrdremote:host:port:file.rrd (need to learn PHP sockets) + +php-rrdtool support in rrd DS plugin + +Cacti THold DS plugin +Cacti Manage DS plugin (if I can get Manage to work) +Cacti Report DS plugin? +WhatsUp Gold 8 & 11 DS plugins +Nagios DS plugin + +BWLABELS nonzero to hide bwlabel boxes for (exactly) zero values. (grangenet weathermap) + +Node width/height adjustment? Maybe some special ICONs? :- + ICON 300 400 box # use existing size thingy. 'box' just draws a bigger box + ICON 48 48 nink # draw a nink + +INBWFORMAT/OUTBWFORMAT - ProcessString strings for the bwlabels +- Some way to format BWLABELs? I want milliseconds, someone else wanted "x% of yMb" +- should be something like BWLABELIN and BWLABELOUT. Each one needs different vars. +- This is starting to get ugly. + +DONE Refactor draw_curve/draw_label - store the spine in the link? +DONE - allow for tangential labels, moving comments, etc, without making draw_curve even bigger + +DONE INCOMMENTPOS/OUTCOMMENTPOS +DONE Tangential Labels +DONE Use PHP_CompatInfo to get definitive requirements +DONE "subtractive aggregation" prefix a - to a target + +DONE Editor QuickWin(tm): Pick any defined font? (like the current image picker) +DONE Editor QuickWin(tm): Moving a node rotates VIAs - needed in AJAX editor anyway. +FIXED SET not inherited for links or nodes? + +Things below this line are not urgent +----------------------------------------------------------------------------------------------------- + + +Move to seperate runtime vars from config vars in WeatherMapItem - makes WriteConfig and editor UI easier. +* ReadConfig sets config vars +* some kind of GetConfig is used by anything that needs to read these +* the runtime state is NOT the config vars +* WriteConfig writes the config vars +- should a pre/post plugin be allowed to alter the config vars? (e.g. snap to grid) + +DEAD Decide which internal properties are visible through ProcessString, and limit/rename them. + +DEAD Move to using RRD xml output, to avoid some text-parsing problems + +Nagios target + +Cacti data target (use data_id instead of rrd path - helps with Boost?) + +Editor: wierd redraw bug switching to xy sometimes. Some kind of preloader? + +################################# + +FIXED WriteConfig fails to write KEYSTYLEs properly for multiple SCALEs + +FIXED COMMENTFONTCOLOR is ignored! + +DONE --help for weathermap CLI +DONE --no-data option for CLI + +DONE Config for plugins - some kind of #pragma? +DONE Allow specification of RRD command line (via #pragma-like thing) (Andrei) +DONE - this is the incomplete SET command + +FIXED BUG: Two nodes close together will really freak out the curve code + +DONE? RRD plugin - headers different in rrdtool 1.x + +DONE Additional ProcessString format option to get KMGT version of value + +DONE MAXVALUE as synonym for BANDWIDTH on LINKS + +DONE Figure out at least an appropriate straight-line angle to draw link comments + +FIRST CUT DONE Label number formatting options in ProcessString - %2f + +FIXED INCOMMENT and OUTCOMMENT don't do anything + +FIXED COMMENTFONT and COMMENTFONTCOLOR don't do anything either + +DONE ProcessString - node:parent:xxxx + this would allow you to cut&paste chunks of subordinate nodes without rewriting + parent refers to the node that this one is positioned relative to, if any + +SIDESTEPPED RRD needs bytes/bits/absolute options + +FIXED $map->rrdtool_check is no longer checked! + +FIXED WriteConfig doesn't write ICON scaling + +FIXED? RRD plugin doesn't set data_time (do ANY?) + +FIXED Editor doesn't edit horiz/vertical keystyles - no AREA? + +FIXED? ShortOpenTags Editor bug? + + +FIXED WriteConfig doesn't understand ICON none? +DONE WriteConfig doesn't do MAXVALUE +DONE WriteConfig doesn't do imageoutputfile and htmloutputfile?? + +DONE UI to allow disabling of poller map generation (while retaining thumbs browsing) (Andrei) +DONE UI to 'render now' for debugging +DONE CLI script to 'render now' to do async maps (Andrei) + +FIXED LABELOFFSET needs 'C' +FIXED ICON needs 'none' + +FIXED OVERLIBGRAPH flicker on near-centre verticals + +FIXED BUG: New node-image stuff doesn't work on PHP4? FIXED with $map->nodes[$this->name]->labeloffsetx = 0; + +FIXED BUG: Flashing overlib graphs + +FIXED Node positioning relative to another node + +DONE positioning bw labels as a percentage from each end... +DONE BWLABEL 25 75 bits +DONE BWLABEL 45 55 bits + +DONE Use ProcessString for icon filenames (may allow some up/down icons?) + + +DONE Named SCALEs * DONE for LINKs + +DONE Format strings - decide how these work! + +DONE ICON maxwidth maxheight filename +DONE rescaling icons without doing any work + +DONE NODES node1:N node2:10:10 +DONE Allow numerical offsets for node offsets + +LINK sdfsdf + INCOMMENT fe0/0.1 + OUTCOMMENT fe1/0.1 + COMMENTFONT 33 +Allow extra 'annotation' text per-link-direction + +DONE Unrecognised config on line 7: KEYSTYLE horizontal + +DONE Take classic, horizontal and vertical. H&V are both a continuous +DONE strip from 0 to 100%, marked up in 20%s. (maybe 'notches' for the bands?) + + +##################################################################### + + +DONE Unrecognised config on line 39: KEYBGCOLOR 192 192 192 +DONE Unrecognised config on line 40: KEYTEXTCOLOR 0 0 0 +DONE Unrecognised config on line 41: TIMECOLOR 255 255 255 +DONE Unrecognised config on line 42: TITLEPOS 30 30 +DONE Unrecognised config on line 43: TITLECOLOR 255 255 255 +DONE Unrecognised config on line 44: TITLEFONT 120 +DONE More colours, and also a drawable title + + +DONE Unrecognised config on line 57: BWOUTLINECOLOR 255 255 255 +DONE Unrecognised config on line 58: BWFONTCOLOR 255 255 255 +DONE Unrecognised config on line 59: BWBOXCOLOR 0 0 0 +DONE Unrecognised config on line 60: ARROWSTYLE 3 2 +DONE Unrecognised config on line 67: OUTLINECOLOR 255 0 0 +DONE for LINKS + + +DONE Unrecognised config on line 68: FONTCOLOR 0 0 255 +DONE Unrecognised config on line 69: FONTSHADOWCOLOR none +DONE for NODES + +DONE Extras: + DONE Finish curves + DONE ( + DONE all links are curves + DONE imagemap is generated correctly + DONE ) + + DONE WriteConfig doesn't do half these things! + + Always calc nodesizes early. simplify the box/margin calcs + + GD capability checking. + + Option to use indexed colour, for the plebs. + + Cacti-pick -> MRTG-pick -> NRG-pick + + DONE Cacti plugin -> at least view/manage. Get weathermap logs into cacti log? + +Editor: cacti-pick style thing for MRTG folder-of-rrds (and NRG, etc etc) +Editor: i18n - all text from a seperate file... + +DONE Cacti Plugin - display +DONE Cacti Plugin - poller +DONE Cacti Plugin - manage +DONE Cacti Plugin - edit + +FIXED Editor: Node renaming doesn't work +Editor: Draggable dialogs? +Editor: Draggable NODEs? +Editor: Update to use new defaults model + +DONE Aggregate TARGETS: TARGET xy.rrd + yz.rrd + rr.rrd [can't be asymmetric in this style] + +DONE Some way to change Icon/Label colour based on a data source (e.g. up/down info) + +Some way to have one-directional arrows (e.g. latency) +Some way to have non-bits/sec data (e.g. latency in seconds, no *8) + +Niels Baggesen: BWLABELS BOTH (!) +Ueli: Use rrdtool extension if possible +DONE: TFC: multipoint links, or curved, or parallel? + +DONE Alex Soares de Moura: arrow outlines on/off/colour + +DONE Me: overhaul arrow drawing generally, so I understand it properly! :-) + +Editor: Scale editor +DONE Editor: font selection +Editor: other colours (background, link outline) +DONE Editor: Cacti source picker +Editor: Image management (backgrounds, icons) + +NOT DONE RIGHT Editor: Help text - onfocus & onblur handlers for all form elements. + +NOT NEEDED ANYMORE Editor: 'reverse' option on cacti-picker + +DONE? Editor: wierd redraw bug switching to xy sometimes. Some kind of preloader? + +NON-BUG sizedebug doesn't work in editor?? did before... maybe only in PHP4 (of course) + +Recalc Now should check permissions + +FIXED Editor: ' & " stripslashes issue - MORE stripslashes crap in editor.php - it breaks ' and " in nodenames. + +FIXED Editor: images on windows \ vs / - http://forums.cacti.net/viewtopic.php?p=93556#93556 + +DONE Some memory-usage monitoring would make debugging configs easier. + +FIXED Map Cycle mode broken in IE? + +DONE Cacti Host Status target + +DONE length for horizonal/vertical scales: KEYSTYLE horizontal 300 (the width is auto, based on font, isn't it?) + +DONE Make a note available with the percentage bandwidth, so it can appear in comments/labels +DONE --> calculate percentage bandwidth BEFORE drawing anything (before the post-process?), so it's universally available. + +DONE ProcessString for TARGET, based on hints but not notes. + +DONE --define x=y option for CLI + +DONE ProcessString for INFOURL, OVERLIBGRAPH? +- Not TARGET? (any plugin could put strings into a command line for '!' plugin) + +NON-BUG weathermap-cacti-rebuild.php has cacti-path hardcoded! + + + diff --git a/TODO-for-0.98.md b/TODO-for-0.98.md new file mode 100644 index 00000000..caceb6b4 --- /dev/null +++ b/TODO-for-0.98.md @@ -0,0 +1,40 @@ +## TODO for next 0.98 release + +* Fix 5.3-7.0 strict errors +* ~~KEYBGCOLOR none http://forums.cacti.net/viewtopic.php?f=16&t=55922~~ +* ~~Config file path validation issue in editor (CVE-2013-3739)~~ +* ~~KILO was ignored when processing %k in special tokens~~ +* ~~nowarn_WMxxxx actually works!~~ +* ~~rounding error 'kinks' in angled VIA links~~ +* ~~Cloning a templated node in editor retains the template in the clone~~ +* ~~cacti_use_ifspeed incorrect when interfaces > 20M and ifhighspeed available~~ +* ~~Add a warning for missing tables on manage~~ +* ~~Add a warning for no maps on main tab if there are NO MAPS~~ +* ~~Add note on editor that config names must have no space and end in .conf~~ +* ~~DATAOUTPUTFILE~~ +* ~~HTMLOUTPUTFILE and IMAGEOUTPUTFILE in Cacti~~ +* ~~new image-cycle~~ +* ~~detect if Boost is installed and enabled, and recommend poller_output~~ + * ~~the 'click here to add global setting' doesn't yet~~ +* ~~editor 'tidy' function~~ +* ~~%t and %T support in ProcessString~~ +* ~~Document %d in manual http://forums.cacti.net/viewtopic.php?f=16&t=22677~~ +* ~~AICONFILLCOLOR accepts 'none' for drawing giant transparent shapes.~~ +* ~~Switch to new-style plugin~~ +* ~~Fix horrible formatting of manual~~ +* ~~editor MRU for picker http://forums.cacti.net/viewtopic.php?f=16&t=50649~~ +* if permissions in Cacti said Anyone *and* you, then no map images are shown +* Imagemap sortorder problem in editor. If you can see it, you can click it. +* ~~Update manual to at least include correct installation instructions!~~ + +Commit old enough to have old-style code layout in it(!) for reference: +https://github.com/howardjones/network-weathermap/tree/3d8ae103dcddd67b1a1c9db109f5985e496ecd77 + +### Small features + +* In-editor generator for switch port arrays http://forums.cacti.net/viewtopic.php?f=16&t=52618 + +--- +## TODO for 0.98a + +* Manual rewrite diff --git a/check-gdbug.php b/check-gdbug.php index bc90687c..9450875e 100644 --- a/check-gdbug.php +++ b/check-gdbug.php @@ -43,4 +43,3 @@ print "...nope. We got past the risky part, so that's good.\nYour GD library looks healthy.\n"; print ($env=='CLI'?"\n":"\n

"); -?> \ No newline at end of file diff --git a/check.php b/check.php index e1a6585a..a3f93efe 100755 --- a/check.php +++ b/check.php @@ -1,282 +1,282 @@ -0) && ($mem_allowed_int < 32000000)) { $mem_warning='You should increase this value to at least 32M. '; } - - // capture the PHP "General Info" table - ob_start(); - phpinfo(INFO_GENERAL); - $s = ob_get_contents(); - ob_end_clean(); - - // System Windows NT BLINKYZERO 6.0 build 6000 - // since preg_* are potentially missing, we'll have to do this without regexps. - foreach (explode("\n",$s) as $line) - { - $line = str_replace('','',$line); - $line = str_replace('','',$line); - $line = str_replace(' ',' => ',$line); - $sep_pos = strpos($line," => "); - if($sep_pos!==FALSE) - { - // by here, it should be a straight "name => value" - $name = substr($line,0,$sep_pos); - $value = substr($line,$sep_pos+4); - $php_general[$name] = $value; - } - } - - $ini_file = $php_general['Loaded Configuration File']; - $extra_ini = php_ini_scanned_files(); - if($extra_ini != '') - { $extra_ini = "The following additional ini files were read: $extra_ini"; } - else { $extra_ini = "There were no additional ini files, according to PHP."; } - - $gdversion = ""; - $gdbuiltin=FALSE; - $gdstring = ""; - if(function_exists('gd_info')) - { - $gdinfo = gd_info(); - $gdversion=$gdinfo['GD Version']; - if(strpos($gdversion,"bundled") !== FALSE) - { - $gdbuiltin=TRUE; - $gdstring="This PHP uses the 'bundled' GD library, which doesn't have alpha-blending bugs. That's good!\n"; - } - else - { - $gdstring="This PHP uses the system GD library, which MIGHT have alpha-blending bugs. Check that you have at least GD 2.0.34 installed, if you see problems with weathermap segfaulting.\n"; - $gdstring .= "You can test for this specific fault by running check-gdbug.php\n"; - } - } - else - { - $gdstring = "The gdinfo() function is not available, which means that either the GD extension is not available, not enabled, or not installed.\n"; - } - - if(isset($argv)) - { - $environment = "CLI"; - print "\n----------------------------------------------------\nWeathermap Pre-Install Checker\n\n"; - print "This script checks for some common problems with your PHP and server\nenvironment that may stop Weathermap or the Editor from working.\n\n"; - print "NOTE: You should run this script as both a web page AND from the\ncommand-line, as the environment can be different in each.\n"; - print "\nThis is the PHP version that is responsible for \n* creating maps from the Cacti poller\n* the command-line weathermap tool\n\n"; - print "PHP Basics\n----------\n"; - print wordwrap("This is PHP Version $php_version running on \"$php_os\" with a memory_limit of '$mem_allowed'. $mem_warning\n"); - print "\nThe php.ini file was $ini_file\n$extra_ini\n\n"; - print ""; - print "PHP Functions\n-------------\n"; - print "Some parts of Weathermap need special support in your PHP\ninstallation to work.\n\n"; - print wordwrap($gdstring)."\n"; - } - else - { - $environment = "web"; -?> - - - - Weathermap Pre-Install Checker - - - - -

Weathermap Pre-install Checker

- -

This page checks for some common problems with your PHP and server environment that may stop Weathermap or the Editor from working.

-

NOTE: You should run this script as a web page AND from the command-line, as the environment can be different in each.

-

PHP Basics

This is the PHP version that is responsible for

    -
  • The web-based editor
  • Building maps with Rebuild Now from Cacti
-

This is PHP Version running on "" with a memory_limit of ''.

-

The php.ini file was

-

-

PHP Functions

-

Some parts of Weathermap need special support in your PHP installation to work.

- - - array(TRUE,FALSE,'all of Weathermap','part of the GD library and the "gd" PHP extension'), - 'imagecreatetruecolor' => array(TRUE,FALSE,'all of Weathermap','part of the GD library and the "gd" PHP extension'), - 'imagealphablending' => array(TRUE,FALSE,'all of Weathermap','part of the GD library and the "gd" PHP extension'), - 'imageSaveAlpha' => array(TRUE,FALSE,'all of Weathermap','part of the GD library and the "gd" PHP extension'), - 'preg_match'=> array(TRUE,FALSE,'configuration reading','provided by the "pcre" extension') , - 'imagecreatefrompng' => array(TRUE,FALSE,'all of Weathermap','part of the GD library and the "gd" PHP extension'), - - 'imagecreatefromjpeg' => array(FALSE,FALSE,'JPEG input support for ICON and BACKGROUND','an optional part of the GD library and the "gd" PHP extension'), - 'imagecreatefromgif' => array(FALSE,FALSE,'GIF input support for ICON and BACKGROUND','an optional part of the GD library and the "gd" PHP extension'), - 'imagejpeg' => array(FALSE,FALSE,'JPEG output support','an optional part of the GD library and the "gd" PHP extension'), - 'imagegif' => array(FALSE,FALSE,'GIF output support','an optional part of the GD library and the "gd" PHP extension'), - # 'imagefilter' => array(FALSE, FALSE, 'colorizing icons','a special function of the PHP-supplied GD library ONLY (not the external GD library'.($gdbuiltin?'':' that you are using').')'), - 'imagecopyresampled' => array(FALSE,FALSE,'Thumbnail creation in the Cacti plugin','an optional part of the GD library and the "gd" PHP extension'), - 'imagettfbbox' => array(FALSE,FALSE,'TrueType font support','an optional part of the GD library and the "gd" PHP extension'), - 'memory_get_usage' => array(FALSE,TRUE,'memory-usage debugging','not supported on all PHP versions and platforms') - ); - - $results=array(); - - if($environment == 'CLI') - { - // Console_Getopt is only needed by the CLI tool. - $included = @include_once 'Console/Getopt.php'; - - if($included != 1) - { - $noncritical++; - print wordwrap("The Console_Getopt PEAR module is not available. The CLI weathermap tool will not run without it (that may not be a problem, if you only intend to use Cacti).\n\n"); - } - else - { - print wordwrap("The Console_Getopt PEAR module is available. That's good!\n\n"); - } - - } - - foreach ($functions as $function=>$details) - { - $exists = ""; $notes=""; - if($environment=='web') print ""; - - if(function_exists($function)) - { - $exists = "YES"; - if($environment=='web') print ""; - } - else - { - $exists = "NO"; - if($details[0]) - { - $notes .= "CRITICAL. "; - if($environment=='web') print ""; - } - if($environment=='web') print "\n"; - else - { - $wnotes = wordwrap($notes,50); - $lines = explode("\n",$wnotes); - $i=0; - foreach ($lines as $noteline) - { - if($i==0) - { - print sprintf("%20s %5s %-52s\n",$function,$exists,$noteline); - $i++; - } - else - { - print sprintf("%20s %5s %-52s\n","","",$noteline); - $i++; - } - } - } - } - - if($environment=='web') print "
$function()\"YES\"\"NO\"CRITICAL "; - $critical++; - } else { - if(!$details[1]) - { - $notes .= "Non-Critical. "; - if($environment=='web') print "\"NO\"non-critical "; - $noncritical++; - } - else - { - $notes .= "Minor. "; - if($environment=='web') print "\"NO\"minor "; - } - } - $explanation = "This is required for ".$details[2].". It is ".$details[3]."."; - $notes .= $explanation; - - if($environment=='web') print "$explanation
"; - - if( ($critical + $noncritical) > 0) - { - if($environment=='web') - { - print "

If these functions are not found, you may need to

  • check that the 'extension=' line for that extension is uncommented in your php.ini file (then restart your webserver), or
  • install the extension, if it isn't installed already
"; - } - else - { - print "\nIf these functions are not found, you may need to\n * check that the 'extension=' line for that extension is uncommented in\n your php.ini file (then restart your webserver), or\n * install the extension, if it isn't installed already\n\n"; - } - - print wordwrap("The details of how this is done will depend on your operating system, and on where you installed (or compiled) your PHP from originally. Usually, you would install an RPM, or other package on Linux systems, a port on *BSD, or a DLL on Windows. If you build PHP from source, you need to add extra options to the './configure' line. Consult your PHP documention for more information.\n"); - if($environment=='web') print "

"; - } - - if($environment=="CLI") print "\n---------------------------------------------------------------------\n"; - - if($critical>0) - { - if($environment=='web') print "
"; - print wordwrap("There are problems with your PHP or server environment that will stop Weathermap from working. You need to correct these issues if you wish to use Weathermap.\n"); - if($environment=='web') print "
"; - } - else - { - if($noncritical>0) - { - if($environment=='web') print "
"; - print wordwrap("Some features of Weathermap will not be available to you, due to lack of support in your PHP installation. You can still proceed with Weathermap though.\n"); - if($environment=='web') print "
"; - - } - else - { - if($environment=='web') print "
"; - print wordwrap("OK! Your PHP and server environment *seems* to have support for ALL of the Weathermap features. Make sure you have run this script BOTH as a web page and from the CLI to be sure, however.\n"); - if($environment=='web') print "
"; - - } - } - if($environment=='web') print ""; - - function return_bytes($val) { - $val = trim($val); - if($val != '') - { - $last = strtolower($val{strlen($val)-1}); - switch($last) { - // The 'G' modifier is available since PHP 5.1.0 - case 'g': - $val *= 1024; - case 'm': - $val *= 1024; - case 'k': - $val *= 1024; - } - } - else - { - $val = 0; - } - - return $val; -} -?> - - - +0) && ($mem_allowed_int < 32000000)) { $mem_warning='You should increase this value to at least 32M. '; } + + // capture the PHP "General Info" table + ob_start(); + phpinfo(INFO_GENERAL); + $s = ob_get_contents(); + ob_end_clean(); + + // System Windows NT BLINKYZERO 6.0 build 6000 + // since preg_* are potentially missing, we'll have to do this without regexps. + foreach (explode("\n",$s) as $line) + { + $line = str_replace('','',$line); + $line = str_replace('','',$line); + $line = str_replace(' ',' => ',$line); + $sep_pos = strpos($line," => "); + if($sep_pos!==FALSE) + { + // by here, it should be a straight "name => value" + $name = substr($line,0,$sep_pos); + $value = substr($line,$sep_pos+4); + $php_general[$name] = $value; + } + } + + $ini_file = $php_general['Loaded Configuration File']; + $extra_ini = php_ini_scanned_files(); + if($extra_ini != '') + { $extra_ini = "The following additional ini files were read: $extra_ini"; } + else { $extra_ini = "There were no additional ini files, according to PHP."; } + + $gdversion = ""; + $gdbuiltin=FALSE; + $gdstring = ""; + if(function_exists('gd_info')) + { + $gdinfo = gd_info(); + $gdversion=$gdinfo['GD Version']; + if(strpos($gdversion,"bundled") !== FALSE) + { + $gdbuiltin=TRUE; + $gdstring="This PHP uses the 'bundled' GD library, which doesn't have alpha-blending bugs. That's good!\n"; + } + else + { + $gdstring="This PHP uses the system GD library, which MIGHT have alpha-blending bugs. Check that you have at least GD 2.0.34 installed, if you see problems with weathermap segfaulting.\n"; + $gdstring .= "You can test for this specific fault by running check-gdbug.php\n"; + } + } + else + { + $gdstring = "The gdinfo() function is not available, which means that either the GD extension is not available, not enabled, or not installed.\n"; + } + + if(isset($argv)) + { + $environment = "CLI"; + print "\n----------------------------------------------------\nWeathermap Pre-Install Checker\n\n"; + print "This script checks for some common problems with your PHP and server\nenvironment that may stop Weathermap or the Editor from working.\n\n"; + print "NOTE: You should run this script as both a web page AND from the\ncommand-line, as the environment can be different in each.\n"; + print "\nThis is the PHP version that is responsible for \n* creating maps from the Cacti poller\n* the command-line weathermap tool\n\n"; + print "PHP Basics\n----------\n"; + print wordwrap("This is PHP Version $php_version running on \"$php_os\" with a memory_limit of '$mem_allowed'. $mem_warning\n"); + print "\nThe php.ini file was $ini_file\n$extra_ini\n\n"; + print ""; + print "PHP Functions\n-------------\n"; + print "Some parts of Weathermap need special support in your PHP\ninstallation to work.\n\n"; + print wordwrap($gdstring)."\n"; + } + else + { + $environment = "web"; +?> + + + + Weathermap Pre-Install Checker + + + + +

Weathermap Pre-install Checker

+ +

This page checks for some common problems with your PHP and server environment that may stop Weathermap or the Editor from working.

+

NOTE: You should run this script as a web page AND from the command-line, as the environment can be different in each.

+

PHP Basics

This is the PHP version that is responsible for

    +
  • The web-based editor
  • Building maps with Rebuild Now from Cacti
+

This is PHP Version running on "" with a memory_limit of ''.

+

The php.ini file was

+

+

PHP Functions

+

Some parts of Weathermap need special support in your PHP installation to work.

+ + + array(TRUE,FALSE,'all of Weathermap','part of the GD library and the "gd" PHP extension'), + 'imagecreatetruecolor' => array(TRUE,FALSE,'all of Weathermap','part of the GD library and the "gd" PHP extension'), + 'imagealphablending' => array(TRUE,FALSE,'all of Weathermap','part of the GD library and the "gd" PHP extension'), + 'imageSaveAlpha' => array(TRUE,FALSE,'all of Weathermap','part of the GD library and the "gd" PHP extension'), + 'preg_match'=> array(TRUE,FALSE,'configuration reading','provided by the "pcre" extension') , + 'imagecreatefrompng' => array(TRUE,FALSE,'all of Weathermap','part of the GD library and the "gd" PHP extension'), + + 'imagecreatefromjpeg' => array(FALSE,FALSE,'JPEG input support for ICON and BACKGROUND','an optional part of the GD library and the "gd" PHP extension'), + 'imagecreatefromgif' => array(FALSE,FALSE,'GIF input support for ICON and BACKGROUND','an optional part of the GD library and the "gd" PHP extension'), + 'imagejpeg' => array(FALSE,FALSE,'JPEG output support','an optional part of the GD library and the "gd" PHP extension'), + 'imagegif' => array(FALSE,FALSE,'GIF output support','an optional part of the GD library and the "gd" PHP extension'), + # 'imagefilter' => array(FALSE, FALSE, 'colorizing icons','a special function of the PHP-supplied GD library ONLY (not the external GD library'.($gdbuiltin?'':' that you are using').')'), + 'imagecopyresampled' => array(FALSE,FALSE,'Thumbnail creation in the Cacti plugin','an optional part of the GD library and the "gd" PHP extension'), + 'imagettfbbox' => array(FALSE,FALSE,'TrueType font support','an optional part of the GD library and the "gd" PHP extension'), + 'memory_get_usage' => array(FALSE,TRUE,'memory-usage debugging','not supported on all PHP versions and platforms') + ); + + $results=array(); + + if($environment == 'CLI') + { + // Console_Getopt is only needed by the CLI tool. + $included = @include_once 'Console/Getopt.php'; + + if($included != 1) + { + $noncritical++; + print wordwrap("The Console_Getopt PEAR module is not available. The CLI weathermap tool will not run without it (that may not be a problem, if you only intend to use Cacti).\n\n"); + } + else + { + print wordwrap("The Console_Getopt PEAR module is available. That's good!\n\n"); + } + + } + + foreach ($functions as $function=>$details) + { + $exists = ""; $notes=""; + if($environment=='web') print ""; + + if(function_exists($function)) + { + $exists = "YES"; + if($environment=='web') print ""; + } + else + { + $exists = "NO"; + if($details[0]) + { + $notes .= "CRITICAL. "; + if($environment=='web') print ""; + } + if($environment=='web') print "\n"; + else + { + $wnotes = wordwrap($notes,50); + $lines = explode("\n",$wnotes); + $i=0; + foreach ($lines as $noteline) + { + if($i==0) + { + print sprintf("%20s %5s %-52s\n",$function,$exists,$noteline); + $i++; + } + else + { + print sprintf("%20s %5s %-52s\n","","",$noteline); + $i++; + } + } + } + } + + if($environment=='web') print "
$function()\"YES\"\"NO\"CRITICAL "; + $critical++; + } else { + if(!$details[1]) + { + $notes .= "Non-Critical. "; + if($environment=='web') print "\"NO\"non-critical "; + $noncritical++; + } + else + { + $notes .= "Minor. "; + if($environment=='web') print "\"NO\"minor "; + } + } + $explanation = "This is required for ".$details[2].". It is ".$details[3]."."; + $notes .= $explanation; + + if($environment=='web') print "$explanation
"; + + if( ($critical + $noncritical) > 0) + { + if($environment=='web') + { + print "

If these functions are not found, you may need to

  • check that the 'extension=' line for that extension is uncommented in your php.ini file (then restart your webserver), or
  • install the extension, if it isn't installed already
On Debian/Ubuntu systems, you may also need to use the php5enmod command to enable the extension.

"; + } + else + { + print "\nIf these functions are not found, you may need to\n * check that the 'extension=' line for that extension is uncommented in\n your php.ini file (then restart your webserver), or\n * install the extension, if it isn't installed already\n\n"; + } + + print wordwrap("The details of how this is done will depend on your operating system, and on where you installed (or compiled) your PHP from originally. Usually, you would install an RPM, or other package on Linux systems, a port on *BSD, or a DLL on Windows. If you build PHP from source, you need to add extra options to the './configure' line. Consult your PHP documention for more information.\n"); + if($environment=='web') print "

"; + } + + if($environment=="CLI") print "\n---------------------------------------------------------------------\n"; + + if($critical>0) + { + if($environment=='web') print "
"; + print wordwrap("There are problems with your PHP or server environment that will stop Weathermap from working. You need to correct these issues if you wish to use Weathermap.\n"); + if($environment=='web') print "
"; + } + else + { + if($noncritical>0) + { + if($environment=='web') print "
"; + print wordwrap("Some features of Weathermap will not be available to you, due to lack of support in your PHP installation. You can still proceed with Weathermap though.\n"); + if($environment=='web') print "
"; + + } + else + { + if($environment=='web') print "
"; + print wordwrap("OK! Your PHP and server environment *seems* to have support for ALL of the Weathermap features. Make sure you have run this script BOTH as a web page and from the CLI to be sure, however.\n"); + if($environment=='web') print "
"; + + } + } + if($environment=='web') print ""; + + function return_bytes($val) { + $val = trim($val); + if($val != '') + { + $last = strtolower($val{strlen($val)-1}); + switch($last) { + // The 'G' modifier is available since PHP 5.1.0 + case 'g': + $val *= 1024; + case 'm': + $val *= 1024; + case 'k': + $val *= 1024; + } + } + else + { + $val = 0; + } + + return $val; +} +?> + + + diff --git a/config.inc.php b/config.inc.php index d2773150..f391c4fe 100644 --- a/config.inc.php +++ b/config.inc.php @@ -9,6 +9,8 @@ $librenms_url = '/'; $ignore_librenms=FALSE; $configerror = ''; +// Absolute route for the rrd directory +$rrd_default_path1 = $librenms_base . '/'.'rrd'; $config_loaded = @include_once 'editor-config.php'; diff --git a/data-pick.php b/data-pick.php index b995691d..3ff60f32 100755 --- a/data-pick.php +++ b/data-pick.php @@ -113,7 +113,7 @@ function update_source_step2(graphid) ?> - + +
- - + + - + - - - - - - - - - - - - + + + + + + + + + + + + - - - + + + - - - - - - - - - - + + + + + + + + + + - - - + + + - - + + - - - -
Network Map created with PHP Network Weathermap v0.97c \ No newline at end of file + + + +
Network Map created with PHP Network Weathermap v0.98a \ No newline at end of file diff --git a/docs/example/example.png b/docs/example/example.png index 5cbbc131..15ed160a 100644 Binary files a/docs/example/example.png and b/docs/example/example.png differ diff --git a/docs/example/overlib.js b/docs/example/overlib.js index 217f4b87..9447c267 100644 --- a/docs/example/overlib.js +++ b/docs/example/overlib.js @@ -1,1491 +1,1491 @@ -//\///// -//\ overLIB 4.21 - You may not remove or change this notice. -//\ Copyright Erik Bosrup 1998-2004. All rights reserved. -//\ -//\ Contributors are listed on the homepage. -//\ This file might be old, always check for the latest version at: -//\ http://www.bosrup.com/web/overlib/ -//\ -//\ Please read the license agreement (available through the link above) -//\ before using overLIB. Direct any licensing questions to erik@bosrup.com. -//\ -//\ Do not sell this as your own work or remove this copyright notice. -//\ For full details on copying or changing this script please read the -//\ license agreement at the link above. Please give credit on sites that -//\ use overLIB and submit changes of the script so other people can use -//\ them as well. -// $Revision: 1.119 $ $Date: 2005/07/02 23:41:44 $ -//\///// -//\mini - -//////// -// PRE-INIT -// Ignore these lines, configuration is below. -//////// -var olLoaded = 0;var pmStart = 10000000; var pmUpper = 10001000; var pmCount = pmStart+1; var pmt=''; var pms = new Array(); var olInfo = new Info('4.21', 1); -var FREPLACE = 0; var FBEFORE = 1; var FAFTER = 2; var FALTERNATE = 3; var FCHAIN=4; -var olHideForm=0; // parameter for hiding SELECT and ActiveX elements in IE5.5+ -var olHautoFlag = 0; // flags for over-riding VAUTO and HAUTO if corresponding -var olVautoFlag = 0; // positioning commands are used on the command line -var hookPts = new Array(), postParse = new Array(), cmdLine = new Array(), runTime = new Array(); -// for plugins -registerCommands('donothing,inarray,caparray,sticky,background,noclose,caption,left,right,center,offsetx,offsety,fgcolor,bgcolor,textcolor,capcolor,closecolor,width,border,cellpad,status,autostatus,autostatuscap,height,closetext,snapx,snapy,fixx,fixy,relx,rely,fgbackground,bgbackground,padx,pady,fullhtml,above,below,capicon,textfont,captionfont,closefont,textsize,captionsize,closesize,timeout,function,delay,hauto,vauto,closeclick,wrap,followmouse,mouseoff,closetitle,cssoff,compatmode,cssclass,fgclass,bgclass,textfontclass,captionfontclass,closefontclass'); - -//////// -// DEFAULT CONFIGURATION -// Settings you want everywhere are set here. All of this can also be -// changed on your html page or through an overLIB call. -//////// -if (typeof ol_fgcolor=='undefined') var ol_fgcolor="#CCCCFF"; -if (typeof ol_bgcolor=='undefined') var ol_bgcolor="#333399"; -if (typeof ol_textcolor=='undefined') var ol_textcolor="#000000"; -if (typeof ol_capcolor=='undefined') var ol_capcolor="#FFFFFF"; -if (typeof ol_closecolor=='undefined') var ol_closecolor="#9999FF"; -if (typeof ol_textfont=='undefined') var ol_textfont="Verdana,Arial,Helvetica"; -if (typeof ol_captionfont=='undefined') var ol_captionfont="Verdana,Arial,Helvetica"; -if (typeof ol_closefont=='undefined') var ol_closefont="Verdana,Arial,Helvetica"; -if (typeof ol_textsize=='undefined') var ol_textsize="1"; -if (typeof ol_captionsize=='undefined') var ol_captionsize="1"; -if (typeof ol_closesize=='undefined') var ol_closesize="1"; -if (typeof ol_width=='undefined') var ol_width="200"; -if (typeof ol_border=='undefined') var ol_border="1"; -if (typeof ol_cellpad=='undefined') var ol_cellpad=2; -if (typeof ol_offsetx=='undefined') var ol_offsetx=10; -if (typeof ol_offsety=='undefined') var ol_offsety=10; -if (typeof ol_text=='undefined') var ol_text="Default Text"; -if (typeof ol_cap=='undefined') var ol_cap=""; -if (typeof ol_sticky=='undefined') var ol_sticky=0; -if (typeof ol_background=='undefined') var ol_background=""; -if (typeof ol_close=='undefined') var ol_close="Close"; -if (typeof ol_hpos=='undefined') var ol_hpos=RIGHT; -if (typeof ol_status=='undefined') var ol_status=""; -if (typeof ol_autostatus=='undefined') var ol_autostatus=0; -if (typeof ol_height=='undefined') var ol_height=-1; -if (typeof ol_snapx=='undefined') var ol_snapx=0; -if (typeof ol_snapy=='undefined') var ol_snapy=0; -if (typeof ol_fixx=='undefined') var ol_fixx=-1; -if (typeof ol_fixy=='undefined') var ol_fixy=-1; -if (typeof ol_relx=='undefined') var ol_relx=null; -if (typeof ol_rely=='undefined') var ol_rely=null; -if (typeof ol_fgbackground=='undefined') var ol_fgbackground=""; -if (typeof ol_bgbackground=='undefined') var ol_bgbackground=""; -if (typeof ol_padxl=='undefined') var ol_padxl=1; -if (typeof ol_padxr=='undefined') var ol_padxr=1; -if (typeof ol_padyt=='undefined') var ol_padyt=1; -if (typeof ol_padyb=='undefined') var ol_padyb=1; -if (typeof ol_fullhtml=='undefined') var ol_fullhtml=0; -if (typeof ol_vpos=='undefined') var ol_vpos=BELOW; -if (typeof ol_aboveheight=='undefined') var ol_aboveheight=0; -if (typeof ol_capicon=='undefined') var ol_capicon=""; -if (typeof ol_frame=='undefined') var ol_frame=self; -if (typeof ol_timeout=='undefined') var ol_timeout=0; -if (typeof ol_function=='undefined') var ol_function=null; -if (typeof ol_delay=='undefined') var ol_delay=0; -if (typeof ol_hauto=='undefined') var ol_hauto=0; -if (typeof ol_vauto=='undefined') var ol_vauto=0; -if (typeof ol_closeclick=='undefined') var ol_closeclick=0; -if (typeof ol_wrap=='undefined') var ol_wrap=0; -if (typeof ol_followmouse=='undefined') var ol_followmouse=1; -if (typeof ol_mouseoff=='undefined') var ol_mouseoff=0; -if (typeof ol_closetitle=='undefined') var ol_closetitle='Close'; -if (typeof ol_compatmode=='undefined') var ol_compatmode=0; -if (typeof ol_css=='undefined') var ol_css=CSSOFF; -if (typeof ol_fgclass=='undefined') var ol_fgclass=""; -if (typeof ol_bgclass=='undefined') var ol_bgclass=""; -if (typeof ol_textfontclass=='undefined') var ol_textfontclass=""; -if (typeof ol_captionfontclass=='undefined') var ol_captionfontclass=""; -if (typeof ol_closefontclass=='undefined') var ol_closefontclass=""; - -//////// -// ARRAY CONFIGURATION -//////// - -// You can use these arrays to store popup text here instead of in the html. -if (typeof ol_texts=='undefined') var ol_texts = new Array("Text 0", "Text 1"); -if (typeof ol_caps=='undefined') var ol_caps = new Array("Caption 0", "Caption 1"); - -//////// -// END OF CONFIGURATION -// Don't change anything below this line, all configuration is above. -//////// - - - - - -//////// -// INIT -//////// -// Runtime variables init. Don't change for config! -var o3_text=""; -var o3_cap=""; -var o3_sticky=0; -var o3_background=""; -var o3_close="Close"; -var o3_hpos=RIGHT; -var o3_offsetx=2; -var o3_offsety=2; -var o3_fgcolor=""; -var o3_bgcolor=""; -var o3_textcolor=""; -var o3_capcolor=""; -var o3_closecolor=""; -var o3_width=100; -var o3_border=1; -var o3_cellpad=2; -var o3_status=""; -var o3_autostatus=0; -var o3_height=-1; -var o3_snapx=0; -var o3_snapy=0; -var o3_fixx=-1; -var o3_fixy=-1; -var o3_relx=null; -var o3_rely=null; -var o3_fgbackground=""; -var o3_bgbackground=""; -var o3_padxl=0; -var o3_padxr=0; -var o3_padyt=0; -var o3_padyb=0; -var o3_fullhtml=0; -var o3_vpos=BELOW; -var o3_aboveheight=0; -var o3_capicon=""; -var o3_textfont="Verdana,Arial,Helvetica"; -var o3_captionfont="Verdana,Arial,Helvetica"; -var o3_closefont="Verdana,Arial,Helvetica"; -var o3_textsize="1"; -var o3_captionsize="1"; -var o3_closesize="1"; -var o3_frame=self; -var o3_timeout=0; -var o3_timerid=0; -var o3_allowmove=0; -var o3_function=null; -var o3_delay=0; -var o3_delayid=0; -var o3_hauto=0; -var o3_vauto=0; -var o3_closeclick=0; -var o3_wrap=0; -var o3_followmouse=1; -var o3_mouseoff=0; -var o3_closetitle=''; -var o3_compatmode=0; -var o3_css=CSSOFF; -var o3_fgclass=""; -var o3_bgclass=""; -var o3_textfontclass=""; -var o3_captionfontclass=""; -var o3_closefontclass=""; - -// Display state variables -var o3_x = 0; -var o3_y = 0; -var o3_showingsticky = 0; -var o3_removecounter = 0; - -// Our layer -var over = null; -var fnRef, hoveringSwitch = false; -var olHideDelay; - -// Decide browser version -var isMac = (navigator.userAgent.indexOf("Mac") != -1); -var olOp = (navigator.userAgent.toLowerCase().indexOf('opera') > -1 && document.createTextNode); // Opera 7 -var olNs4 = (navigator.appName=='Netscape' && parseInt(navigator.appVersion) == 4); -var olNs6 = (document.getElementById) ? true : false; -var olKq = (olNs6 && /konqueror/i.test(navigator.userAgent)); -var olIe4 = (document.all) ? true : false; -var olIe5 = false; -var olIe55 = false; // Added additional variable to identify IE5.5+ -var docRoot = 'document.body'; - -// Resize fix for NS4.x to keep track of layer -if (olNs4) { - var oW = window.innerWidth; - var oH = window.innerHeight; - window.onresize = function() { if (oW != window.innerWidth || oH != window.innerHeight) location.reload(); } -} - -// Microsoft Stupidity Check(tm). -if (olIe4) { - var agent = navigator.userAgent; - if (/MSIE/.test(agent)) { - var versNum = parseFloat(agent.match(/MSIE[ ](\d\.\d+)\.*/i)[1]); - if (versNum >= 5){ - olIe5=true; - olIe55=(versNum>=5.5&&!olOp) ? true : false; - if (olNs6) olNs6=false; - } - } - if (olNs6) olIe4 = false; -} - -// Check for compatability mode. -if (document.compatMode && document.compatMode == 'CSS1Compat') { - docRoot= ((olIe4 && !olOp) ? 'document.documentElement' : docRoot); -} - -// Add window onload handlers to indicate when all modules have been loaded -// For Netscape 6+ and Mozilla, uses addEventListener method on the window object -// For IE it uses the attachEvent method of the window object and for Netscape 4.x -// it sets the window.onload handler to the OLonload_handler function for Bubbling -if(window.addEventListener) window.addEventListener("load",OLonLoad_handler,false); -else if (window.attachEvent) window.attachEvent("onload",OLonLoad_handler); - -var capExtent; - -//////// -// PUBLIC FUNCTIONS -//////// - -// overlib(arg0,...,argN) -// Loads parameters into global runtime variables. -function overlib() { - if (!olLoaded || isExclusive(overlib.arguments)) return true; - if (olCheckMouseCapture) olMouseCapture(); - if (over) { - over = (typeof over.id != 'string') ? o3_frame.document.all['overDiv'] : over; - cClick(); - } - - // Load defaults to runtime. - olHideDelay=0; - o3_text=ol_text; - o3_cap=ol_cap; - o3_sticky=ol_sticky; - o3_background=ol_background; - o3_close=ol_close; - o3_hpos=ol_hpos; - o3_offsetx=ol_offsetx; - o3_offsety=ol_offsety; - o3_fgcolor=ol_fgcolor; - o3_bgcolor=ol_bgcolor; - o3_textcolor=ol_textcolor; - o3_capcolor=ol_capcolor; - o3_closecolor=ol_closecolor; - o3_width=ol_width; - o3_border=ol_border; - o3_cellpad=ol_cellpad; - o3_status=ol_status; - o3_autostatus=ol_autostatus; - o3_height=ol_height; - o3_snapx=ol_snapx; - o3_snapy=ol_snapy; - o3_fixx=ol_fixx; - o3_fixy=ol_fixy; - o3_relx=ol_relx; - o3_rely=ol_rely; - o3_fgbackground=ol_fgbackground; - o3_bgbackground=ol_bgbackground; - o3_padxl=ol_padxl; - o3_padxr=ol_padxr; - o3_padyt=ol_padyt; - o3_padyb=ol_padyb; - o3_fullhtml=ol_fullhtml; - o3_vpos=ol_vpos; - o3_aboveheight=ol_aboveheight; - o3_capicon=ol_capicon; - o3_textfont=ol_textfont; - o3_captionfont=ol_captionfont; - o3_closefont=ol_closefont; - o3_textsize=ol_textsize; - o3_captionsize=ol_captionsize; - o3_closesize=ol_closesize; - o3_timeout=ol_timeout; - o3_function=ol_function; - o3_delay=ol_delay; - o3_hauto=ol_hauto; - o3_vauto=ol_vauto; - o3_closeclick=ol_closeclick; - o3_wrap=ol_wrap; - o3_followmouse=ol_followmouse; - o3_mouseoff=ol_mouseoff; - o3_closetitle=ol_closetitle; - o3_css=ol_css; - o3_compatmode=ol_compatmode; - o3_fgclass=ol_fgclass; - o3_bgclass=ol_bgclass; - o3_textfontclass=ol_textfontclass; - o3_captionfontclass=ol_captionfontclass; - o3_closefontclass=ol_closefontclass; - - setRunTimeVariables(); - - fnRef = ''; - - // Special for frame support, over must be reset... - o3_frame = ol_frame; - - if(!(over=createDivContainer())) return false; - - parseTokens('o3_', overlib.arguments); - if (!postParseChecks()) return false; - - if (o3_delay == 0) { - return runHook("olMain", FREPLACE); - } else { - o3_delayid = setTimeout("runHook('olMain', FREPLACE)", o3_delay); - return false; - } -} - -// Clears popups if appropriate -function nd(time) { - if (olLoaded && !isExclusive()) { - hideDelay(time); // delay popup close if time specified - - if (o3_removecounter >= 1) { o3_showingsticky = 0 } - - if (o3_showingsticky == 0) { - o3_allowmove = 0; - if (over != null && o3_timerid == 0) runHook("hideObject", FREPLACE, over); - } else { - o3_removecounter++; - } - } - - return true; -} - -// The Close onMouseOver function for stickies -function cClick() { - if (olLoaded) { - runHook("hideObject", FREPLACE, over); - o3_showingsticky = 0; - } - return false; -} - -// Method for setting page specific defaults. -function overlib_pagedefaults() { - parseTokens('ol_', overlib_pagedefaults.arguments); -} - - -//////// -// OVERLIB MAIN FUNCTION -//////// - -// This function decides what it is we want to display and how we want it done. -function olMain() { - var layerhtml, styleType; - runHook("olMain", FBEFORE); - - if (o3_background!="" || o3_fullhtml) { - // Use background instead of box. - layerhtml = runHook('ol_content_background', FALTERNATE, o3_css, o3_text, o3_background, o3_fullhtml); - } else { - // They want a popup box. - styleType = (pms[o3_css-1-pmStart] == "cssoff" || pms[o3_css-1-pmStart] == "cssclass"); - - // Prepare popup background - if (o3_fgbackground != "") o3_fgbackground = "background=\""+o3_fgbackground+"\""; - if (o3_bgbackground != "") o3_bgbackground = (styleType ? "background=\""+o3_bgbackground+"\"" : o3_bgbackground); - - // Prepare popup colors - if (o3_fgcolor != "") o3_fgcolor = (styleType ? "bgcolor=\""+o3_fgcolor+"\"" : o3_fgcolor); - if (o3_bgcolor != "") o3_bgcolor = (styleType ? "bgcolor=\""+o3_bgcolor+"\"" : o3_bgcolor); - - // Prepare popup height - if (o3_height > 0) o3_height = (styleType ? "height=\""+o3_height+"\"" : o3_height); - else o3_height = ""; - - // Decide which kinda box. - if (o3_cap=="") { - // Plain - layerhtml = runHook('ol_content_simple', FALTERNATE, o3_css, o3_text); - } else { - // With caption - if (o3_sticky) { - // Show close text - layerhtml = runHook('ol_content_caption', FALTERNATE, o3_css, o3_text, o3_cap, o3_close); - } else { - // No close text - layerhtml = runHook('ol_content_caption', FALTERNATE, o3_css, o3_text, o3_cap, ""); - } - } - } - - // We want it to stick! - if (o3_sticky) { - if (o3_timerid > 0) { - clearTimeout(o3_timerid); - o3_timerid = 0; - } - o3_showingsticky = 1; - o3_removecounter = 0; - } - - // Created a separate routine to generate the popup to make it easier - // to implement a plugin capability - if (!runHook("createPopup", FREPLACE, layerhtml)) return false; - - // Prepare status bar - if (o3_autostatus > 0) { - o3_status = o3_text; - if (o3_autostatus > 1) o3_status = o3_cap; - } - - // When placing the layer the first time, even stickies may be moved. - o3_allowmove = 0; - - // Initiate a timer for timeout - if (o3_timeout > 0) { - if (o3_timerid > 0) clearTimeout(o3_timerid); - o3_timerid = setTimeout("cClick()", o3_timeout); - } - - // Show layer - runHook("disp", FREPLACE, o3_status); - runHook("olMain", FAFTER); - - return (olOp && event && event.type == 'mouseover' && !o3_status) ? '' : (o3_status != ''); -} - -//////// -// LAYER GENERATION FUNCTIONS -//////// -// These functions just handle popup content with tags that should adhere to the W3C standards specification. - -// Makes simple table without caption -function ol_content_simple(text) { - var cpIsMultiple = /,/.test(o3_cellpad); - var txt = '
' : ((!olNs4&&cpIsMultiple) ? ' style="'+setCellPadStr(o3_cellpad)+'">' : '>'))+(o3_textfontclass ? '' : wrapStr(0,o3_textsize,'text'))+text+(o3_textfontclass ? '' : wrapStr(1,o3_textsize))+'
'; - - set_background(""); - return txt; -} - -// Makes table with caption and optional close link -function ol_content_caption(text,title,close) { - var nameId, txt, cpIsMultiple = /,/.test(o3_cellpad); - var closing, closeevent; - - closing = ""; - closeevent = "onmouseover"; - if (o3_closeclick == 1) closeevent = (o3_closetitle ? "title='" + o3_closetitle +"'" : "") + " onclick"; - if (o3_capicon != "") { - nameId = ' hspace = \"5\"'+' align = \"middle\" alt = \"\"'; - if (typeof o3_dragimg != 'undefined' && o3_dragimg) nameId =' hspace=\"5\"'+' name=\"'+o3_dragimg+'\" id=\"'+o3_dragimg+'\" align=\"middle\" alt=\"Drag Enabled\" title=\"Drag Enabled\"'; - o3_capicon = ''; - } - - if (close != "") - closing = ''+(o3_closefontclass ? '' : wrapStr(0,o3_closesize,'close'))+close+(o3_closefontclass ? '' : wrapStr(1,o3_closesize,'close'))+''; - txt = '
' : '>')+(o3_captionfontclass ? '' : ''+wrapStr(0,o3_captionsize,'caption'))+o3_capicon+title+(o3_captionfontclass ? '' : wrapStr(1,o3_captionsize)+'')+''+closing+'
' :((!olNs4&&cpIsMultiple) ? ' style="'+setCellPadStr(o3_cellpad)+'">' : '>'))+(o3_textfontclass ? '' : wrapStr(0,o3_textsize,'text'))+text+(o3_textfontclass ? '' : wrapStr(1,o3_textsize)) + '
'; - - set_background(""); - return txt; -} - -// Sets the background picture,padding and lots more. :) -function ol_content_background(text,picture,hasfullhtml) { - if (hasfullhtml) { - txt=text; - } else { - txt='
'+(o3_textfontclass ? '' : wrapStr(0,o3_textsize,'text'))+text+(o3_textfontclass ? '' : wrapStr(1,o3_textsize))+'
'; - } - - set_background(picture); - return txt; -} - -// Loads a picture into the div. -function set_background(pic) { - if (pic == "") { - if (olNs4) { - over.background.src = null; - } else if (over.style) { - over.style.backgroundImage = "none"; - } - } else { - if (olNs4) { - over.background.src = pic; - } else if (over.style) { - over.style.width=o3_width + 'px'; - over.style.backgroundImage = "url("+pic+")"; - } - } -} - -//////// -// HANDLING FUNCTIONS -//////// -var olShowId=-1; - -// Displays the popup -function disp(statustext) { - runHook("disp", FBEFORE); - - if (o3_allowmove == 0) { - runHook("placeLayer", FREPLACE); - (olNs6&&olShowId<0) ? olShowId=setTimeout("runHook('showObject', FREPLACE, over)", 1) : runHook("showObject", FREPLACE, over); - o3_allowmove = (o3_sticky || o3_followmouse==0) ? 0 : 1; - } - - runHook("disp", FAFTER); - - if (statustext != "") self.status = statustext; -} - -// Creates the actual popup structure -function createPopup(lyrContent){ - runHook("createPopup", FBEFORE); - - if (o3_wrap) { - var wd,ww,theObj = (olNs4 ? over : over.style); - theObj.top = theObj.left = ((olIe4&&!olOp) ? 0 : -10000) + (!olNs4 ? 'px' : 0); - layerWrite(lyrContent); - wd = (olNs4 ? over.clip.width : over.offsetWidth); - if (wd > (ww=windowWidth())) { - lyrContent=lyrContent.replace(/\ /g, ' '); - o3_width=ww; - o3_wrap=0; - } - } - - layerWrite(lyrContent); - - // Have to set o3_width for placeLayer() routine if o3_wrap is turned on - if (o3_wrap) o3_width=(olNs4 ? over.clip.width : over.offsetWidth); - - runHook("createPopup", FAFTER, lyrContent); - - return true; -} - -// Decides where we want the popup. -function placeLayer() { - var placeX, placeY, widthFix = 0; - - // HORIZONTAL PLACEMENT, re-arranged to work in Safari - if (o3_frame.innerWidth) widthFix=18; - iwidth = windowWidth(); - - // Horizontal scroll offset - winoffset=(olIe4) ? eval('o3_frame.'+docRoot+'.scrollLeft') : o3_frame.pageXOffset; - - placeX = runHook('horizontalPlacement',FCHAIN,iwidth,winoffset,widthFix); - - // VERTICAL PLACEMENT, re-arranged to work in Safari - if (o3_frame.innerHeight) { - iheight=o3_frame.innerHeight; - } else if (eval('o3_frame.'+docRoot)&&eval("typeof o3_frame."+docRoot+".clientHeight=='number'")&&eval('o3_frame.'+docRoot+'.clientHeight')) { - iheight=eval('o3_frame.'+docRoot+'.clientHeight'); - } - - // Vertical scroll offset - scrolloffset=(olIe4) ? eval('o3_frame.'+docRoot+'.scrollTop') : o3_frame.pageYOffset; - placeY = runHook('verticalPlacement',FCHAIN,iheight,scrolloffset); - - // Actually move the object. - repositionTo(over, placeX, placeY); -} - -// Moves the layer -function olMouseMove(e) { - var e = (e) ? e : event; - - if (e.pageX) { - o3_x = e.pageX; - o3_y = e.pageY; - } else if (e.clientX) { - o3_x = eval('e.clientX+o3_frame.'+docRoot+'.scrollLeft'); - o3_y = eval('e.clientY+o3_frame.'+docRoot+'.scrollTop'); - } - - if (o3_allowmove == 1) runHook("placeLayer", FREPLACE); - - // MouseOut handler - if (hoveringSwitch && !olNs4 && runHook("cursorOff", FREPLACE)) { - (olHideDelay ? hideDelay(olHideDelay) : cClick()); - hoveringSwitch = !hoveringSwitch; - } -} - -// Fake function for 3.0 users. -function no_overlib() { return ver3fix; } - -// Capture the mouse and chain other scripts. -function olMouseCapture() { - capExtent = document; - var fN, str = '', l, k, f, wMv, sS, mseHandler = olMouseMove; - var re = /function[ ]*(\w*)\(/; - - wMv = (!olIe4 && window.onmousemove); - if (document.onmousemove || wMv) { - if (wMv) capExtent = window; - f = capExtent.onmousemove.toString(); - fN = f.match(re); - if (fN == null) { - str = f+'(e); '; - } else if (fN[1] == 'anonymous' || fN[1] == 'olMouseMove' || (wMv && fN[1] == 'onmousemove')) { - if (!olOp && wMv) { - l = f.indexOf('{')+1; - k = f.lastIndexOf('}'); - sS = f.substring(l,k); - if ((l = sS.indexOf('(')) != -1) { - sS = sS.substring(0,l).replace(/^\s+/,'').replace(/\s+$/,''); - if (eval("typeof " + sS + " == 'undefined'")) window.onmousemove = null; - else str = sS + '(e);'; - } - } - if (!str) { - olCheckMouseCapture = false; - return; - } - } else { - if (fN[1]) str = fN[1]+'(e); '; - else { - l = f.indexOf('{')+1; - k = f.lastIndexOf('}'); - str = f.substring(l,k) + '\n'; - } - } - str += 'olMouseMove(e); '; - mseHandler = new Function('e', str); - } - - capExtent.onmousemove = mseHandler; - if (olNs4) capExtent.captureEvents(Event.MOUSEMOVE); -} - -//////// -// PARSING FUNCTIONS -//////// - -// Does the actual command parsing. -function parseTokens(pf, ar) { - // What the next argument is expected to be. - var v, i, mode=-1, par = (pf != 'ol_'); - var fnMark = (par && !ar.length ? 1 : 0); - - for (i = 0; i < ar.length; i++) { - if (mode < 0) { - // Arg is maintext,unless its a number between pmStart and pmUpper - // then its a command. - if (typeof ar[i] == 'number' && ar[i] > pmStart && ar[i] < pmUpper) { - fnMark = (par ? 1 : 0); - i--; // backup one so that the next block can parse it - } else { - switch(pf) { - case 'ol_': - ol_text = ar[i].toString(); - break; - default: - o3_text=ar[i].toString(); - } - } - mode = 0; - } else { - // Note: NS4 doesn't like switch cases with vars. - if (ar[i] >= pmCount || ar[i]==DONOTHING) { continue; } - if (ar[i]==INARRAY) { fnMark = 0; eval(pf+'text=ol_texts['+ar[++i]+'].toString()'); continue; } - if (ar[i]==CAPARRAY) { eval(pf+'cap=ol_caps['+ar[++i]+'].toString()'); continue; } - if (ar[i]==STICKY) { if (pf!='ol_') eval(pf+'sticky=1'); continue; } - if (ar[i]==BACKGROUND) { eval(pf+'background="'+ar[++i]+'"'); continue; } - if (ar[i]==NOCLOSE) { if (pf!='ol_') opt_NOCLOSE(); continue; } - if (ar[i]==CAPTION) { eval(pf+"cap='"+escSglQuote(ar[++i])+"'"); continue; } - if (ar[i]==CENTER || ar[i]==LEFT || ar[i]==RIGHT) { eval(pf+'hpos='+ar[i]); if(pf!='ol_') olHautoFlag=1; continue; } - if (ar[i]==OFFSETX) { eval(pf+'offsetx='+ar[++i]); continue; } - if (ar[i]==OFFSETY) { eval(pf+'offsety='+ar[++i]); continue; } - if (ar[i]==FGCOLOR) { eval(pf+'fgcolor="'+ar[++i]+'"'); continue; } - if (ar[i]==BGCOLOR) { eval(pf+'bgcolor="'+ar[++i]+'"'); continue; } - if (ar[i]==TEXTCOLOR) { eval(pf+'textcolor="'+ar[++i]+'"'); continue; } - if (ar[i]==CAPCOLOR) { eval(pf+'capcolor="'+ar[++i]+'"'); continue; } - if (ar[i]==CLOSECOLOR) { eval(pf+'closecolor="'+ar[++i]+'"'); continue; } - if (ar[i]==WIDTH) { eval(pf+'width='+ar[++i]); continue; } - if (ar[i]==BORDER) { eval(pf+'border='+ar[++i]); continue; } - if (ar[i]==CELLPAD) { i=opt_MULTIPLEARGS(++i,ar,(pf+'cellpad')); continue; } - if (ar[i]==STATUS) { eval(pf+"status='"+escSglQuote(ar[++i])+"'"); continue; } - if (ar[i]==AUTOSTATUS) { eval(pf +'autostatus=('+pf+'autostatus == 1) ? 0 : 1'); continue; } - if (ar[i]==AUTOSTATUSCAP) { eval(pf +'autostatus=('+pf+'autostatus == 2) ? 0 : 2'); continue; } - if (ar[i]==HEIGHT) { eval(pf+'height='+pf+'aboveheight='+ar[++i]); continue; } // Same param again. - if (ar[i]==CLOSETEXT) { eval(pf+"close='"+escSglQuote(ar[++i])+"'"); continue; } - if (ar[i]==SNAPX) { eval(pf+'snapx='+ar[++i]); continue; } - if (ar[i]==SNAPY) { eval(pf+'snapy='+ar[++i]); continue; } - if (ar[i]==FIXX) { eval(pf+'fixx='+ar[++i]); continue; } - if (ar[i]==FIXY) { eval(pf+'fixy='+ar[++i]); continue; } - if (ar[i]==RELX) { eval(pf+'relx='+ar[++i]); continue; } - if (ar[i]==RELY) { eval(pf+'rely='+ar[++i]); continue; } - if (ar[i]==FGBACKGROUND) { eval(pf+'fgbackground="'+ar[++i]+'"'); continue; } - if (ar[i]==BGBACKGROUND) { eval(pf+'bgbackground="'+ar[++i]+'"'); continue; } - if (ar[i]==PADX) { eval(pf+'padxl='+ar[++i]); eval(pf+'padxr='+ar[++i]); continue; } - if (ar[i]==PADY) { eval(pf+'padyt='+ar[++i]); eval(pf+'padyb='+ar[++i]); continue; } - if (ar[i]==FULLHTML) { if (pf!='ol_') eval(pf+'fullhtml=1'); continue; } - if (ar[i]==BELOW || ar[i]==ABOVE) { eval(pf+'vpos='+ar[i]); if (pf!='ol_') olVautoFlag=1; continue; } - if (ar[i]==CAPICON) { eval(pf+'capicon="'+ar[++i]+'"'); continue; } - if (ar[i]==TEXTFONT) { eval(pf+"textfont='"+escSglQuote(ar[++i])+"'"); continue; } - if (ar[i]==CAPTIONFONT) { eval(pf+"captionfont='"+escSglQuote(ar[++i])+"'"); continue; } - if (ar[i]==CLOSEFONT) { eval(pf+"closefont='"+escSglQuote(ar[++i])+"'"); continue; } - if (ar[i]==TEXTSIZE) { eval(pf+'textsize="'+ar[++i]+'"'); continue; } - if (ar[i]==CAPTIONSIZE) { eval(pf+'captionsize="'+ar[++i]+'"'); continue; } - if (ar[i]==CLOSESIZE) { eval(pf+'closesize="'+ar[++i]+'"'); continue; } - if (ar[i]==TIMEOUT) { eval(pf+'timeout='+ar[++i]); continue; } - if (ar[i]==FUNCTION) { if (pf=='ol_') { if (typeof ar[i+1]!='number') { v=ar[++i]; ol_function=(typeof v=='function' ? v : null); }} else {fnMark = 0; v = null; if (typeof ar[i+1]!='number') v = ar[++i]; opt_FUNCTION(v); } continue; } - if (ar[i]==DELAY) { eval(pf+'delay='+ar[++i]); continue; } - if (ar[i]==HAUTO) { eval(pf+'hauto=('+pf+'hauto == 0) ? 1 : 0'); continue; } - if (ar[i]==VAUTO) { eval(pf+'vauto=('+pf+'vauto == 0) ? 1 : 0'); continue; } - if (ar[i]==CLOSECLICK) { eval(pf +'closeclick=('+pf+'closeclick == 0) ? 1 : 0'); continue; } - if (ar[i]==WRAP) { eval(pf +'wrap=('+pf+'wrap == 0) ? 1 : 0'); continue; } - if (ar[i]==FOLLOWMOUSE) { eval(pf +'followmouse=('+pf+'followmouse == 1) ? 0 : 1'); continue; } - if (ar[i]==MOUSEOFF) { eval(pf +'mouseoff=('+pf+'mouseoff==0) ? 1 : 0'); v=ar[i+1]; if (pf != 'ol_' && eval(pf+'mouseoff') && typeof v == 'number' && (v < pmStart || v > pmUpper)) olHideDelay=ar[++i]; continue; } - if (ar[i]==CLOSETITLE) { eval(pf+"closetitle='"+escSglQuote(ar[++i])+"'"); continue; } - if (ar[i]==CSSOFF||ar[i]==CSSCLASS) { eval(pf+'css='+ar[i]); continue; } - if (ar[i]==COMPATMODE) { eval(pf+'compatmode=('+pf+'compatmode==0) ? 1 : 0'); continue; } - if (ar[i]==FGCLASS) { eval(pf+'fgclass="'+ar[++i]+'"'); continue; } - if (ar[i]==BGCLASS) { eval(pf+'bgclass="'+ar[++i]+'"'); continue; } - if (ar[i]==TEXTFONTCLASS) { eval(pf+'textfontclass="'+ar[++i]+'"'); continue; } - if (ar[i]==CAPTIONFONTCLASS) { eval(pf+'captionfontclass="'+ar[++i]+'"'); continue; } - if (ar[i]==CLOSEFONTCLASS) { eval(pf+'closefontclass="'+ar[++i]+'"'); continue; } - i = parseCmdLine(pf, i, ar); - } - } - - if (fnMark && o3_function) o3_text = o3_function(); - - if ((pf == 'o3_') && o3_wrap) { - o3_width = 0; - - var tReg=/<.*\n*>/ig; - if (!tReg.test(o3_text)) o3_text = o3_text.replace(/[ ]+/g, ' '); - if (!tReg.test(o3_cap))o3_cap = o3_cap.replace(/[ ]+/g, ' '); - } - if ((pf == 'o3_') && o3_sticky) { - if (!o3_close && (o3_frame != ol_frame)) o3_close = ol_close; - if (o3_mouseoff && (o3_frame == ol_frame)) opt_NOCLOSE(' '); - } -} - - -//////// -// LAYER FUNCTIONS -//////// - -// Writes to a layer -function layerWrite(txt) { - txt += "\n"; - if (olNs4) { - var lyr = o3_frame.document.layers['overDiv'].document - lyr.write(txt) - lyr.close() - } else if (typeof over.innerHTML != 'undefined') { - if (olIe5 && isMac) over.innerHTML = ''; - over.innerHTML = txt; - } else { - range = o3_frame.document.createRange(); - range.setStartAfter(over); - domfrag = range.createContextualFragment(txt); - - while (over.hasChildNodes()) { - over.removeChild(over.lastChild); - } - - over.appendChild(domfrag); - } -} - -// Make an object visible -function showObject(obj) { - runHook("showObject", FBEFORE); - - var theObj=(olNs4 ? obj : obj.style); - theObj.visibility = 'visible'; - - runHook("showObject", FAFTER); -} - -// Hides an object -function hideObject(obj) { - runHook("hideObject", FBEFORE); - - var theObj=(olNs4 ? obj : obj.style); - if (olNs6 && olShowId>0) { clearTimeout(olShowId); olShowId=0; } - theObj.visibility = 'hidden'; - theObj.top = theObj.left = ((olIe4&&!olOp) ? 0 : -10000) + (!olNs4 ? 'px' : 0); - - if (o3_timerid > 0) clearTimeout(o3_timerid); - if (o3_delayid > 0) clearTimeout(o3_delayid); - - o3_timerid = 0; - o3_delayid = 0; - self.status = ""; - - if (obj.onmouseout||obj.onmouseover) { - if (olNs4) obj.releaseEvents(Event.MOUSEOUT || Event.MOUSEOVER); - obj.onmouseout = obj.onmouseover = null; - } - - runHook("hideObject", FAFTER); -} - -// Move a layer -function repositionTo(obj, xL, yL) { - var theObj=(olNs4 ? obj : obj.style); - theObj.left = xL + (!olNs4 ? 'px' : 0); - theObj.top = yL + (!olNs4 ? 'px' : 0); -} - -// Check position of cursor relative to overDiv DIVision; mouseOut function -function cursorOff() { - var left = parseInt(over.style.left); - var top = parseInt(over.style.top); - var right = left + (over.offsetWidth >= parseInt(o3_width) ? over.offsetWidth : parseInt(o3_width)); - var bottom = top + (over.offsetHeight >= o3_aboveheight ? over.offsetHeight : o3_aboveheight); - - if (o3_x < left || o3_x > right || o3_y < top || o3_y > bottom) return true; - - return false; -} - - -//////// -// COMMAND FUNCTIONS -//////// - -// Calls callme or the default function. -function opt_FUNCTION(callme) { - o3_text = (callme ? (typeof callme=='string' ? (/.+\(.*\)/.test(callme) ? eval(callme) : callme) : callme()) : (o3_function ? o3_function() : 'No Function')); - - return 0; -} - -// Handle hovering -function opt_NOCLOSE(unused) { - if (!unused) o3_close = ""; - - if (olNs4) { - over.captureEvents(Event.MOUSEOUT || Event.MOUSEOVER); - over.onmouseover = function () { if (o3_timerid > 0) { clearTimeout(o3_timerid); o3_timerid = 0; } } - over.onmouseout = function (e) { if (olHideDelay) hideDelay(olHideDelay); else cClick(e); } - } else { - over.onmouseover = function () {hoveringSwitch = true; if (o3_timerid > 0) { clearTimeout(o3_timerid); o3_timerid =0; } } - } - - return 0; -} - -// Function to scan command line arguments for multiples -function opt_MULTIPLEARGS(i, args, parameter) { - var k=i, re, pV, str=''; - - for(k=i; kpmStart) break; - str += args[k] + ','; - } - if (str) str = str.substring(0,--str.length); - - k--; // reduce by one so the for loop this is in works correctly - pV=(olNs4 && /cellpad/i.test(parameter)) ? str.split(',')[0] : str; - eval(parameter + '="' + pV + '"'); - - return k; -} - -// Remove   in texts when done. -function nbspCleanup() { - if (o3_wrap) { - o3_text = o3_text.replace(/\ /g, ' '); - o3_cap = o3_cap.replace(/\ /g, ' '); - } -} - -// Escape embedded single quotes in text strings -function escSglQuote(str) { - return str.toString().replace(/'/g,"\\'"); -} - -// Onload handler for window onload event -function OLonLoad_handler(e) { - var re = /\w+\(.*\)[;\s]+/g, olre = /overlib\(|nd\(|cClick\(/, fn, l, i; - - if(!olLoaded) olLoaded=1; - - // Remove it for Gecko based browsers - if(window.removeEventListener && e.eventPhase == 3) window.removeEventListener("load",OLonLoad_handler,false); - else if(window.detachEvent) { // and for IE and Opera 4.x but execute calls to overlib, nd, or cClick() - window.detachEvent("onload",OLonLoad_handler); - var fN = document.body.getAttribute('onload'); - if (fN) { - fN=fN.toString().match(re); - if (fN && fN.length) { - for (i=0; i' : '
') : ''; - else { - fontStr='o3_'+whichString+'font'; - fontColor='o3_'+((whichString=='caption')? 'cap' : whichString)+'color'; - return (hasDims&&!olNs4) ? (isClose ? '' : '
') : ''; - } -} - -// Quotes Multi word font names; needed for CSS Standards adherence in font-family -function quoteMultiNameFonts(theFont) { - var v, pM=theFont.split(','); - for (var i=0; i 0) clearTimeout(o3_timerid); - - o3_timerid=setTimeout("cClick()",(o3_timeout=time)); - } -} - -// Was originally in the placeLayer() routine; separated out for future ease -function horizontalPlacement(browserWidth, horizontalScrollAmount, widthFix) { - var placeX, iwidth=browserWidth, winoffset=horizontalScrollAmount; - var parsedWidth = parseInt(o3_width); - - if (o3_fixx > -1 || o3_relx != null) { - // Fixed position - placeX=(o3_relx != null ? ( o3_relx < 0 ? winoffset +o3_relx+ iwidth - parsedWidth - widthFix : winoffset+o3_relx) : o3_fixx); - } else { - // If HAUTO, decide what to use. - if (o3_hauto == 1) { - if ((o3_x - winoffset) > (iwidth / 2)) { - o3_hpos = LEFT; - } else { - o3_hpos = RIGHT; - } - } - - // From mouse - if (o3_hpos == CENTER) { // Center - placeX = o3_x+o3_offsetx-(parsedWidth/2); - - if (placeX < winoffset) placeX = winoffset; - } - - if (o3_hpos == RIGHT) { // Right - placeX = o3_x+o3_offsetx; - - if ((placeX+parsedWidth) > (winoffset+iwidth - widthFix)) { - placeX = iwidth+winoffset - parsedWidth - widthFix; - if (placeX < 0) placeX = 0; - } - } - if (o3_hpos == LEFT) { // Left - placeX = o3_x-o3_offsetx-parsedWidth; - if (placeX < winoffset) placeX = winoffset; - } - - // Snapping! - if (o3_snapx > 1) { - var snapping = placeX % o3_snapx; - - if (o3_hpos == LEFT) { - placeX = placeX - (o3_snapx+snapping); - } else { - // CENTER and RIGHT - placeX = placeX+(o3_snapx - snapping); - } - - if (placeX < winoffset) placeX = winoffset; - } - } - - return placeX; -} - -// was originally in the placeLayer() routine; separated out for future ease -function verticalPlacement(browserHeight,verticalScrollAmount) { - var placeY, iheight=browserHeight, scrolloffset=verticalScrollAmount; - var parsedHeight=(o3_aboveheight ? parseInt(o3_aboveheight) : (olNs4 ? over.clip.height : over.offsetHeight)); - - if (o3_fixy > -1 || o3_rely != null) { - // Fixed position - placeY=(o3_rely != null ? (o3_rely < 0 ? scrolloffset+o3_rely+iheight - parsedHeight : scrolloffset+o3_rely) : o3_fixy); - } else { - // If VAUTO, decide what to use. - if (o3_vauto == 1) { - if ((o3_y - scrolloffset) > (iheight / 2) && o3_vpos == BELOW && (o3_y + parsedHeight + o3_offsety - (scrolloffset + iheight) > 0)) { - o3_vpos = ABOVE; - } else if (o3_vpos == ABOVE && (o3_y - (parsedHeight + o3_offsety) - scrolloffset < 0)) { - o3_vpos = BELOW; - } - } - - // From mouse - if (o3_vpos == ABOVE) { - if (o3_aboveheight == 0) o3_aboveheight = parsedHeight; - - placeY = o3_y - (o3_aboveheight+o3_offsety); - if (placeY < scrolloffset) placeY = scrolloffset; - } else { - // BELOW - placeY = o3_y+o3_offsety; - } - - // Snapping! - if (o3_snapy > 1) { - var snapping = placeY % o3_snapy; - - if (o3_aboveheight > 0 && o3_vpos == ABOVE) { - placeY = placeY - (o3_snapy+snapping); - } else { - placeY = placeY+(o3_snapy - snapping); - } - - if (placeY < scrolloffset) placeY = scrolloffset; - } - } - - return placeY; -} - -// checks positioning flags -function checkPositionFlags() { - if (olHautoFlag) olHautoFlag = o3_hauto=0; - if (olVautoFlag) olVautoFlag = o3_vauto=0; - return true; -} - -// get Browser window width -function windowWidth() { - var w; - if (o3_frame.innerWidth) w=o3_frame.innerWidth; - else if (eval('o3_frame.'+docRoot)&&eval("typeof o3_frame."+docRoot+".clientWidth=='number'")&&eval('o3_frame.'+docRoot+'.clientWidth')) - w=eval('o3_frame.'+docRoot+'.clientWidth'); - return w; -} - -// create the div container for popup content if it doesn't exist -function createDivContainer(id,frm,zValue) { - id = (id || 'overDiv'), frm = (frm || o3_frame), zValue = (zValue || 1000); - var objRef, divContainer = layerReference(id); - - if (divContainer == null) { - if (olNs4) { - divContainer = frm.document.layers[id] = new Layer(window.innerWidth, frm); - objRef = divContainer; - } else { - var body = (olIe4 ? frm.document.all.tags('BODY')[0] : frm.document.getElementsByTagName("BODY")[0]); - if (olIe4&&!document.getElementById) { - body.insertAdjacentHTML("beforeEnd",'
'); - divContainer=layerReference(id); - } else { - divContainer = frm.document.createElement("DIV"); - divContainer.id = id; - body.appendChild(divContainer); - } - objRef = divContainer.style; - } - - objRef.position = 'absolute'; - objRef.visibility = 'hidden'; - objRef.zIndex = zValue; - if (olIe4&&!olOp) objRef.left = objRef.top = '0px'; - else objRef.left = objRef.top = -10000 + (!olNs4 ? 'px' : 0); - } - - return divContainer; -} - -// get reference to a layer with ID=id -function layerReference(id) { - return (olNs4 ? o3_frame.document.layers[id] : (document.all ? o3_frame.document.all[id] : o3_frame.document.getElementById(id))); -} -//////// -// UTILITY FUNCTIONS -//////// - -// Checks if something is a function. -function isFunction(fnRef) { - var rtn = true; - - if (typeof fnRef == 'object') { - for (var i = 0; i < fnRef.length; i++) { - if (typeof fnRef[i]=='function') continue; - rtn = false; - break; - } - } else if (typeof fnRef != 'function') { - rtn = false; - } - - return rtn; -} - -// Converts an array into an argument string for use in eval. -function argToString(array, strtInd, argName) { - var jS = strtInd, aS = '', ar = array; - argName=(argName ? argName : 'ar'); - - if (ar.length > jS) { - for (var k = jS; k < ar.length; k++) aS += argName+'['+k+'], '; - aS = aS.substring(0, aS.length-2); - } - - return aS; -} - -// Places a hook in the correct position in a hook point. -function reOrder(hookPt, fnRef, order) { - var newPt = new Array(), match, i, j; - - if (!order || typeof order == 'undefined' || typeof order == 'number') return hookPt; - - if (typeof order=='function') { - if (typeof fnRef=='object') { - newPt = newPt.concat(fnRef); - } else { - newPt[newPt.length++]=fnRef; - } - - for (i = 0; i < hookPt.length; i++) { - match = false; - if (typeof fnRef == 'function' && hookPt[i] == fnRef) { - continue; - } else { - for(j = 0; j < fnRef.length; j++) if (hookPt[i] == fnRef[j]) { - match = true; - break; - } - } - if (!match) newPt[newPt.length++] = hookPt[i]; - } - - newPt[newPt.length++] = order; - - } else if (typeof order == 'object') { - if (typeof fnRef == 'object') { - newPt = newPt.concat(fnRef); - } else { - newPt[newPt.length++] = fnRef; - } - - for (j = 0; j < hookPt.length; j++) { - match = false; - if (typeof fnRef == 'function' && hookPt[j] == fnRef) { - continue; - } else { - for (i = 0; i < fnRef.length; i++) if (hookPt[j] == fnRef[i]) { - match = true; - break; - } - } - if (!match) newPt[newPt.length++]=hookPt[j]; - } - - for (i = 0; i < newPt.length; i++) hookPt[i] = newPt[i]; - newPt.length = 0; - - for (j = 0; j < hookPt.length; j++) { - match = false; - for (i = 0; i < order.length; i++) { - if (hookPt[j] == order[i]) { - match = true; - break; - } - } - if (!match) newPt[newPt.length++] = hookPt[j]; - } - newPt = newPt.concat(order); - } - - hookPt = newPt; - - return hookPt; -} - -//////// -// PLUGIN ACTIVATION FUNCTIONS -//////// - -// Runs plugin functions to set runtime variables. -function setRunTimeVariables(){ - if (typeof runTime != 'undefined' && runTime.length) { - for (var k = 0; k < runTime.length; k++) { - runTime[k](); - } - } -} - -// Runs plugin functions to parse commands. -function parseCmdLine(pf, i, args) { - if (typeof cmdLine != 'undefined' && cmdLine.length) { - for (var k = 0; k < cmdLine.length; k++) { - var j = cmdLine[k](pf, i, args); - if (j >- 1) { - i = j; - break; - } - } - } - - return i; -} - -// Runs plugin functions to do things after parse. -function postParseChecks(pf,args){ - if (typeof postParse != 'undefined' && postParse.length) { - for (var k = 0; k < postParse.length; k++) { - if (postParse[k](pf,args)) continue; - return false; // end now since have an error - } - } - return true; -} - - -//////// -// PLUGIN REGISTRATION FUNCTIONS -//////// - -// Registers commands and creates constants. -function registerCommands(cmdStr) { - if (typeof cmdStr!='string') return; - - var pM = cmdStr.split(','); - pms = pms.concat(pM); - - for (var i = 0; i< pM.length; i++) { - eval(pM[i].toUpperCase()+'='+pmCount++); - } -} - -// Registers no-parameter commands -function registerNoParameterCommands(cmdStr) { - if (!cmdStr && typeof cmdStr != 'string') return; - pmt=(!pmt) ? cmdStr : pmt + ',' + cmdStr; -} - -// Register a function to hook at a certain point. -function registerHook(fnHookTo, fnRef, hookType, optPm) { - var hookPt, last = typeof optPm; - - if (fnHookTo == 'plgIn'||fnHookTo == 'postParse') return; - if (typeof hookPts[fnHookTo] == 'undefined') hookPts[fnHookTo] = new FunctionReference(); - - hookPt = hookPts[fnHookTo]; - - if (hookType != null) { - if (hookType == FREPLACE) { - hookPt.ovload = fnRef; // replace normal overlib routine - if (fnHookTo.indexOf('ol_content_') > -1) hookPt.alt[pms[CSSOFF-1-pmStart]]=fnRef; - - } else if (hookType == FBEFORE || hookType == FAFTER) { - var hookPt=(hookType == 1 ? hookPt.before : hookPt.after); - - if (typeof fnRef == 'object') { - hookPt = hookPt.concat(fnRef); - } else { - hookPt[hookPt.length++] = fnRef; - } - - if (optPm) hookPt = reOrder(hookPt, fnRef, optPm); - - } else if (hookType == FALTERNATE) { - if (last=='number') hookPt.alt[pms[optPm-1-pmStart]] = fnRef; - } else if (hookType == FCHAIN) { - hookPt = hookPt.chain; - if (typeof fnRef=='object') hookPt=hookPt.concat(fnRef); // add other functions - else hookPt[hookPt.length++]=fnRef; - } - - return; - } -} - -// Register a function that will set runtime variables. -function registerRunTimeFunction(fn) { - if (isFunction(fn)) { - if (typeof fn == 'object') { - runTime = runTime.concat(fn); - } else { - runTime[runTime.length++] = fn; - } - } -} - -// Register a function that will handle command parsing. -function registerCmdLineFunction(fn){ - if (isFunction(fn)) { - if (typeof fn == 'object') { - cmdLine = cmdLine.concat(fn); - } else { - cmdLine[cmdLine.length++] = fn; - } - } -} - -// Register a function that does things after command parsing. -function registerPostParseFunction(fn){ - if (isFunction(fn)) { - if (typeof fn == 'object') { - postParse = postParse.concat(fn); - } else { - postParse[postParse.length++] = fn; - } - } -} - -//////// -// PLUGIN REGISTRATION FUNCTIONS -//////// - -// Runs any hooks registered. -function runHook(fnHookTo, hookType) { - var l = hookPts[fnHookTo], k, rtnVal = null, optPm, arS, ar = runHook.arguments; - - if (hookType == FREPLACE) { - arS = argToString(ar, 2); - - if (typeof l == 'undefined' || !(l = l.ovload)) rtnVal = eval(fnHookTo+'('+arS+')'); - else rtnVal = eval('l('+arS+')'); - - } else if (hookType == FBEFORE || hookType == FAFTER) { - if (typeof l != 'undefined') { - l=(hookType == 1 ? l.before : l.after); - - if (l.length) { - arS = argToString(ar, 2); - for (var k = 0; k < l.length; k++) eval('l[k]('+arS+')'); - } - } - } else if (hookType == FALTERNATE) { - optPm = ar[2]; - arS = argToString(ar, 3); - - if (typeof l == 'undefined' || (l = l.alt[pms[optPm-1-pmStart]]) == 'undefined') { - rtnVal = eval(fnHookTo+'('+arS+')'); - } else { - rtnVal = eval('l('+arS+')'); - } - } else if (hookType == FCHAIN) { - arS=argToString(ar,2); - l=l.chain; - - for (k=l.length; k > 0; k--) if((rtnVal=eval('l[k-1]('+arS+')'))!=void(0)) break; - } - - return rtnVal; -} - -//////// -// OBJECT CONSTRUCTORS -//////// - -// Object for handling hooks. -function FunctionReference() { - this.ovload = null; - this.before = new Array(); - this.after = new Array(); - this.alt = new Array(); - this.chain = new Array(); -} - -// Object for simple access to the overLIB version used. -// Examples: simpleversion:351 major:3 minor:5 revision:1 -function Info(version, prerelease) { - this.version = version; - this.prerelease = prerelease; - - this.simpleversion = Math.round(this.version*100); - this.major = parseInt(this.simpleversion / 100); - this.minor = parseInt(this.simpleversion / 10) - this.major * 10; - this.revision = parseInt(this.simpleversion) - this.major * 100 - this.minor * 10; - this.meets = meets; -} - -// checks for Core Version required -function meets(reqdVersion) { - return (!reqdVersion) ? false : this.simpleversion >= Math.round(100*parseFloat(reqdVersion)); -} - - -//////// -// STANDARD REGISTRATIONS -//////// -registerHook("ol_content_simple", ol_content_simple, FALTERNATE, CSSOFF); -registerHook("ol_content_caption", ol_content_caption, FALTERNATE, CSSOFF); -registerHook("ol_content_background", ol_content_background, FALTERNATE, CSSOFF); -registerHook("ol_content_simple", ol_content_simple, FALTERNATE, CSSCLASS); -registerHook("ol_content_caption", ol_content_caption, FALTERNATE, CSSCLASS); -registerHook("ol_content_background", ol_content_background, FALTERNATE, CSSCLASS); -registerPostParseFunction(checkPositionFlags); -registerHook("hideObject", nbspCleanup, FAFTER); -registerHook("horizontalPlacement", horizontalPlacement, FCHAIN); -registerHook("verticalPlacement", verticalPlacement, FCHAIN); -if (olNs4||(olIe5&&isMac)||olKq) olLoaded=1; -registerNoParameterCommands('sticky,autostatus,autostatuscap,fullhtml,hauto,vauto,closeclick,wrap,followmouse,mouseoff,compatmode'); -/////// -// ESTABLISH MOUSECAPTURING -/////// - -// Capture events, alt. diffuses the overlib function. -var olCheckMouseCapture=true; -if ((olNs4 || olNs6 || olIe4)) { - olMouseCapture(); -} else { - overlib = no_overlib; - nd = no_overlib; - ver3fix = true; -} +//\///// +//\ overLIB 4.21 - You may not remove or change this notice. +//\ Copyright Erik Bosrup 1998-2004. All rights reserved. +//\ +//\ Contributors are listed on the homepage. +//\ This file might be old, always check for the latest version at: +//\ http://www.bosrup.com/web/overlib/ +//\ +//\ Please read the license agreement (available through the link above) +//\ before using overLIB. Direct any licensing questions to erik@bosrup.com. +//\ +//\ Do not sell this as your own work or remove this copyright notice. +//\ For full details on copying or changing this script please read the +//\ license agreement at the link above. Please give credit on sites that +//\ use overLIB and submit changes of the script so other people can use +//\ them as well. +// $Revision: 1.119 $ $Date: 2005/07/02 23:41:44 $ +//\///// +//\mini + +//////// +// PRE-INIT +// Ignore these lines, configuration is below. +//////// +var olLoaded = 0;var pmStart = 10000000; var pmUpper = 10001000; var pmCount = pmStart+1; var pmt=''; var pms = new Array(); var olInfo = new Info('4.21', 1); +var FREPLACE = 0; var FBEFORE = 1; var FAFTER = 2; var FALTERNATE = 3; var FCHAIN=4; +var olHideForm=0; // parameter for hiding SELECT and ActiveX elements in IE5.5+ +var olHautoFlag = 0; // flags for over-riding VAUTO and HAUTO if corresponding +var olVautoFlag = 0; // positioning commands are used on the command line +var hookPts = new Array(), postParse = new Array(), cmdLine = new Array(), runTime = new Array(); +// for plugins +registerCommands('donothing,inarray,caparray,sticky,background,noclose,caption,left,right,center,offsetx,offsety,fgcolor,bgcolor,textcolor,capcolor,closecolor,width,border,cellpad,status,autostatus,autostatuscap,height,closetext,snapx,snapy,fixx,fixy,relx,rely,fgbackground,bgbackground,padx,pady,fullhtml,above,below,capicon,textfont,captionfont,closefont,textsize,captionsize,closesize,timeout,function,delay,hauto,vauto,closeclick,wrap,followmouse,mouseoff,closetitle,cssoff,compatmode,cssclass,fgclass,bgclass,textfontclass,captionfontclass,closefontclass'); + +//////// +// DEFAULT CONFIGURATION +// Settings you want everywhere are set here. All of this can also be +// changed on your html page or through an overLIB call. +//////// +if (typeof ol_fgcolor=='undefined') var ol_fgcolor="#CCCCFF"; +if (typeof ol_bgcolor=='undefined') var ol_bgcolor="#333399"; +if (typeof ol_textcolor=='undefined') var ol_textcolor="#000000"; +if (typeof ol_capcolor=='undefined') var ol_capcolor="#FFFFFF"; +if (typeof ol_closecolor=='undefined') var ol_closecolor="#9999FF"; +if (typeof ol_textfont=='undefined') var ol_textfont="Verdana,Arial,Helvetica"; +if (typeof ol_captionfont=='undefined') var ol_captionfont="Verdana,Arial,Helvetica"; +if (typeof ol_closefont=='undefined') var ol_closefont="Verdana,Arial,Helvetica"; +if (typeof ol_textsize=='undefined') var ol_textsize="1"; +if (typeof ol_captionsize=='undefined') var ol_captionsize="1"; +if (typeof ol_closesize=='undefined') var ol_closesize="1"; +if (typeof ol_width=='undefined') var ol_width="200"; +if (typeof ol_border=='undefined') var ol_border="1"; +if (typeof ol_cellpad=='undefined') var ol_cellpad=2; +if (typeof ol_offsetx=='undefined') var ol_offsetx=10; +if (typeof ol_offsety=='undefined') var ol_offsety=10; +if (typeof ol_text=='undefined') var ol_text="Default Text"; +if (typeof ol_cap=='undefined') var ol_cap=""; +if (typeof ol_sticky=='undefined') var ol_sticky=0; +if (typeof ol_background=='undefined') var ol_background=""; +if (typeof ol_close=='undefined') var ol_close="Close"; +if (typeof ol_hpos=='undefined') var ol_hpos=RIGHT; +if (typeof ol_status=='undefined') var ol_status=""; +if (typeof ol_autostatus=='undefined') var ol_autostatus=0; +if (typeof ol_height=='undefined') var ol_height=-1; +if (typeof ol_snapx=='undefined') var ol_snapx=0; +if (typeof ol_snapy=='undefined') var ol_snapy=0; +if (typeof ol_fixx=='undefined') var ol_fixx=-1; +if (typeof ol_fixy=='undefined') var ol_fixy=-1; +if (typeof ol_relx=='undefined') var ol_relx=null; +if (typeof ol_rely=='undefined') var ol_rely=null; +if (typeof ol_fgbackground=='undefined') var ol_fgbackground=""; +if (typeof ol_bgbackground=='undefined') var ol_bgbackground=""; +if (typeof ol_padxl=='undefined') var ol_padxl=1; +if (typeof ol_padxr=='undefined') var ol_padxr=1; +if (typeof ol_padyt=='undefined') var ol_padyt=1; +if (typeof ol_padyb=='undefined') var ol_padyb=1; +if (typeof ol_fullhtml=='undefined') var ol_fullhtml=0; +if (typeof ol_vpos=='undefined') var ol_vpos=BELOW; +if (typeof ol_aboveheight=='undefined') var ol_aboveheight=0; +if (typeof ol_capicon=='undefined') var ol_capicon=""; +if (typeof ol_frame=='undefined') var ol_frame=self; +if (typeof ol_timeout=='undefined') var ol_timeout=0; +if (typeof ol_function=='undefined') var ol_function=null; +if (typeof ol_delay=='undefined') var ol_delay=0; +if (typeof ol_hauto=='undefined') var ol_hauto=0; +if (typeof ol_vauto=='undefined') var ol_vauto=0; +if (typeof ol_closeclick=='undefined') var ol_closeclick=0; +if (typeof ol_wrap=='undefined') var ol_wrap=0; +if (typeof ol_followmouse=='undefined') var ol_followmouse=1; +if (typeof ol_mouseoff=='undefined') var ol_mouseoff=0; +if (typeof ol_closetitle=='undefined') var ol_closetitle='Close'; +if (typeof ol_compatmode=='undefined') var ol_compatmode=0; +if (typeof ol_css=='undefined') var ol_css=CSSOFF; +if (typeof ol_fgclass=='undefined') var ol_fgclass=""; +if (typeof ol_bgclass=='undefined') var ol_bgclass=""; +if (typeof ol_textfontclass=='undefined') var ol_textfontclass=""; +if (typeof ol_captionfontclass=='undefined') var ol_captionfontclass=""; +if (typeof ol_closefontclass=='undefined') var ol_closefontclass=""; + +//////// +// ARRAY CONFIGURATION +//////// + +// You can use these arrays to store popup text here instead of in the html. +if (typeof ol_texts=='undefined') var ol_texts = new Array("Text 0", "Text 1"); +if (typeof ol_caps=='undefined') var ol_caps = new Array("Caption 0", "Caption 1"); + +//////// +// END OF CONFIGURATION +// Don't change anything below this line, all configuration is above. +//////// + + + + + +//////// +// INIT +//////// +// Runtime variables init. Don't change for config! +var o3_text=""; +var o3_cap=""; +var o3_sticky=0; +var o3_background=""; +var o3_close="Close"; +var o3_hpos=RIGHT; +var o3_offsetx=2; +var o3_offsety=2; +var o3_fgcolor=""; +var o3_bgcolor=""; +var o3_textcolor=""; +var o3_capcolor=""; +var o3_closecolor=""; +var o3_width=100; +var o3_border=1; +var o3_cellpad=2; +var o3_status=""; +var o3_autostatus=0; +var o3_height=-1; +var o3_snapx=0; +var o3_snapy=0; +var o3_fixx=-1; +var o3_fixy=-1; +var o3_relx=null; +var o3_rely=null; +var o3_fgbackground=""; +var o3_bgbackground=""; +var o3_padxl=0; +var o3_padxr=0; +var o3_padyt=0; +var o3_padyb=0; +var o3_fullhtml=0; +var o3_vpos=BELOW; +var o3_aboveheight=0; +var o3_capicon=""; +var o3_textfont="Verdana,Arial,Helvetica"; +var o3_captionfont="Verdana,Arial,Helvetica"; +var o3_closefont="Verdana,Arial,Helvetica"; +var o3_textsize="1"; +var o3_captionsize="1"; +var o3_closesize="1"; +var o3_frame=self; +var o3_timeout=0; +var o3_timerid=0; +var o3_allowmove=0; +var o3_function=null; +var o3_delay=0; +var o3_delayid=0; +var o3_hauto=0; +var o3_vauto=0; +var o3_closeclick=0; +var o3_wrap=0; +var o3_followmouse=1; +var o3_mouseoff=0; +var o3_closetitle=''; +var o3_compatmode=0; +var o3_css=CSSOFF; +var o3_fgclass=""; +var o3_bgclass=""; +var o3_textfontclass=""; +var o3_captionfontclass=""; +var o3_closefontclass=""; + +// Display state variables +var o3_x = 0; +var o3_y = 0; +var o3_showingsticky = 0; +var o3_removecounter = 0; + +// Our layer +var over = null; +var fnRef, hoveringSwitch = false; +var olHideDelay; + +// Decide browser version +var isMac = (navigator.userAgent.indexOf("Mac") != -1); +var olOp = (navigator.userAgent.toLowerCase().indexOf('opera') > -1 && document.createTextNode); // Opera 7 +var olNs4 = (navigator.appName=='Netscape' && parseInt(navigator.appVersion) == 4); +var olNs6 = (document.getElementById) ? true : false; +var olKq = (olNs6 && /konqueror/i.test(navigator.userAgent)); +var olIe4 = (document.all) ? true : false; +var olIe5 = false; +var olIe55 = false; // Added additional variable to identify IE5.5+ +var docRoot = 'document.body'; + +// Resize fix for NS4.x to keep track of layer +if (olNs4) { + var oW = window.innerWidth; + var oH = window.innerHeight; + window.onresize = function() { if (oW != window.innerWidth || oH != window.innerHeight) location.reload(); } +} + +// Microsoft Stupidity Check(tm). +if (olIe4) { + var agent = navigator.userAgent; + if (/MSIE/.test(agent)) { + var versNum = parseFloat(agent.match(/MSIE[ ](\d\.\d+)\.*/i)[1]); + if (versNum >= 5){ + olIe5=true; + olIe55=(versNum>=5.5&&!olOp) ? true : false; + if (olNs6) olNs6=false; + } + } + if (olNs6) olIe4 = false; +} + +// Check for compatability mode. +if (document.compatMode && document.compatMode == 'CSS1Compat') { + docRoot= ((olIe4 && !olOp) ? 'document.documentElement' : docRoot); +} + +// Add window onload handlers to indicate when all modules have been loaded +// For Netscape 6+ and Mozilla, uses addEventListener method on the window object +// For IE it uses the attachEvent method of the window object and for Netscape 4.x +// it sets the window.onload handler to the OLonload_handler function for Bubbling +if(window.addEventListener) window.addEventListener("load",OLonLoad_handler,false); +else if (window.attachEvent) window.attachEvent("onload",OLonLoad_handler); + +var capExtent; + +//////// +// PUBLIC FUNCTIONS +//////// + +// overlib(arg0,...,argN) +// Loads parameters into global runtime variables. +function overlib() { + if (!olLoaded || isExclusive(overlib.arguments)) return true; + if (olCheckMouseCapture) olMouseCapture(); + if (over) { + over = (typeof over.id != 'string') ? o3_frame.document.all['overDiv'] : over; + cClick(); + } + + // Load defaults to runtime. + olHideDelay=0; + o3_text=ol_text; + o3_cap=ol_cap; + o3_sticky=ol_sticky; + o3_background=ol_background; + o3_close=ol_close; + o3_hpos=ol_hpos; + o3_offsetx=ol_offsetx; + o3_offsety=ol_offsety; + o3_fgcolor=ol_fgcolor; + o3_bgcolor=ol_bgcolor; + o3_textcolor=ol_textcolor; + o3_capcolor=ol_capcolor; + o3_closecolor=ol_closecolor; + o3_width=ol_width; + o3_border=ol_border; + o3_cellpad=ol_cellpad; + o3_status=ol_status; + o3_autostatus=ol_autostatus; + o3_height=ol_height; + o3_snapx=ol_snapx; + o3_snapy=ol_snapy; + o3_fixx=ol_fixx; + o3_fixy=ol_fixy; + o3_relx=ol_relx; + o3_rely=ol_rely; + o3_fgbackground=ol_fgbackground; + o3_bgbackground=ol_bgbackground; + o3_padxl=ol_padxl; + o3_padxr=ol_padxr; + o3_padyt=ol_padyt; + o3_padyb=ol_padyb; + o3_fullhtml=ol_fullhtml; + o3_vpos=ol_vpos; + o3_aboveheight=ol_aboveheight; + o3_capicon=ol_capicon; + o3_textfont=ol_textfont; + o3_captionfont=ol_captionfont; + o3_closefont=ol_closefont; + o3_textsize=ol_textsize; + o3_captionsize=ol_captionsize; + o3_closesize=ol_closesize; + o3_timeout=ol_timeout; + o3_function=ol_function; + o3_delay=ol_delay; + o3_hauto=ol_hauto; + o3_vauto=ol_vauto; + o3_closeclick=ol_closeclick; + o3_wrap=ol_wrap; + o3_followmouse=ol_followmouse; + o3_mouseoff=ol_mouseoff; + o3_closetitle=ol_closetitle; + o3_css=ol_css; + o3_compatmode=ol_compatmode; + o3_fgclass=ol_fgclass; + o3_bgclass=ol_bgclass; + o3_textfontclass=ol_textfontclass; + o3_captionfontclass=ol_captionfontclass; + o3_closefontclass=ol_closefontclass; + + setRunTimeVariables(); + + fnRef = ''; + + // Special for frame support, over must be reset... + o3_frame = ol_frame; + + if(!(over=createDivContainer())) return false; + + parseTokens('o3_', overlib.arguments); + if (!postParseChecks()) return false; + + if (o3_delay == 0) { + return runHook("olMain", FREPLACE); + } else { + o3_delayid = setTimeout("runHook('olMain', FREPLACE)", o3_delay); + return false; + } +} + +// Clears popups if appropriate +function nd(time) { + if (olLoaded && !isExclusive()) { + hideDelay(time); // delay popup close if time specified + + if (o3_removecounter >= 1) { o3_showingsticky = 0 } + + if (o3_showingsticky == 0) { + o3_allowmove = 0; + if (over != null && o3_timerid == 0) runHook("hideObject", FREPLACE, over); + } else { + o3_removecounter++; + } + } + + return true; +} + +// The Close onMouseOver function for stickies +function cClick() { + if (olLoaded) { + runHook("hideObject", FREPLACE, over); + o3_showingsticky = 0; + } + return false; +} + +// Method for setting page specific defaults. +function overlib_pagedefaults() { + parseTokens('ol_', overlib_pagedefaults.arguments); +} + + +//////// +// OVERLIB MAIN FUNCTION +//////// + +// This function decides what it is we want to display and how we want it done. +function olMain() { + var layerhtml, styleType; + runHook("olMain", FBEFORE); + + if (o3_background!="" || o3_fullhtml) { + // Use background instead of box. + layerhtml = runHook('ol_content_background', FALTERNATE, o3_css, o3_text, o3_background, o3_fullhtml); + } else { + // They want a popup box. + styleType = (pms[o3_css-1-pmStart] == "cssoff" || pms[o3_css-1-pmStart] == "cssclass"); + + // Prepare popup background + if (o3_fgbackground != "") o3_fgbackground = "background=\""+o3_fgbackground+"\""; + if (o3_bgbackground != "") o3_bgbackground = (styleType ? "background=\""+o3_bgbackground+"\"" : o3_bgbackground); + + // Prepare popup colors + if (o3_fgcolor != "") o3_fgcolor = (styleType ? "bgcolor=\""+o3_fgcolor+"\"" : o3_fgcolor); + if (o3_bgcolor != "") o3_bgcolor = (styleType ? "bgcolor=\""+o3_bgcolor+"\"" : o3_bgcolor); + + // Prepare popup height + if (o3_height > 0) o3_height = (styleType ? "height=\""+o3_height+"\"" : o3_height); + else o3_height = ""; + + // Decide which kinda box. + if (o3_cap=="") { + // Plain + layerhtml = runHook('ol_content_simple', FALTERNATE, o3_css, o3_text); + } else { + // With caption + if (o3_sticky) { + // Show close text + layerhtml = runHook('ol_content_caption', FALTERNATE, o3_css, o3_text, o3_cap, o3_close); + } else { + // No close text + layerhtml = runHook('ol_content_caption', FALTERNATE, o3_css, o3_text, o3_cap, ""); + } + } + } + + // We want it to stick! + if (o3_sticky) { + if (o3_timerid > 0) { + clearTimeout(o3_timerid); + o3_timerid = 0; + } + o3_showingsticky = 1; + o3_removecounter = 0; + } + + // Created a separate routine to generate the popup to make it easier + // to implement a plugin capability + if (!runHook("createPopup", FREPLACE, layerhtml)) return false; + + // Prepare status bar + if (o3_autostatus > 0) { + o3_status = o3_text; + if (o3_autostatus > 1) o3_status = o3_cap; + } + + // When placing the layer the first time, even stickies may be moved. + o3_allowmove = 0; + + // Initiate a timer for timeout + if (o3_timeout > 0) { + if (o3_timerid > 0) clearTimeout(o3_timerid); + o3_timerid = setTimeout("cClick()", o3_timeout); + } + + // Show layer + runHook("disp", FREPLACE, o3_status); + runHook("olMain", FAFTER); + + return (olOp && event && event.type == 'mouseover' && !o3_status) ? '' : (o3_status != ''); +} + +//////// +// LAYER GENERATION FUNCTIONS +//////// +// These functions just handle popup content with tags that should adhere to the W3C standards specification. + +// Makes simple table without caption +function ol_content_simple(text) { + var cpIsMultiple = /,/.test(o3_cellpad); + var txt = '
' : ((!olNs4&&cpIsMultiple) ? ' style="'+setCellPadStr(o3_cellpad)+'">' : '>'))+(o3_textfontclass ? '' : wrapStr(0,o3_textsize,'text'))+text+(o3_textfontclass ? '' : wrapStr(1,o3_textsize))+'
'; + + set_background(""); + return txt; +} + +// Makes table with caption and optional close link +function ol_content_caption(text,title,close) { + var nameId, txt, cpIsMultiple = /,/.test(o3_cellpad); + var closing, closeevent; + + closing = ""; + closeevent = "onmouseover"; + if (o3_closeclick == 1) closeevent = (o3_closetitle ? "title='" + o3_closetitle +"'" : "") + " onclick"; + if (o3_capicon != "") { + nameId = ' hspace = \"5\"'+' align = \"middle\" alt = \"\"'; + if (typeof o3_dragimg != 'undefined' && o3_dragimg) nameId =' hspace=\"5\"'+' name=\"'+o3_dragimg+'\" id=\"'+o3_dragimg+'\" align=\"middle\" alt=\"Drag Enabled\" title=\"Drag Enabled\"'; + o3_capicon = ''; + } + + if (close != "") + closing = ''+(o3_closefontclass ? '' : wrapStr(0,o3_closesize,'close'))+close+(o3_closefontclass ? '' : wrapStr(1,o3_closesize,'close'))+''; + txt = '
' : '>')+(o3_captionfontclass ? '' : ''+wrapStr(0,o3_captionsize,'caption'))+o3_capicon+title+(o3_captionfontclass ? '' : wrapStr(1,o3_captionsize)+'')+''+closing+'
' :((!olNs4&&cpIsMultiple) ? ' style="'+setCellPadStr(o3_cellpad)+'">' : '>'))+(o3_textfontclass ? '' : wrapStr(0,o3_textsize,'text'))+text+(o3_textfontclass ? '' : wrapStr(1,o3_textsize)) + '
'; + + set_background(""); + return txt; +} + +// Sets the background picture,padding and lots more. :) +function ol_content_background(text,picture,hasfullhtml) { + if (hasfullhtml) { + txt=text; + } else { + txt='
'+(o3_textfontclass ? '' : wrapStr(0,o3_textsize,'text'))+text+(o3_textfontclass ? '' : wrapStr(1,o3_textsize))+'
'; + } + + set_background(picture); + return txt; +} + +// Loads a picture into the div. +function set_background(pic) { + if (pic == "") { + if (olNs4) { + over.background.src = null; + } else if (over.style) { + over.style.backgroundImage = "none"; + } + } else { + if (olNs4) { + over.background.src = pic; + } else if (over.style) { + over.style.width=o3_width + 'px'; + over.style.backgroundImage = "url("+pic+")"; + } + } +} + +//////// +// HANDLING FUNCTIONS +//////// +var olShowId=-1; + +// Displays the popup +function disp(statustext) { + runHook("disp", FBEFORE); + + if (o3_allowmove == 0) { + runHook("placeLayer", FREPLACE); + (olNs6&&olShowId<0) ? olShowId=setTimeout("runHook('showObject', FREPLACE, over)", 1) : runHook("showObject", FREPLACE, over); + o3_allowmove = (o3_sticky || o3_followmouse==0) ? 0 : 1; + } + + runHook("disp", FAFTER); + + if (statustext != "") self.status = statustext; +} + +// Creates the actual popup structure +function createPopup(lyrContent){ + runHook("createPopup", FBEFORE); + + if (o3_wrap) { + var wd,ww,theObj = (olNs4 ? over : over.style); + theObj.top = theObj.left = ((olIe4&&!olOp) ? 0 : -10000) + (!olNs4 ? 'px' : 0); + layerWrite(lyrContent); + wd = (olNs4 ? over.clip.width : over.offsetWidth); + if (wd > (ww=windowWidth())) { + lyrContent=lyrContent.replace(/\ /g, ' '); + o3_width=ww; + o3_wrap=0; + } + } + + layerWrite(lyrContent); + + // Have to set o3_width for placeLayer() routine if o3_wrap is turned on + if (o3_wrap) o3_width=(olNs4 ? over.clip.width : over.offsetWidth); + + runHook("createPopup", FAFTER, lyrContent); + + return true; +} + +// Decides where we want the popup. +function placeLayer() { + var placeX, placeY, widthFix = 0; + + // HORIZONTAL PLACEMENT, re-arranged to work in Safari + if (o3_frame.innerWidth) widthFix=18; + iwidth = windowWidth(); + + // Horizontal scroll offset + winoffset=(olIe4) ? eval('o3_frame.'+docRoot+'.scrollLeft') : o3_frame.pageXOffset; + + placeX = runHook('horizontalPlacement',FCHAIN,iwidth,winoffset,widthFix); + + // VERTICAL PLACEMENT, re-arranged to work in Safari + if (o3_frame.innerHeight) { + iheight=o3_frame.innerHeight; + } else if (eval('o3_frame.'+docRoot)&&eval("typeof o3_frame."+docRoot+".clientHeight=='number'")&&eval('o3_frame.'+docRoot+'.clientHeight')) { + iheight=eval('o3_frame.'+docRoot+'.clientHeight'); + } + + // Vertical scroll offset + scrolloffset=(olIe4) ? eval('o3_frame.'+docRoot+'.scrollTop') : o3_frame.pageYOffset; + placeY = runHook('verticalPlacement',FCHAIN,iheight,scrolloffset); + + // Actually move the object. + repositionTo(over, placeX, placeY); +} + +// Moves the layer +function olMouseMove(e) { + var e = (e) ? e : event; + + if (e.pageX) { + o3_x = e.pageX; + o3_y = e.pageY; + } else if (e.clientX) { + o3_x = eval('e.clientX+o3_frame.'+docRoot+'.scrollLeft'); + o3_y = eval('e.clientY+o3_frame.'+docRoot+'.scrollTop'); + } + + if (o3_allowmove == 1) runHook("placeLayer", FREPLACE); + + // MouseOut handler + if (hoveringSwitch && !olNs4 && runHook("cursorOff", FREPLACE)) { + (olHideDelay ? hideDelay(olHideDelay) : cClick()); + hoveringSwitch = !hoveringSwitch; + } +} + +// Fake function for 3.0 users. +function no_overlib() { return ver3fix; } + +// Capture the mouse and chain other scripts. +function olMouseCapture() { + capExtent = document; + var fN, str = '', l, k, f, wMv, sS, mseHandler = olMouseMove; + var re = /function[ ]*(\w*)\(/; + + wMv = (!olIe4 && window.onmousemove); + if (document.onmousemove || wMv) { + if (wMv) capExtent = window; + f = capExtent.onmousemove.toString(); + fN = f.match(re); + if (fN == null) { + str = f+'(e); '; + } else if (fN[1] == 'anonymous' || fN[1] == 'olMouseMove' || (wMv && fN[1] == 'onmousemove')) { + if (!olOp && wMv) { + l = f.indexOf('{')+1; + k = f.lastIndexOf('}'); + sS = f.substring(l,k); + if ((l = sS.indexOf('(')) != -1) { + sS = sS.substring(0,l).replace(/^\s+/,'').replace(/\s+$/,''); + if (eval("typeof " + sS + " == 'undefined'")) window.onmousemove = null; + else str = sS + '(e);'; + } + } + if (!str) { + olCheckMouseCapture = false; + return; + } + } else { + if (fN[1]) str = fN[1]+'(e); '; + else { + l = f.indexOf('{')+1; + k = f.lastIndexOf('}'); + str = f.substring(l,k) + '\n'; + } + } + str += 'olMouseMove(e); '; + mseHandler = new Function('e', str); + } + + capExtent.onmousemove = mseHandler; + if (olNs4) capExtent.captureEvents(Event.MOUSEMOVE); +} + +//////// +// PARSING FUNCTIONS +//////// + +// Does the actual command parsing. +function parseTokens(pf, ar) { + // What the next argument is expected to be. + var v, i, mode=-1, par = (pf != 'ol_'); + var fnMark = (par && !ar.length ? 1 : 0); + + for (i = 0; i < ar.length; i++) { + if (mode < 0) { + // Arg is maintext,unless its a number between pmStart and pmUpper + // then its a command. + if (typeof ar[i] == 'number' && ar[i] > pmStart && ar[i] < pmUpper) { + fnMark = (par ? 1 : 0); + i--; // backup one so that the next block can parse it + } else { + switch(pf) { + case 'ol_': + ol_text = ar[i].toString(); + break; + default: + o3_text=ar[i].toString(); + } + } + mode = 0; + } else { + // Note: NS4 doesn't like switch cases with vars. + if (ar[i] >= pmCount || ar[i]==DONOTHING) { continue; } + if (ar[i]==INARRAY) { fnMark = 0; eval(pf+'text=ol_texts['+ar[++i]+'].toString()'); continue; } + if (ar[i]==CAPARRAY) { eval(pf+'cap=ol_caps['+ar[++i]+'].toString()'); continue; } + if (ar[i]==STICKY) { if (pf!='ol_') eval(pf+'sticky=1'); continue; } + if (ar[i]==BACKGROUND) { eval(pf+'background="'+ar[++i]+'"'); continue; } + if (ar[i]==NOCLOSE) { if (pf!='ol_') opt_NOCLOSE(); continue; } + if (ar[i]==CAPTION) { eval(pf+"cap='"+escSglQuote(ar[++i])+"'"); continue; } + if (ar[i]==CENTER || ar[i]==LEFT || ar[i]==RIGHT) { eval(pf+'hpos='+ar[i]); if(pf!='ol_') olHautoFlag=1; continue; } + if (ar[i]==OFFSETX) { eval(pf+'offsetx='+ar[++i]); continue; } + if (ar[i]==OFFSETY) { eval(pf+'offsety='+ar[++i]); continue; } + if (ar[i]==FGCOLOR) { eval(pf+'fgcolor="'+ar[++i]+'"'); continue; } + if (ar[i]==BGCOLOR) { eval(pf+'bgcolor="'+ar[++i]+'"'); continue; } + if (ar[i]==TEXTCOLOR) { eval(pf+'textcolor="'+ar[++i]+'"'); continue; } + if (ar[i]==CAPCOLOR) { eval(pf+'capcolor="'+ar[++i]+'"'); continue; } + if (ar[i]==CLOSECOLOR) { eval(pf+'closecolor="'+ar[++i]+'"'); continue; } + if (ar[i]==WIDTH) { eval(pf+'width='+ar[++i]); continue; } + if (ar[i]==BORDER) { eval(pf+'border='+ar[++i]); continue; } + if (ar[i]==CELLPAD) { i=opt_MULTIPLEARGS(++i,ar,(pf+'cellpad')); continue; } + if (ar[i]==STATUS) { eval(pf+"status='"+escSglQuote(ar[++i])+"'"); continue; } + if (ar[i]==AUTOSTATUS) { eval(pf +'autostatus=('+pf+'autostatus == 1) ? 0 : 1'); continue; } + if (ar[i]==AUTOSTATUSCAP) { eval(pf +'autostatus=('+pf+'autostatus == 2) ? 0 : 2'); continue; } + if (ar[i]==HEIGHT) { eval(pf+'height='+pf+'aboveheight='+ar[++i]); continue; } // Same param again. + if (ar[i]==CLOSETEXT) { eval(pf+"close='"+escSglQuote(ar[++i])+"'"); continue; } + if (ar[i]==SNAPX) { eval(pf+'snapx='+ar[++i]); continue; } + if (ar[i]==SNAPY) { eval(pf+'snapy='+ar[++i]); continue; } + if (ar[i]==FIXX) { eval(pf+'fixx='+ar[++i]); continue; } + if (ar[i]==FIXY) { eval(pf+'fixy='+ar[++i]); continue; } + if (ar[i]==RELX) { eval(pf+'relx='+ar[++i]); continue; } + if (ar[i]==RELY) { eval(pf+'rely='+ar[++i]); continue; } + if (ar[i]==FGBACKGROUND) { eval(pf+'fgbackground="'+ar[++i]+'"'); continue; } + if (ar[i]==BGBACKGROUND) { eval(pf+'bgbackground="'+ar[++i]+'"'); continue; } + if (ar[i]==PADX) { eval(pf+'padxl='+ar[++i]); eval(pf+'padxr='+ar[++i]); continue; } + if (ar[i]==PADY) { eval(pf+'padyt='+ar[++i]); eval(pf+'padyb='+ar[++i]); continue; } + if (ar[i]==FULLHTML) { if (pf!='ol_') eval(pf+'fullhtml=1'); continue; } + if (ar[i]==BELOW || ar[i]==ABOVE) { eval(pf+'vpos='+ar[i]); if (pf!='ol_') olVautoFlag=1; continue; } + if (ar[i]==CAPICON) { eval(pf+'capicon="'+ar[++i]+'"'); continue; } + if (ar[i]==TEXTFONT) { eval(pf+"textfont='"+escSglQuote(ar[++i])+"'"); continue; } + if (ar[i]==CAPTIONFONT) { eval(pf+"captionfont='"+escSglQuote(ar[++i])+"'"); continue; } + if (ar[i]==CLOSEFONT) { eval(pf+"closefont='"+escSglQuote(ar[++i])+"'"); continue; } + if (ar[i]==TEXTSIZE) { eval(pf+'textsize="'+ar[++i]+'"'); continue; } + if (ar[i]==CAPTIONSIZE) { eval(pf+'captionsize="'+ar[++i]+'"'); continue; } + if (ar[i]==CLOSESIZE) { eval(pf+'closesize="'+ar[++i]+'"'); continue; } + if (ar[i]==TIMEOUT) { eval(pf+'timeout='+ar[++i]); continue; } + if (ar[i]==FUNCTION) { if (pf=='ol_') { if (typeof ar[i+1]!='number') { v=ar[++i]; ol_function=(typeof v=='function' ? v : null); }} else {fnMark = 0; v = null; if (typeof ar[i+1]!='number') v = ar[++i]; opt_FUNCTION(v); } continue; } + if (ar[i]==DELAY) { eval(pf+'delay='+ar[++i]); continue; } + if (ar[i]==HAUTO) { eval(pf+'hauto=('+pf+'hauto == 0) ? 1 : 0'); continue; } + if (ar[i]==VAUTO) { eval(pf+'vauto=('+pf+'vauto == 0) ? 1 : 0'); continue; } + if (ar[i]==CLOSECLICK) { eval(pf +'closeclick=('+pf+'closeclick == 0) ? 1 : 0'); continue; } + if (ar[i]==WRAP) { eval(pf +'wrap=('+pf+'wrap == 0) ? 1 : 0'); continue; } + if (ar[i]==FOLLOWMOUSE) { eval(pf +'followmouse=('+pf+'followmouse == 1) ? 0 : 1'); continue; } + if (ar[i]==MOUSEOFF) { eval(pf +'mouseoff=('+pf+'mouseoff==0) ? 1 : 0'); v=ar[i+1]; if (pf != 'ol_' && eval(pf+'mouseoff') && typeof v == 'number' && (v < pmStart || v > pmUpper)) olHideDelay=ar[++i]; continue; } + if (ar[i]==CLOSETITLE) { eval(pf+"closetitle='"+escSglQuote(ar[++i])+"'"); continue; } + if (ar[i]==CSSOFF||ar[i]==CSSCLASS) { eval(pf+'css='+ar[i]); continue; } + if (ar[i]==COMPATMODE) { eval(pf+'compatmode=('+pf+'compatmode==0) ? 1 : 0'); continue; } + if (ar[i]==FGCLASS) { eval(pf+'fgclass="'+ar[++i]+'"'); continue; } + if (ar[i]==BGCLASS) { eval(pf+'bgclass="'+ar[++i]+'"'); continue; } + if (ar[i]==TEXTFONTCLASS) { eval(pf+'textfontclass="'+ar[++i]+'"'); continue; } + if (ar[i]==CAPTIONFONTCLASS) { eval(pf+'captionfontclass="'+ar[++i]+'"'); continue; } + if (ar[i]==CLOSEFONTCLASS) { eval(pf+'closefontclass="'+ar[++i]+'"'); continue; } + i = parseCmdLine(pf, i, ar); + } + } + + if (fnMark && o3_function) o3_text = o3_function(); + + if ((pf == 'o3_') && o3_wrap) { + o3_width = 0; + + var tReg=/<.*\n*>/ig; + if (!tReg.test(o3_text)) o3_text = o3_text.replace(/[ ]+/g, ' '); + if (!tReg.test(o3_cap))o3_cap = o3_cap.replace(/[ ]+/g, ' '); + } + if ((pf == 'o3_') && o3_sticky) { + if (!o3_close && (o3_frame != ol_frame)) o3_close = ol_close; + if (o3_mouseoff && (o3_frame == ol_frame)) opt_NOCLOSE(' '); + } +} + + +//////// +// LAYER FUNCTIONS +//////// + +// Writes to a layer +function layerWrite(txt) { + txt += "\n"; + if (olNs4) { + var lyr = o3_frame.document.layers['overDiv'].document + lyr.write(txt) + lyr.close() + } else if (typeof over.innerHTML != 'undefined') { + if (olIe5 && isMac) over.innerHTML = ''; + over.innerHTML = txt; + } else { + range = o3_frame.document.createRange(); + range.setStartAfter(over); + domfrag = range.createContextualFragment(txt); + + while (over.hasChildNodes()) { + over.removeChild(over.lastChild); + } + + over.appendChild(domfrag); + } +} + +// Make an object visible +function showObject(obj) { + runHook("showObject", FBEFORE); + + var theObj=(olNs4 ? obj : obj.style); + theObj.visibility = 'visible'; + + runHook("showObject", FAFTER); +} + +// Hides an object +function hideObject(obj) { + runHook("hideObject", FBEFORE); + + var theObj=(olNs4 ? obj : obj.style); + if (olNs6 && olShowId>0) { clearTimeout(olShowId); olShowId=0; } + theObj.visibility = 'hidden'; + theObj.top = theObj.left = ((olIe4&&!olOp) ? 0 : -10000) + (!olNs4 ? 'px' : 0); + + if (o3_timerid > 0) clearTimeout(o3_timerid); + if (o3_delayid > 0) clearTimeout(o3_delayid); + + o3_timerid = 0; + o3_delayid = 0; + self.status = ""; + + if (obj.onmouseout||obj.onmouseover) { + if (olNs4) obj.releaseEvents(Event.MOUSEOUT || Event.MOUSEOVER); + obj.onmouseout = obj.onmouseover = null; + } + + runHook("hideObject", FAFTER); +} + +// Move a layer +function repositionTo(obj, xL, yL) { + var theObj=(olNs4 ? obj : obj.style); + theObj.left = xL + (!olNs4 ? 'px' : 0); + theObj.top = yL + (!olNs4 ? 'px' : 0); +} + +// Check position of cursor relative to overDiv DIVision; mouseOut function +function cursorOff() { + var left = parseInt(over.style.left); + var top = parseInt(over.style.top); + var right = left + (over.offsetWidth >= parseInt(o3_width) ? over.offsetWidth : parseInt(o3_width)); + var bottom = top + (over.offsetHeight >= o3_aboveheight ? over.offsetHeight : o3_aboveheight); + + if (o3_x < left || o3_x > right || o3_y < top || o3_y > bottom) return true; + + return false; +} + + +//////// +// COMMAND FUNCTIONS +//////// + +// Calls callme or the default function. +function opt_FUNCTION(callme) { + o3_text = (callme ? (typeof callme=='string' ? (/.+\(.*\)/.test(callme) ? eval(callme) : callme) : callme()) : (o3_function ? o3_function() : 'No Function')); + + return 0; +} + +// Handle hovering +function opt_NOCLOSE(unused) { + if (!unused) o3_close = ""; + + if (olNs4) { + over.captureEvents(Event.MOUSEOUT || Event.MOUSEOVER); + over.onmouseover = function () { if (o3_timerid > 0) { clearTimeout(o3_timerid); o3_timerid = 0; } } + over.onmouseout = function (e) { if (olHideDelay) hideDelay(olHideDelay); else cClick(e); } + } else { + over.onmouseover = function () {hoveringSwitch = true; if (o3_timerid > 0) { clearTimeout(o3_timerid); o3_timerid =0; } } + } + + return 0; +} + +// Function to scan command line arguments for multiples +function opt_MULTIPLEARGS(i, args, parameter) { + var k=i, re, pV, str=''; + + for(k=i; kpmStart) break; + str += args[k] + ','; + } + if (str) str = str.substring(0,--str.length); + + k--; // reduce by one so the for loop this is in works correctly + pV=(olNs4 && /cellpad/i.test(parameter)) ? str.split(',')[0] : str; + eval(parameter + '="' + pV + '"'); + + return k; +} + +// Remove   in texts when done. +function nbspCleanup() { + if (o3_wrap) { + o3_text = o3_text.replace(/\ /g, ' '); + o3_cap = o3_cap.replace(/\ /g, ' '); + } +} + +// Escape embedded single quotes in text strings +function escSglQuote(str) { + return str.toString().replace(/'/g,"\\'"); +} + +// Onload handler for window onload event +function OLonLoad_handler(e) { + var re = /\w+\(.*\)[;\s]+/g, olre = /overlib\(|nd\(|cClick\(/, fn, l, i; + + if(!olLoaded) olLoaded=1; + + // Remove it for Gecko based browsers + if(window.removeEventListener && e.eventPhase == 3) window.removeEventListener("load",OLonLoad_handler,false); + else if(window.detachEvent) { // and for IE and Opera 4.x but execute calls to overlib, nd, or cClick() + window.detachEvent("onload",OLonLoad_handler); + var fN = document.body.getAttribute('onload'); + if (fN) { + fN=fN.toString().match(re); + if (fN && fN.length) { + for (i=0; i' : '
') : ''; + else { + fontStr='o3_'+whichString+'font'; + fontColor='o3_'+((whichString=='caption')? 'cap' : whichString)+'color'; + return (hasDims&&!olNs4) ? (isClose ? '' : '
') : ''; + } +} + +// Quotes Multi word font names; needed for CSS Standards adherence in font-family +function quoteMultiNameFonts(theFont) { + var v, pM=theFont.split(','); + for (var i=0; i 0) clearTimeout(o3_timerid); + + o3_timerid=setTimeout("cClick()",(o3_timeout=time)); + } +} + +// Was originally in the placeLayer() routine; separated out for future ease +function horizontalPlacement(browserWidth, horizontalScrollAmount, widthFix) { + var placeX, iwidth=browserWidth, winoffset=horizontalScrollAmount; + var parsedWidth = parseInt(o3_width); + + if (o3_fixx > -1 || o3_relx != null) { + // Fixed position + placeX=(o3_relx != null ? ( o3_relx < 0 ? winoffset +o3_relx+ iwidth - parsedWidth - widthFix : winoffset+o3_relx) : o3_fixx); + } else { + // If HAUTO, decide what to use. + if (o3_hauto == 1) { + if ((o3_x - winoffset) > (iwidth / 2)) { + o3_hpos = LEFT; + } else { + o3_hpos = RIGHT; + } + } + + // From mouse + if (o3_hpos == CENTER) { // Center + placeX = o3_x+o3_offsetx-(parsedWidth/2); + + if (placeX < winoffset) placeX = winoffset; + } + + if (o3_hpos == RIGHT) { // Right + placeX = o3_x+o3_offsetx; + + if ((placeX+parsedWidth) > (winoffset+iwidth - widthFix)) { + placeX = iwidth+winoffset - parsedWidth - widthFix; + if (placeX < 0) placeX = 0; + } + } + if (o3_hpos == LEFT) { // Left + placeX = o3_x-o3_offsetx-parsedWidth; + if (placeX < winoffset) placeX = winoffset; + } + + // Snapping! + if (o3_snapx > 1) { + var snapping = placeX % o3_snapx; + + if (o3_hpos == LEFT) { + placeX = placeX - (o3_snapx+snapping); + } else { + // CENTER and RIGHT + placeX = placeX+(o3_snapx - snapping); + } + + if (placeX < winoffset) placeX = winoffset; + } + } + + return placeX; +} + +// was originally in the placeLayer() routine; separated out for future ease +function verticalPlacement(browserHeight,verticalScrollAmount) { + var placeY, iheight=browserHeight, scrolloffset=verticalScrollAmount; + var parsedHeight=(o3_aboveheight ? parseInt(o3_aboveheight) : (olNs4 ? over.clip.height : over.offsetHeight)); + + if (o3_fixy > -1 || o3_rely != null) { + // Fixed position + placeY=(o3_rely != null ? (o3_rely < 0 ? scrolloffset+o3_rely+iheight - parsedHeight : scrolloffset+o3_rely) : o3_fixy); + } else { + // If VAUTO, decide what to use. + if (o3_vauto == 1) { + if ((o3_y - scrolloffset) > (iheight / 2) && o3_vpos == BELOW && (o3_y + parsedHeight + o3_offsety - (scrolloffset + iheight) > 0)) { + o3_vpos = ABOVE; + } else if (o3_vpos == ABOVE && (o3_y - (parsedHeight + o3_offsety) - scrolloffset < 0)) { + o3_vpos = BELOW; + } + } + + // From mouse + if (o3_vpos == ABOVE) { + if (o3_aboveheight == 0) o3_aboveheight = parsedHeight; + + placeY = o3_y - (o3_aboveheight+o3_offsety); + if (placeY < scrolloffset) placeY = scrolloffset; + } else { + // BELOW + placeY = o3_y+o3_offsety; + } + + // Snapping! + if (o3_snapy > 1) { + var snapping = placeY % o3_snapy; + + if (o3_aboveheight > 0 && o3_vpos == ABOVE) { + placeY = placeY - (o3_snapy+snapping); + } else { + placeY = placeY+(o3_snapy - snapping); + } + + if (placeY < scrolloffset) placeY = scrolloffset; + } + } + + return placeY; +} + +// checks positioning flags +function checkPositionFlags() { + if (olHautoFlag) olHautoFlag = o3_hauto=0; + if (olVautoFlag) olVautoFlag = o3_vauto=0; + return true; +} + +// get Browser window width +function windowWidth() { + var w; + if (o3_frame.innerWidth) w=o3_frame.innerWidth; + else if (eval('o3_frame.'+docRoot)&&eval("typeof o3_frame."+docRoot+".clientWidth=='number'")&&eval('o3_frame.'+docRoot+'.clientWidth')) + w=eval('o3_frame.'+docRoot+'.clientWidth'); + return w; +} + +// create the div container for popup content if it doesn't exist +function createDivContainer(id,frm,zValue) { + id = (id || 'overDiv'), frm = (frm || o3_frame), zValue = (zValue || 1000); + var objRef, divContainer = layerReference(id); + + if (divContainer == null) { + if (olNs4) { + divContainer = frm.document.layers[id] = new Layer(window.innerWidth, frm); + objRef = divContainer; + } else { + var body = (olIe4 ? frm.document.all.tags('BODY')[0] : frm.document.getElementsByTagName("BODY")[0]); + if (olIe4&&!document.getElementById) { + body.insertAdjacentHTML("beforeEnd",'
'); + divContainer=layerReference(id); + } else { + divContainer = frm.document.createElement("DIV"); + divContainer.id = id; + body.appendChild(divContainer); + } + objRef = divContainer.style; + } + + objRef.position = 'absolute'; + objRef.visibility = 'hidden'; + objRef.zIndex = zValue; + if (olIe4&&!olOp) objRef.left = objRef.top = '0px'; + else objRef.left = objRef.top = -10000 + (!olNs4 ? 'px' : 0); + } + + return divContainer; +} + +// get reference to a layer with ID=id +function layerReference(id) { + return (olNs4 ? o3_frame.document.layers[id] : (document.all ? o3_frame.document.all[id] : o3_frame.document.getElementById(id))); +} +//////// +// UTILITY FUNCTIONS +//////// + +// Checks if something is a function. +function isFunction(fnRef) { + var rtn = true; + + if (typeof fnRef == 'object') { + for (var i = 0; i < fnRef.length; i++) { + if (typeof fnRef[i]=='function') continue; + rtn = false; + break; + } + } else if (typeof fnRef != 'function') { + rtn = false; + } + + return rtn; +} + +// Converts an array into an argument string for use in eval. +function argToString(array, strtInd, argName) { + var jS = strtInd, aS = '', ar = array; + argName=(argName ? argName : 'ar'); + + if (ar.length > jS) { + for (var k = jS; k < ar.length; k++) aS += argName+'['+k+'], '; + aS = aS.substring(0, aS.length-2); + } + + return aS; +} + +// Places a hook in the correct position in a hook point. +function reOrder(hookPt, fnRef, order) { + var newPt = new Array(), match, i, j; + + if (!order || typeof order == 'undefined' || typeof order == 'number') return hookPt; + + if (typeof order=='function') { + if (typeof fnRef=='object') { + newPt = newPt.concat(fnRef); + } else { + newPt[newPt.length++]=fnRef; + } + + for (i = 0; i < hookPt.length; i++) { + match = false; + if (typeof fnRef == 'function' && hookPt[i] == fnRef) { + continue; + } else { + for(j = 0; j < fnRef.length; j++) if (hookPt[i] == fnRef[j]) { + match = true; + break; + } + } + if (!match) newPt[newPt.length++] = hookPt[i]; + } + + newPt[newPt.length++] = order; + + } else if (typeof order == 'object') { + if (typeof fnRef == 'object') { + newPt = newPt.concat(fnRef); + } else { + newPt[newPt.length++] = fnRef; + } + + for (j = 0; j < hookPt.length; j++) { + match = false; + if (typeof fnRef == 'function' && hookPt[j] == fnRef) { + continue; + } else { + for (i = 0; i < fnRef.length; i++) if (hookPt[j] == fnRef[i]) { + match = true; + break; + } + } + if (!match) newPt[newPt.length++]=hookPt[j]; + } + + for (i = 0; i < newPt.length; i++) hookPt[i] = newPt[i]; + newPt.length = 0; + + for (j = 0; j < hookPt.length; j++) { + match = false; + for (i = 0; i < order.length; i++) { + if (hookPt[j] == order[i]) { + match = true; + break; + } + } + if (!match) newPt[newPt.length++] = hookPt[j]; + } + newPt = newPt.concat(order); + } + + hookPt = newPt; + + return hookPt; +} + +//////// +// PLUGIN ACTIVATION FUNCTIONS +//////// + +// Runs plugin functions to set runtime variables. +function setRunTimeVariables(){ + if (typeof runTime != 'undefined' && runTime.length) { + for (var k = 0; k < runTime.length; k++) { + runTime[k](); + } + } +} + +// Runs plugin functions to parse commands. +function parseCmdLine(pf, i, args) { + if (typeof cmdLine != 'undefined' && cmdLine.length) { + for (var k = 0; k < cmdLine.length; k++) { + var j = cmdLine[k](pf, i, args); + if (j >- 1) { + i = j; + break; + } + } + } + + return i; +} + +// Runs plugin functions to do things after parse. +function postParseChecks(pf,args){ + if (typeof postParse != 'undefined' && postParse.length) { + for (var k = 0; k < postParse.length; k++) { + if (postParse[k](pf,args)) continue; + return false; // end now since have an error + } + } + return true; +} + + +//////// +// PLUGIN REGISTRATION FUNCTIONS +//////// + +// Registers commands and creates constants. +function registerCommands(cmdStr) { + if (typeof cmdStr!='string') return; + + var pM = cmdStr.split(','); + pms = pms.concat(pM); + + for (var i = 0; i< pM.length; i++) { + eval(pM[i].toUpperCase()+'='+pmCount++); + } +} + +// Registers no-parameter commands +function registerNoParameterCommands(cmdStr) { + if (!cmdStr && typeof cmdStr != 'string') return; + pmt=(!pmt) ? cmdStr : pmt + ',' + cmdStr; +} + +// Register a function to hook at a certain point. +function registerHook(fnHookTo, fnRef, hookType, optPm) { + var hookPt, last = typeof optPm; + + if (fnHookTo == 'plgIn'||fnHookTo == 'postParse') return; + if (typeof hookPts[fnHookTo] == 'undefined') hookPts[fnHookTo] = new FunctionReference(); + + hookPt = hookPts[fnHookTo]; + + if (hookType != null) { + if (hookType == FREPLACE) { + hookPt.ovload = fnRef; // replace normal overlib routine + if (fnHookTo.indexOf('ol_content_') > -1) hookPt.alt[pms[CSSOFF-1-pmStart]]=fnRef; + + } else if (hookType == FBEFORE || hookType == FAFTER) { + var hookPt=(hookType == 1 ? hookPt.before : hookPt.after); + + if (typeof fnRef == 'object') { + hookPt = hookPt.concat(fnRef); + } else { + hookPt[hookPt.length++] = fnRef; + } + + if (optPm) hookPt = reOrder(hookPt, fnRef, optPm); + + } else if (hookType == FALTERNATE) { + if (last=='number') hookPt.alt[pms[optPm-1-pmStart]] = fnRef; + } else if (hookType == FCHAIN) { + hookPt = hookPt.chain; + if (typeof fnRef=='object') hookPt=hookPt.concat(fnRef); // add other functions + else hookPt[hookPt.length++]=fnRef; + } + + return; + } +} + +// Register a function that will set runtime variables. +function registerRunTimeFunction(fn) { + if (isFunction(fn)) { + if (typeof fn == 'object') { + runTime = runTime.concat(fn); + } else { + runTime[runTime.length++] = fn; + } + } +} + +// Register a function that will handle command parsing. +function registerCmdLineFunction(fn){ + if (isFunction(fn)) { + if (typeof fn == 'object') { + cmdLine = cmdLine.concat(fn); + } else { + cmdLine[cmdLine.length++] = fn; + } + } +} + +// Register a function that does things after command parsing. +function registerPostParseFunction(fn){ + if (isFunction(fn)) { + if (typeof fn == 'object') { + postParse = postParse.concat(fn); + } else { + postParse[postParse.length++] = fn; + } + } +} + +//////// +// PLUGIN REGISTRATION FUNCTIONS +//////// + +// Runs any hooks registered. +function runHook(fnHookTo, hookType) { + var l = hookPts[fnHookTo], k, rtnVal = null, optPm, arS, ar = runHook.arguments; + + if (hookType == FREPLACE) { + arS = argToString(ar, 2); + + if (typeof l == 'undefined' || !(l = l.ovload)) rtnVal = eval(fnHookTo+'('+arS+')'); + else rtnVal = eval('l('+arS+')'); + + } else if (hookType == FBEFORE || hookType == FAFTER) { + if (typeof l != 'undefined') { + l=(hookType == 1 ? l.before : l.after); + + if (l.length) { + arS = argToString(ar, 2); + for (var k = 0; k < l.length; k++) eval('l[k]('+arS+')'); + } + } + } else if (hookType == FALTERNATE) { + optPm = ar[2]; + arS = argToString(ar, 3); + + if (typeof l == 'undefined' || (l = l.alt[pms[optPm-1-pmStart]]) == 'undefined') { + rtnVal = eval(fnHookTo+'('+arS+')'); + } else { + rtnVal = eval('l('+arS+')'); + } + } else if (hookType == FCHAIN) { + arS=argToString(ar,2); + l=l.chain; + + for (k=l.length; k > 0; k--) if((rtnVal=eval('l[k-1]('+arS+')'))!=void(0)) break; + } + + return rtnVal; +} + +//////// +// OBJECT CONSTRUCTORS +//////// + +// Object for handling hooks. +function FunctionReference() { + this.ovload = null; + this.before = new Array(); + this.after = new Array(); + this.alt = new Array(); + this.chain = new Array(); +} + +// Object for simple access to the overLIB version used. +// Examples: simpleversion:351 major:3 minor:5 revision:1 +function Info(version, prerelease) { + this.version = version; + this.prerelease = prerelease; + + this.simpleversion = Math.round(this.version*100); + this.major = parseInt(this.simpleversion / 100); + this.minor = parseInt(this.simpleversion / 10) - this.major * 10; + this.revision = parseInt(this.simpleversion) - this.major * 100 - this.minor * 10; + this.meets = meets; +} + +// checks for Core Version required +function meets(reqdVersion) { + return (!reqdVersion) ? false : this.simpleversion >= Math.round(100*parseFloat(reqdVersion)); +} + + +//////// +// STANDARD REGISTRATIONS +//////// +registerHook("ol_content_simple", ol_content_simple, FALTERNATE, CSSOFF); +registerHook("ol_content_caption", ol_content_caption, FALTERNATE, CSSOFF); +registerHook("ol_content_background", ol_content_background, FALTERNATE, CSSOFF); +registerHook("ol_content_simple", ol_content_simple, FALTERNATE, CSSCLASS); +registerHook("ol_content_caption", ol_content_caption, FALTERNATE, CSSCLASS); +registerHook("ol_content_background", ol_content_background, FALTERNATE, CSSCLASS); +registerPostParseFunction(checkPositionFlags); +registerHook("hideObject", nbspCleanup, FAFTER); +registerHook("horizontalPlacement", horizontalPlacement, FCHAIN); +registerHook("verticalPlacement", verticalPlacement, FCHAIN); +if (olNs4||(olIe5&&isMac)||olKq) olLoaded=1; +registerNoParameterCommands('sticky,autostatus,autostatuscap,fullhtml,hauto,vauto,closeclick,wrap,followmouse,mouseoff,compatmode'); +/////// +// ESTABLISH MOUSECAPTURING +/////// + +// Capture events, alt. diffuses the overlib function. +var olCheckMouseCapture=true; +if ((olNs4 || olNs6 || olIe4)) { + olMouseCapture(); +} else { + overlib = no_overlib; + nd = no_overlib; + ver3fix = true; +} diff --git a/docs/fonts/PTS56F-webfont.ttf b/docs/fonts/PTS56F-webfont.ttf new file mode 100644 index 00000000..a847072f Binary files /dev/null and b/docs/fonts/PTS56F-webfont.ttf differ diff --git a/docs/fonts/PTS76F-webfont.ttf b/docs/fonts/PTS76F-webfont.ttf new file mode 100644 index 00000000..6e146b65 Binary files /dev/null and b/docs/fonts/PTS76F-webfont.ttf differ diff --git a/docs/fonts/Paratype PT Sans Free Font License.txt b/docs/fonts/Paratype PT Sans Free Font License.txt new file mode 100644 index 00000000..20330f6d --- /dev/null +++ b/docs/fonts/Paratype PT Sans Free Font License.txt @@ -0,0 +1,26 @@ +Copyright © 2009 ParaType Ltd. +with Reserved Names &quot;PT Sans&quot; and &quot;ParaType&quot;. + +FONT LICENSE + +PERMISSION &amp; CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining a copy of the font software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the font software, subject to the following conditions: + +1) Neither the font software nor any of its individual components, in original or modified versions, may be sold by itself. + +2) Original or modified versions of the font software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. + +3) No modified version of the font software may use the Reserved Name(s) or combinations of Reserved Names with other words unless explicit written permission is granted by the ParaType. This restriction only applies to the primary font name as presented to the users. + +4) The name of ParaType or the author(s) of the font software shall not be used to promote, endorse or advertise any modified version, except to acknowledge the contribution(s) of ParaType and the author(s) or with explicit written permission of ParaType. + +5) The font software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. + +TERMINATION &amp; TERRITORY +This license has no limits on time and territory, but it becomes null and void if any of the above conditions are not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL PARATYPE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. + +ParaType Ltd +http://www.paratype.ru \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 129e8d00..4a1f21c1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,25 +1,26 @@ - + - + - PHP Weathermap v0.97c - Start Here + PHP Weathermap v0.98b - Start Here - -
-
+ + + + + +
- -

New Users should start here.

@@ -96,6 +97,6 @@

Visual Guides


-
+ diff --git a/docs/kube101/css/kube.css b/docs/kube101/css/kube.css new file mode 100644 index 00000000..b509a37b --- /dev/null +++ b/docs/kube101/css/kube.css @@ -0,0 +1,1306 @@ +/* + Kube Professional CSS-framework + + Copyright (c) 2012, Imperavi Inc. + + http://imperavi.com/kube/ + + License: free + +*/ +/* =Base, reset, normalize +-----------------------------------------------------------------------------*/ +html, +body, +div, +span, +object, +iframe, +p, +blockquote, +pre, +a, +abbr, +acronym, +address, +big, +cite, +code, +del, +dfn, +em, +img, +ins, +kbd, +q, +s, +samp, +small, +strike, +strong, +sub, +sup, +tt, +var, +b, +u, +i, +center, +dl, +dt, +dd, +ol, +ul, +li, +fieldset, +form, +label, +legend, +table, +caption, +tbody, +tfoot, +thead, +tr, +th, +td, +article, +aside, +canvas, +details, +embed, +figure, +figcaption, +footer, +header, +hgroup, +menu, +nav, +output, +ruby, +section, +summary, +time, +mark, +audio, +video, +h1, +h2, +h3, +h4, +h5, +h6 { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-size: 100%; + vertical-align: baseline; + background: transparent; + font-style: normal; +} +/* Structure tags */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +nav, +section { + display: block; +} +/* Responsive images and other embedded objects */ +img, +object, +embed, +video, +iframe { + width: auto; + max-width: 100%; +} +/* Responsive images aspeÑt ratio */ +img, +video, +iframe { + height: auto; +} +/* To prevent some browsers from inserting quotes on q and p */ +blockquote, +q { + quotes: none; +} +blockquote p:before, +blockquote p:after, +q:before, +q:after { + content: ''; + content: none; +} +/* Table reset */ +table { + border-collapse: collapse; + border-spacing: 0; +} +caption, +th, +td { + text-align: left; + vertical-align: top; + font-weight: normal; +} +thead th, +thead td { + font-weight: bold; + vertical-align: bottom; +} +/* Image inside */ +a img, +th img, +td img { + vertical-align: top; +} +/* Webkit browsers reset margin */ +button, +input, +select, +textarea { + margin: 0; +} +textarea { + overflow: auto; +} +/* Normalize buttons in IE */ +button { + width: auto; + overflow: visible; +} +/* Hand cursor on clickable controls */ +input[type=button], +input[type=submit], +button { + cursor: pointer; +} +/* Trick with vertical align for radio and checkbox */ +input[type="radio"], +input[type="checkbox"] { + font-size: 110%; +} +/* Horizontal rule reset */ +hr { + display: block; + height: 1px; + border: 0; + border-top: 1px solid #ddd; +} +/* Clearfix */ +.group:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +/* =Typography +-----------------------------------------------------------------------------*/ +body { + background: #ffffff; + color: #000000; + font-size: 0.875em; + line-height: 1.5em; + font-family: Helvetica, Arial, Tahoma, sans-serif; +} +a { + color: #336699; +} +a:hover { + color: #19334d; +} +h1, +h2, +h3, +h4, +h5, +h6 { + font-weight: bold; + margin-bottom: 0.5em; +} +h1 { + font-size: 2.5714285714285716em; + line-height: 1em; +} +h2 { + font-size: 2.142857142857143em; + line-height: 1.1em; +} +h3 { + font-size: 1.7142857142857142em; + line-height: 1.3em; +} +h4 { + font-size: 1.2857142857142858em; + line-height: 1.3em; +} +h5 { + font-size: 1.1428571428571428em; + line-height: 1.3em; +} +h6 { + font-size: 1em; + line-height: 1.3em; + text-transform: uppercase; +} +hgroup h1, +hgroup h2, +hgroup h3, +hgroup h4 { + margin-bottom: .1em; +} +.subheader { + font-size: 1.2em; + font-weight: normal; + color: #8f8f8f; + margin-bottom: 1em; +} +p, +ul, +ol, +dl, +dd, +dt, +blockquote, +td, +th { + line-height: 1.5em; +} +ul, +ol, +ul ul, +ol ol, +ul ol, +ol ul { + margin: 0 0 0 2em; +} +ol ol li { + list-style-type: lower-alpha; +} +ol ol ol li { + list-style-type: lower-roman; +} +p, +ul, +ol, +dl, +blockquote, +hr, +pre, +hgroup, +table, +form, +fieldset { + margin-bottom: 1.5em; +} +dl dt { + font-weight: bold; +} +dd { + margin-left: 1em; +} +blockquote { + margin-bottom: 1.5em; + padding-left: 1.5em; + border-left: 1px solid #ccc; + color: #666; +} +blockquote small, +cite { + color: #888; + font-style: italic; +} +blockquote p { + margin-bottom: 1em; + font-style: italic; +} +small, +blockquote cite { + font-size: 0.85em; + line-height: 1; +} +blockquote .pull-right, +.row blockquote .pull-right { + float: none; + text-align: right; + display: block; +} +address { + font-style: italic; +} +del { + text-decoration: line-through; +} +abbr[title], +dfn[title] { + border-bottom: 1px dotted #000; + cursor: help; +} +strong, +b { + font-weight: bold; +} +em, +i { + font-style: italic; +} +sub, +sup { + font-size: 0.7em; + line-height: 0; + position: relative; +} +sup { + top: -0.5em; +} +sub { + bottom: -0.25em; +} +figcaption { + font-size: 0.85em; + font-style: italic; +} +ins, +mark { + background-color: #ffee55; + color: #000000; + text-decoration: none; +} +pre, +code, +kbd, +samp { + font-size: 90%; + font-family: Menlo, Monaco, monospace, sans-serif; +} +pre { + background: #f8f8f8; + border: 1px solid #ddd; + border-radius: 3px; + padding: 1.5em; + white-space: pre; + overflow: auto; +} +code { + padding: 2px 3px; + display: inline-block; + line-height: 1; + background: #f8f8f8; + border: 1px solid #ddd; +} +kbd { + padding: 0 6px; + border-radius: 4px; + box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2), 0 0 0 1px #ffffff inset; + background-color: #fafafa; + border-color: #ccc #ccc white; + border-style: solid solid none; + border-width: 1px 1px medium; + color: #444; + font-weight: bold; + white-space: nowrap; +} +input[type="text"], +input[type="password"], +input[type="email"], +textarea { + font-size: 13px; +} +fieldset { + padding: 2em 1.5em; + margin-bottom: 1.5em; + border: 1px solid #dddddd; +} +legend { + font-size: 1.2em; + text-transform: uppercase; + font-weight: bold; + padding: 0 1em; +} +tfoot th, +tfoot td { + background-color: #f2f2f2; +} +th, +td { + border-bottom: 1px solid #eeeeee; + padding: 0.75em 0.5em; +} +/* =Tables +-----------------------------------------------------------------------------*/ +table caption { + text-transform: uppercase; + font-weight: bold; + padding-left: 0.5em; + color: #666; +} +table.simple td, +table.simple th { + border: none; + padding: 0.75em 0.7em 0.75em 0; +} +table.bordered td, +table.bordered th { + border: 1px solid #ddd; +} +table.stroked td, +table.stroked th { + border-bottom: 1px solid #eee; +} +table.striped tbody tr:nth-child(odd) td { + background-color: #f8f8f8; +} +table.hovered tbody tr:hover td, +table.hovered thead tr:hover th { + background-color: #f6f6f6; +} +.thead-gray td, +.thead-gray th { + background-color: #f0f0f0; +} +.thead-black td, +.thead-black th { + font-weight: normal; + color: #f6f6f6; + color: rgba(255, 255, 255, 0.9); + background-color: #222; +} +table.bordered .thead-black td, +table.bordered .thead-black th { + border: 1px solid #444; +} +/* =Forms +-----------------------------------------------------------------------------*/ +.forms label { + display: block; + margin-bottom: 2px; +} +.descr { + color: #999999; + font-size: 0.85em; + line-height: 1.5em; +} +div.descr { + margin: 4px 0; +} +.columnar div.descr { + margin-bottom: 10px; +} +.forms ul { + list-style: none; + margin: 0; +} +.forms ul li { + margin-bottom: 10px; +} +.forms.columnar ul li { + margin-bottom: 15px; +} +/* liner fieldset */ +fieldset.liner { + border: none; + padding: 0; +} +fieldset.liner legend { + padding: 0; + width: 100%; + padding-bottom: 12px; +} +fieldset.liner legend span { + padding: 0; + padding-bottom: 8px; + border-bottom: 1px solid #eee; + display: block; +} +/* multicolumn */ +.forms ul.multicolumn:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +.forms ul.multicolumn li { + float: left; + margin-right: 12px; + margin-bottom: 0; + line-height: 1.8em; +} +.forms ul.multicolumn li label { + margin-bottom: 0; +} +.forms ul.multicolumn li.width-50 { + width: 48%; + margin-right: 2%; +} +.forms ul.multicolumn li.width-33 { + width: 31%; + margin-right: 2%; +} +/* columnar */ +.forms.columnar legend { + margin-bottom: 1em; +} +.forms.columnar label { + float: left; + width: 150px; + text-align: right; + margin-right: 20px; +} +.forms.columnar .push, +.forms.columnar div.descr { + margin-left: 170px; +} +.forms.columnar li fieldset label { + float: none; + width: auto; + text-align: left; + margin-right: 0; +} +.forms.columnar li fieldset { + border: none; + padding: 0; + margin: 0; + padding-left: 170px; + position: relative; +} +.forms.columnar li fieldset section { + padding: 0; + position: absolute; + width: 150px; + text-align: right; + left: 0; + top: 0; +} +.forms.columnar li fieldset section label { + float: none; + width: auto; + margin-right: 0; + text-align: right; +} +.forms.columnar li fieldset div.descr { + margin-left: 0; +} +/* section */ +.forms li.form-section { + font-weight: bold; + border-bottom: 1px solid #eee; + padding: 1.5em 0 .7em 0; + font-size: 1.1em; + margin-bottom: 1.5em; +} +.columnar li.form-section { + padding-left: 170px; +} +/* tableforms */ +table.tableforms td { + font-size: 90%; + padding: 1px 10px 3px 0 !important; + border: none; +} +table.tableforms tr.labels td { + padding-top: .8em !important; + font-weight: bold; +} +input[type="radio"], +input[type="checkbox"] { + position: relative; + top: -1px; +} +input[type="text"], +input[type="password"], +input[type="email"], +textarea { + position: relative; + z-index: 2; + font-family: Helvetica, Arial, Tahoma, sans-serif; + height: 23px; + border: 1px solid #ccc; + margin: 0; + padding: 1px 2px; + background-color: white; + color: #333; + font-size: 13px; + line-height: 1; + border-radius: 1px; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) inset; + -webkit-transition: border 0.3s ease-in; + -moz-transition: border 0.3s ease-in; + -ms-transition: border 0.3s ease-in; + -o-transition: border 0.3s ease-in; + transition: border 0.3s ease-in; +} +textarea { + line-height: 1.4em; +} +/* Errors and Success */ +.error, +.success { + margin-left: 5px; + font-weight: normal; + font-size: 0.85em; +} +input.input-error, +textarea.input-error, +select.input-error, +.input-error { + border-color: #da3e5a; + box-shadow: 0 0 0 2px rgba(218, 62, 90, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2) inset; +} +input.input-success, +textarea.input-success, +select.input-success, +.input-success { + border-color: #18a011 ; + box-shadow: 0 0 0 2px rgba(24, 160, 17, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2) inset; +} +input.input-gray, +textarea.input-gray, +select.input-gray, +.input-gray { + border-color: #ccc; + box-shadow: 0 0 0 2px rgba(204, 204, 204, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2) inset; +} +input:focus, +textarea:focus { + outline: none; + border-color: #5ca9e4; + box-shadow: 0 0 0 2px rgba(70, 161, 231, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2) inset; +} +input.input-search { + padding-right: 10px; + padding-left: 10px; + margin-bottom: 0; + border-radius: 15px; +} +.input-append, +.input-prepend { + display: inline-block; + background-color: #eee; + height: 23px; + border: 1px solid #ccc; + margin: 0; + padding: 1px 8px; + color: #333; + font-size: 14px; + line-height: 23px; +} +.input-prepend { + margin-right: -1px; +} +.input-append { + position: relative; + z-index: 1; + margin-left: -1px; +} +.btn { + position: relative; + cursor: pointer; + outline: none; + display: inline-block; + text-align: center; + text-decoration: none; + font-family: Arial, Helvetica, sans-serif; + line-height: 1; + font-size: 13px; + font-weight: normal; + padding: 6px 16px; + border-radius: 4px; + background-color: #f3f3f3; + background-image: -moz-linear-gradient(top, #ffffff, #e1e1e1); + background-image: -ms-linear-gradient(top, #ffffff, #e1e1e1); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e1e1e1)); + background-image: -webkit-linear-gradient(top, #ffffff, #e1e1e1); + background-image: -o-linear-gradient(top, #ffffff, #e1e1e1); + background-image: linear-gradient(top, #ffffff, #e1e1e1); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e1e1e1', GradientType=0); + border: 1px solid #dadada; + border-left: 1px solid #d2d2d2; + border-right: 1px solid #d2d2d2; + border-bottom-color: #a9a9a9; + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15), inset 0 1px 1px 0 rgba(255, 255, 255, 0.6); + text-shadow: 0 1px 0px #ffffff; +} +.btn, +.btn:hover { + color: #000; +} +.btn:hover { + filter: none; + background: none; + background: #eee; + text-shadow: 0 1px 0px rgba(255, 255, 255, 0.8); + text-decoration: none; + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15); +} +/* Active */ +.btn-big.btn-active, +.btn-big.btn-active:hover { + padding: 11px 25px; +} +.btn-active, +.btn-active:hover { + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) inset; + color: #555; + border: none; + background: none; + filter: none; + background-color: #ddd; + text-shadow: 0 1px 0px rgba(255, 255, 255, 0.8); + padding: 7px 17px 8px 17px; +} +/* Small */ +.btn-small { + padding: 4px 12px; + font-size: 11px; +} +.btn-small.btn-active { + padding: 5px 12px; +} +/* Big */ +.btn-big { + padding: 10px 24px; + font-size: 20px; +} +/* Square */ +.btn-square { + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} +/* Round */ +.btn-round { + border-radius: 15px; + border-radius: 0 \0; + /* ie9 hack */ +} +/* Full */ +.btn-full { + width: 100%; +} +/* Group */ +.btn-group { + display: inline-block; + margin-right: 2px; + vertical-align: bottom; +} +.btn-group:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +.btn-group > .btn, +.btn-group > input { + float: left; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; + margin-left: -1px; +} +.btn-group > .btn:first-child { + border-radius: 4px 0 0 4px; +} +.btn-group > .btn:last-child { + border-radius: 0 4px 4px 0; +} +.btn-group > .btn.btn-round:first-child, +.btn-group > .input-search:first-child { + border-radius: 15px 0 0 15px; +} +.btn-group > .btn.btn-round:last-child, +.btn-group > .input-search:last-child { + border-radius: 0 15px 15px 0; +} +/* Append */ +.btn-append { + margin-left: -2px; + border-radius: 0 4px 4px 0; +} +/* Disabled */ +.btn.disabled, +.btn[disabled] { + border: none; + filter: none; + background: none; + background-color: #e9e9e9; + opacity: 0.6; + cursor: default; + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.6); +} +/* FF fix */ +@-moz-document url-prefix("http://") { + input[type=submit].btn::-moz-focus-inner, + button.btn::-moz-focus-inner { + border: 0; + padding: 0; + } +} +/* =Grid +-----------------------------------------------------------------------------*/ +.row { + margin-bottom: 1.5em; +} +.container.row { + margin-bottom: 0; +} +.container:after, +.row:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +.half, +.third, +.quarter, +.fifth, +.sixth, +.twothird, +.twofifth, +.threefifth, +.fourfifth, +.fivesixth, +.threequarter { + margin-left: 3.1914893617021276%; + float: left; + min-height: 1px; +} +.half:first-child, +.third:first-child, +.quarter:first-child, +.fifth:first-child, +.sixth:first-child, +.twothird:first-child, +.twofifth:first-child, +.threefifth:first-child, +.fourfifth:first-child, +.fivesixth:first-child, +.threequarter:first-child { + margin-left: 0; +} +.sixth { + width: 14.007092198581558%; +} +.fifth { + width: 17.4468085106383%; +} +.quarter { + width: 22.606382978723403%; +} +.third { + width: 31.205673758865245%; +} +.half { + width: 48.40425531914894%; +} +.threequarter { + width: 74.20212765957446%; +} +.twothird { + width: 65.60283687943262%; +} +.twofifth { + width: 38.08510638297872%; +} +.threefifth { + width: 58.72340425531915%; +} +.fourfifth { + width: 79.36170212765958%; +} +.fivesixth { + width: 82.8014184397163%; +} +.push-half, +.push-threequarter, +.push-quarter, +.push-third, +.push-twothird, +.push-fifth, +.push-twofifth, +.push-threefifth, +.push-fourfifth, +.push-sixth, +.push-fivesixth { + position: relative; +} +.push-half { + left: 51.59574468085106%; +} +.push-third { + left: 34.39716312056737%; +} +.push-quarter { + left: 25.79787234042553%; +} +.push-fifth { + left: 20.638297872340427%; +} +.push-sixth { + left: 17.198581560283685%; +} +.push-threequarter { + left: 77.39361702127658%; +} +.push-twothird { + left: 68.79432624113474%; +} +.push-twofifth { + left: 41.27659574468085%; +} +.push-threefifth { + left: 61.91489361702128%; +} +.push-fourfifth { + left: 82.55319148936171%; +} +.push-fivesixth { + left: 85.99290780141843%; +} +.split .half, +.split .third, +.split .quarter, +.split .fifth, +.split .sixth, +.split .twothird, +.split .twofifth, +.split .threefifth, +.split .fourfifth, +.split .fivesixth, +.split .threequarter { + margin-left: 0; +} +.split .half { + width: 50%; +} +.split .threequarter { + width: 75%; +} +.split .quarter { + width: 25%; +} +.split .third { + width: 33.3%; +} +.split .twothird { + width: 66.6%; +} +.split .fifth { + width: 20%; +} +.split .twofifth { + width: 40%; +} +.split .threefifth { + width: 60%; +} +.split .fourfifth { + width: 80%; +} +.split .sixth { + width: 16.6%; +} +.split .fivesixth { + width: 83.4%; +} +.inner { + padding: 1.5em; +} +.inner-left { + padding-left: 1.5em; +} +.inner-right { + padding-right: 1.5em; +} +.inner-nobottom { + padding-bottom: 1px; +} +.inner-double { + padding: 3em; +} +.inner-double-left { + padding-left: 3em; +} +.inner-double-right { + padding-right: 3em; +} +.inner-double-nobottom { + padding-bottom: 1px; +} +.row .push-right { + float: right; +} +.row .centered { + float: none; + margin: 0 auto; +} +/* =Blocks +-----------------------------------------------------------------------------*/ +.block-two, +.block-three, +.block-four, +.block-five, +.block-six { + list-style: none; + margin-left: -3.1914893617021276%; + margin-bottom: 0; +} +.block-two:after, +.block-three:after, +.block-four:after, +.block-five:after, +.block-six:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +.block-two > li, +.block-three > li, +.block-four > li, +.block-five > li, +.block-six > li { + height: auto; + float: left; + margin-bottom: 1.5em; + margin-left: 3.1914893617021276%; +} +.block-two > li { + width: 46.80851063829787%; +} +.block-three > li { + width: 30.141843971631204%; +} +.block-four > li { + width: 21.80851063829787%; +} +.block-five > li { + width: 16.80851063829787%; +} +.block-six > li { + width: 13.47517730496454%; +} +/* =Goodies +-----------------------------------------------------------------------------*/ +.image-left { + float: left; + margin: 0 1em 1em 0; +} +.image-right { + float: right; + margin: 0 0 1em 1em; +} +.image-left img, +.image-right img { + position: relative; + top: .4em; +} +p.lead { + font-size: 1.2em; +} +.supersmall { + font-size: 0.7em; +} +.small { + font-size: 0.85em; +} +.big { + font-size: 1.2em; +} +input.big { + padding: 2px 0; + font-size: 1.2em; +} +.text-centered { + text-align: center; +} +.uppercase { + text-transform: uppercase; +} +.nowrap { + white-space: nowrap; +} +.clear { + clear: both; +} +.last { + margin-right: 0 !important; +} +.end { + margin-bottom: 0 !important; +} +.handle { + cursor: move; +} +.normal { + font-weight: normal; +} +.bold { + font-weight: bold; +} +.italic { + font-style: italic; +} +.req, +.required { + font-weight: normal; + color: #da3e5a; +} +.highlight { + background-color: #e5ecf5 !important; +} +/* Width */ +.width-33 { + width: 33%; +} +.width-50 { + width: 50%; +} +.width-100 { + width: 100%; +} +input.width-100 { + width: 98.6%; +} +textarea.width-100 { + width: 99.4%; +} +select.width-100 { + width: 99.4%; +} +/* Colors */ +.black { + color: #000000; +} +.gray-dark { + color: #555555; +} +.gray { + color: #777777; +} +.gray-light { + color: #999999; +} +.white { + color: #ffffff; +} +.red, +.error { + color: #da3e5a; +} +.green, +.success { + color: #18a011; +} +/* Link Colors Hover */ +a.white:hover { + color: #d9d9d9; + color: rgba(255, 255, 255, 0.8); +} +a.green:hover, +a.red:hover, +a.error:hover { + color: #000000; +} +/* =Responsive Mobile (Portrait) +-----------------------------------------------------------------------------*/ +@media only screen and (max-width: 767px) { + .row .half, + .row .third, + .row .quarter, + .row .fifth, + .row .sixth, + .row .twothird, + .row .twofifth, + .row .threefifth, + .row .fourfifth, + .row .fivesixth, + .row .threequarter { + margin-left: 0; + width: 100%; + } + .push-half, + .push-threequarter, + .push-quarter, + .push-third, + .push-twothird, + .push-fifth, + .push-twofifth, + .push-threefifth, + .push-fourfifth, + .push-sixth, + .push-fivesixth { + left: 0; + } + .row .pull-right { + float: none; + } + /* + Blocks + */ + .block-two, + .block-three, + .block-four, + .block-five, + .block-six { + margin-left: 0; + margin-bottom: 1.5em; + } + .block-two > li, + .block-three > li, + .block-four > li, + .block-five > li, + .block-six > li { + float: none; + margin: 0; + width: 100%; + } + /* + Forms + */ + .forms.columnar label { + float: none; + text-align: left; + width: auto; + } + .forms.columnar .push, + .forms.columnar div.descr { + margin-left: 0; + } + .forms .multicolumn li { + float: none; + margin-right: 0; + } + .forms .multicolumn li.width-50, + .forms .multicolumn li.width-33 { + width: 100%; + } + .forms.columnar li fieldset, + .forms.columnar li fieldset section { + width: 100%; + padding-left: 0; + text-align: left; + position: static; + } + .forms fieldset { + padding: 0; + padding-top: 1em; + border: none; + } + .forms fieldset legend { + padding: 0; + } +} diff --git a/docs/kube101/css/master.css b/docs/kube101/css/master.css new file mode 100644 index 00000000..3455e8c5 --- /dev/null +++ b/docs/kube101/css/master.css @@ -0,0 +1,33 @@ +/* =Typography +-----------------------------------------------------------------------------*/ +body { + +} + +/* =Links +-----------------------------------------------------------------------------*/ + + +/* =Layout +-----------------------------------------------------------------------------*/ +#page { + width: 940px; + padding: 0 10px; + margin: 24px auto; +} + + +/* =Header +-----------------------------------------------------------------------------*/ + + +/* =Nav +-----------------------------------------------------------------------------*/ + + +/* =Misc +-----------------------------------------------------------------------------*/ + + +/* =Footer +-----------------------------------------------------------------------------*/ diff --git a/docs/pages/advanced.html b/docs/pages/advanced.html index 440c1b55..ee9d4f86 100644 --- a/docs/pages/advanced.html +++ b/docs/pages/advanced.html @@ -1,41 +1,49 @@ - + - + - PHP Weathermap v0.97c - Advanced Topics + PHP Weathermap v0.98b - Advanced Topics - - + diff --git a/docs/pages/cacti-plugin.html b/docs/pages/cacti-plugin.html index d32613ca..242d66c6 100644 --- a/docs/pages/cacti-plugin.html +++ b/docs/pages/cacti-plugin.html @@ -1,39 +1,47 @@ - + - + - PHP Weathermap v0.97c - Cacti Plugin + PHP Weathermap v0.98b - Cacti Plugin - - + diff --git a/docs/pages/changes.html b/docs/pages/changes.html index de8d80ed..52c0eacd 100644 --- a/docs/pages/changes.html +++ b/docs/pages/changes.html @@ -1,47 +1,126 @@ - + - + - PHP Weathermap v0.97c - Changes for this version + PHP Weathermap v0.98b - Changes for this version - - -
+ diff --git a/docs/pages/cli-reference.html b/docs/pages/cli-reference.html index 617e76a4..65cd69ca 100644 --- a/docs/pages/cli-reference.html +++ b/docs/pages/cli-reference.html @@ -1,40 +1,48 @@ - + - + - PHP Weathermap v0.97c - Command-line option Reference + PHP Weathermap v0.98b - Command-line option Reference - - -
+ diff --git a/docs/pages/config-reference.html b/docs/pages/config-reference.html index e180c84f..c15a1a21 100644 --- a/docs/pages/config-reference.html +++ b/docs/pages/config-reference.html @@ -1,42 +1,50 @@ - + - + - PHP Weathermap v0.97c - Configuration Reference + PHP Weathermap v0.98b - Configuration Reference - - -
-
+ + + + + +
- -

Configuration Reference

This page is automatically compiled, and documents all the configuration directives that are available in PHP Weathermap - v0.97c.

+ v0.98b.

Introduction

@@ -112,6 +120,7 @@

Global Configuration Directives

BACKGROUND *COLOR + DATAOUTPUTFILE *FONT FONTDEFINE HEIGHT @@ -187,7 +196,9 @@

TEMPLATE

Examples

- NODE Templates in use - with template-only nodes + + NODE Templates in use - with template-only nodes +
NODE server
             
@@ -230,13 +241,19 @@

POSITION

Examples

- Example of a 'sub-node', that will be 20 pixels above the main + + Example of a 'sub-node', that will be 20 pixels above the main node, wherever that gets moved to. It is used to show additional information about the main node. +
-                NODE main_node POSITION 200 320 LABEL MAIN
+NODE main_node
+    POSITION 200 320
+    LABEL MAIN
 
-                NODE sub_node POSITION main_node 0 -20 LABEL {nodes:main_node:invalue}
+NODE sub_node
+    POSITION main_node 0 -20
+    LABEL {nodes:main_node:invalue}
             
@@ -333,13 +350,17 @@

TARGET

Examples

- Using multiple data sources for one link + + Using multiple data sources for one link +
TARGET link1a.rrd link1b.rrd
             
- Taking the input from one file, and output from + + Taking the input from one file, and output from another +
TARGET poot.rrd:-:DS1 poot2.rrd:DS0:-
             
@@ -717,7 +738,8 @@

*COLOR

Specify the colours used for drawing the LABEL.

red, green and blue are numbers from 0 to 255.

-

LABELFONTSHADOWCOLOR, LABELBGCOLOR and LABELOUTLINECOLOR have an additional +

LABELFONTSHADOWCOLOR, LABELBGCOLOR and LABELOUTLINECOLOR, AICONFILLCOLOR and AICONOUTLINECOLOR + have an additional option - 'none' - which stops that element of the LABEL being drawn. LABELFONTSHADOWCOLOR defaults to 'none'.

@@ -733,6 +755,9 @@

*COLOR

Change History

+
0.98
+
Added 'none' for AICONFILLCOLOR. +
0.95
Added 'contrast' and 'copy' options.
@@ -790,7 +815,9 @@

OVERLIBGRAPH

Examples

- Typical use of OVERLIBGRAPH + + Typical use of OVERLIBGRAPH +
OVERLIBGRAPH http://www.yoursite.net/mrtg/router1-cpu-daily.png
             
@@ -1002,13 +1029,21 @@

Examples

- LINK Templates in use - with template-only links -
LINK bigpipe WIDTH 8 ARROWSTYLE classic
-
-                LINK smallpipe WIDTH 3 ARROWSTYLE compact
-
-                # this link uses the bigpipe template, so it doesn't need any
-            formatting/styling commands LINK a_real_link TEMPLATE bigpipe NODES rtr1 rtr2
+      
+        LINK Templates in use - with template-only links
+      
+      
LINK bigpipe
+    WIDTH 8
+    ARROWSTYLE classic
+
+LINK smallpipe
+    WIDTH 3
+    ARROWSTYLE compact
+
+# this link uses the bigpipe template, so it doesn't need any formatting/styling commands
+LINK a_real_link
+    TEMPLATE bigpipe
+    NODES rtr1 rtr2
             
@@ -1096,33 +1131,49 @@

Examples

- Defining a simple link -
LINK mylink NODES node1 node2
+      
+        Defining a simple link
+      
+      
LINK mylink
+    NODES node1 node2
             
- Two parallel links, using offsets -
LINK firstlink NODES node1:E node2:E
-
-                LINK secondlink NODES node1:W node2:W
+      
+        Two parallel links, using offsets
+      
+      
LINK firstlink
+    NODES node1:E node2:E
+
+LINK secondlink
+    NODES node1:W node2:W
             
- Two parallel links, using percentage compass offsets to bring + + Two parallel links, using percentage compass offsets to bring the links closer together +
LINK firstlink NODES node1:E50 node2:E50
 
-                LINK secondlink NODES node1:W50 node2:W50
+LINK secondlink
+    NODES node1:W50 node2:W50
             
- An offset link using pixel offsets -
LINK firstlink NODES node1:-10:10 node2:20:12
+      
+        An offset link using pixel offsets
+      
+      
LINK firstlink
+    NODES node1:-10:10 node2:20:12
             
- An offset link using polar coordinates -
LINK firstlink NODES node1:45r20 node2:225r20
+      
+        An offset link using polar coordinates
+      
+      
LINK firstlink
+    NODES node1:45r20 node2:225r20
             
@@ -1200,13 +1251,17 @@

Examples

- Using multiple data sources for one link + + Using multiple data sources for one link +
TARGET link1a.rrd link1b.rrd
             
- Taking the input from one file, and output from + + Taking the input from one file, and output from another +
TARGET poot.rrd:-:DS1 poot2.rrd:DS0:-
             
@@ -1334,7 +1389,9 @@

Examples

- A typical ADSL line (as seen from the CPE) + + A typical ADSL line (as seen from the CPE) +
BANDWIDTH 2M 256K
             
@@ -1435,9 +1492,10 @@

Examples

- Providing more information in the bwlabel -
INBWFORMAT {link:this:inpercent}% of
-            {link:this:max_bandwidth_in:%k}b/sec
+      
+        Providing more information in the bwlabel
+      
+      
INBWFORMAT {link:this:inpercent}% of {link:this:max_bandwidth_in:%k}b/sec
             
@@ -1882,7 +1940,9 @@

Examples

- Typical use of OVERLIBGRAPH + + Typical use of OVERLIBGRAPH +
OVERLIBGRAPH http://www.yoursite.net/mrtg/router1-link2-daily.png
             
@@ -2405,18 +2465,44 @@

HTMLOUTPUTFILE

This specifies the name of the HTML file that will be generated.

The equivalent command-line option takes precedence over this configuration - line, if both are used. If you are generating maps using the Cacti plugin, then - this directive is ignored.

+ line, if both are used. +

Change History

+
0.98
+
This now creates a second copy of the file in the location specified, when using the + Cacti plugin. +
0.7
Added HTMLOUTPUTFILE.
+
+

DATAOUTPUTFILE

+
DATAOUTPUTFILE + + datafile +
+
+

Specifies a file to write a dump of all the data collected + during the rendering of the map.

+

The file is in a tab-separated file format suitable for reading using the + wmdata datasource plugin, which allows one map to refer to data in another map.

+

If you are using the Cacti plugin, this data is always saved in the output/ directory, in addition to anywhere you specify with this command.

+
+
+

Change History

+
+
0.98
+
Added DATAOUTPUTFILE +
+
+
+

HTMLSTYLESHEET

@@ -2449,13 +2535,12 @@

IMAGEOUTPUTFILE

The format chosen is based on the file-extension.

The equivalent command-line option takes precedence over this configuration line, if both are used.

-

If you are generating maps using the Cacti - plugin, then this directive is ignored. You can set the output format in the - Cacti Settings page.

Change History

+
0.98
+
This now creates a second copy of the file in the location specified, when using the Cacti plugin.
0.9
Added JPEG and GIF support.
@@ -2541,8 +2626,10 @@

FONTDEFINE

Examples

- Defining a new Truetype font, with the font file in the + + Defining a new Truetype font, with the font file in the weathermap directory +
FONTDEFINE 10 VeraBd 16
             
@@ -2597,7 +2684,7 @@

Change History

*COLOR

-
BGCOLOR red green blue
+
BGCOLOR red green blue
TIMECOLOR red @@ -2622,13 +2709,8 @@

*COLOR

blue
-
KEYOUTLINECOLOR - - red - - green - - blue +
KEYOUTLINECOLOR red green blue
+
KEYOUTLINECOLOR none
KEYBGCOLOR @@ -2638,16 +2720,23 @@

*COLOR

blue
+
KEYBGCOLOR none +

Specify the colours used for drawing the global elements of the map.

red, green and blue are numbers from 0 to 255.

+

You can also choose not to draw either the outline or background rectangle for + keys by specifying 'none' for those. +

Change History

+
0.98
+
Added 'none' option for KEYBGCOLOR and KEYOUTLINECOLOR
0.8
Added TIMECOLOR, TITLECOLOR, KEYTEXTCOLOR, - KEYOUTLINECOLOR and KEYBGCOLOR. + KEYOUTLINECOLOR and KEYBGCOLOR.
0.7
Added BGCOLOR. @@ -3066,16 +3155,27 @@

SCALE

Examples

- Setting up a (very simple) colour scale. Colours run smoothly + + Setting up a (very simple) colour scale. Colours run smoothly from green to red. +
SCALE 0 100 0 255 0 255 0 0
             
- The default scale set -
SCALE 1 10 140 0 255 SCALE 10 25 32 32 255 SCALE 25 40 0 192 255
-            SCALE 40 55 0 240 0 SCALE 55 70 240 240 0 SCALE 70 85 255 192 0 SCALE 85 100
-            255 0 0
+      
+        The default scale set
+      
+      
+SCALE 0 0 192 192 192
+SCALE 0 1 255 255 255
+SCALE 1 10 140 0 255
+SCALE 10 25 32 32 255
+SCALE 25 40 0 192 255
+SCALE 40 55 0 240 0
+SCALE 55 70 240 240 0
+SCALE 70 85 255 192 0
+SCALE 85 100 255 0 0
             
@@ -3232,9 +3332,12 @@

KEYSTYLE

Examples

- Hiding percentage signs, and the 'absolute zero' SCALE entry + + Hiding percentage signs, and the 'absolute zero' SCALE entry in a key. -
SET key_hidezero_DEFAULT 1 SET key_hidepercent_DEFAULT 1
+      
+      
SET key_hidezero_DEFAULT 1
+SET key_hidepercent_DEFAULT 1
             
@@ -3277,19 +3380,25 @@

SET

Examples

- Enabling 'bulging link mode' in the link-rendering + + Enabling 'bulging link mode' in the link-rendering code. +
SET link_bulge 1
             
- Enabling 'screenshot mode' to anonymise a map in 0.95 or + + Enabling 'screenshot mode' to anonymise a map in 0.95 or newer. +
SET screenshot_mode 1
             
- Disabling 'WMWARN50' messages from appearing + + Disabling 'WMWARN50' messages from appearing +
SET nowarn_WMWARN50 1
             
@@ -3347,6 +3456,6 @@

Change History

-
+ diff --git a/docs/pages/editor.html b/docs/pages/editor.html index 5b4d4b2b..1cb44a1a 100644 --- a/docs/pages/editor.html +++ b/docs/pages/editor.html @@ -1,40 +1,48 @@ - + - + - PHP Weathermap v0.97c - The Map Editor + PHP Weathermap v0.98b - The Map Editor - - + diff --git a/docs/pages/errorcodes.html b/docs/pages/errorcodes.html index 960621c7..cd052e14 100644 --- a/docs/pages/errorcodes.html +++ b/docs/pages/errorcodes.html @@ -1,40 +1,48 @@ - + - + - PHP Weathermap v0.97c - Error Code Reference + PHP Weathermap v0.98b - Error Code Reference - -
-
+ diff --git a/docs/pages/faq.html b/docs/pages/faq.html index 06da2244..a38f856a 100644 --- a/docs/pages/faq.html +++ b/docs/pages/faq.html @@ -1,39 +1,47 @@ - + - + - PHP Weathermap v0.97c - FAQ & Useful Tips + PHP Weathermap v0.98b - FAQ & Useful Tips - -
-
+ diff --git a/docs/pages/install-cacti-editor.html b/docs/pages/install-cacti-editor.html index df8a7b60..b8876343 100644 --- a/docs/pages/install-cacti-editor.html +++ b/docs/pages/install-cacti-editor.html @@ -1,40 +1,48 @@ - + - + - PHP Weathermap v0.97c - Installation - Cacti Plugin & Editor + PHP Weathermap v0.98b - Installation - Cacti Plugin & Editor - - + diff --git a/docs/pages/install-cacti.html b/docs/pages/install-cacti.html index 0c5a6ac6..6c7e4d31 100644 --- a/docs/pages/install-cacti.html +++ b/docs/pages/install-cacti.html @@ -1,40 +1,48 @@ - + - + - PHP Weathermap v0.97c - Installation - Cacti Plugin + PHP Weathermap v0.98b - Installation - Cacti Plugin - - + diff --git a/docs/pages/install-cli-editor.html b/docs/pages/install-cli-editor.html index 9e5e80aa..f26f901c 100644 --- a/docs/pages/install-cli-editor.html +++ b/docs/pages/install-cli-editor.html @@ -1,39 +1,47 @@ - + - + - PHP Weathermap v0.97c - Installation - Command-Line Tool and Editor + PHP Weathermap v0.98b - Installation - Command-Line Tool and Editor - - -
+ diff --git a/docs/pages/install-cli.html b/docs/pages/install-cli.html index 14828133..a078ba2a 100644 --- a/docs/pages/install-cli.html +++ b/docs/pages/install-cli.html @@ -1,39 +1,47 @@ - + - + - PHP Weathermap v0.97c - Installation - Command-Line Tool Only + PHP Weathermap v0.98b - Installation - Command-Line Tool Only - - + diff --git a/docs/pages/main.html b/docs/pages/main.html index a8f56f9d..3f7ad77f 100755 --- a/docs/pages/main.html +++ b/docs/pages/main.html @@ -1,53 +1,49 @@ - + - + - PHP Weathermap v0.97c - Introduction + PHP Weathermap v0.98b - Introduction - -