2007-01-05 Sancho Lerena <slerena@artica.es>
Importing data from Azabel brach. This commit is a little chaotic :-). Almost all code it's break apart, so no problems should not be generated. New graphical console will be called "Active console", as temporal name. * pandora_graphical_console.sql: New SQL for active console. * pandora_graphical_console_data.sql: New SQL data for A.C. * images/op9.gif: New icon for operation menu. * operation/active_console/index.php: Main index for A.C. this includes now a require function for config.php. * operation/active_console/imagenes/*: Lots of images for A.C. Need to be ordered or something. * operation/active_console/scripts/*: Most of the Javascript code for the A.C is here. * operation/active_console/lib/*: Main include PHP code for A.C * operation/active_console/styles/*: CSS Styles for A.C. * pandora_graphical_console.INSTALL: How to install A.C * include/styles/cb/: Unused, deleted. * include/styles/op.css: Changes need to activate new A.C option. * include/languages/language_en.php: New string for A.C * operation/menu.php: New menu option. * include/config.php: New version and set error reporting to 0. At this time A.C reports many warnings and notices and dont work properly, so keep this low at the moment. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@353 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
24c793a308
commit
7ff97a2c66
|
@ -1,3 +1,44 @@
|
|||
2007-01-05 Sancho Lerena <slerena@artica.es>
|
||||
|
||||
Importing data from Azabel brach. This commit is a little
|
||||
chaotic :-). Almost all code it's break apart, so no problems
|
||||
should not be generated. New graphical console will be called
|
||||
"Active console", as temporal name.
|
||||
|
||||
|
||||
* pandora_graphical_console.sql: New SQL for active console.
|
||||
|
||||
* pandora_graphical_console_data.sql: New SQL data for A.C.
|
||||
|
||||
* images/op9.gif: New icon for operation menu.
|
||||
|
||||
* operation/active_console/index.php: Main index for A.C. this
|
||||
includes now a require function for config.php.
|
||||
|
||||
* operation/active_console/imagenes/*: Lots of images for
|
||||
A.C. Need to be ordered or something.
|
||||
|
||||
* operation/active_console/scripts/*: Most of the Javascript code
|
||||
for the A.C is here.
|
||||
|
||||
* operation/active_console/lib/*: Main include PHP code for A.C
|
||||
|
||||
* operation/active_console/styles/*: CSS Styles for A.C.
|
||||
|
||||
* pandora_graphical_console.INSTALL: How to install A.C
|
||||
|
||||
* include/styles/cb/: Unused, deleted.
|
||||
|
||||
* include/styles/op.css: Changes need to activate new A.C option.
|
||||
|
||||
* include/languages/language_en.php: New string for A.C
|
||||
|
||||
* operation/menu.php: New menu option.
|
||||
|
||||
* include/config.php: New version and set error reporting to 0. At
|
||||
this time A.C reports many warnings and notices and dont work
|
||||
properly, so keep this low at the moment.
|
||||
|
||||
2007-01-04 Manuel Arostegui <marostegui@artica.es>
|
||||
|
||||
* pandora_console.spec: Now pandora console is installed
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1012 B |
|
@ -20,7 +20,7 @@
|
|||
// This is the base config file
|
||||
|
||||
//Pandora Version
|
||||
$build_version="PC061215"; //PCyymmdd
|
||||
$build_version="PC080105"; //PCyymmdd
|
||||
$pandora_version="v1.3 devel";
|
||||
|
||||
// Database configuration
|
||||
|
@ -36,8 +36,8 @@ $config_fontpath = "../reporting/FreeSans.ttf"; // Change this to your font fold
|
|||
// error_reporting(0);
|
||||
|
||||
// Display all errores, warnings and notices
|
||||
error_reporting(E_ALL);
|
||||
|
||||
// error_reporting(E_ALL);
|
||||
error_reporting(0);
|
||||
// Read rest of config from DB
|
||||
if (! mysql_connect($dbhost,$dbuser,$dbpassword)){
|
||||
//Non-persistent connection. If you want persistent conn change it to mysql_pconnect()
|
||||
|
|
|
@ -657,6 +657,10 @@ $lang_label["no_monitors_g"]="This group doesn't have any monitor";
|
|||
$lang_label["reporting"]="Reporting";
|
||||
$lang_label["agent_general_reporting"]="Agent overview";
|
||||
|
||||
// 5 de Enero 2007
|
||||
$lang_label["active_console"]="Active console";
|
||||
|
||||
|
||||
global $lang_label;
|
||||
global $help_label;
|
||||
?>
|
|
@ -1,14 +0,0 @@
|
|||
@echo off
|
||||
|
||||
echo - Begin X Library Batch Build -
|
||||
|
||||
rem Create a list of all .js files in x/lib, that file will be used by x.xcp.
|
||||
|
||||
del lib\x_files.txt
|
||||
for %%f in (lib\*.js) do echo %%~nf >> lib\x_files.txt
|
||||
|
||||
rem Run XC on all .xcp files in the current dirctory.
|
||||
|
||||
for %%f in (*.xcp) do xc\xc %%~nf
|
||||
|
||||
echo - End X Library Batch Build -
|
|
@ -1,337 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>XC: X Library Compiler</title>
|
||||
<meta name='author' content='Mike Foster (Cross-Browser.com)'>
|
||||
<meta name='description' content='Cross-Browser DHTML Libraries and Applications'>
|
||||
<meta name='keywords' content='dhtml,crossbrowser,tooltips,menu,collapsible,dhtml drag drop,downgradeable layout,dynamic select,image rollover,dhtml layout,css,dom,api,library,dhtml demos,javascript code,unobtrusive dhtml,dom2 events,dynamic forms,animation,ellipse,parametric equation,object-oriented javascript,LGPL license'>
|
||||
<link rel='stylesheet' type='text/css' href='../../css/v3.css'>
|
||||
|
||||
<style type='text/css'>
|
||||
.h5i {
|
||||
color:#596380;
|
||||
background:transparent;
|
||||
margin:1.6em 2em .6em 0;
|
||||
padding:0;
|
||||
font-weight:bold;
|
||||
/**/
|
||||
font-size:xx-small;
|
||||
voice-family: "\"}\"";
|
||||
voice-family: inherit;
|
||||
font-size:x-small;
|
||||
}
|
||||
html>body .h5i {
|
||||
font-size:x-small;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body><div id='topLinkCon'><a name='topofpg'> </a></div>
|
||||
|
||||
<div id='leftColumn' class='column'> <!-- Begin left column -->
|
||||
|
||||
<div class='leftContent'> <!-- Begin left content -->
|
||||
|
||||
<div id='header'>
|
||||
<div id='menubar1'>
|
||||
<a href='../../talk/' title='News, Articles and Documentation'>Talk</a> | <a href='../../toys/' title='Libraries, Demos and Applications'>Toys</a> | <a href='../../' title='Cross-Browser.com'>Home</a></div> <!-- end toolbar1 -->
|
||||
<h1>Cross-Browser.com
|
||||
</h1>
|
||||
</div> <!-- end header -->
|
||||
|
||||
<h2>X Library Compiler</h2>
|
||||
|
||||
<h3>Summary</h3>
|
||||
<div>
|
||||
<p>XC is a companion utility for X. XC scans your application files and creates a custom X library file (with optional compression) which contains only those X functions and objects used in your application. XC also allows you to create a library file containing only the X functions and objects you specify.</p>
|
||||
</div>
|
||||
|
||||
<h3>Feedback</h3>
|
||||
<div>
|
||||
<p>XC is still in its infancy and is very simple. The format for the project file is very simple. The symbol parser and compression are very simple. These may be (<i>will</i> be) improved but for now XC works well enough to test its utility. I am open to any <a href='http://cross-browser.com/contact.php?s=xc_comment'>comments/suggestions</a> you may have.</p>
|
||||
</div>
|
||||
|
||||
<h3>Looking Ahead</h3>
|
||||
<div>
|
||||
<p>Now that I've had a chance to use XC I see lots of things I'd like to improve...</p>
|
||||
<p>The project file format could be better.</p>
|
||||
<p>I now have all documentation in xml files. This opens up many possibilities. The <a href='http://cross-browser.com/x/lib/view.php'>X Viewer</a> is my first application.</p>
|
||||
<p>I'm playing with the idea of <i>conditional compilation</i>.</p>
|
||||
<p>Eventually I'd like to port XC to PHP.</p>
|
||||
</div>
|
||||
|
||||
<h2>For XC Users</h2>
|
||||
|
||||
<h3>XC Usage</h3>
|
||||
<div>
|
||||
<p>XC is a Win32 command-line program (a VC++ project) written in C. It is invoked as follows:
|
||||
<pre> xc prj_name</pre>
|
||||
<p>XC will open the file 'prj_name.xcp' in the current directory and create the output files, prj_name.js and prj_name.log, also in the current directory.</p>
|
||||
</div>
|
||||
|
||||
<h3>XC Project File</h3>
|
||||
<div>
|
||||
<h4>Format</h4>
|
||||
<div>
|
||||
<p>The project file must have a '.xcp' extension (XC Project). The xcp parser looks for three directives: <code>options</code>, <code>libpath</code> and <code>appfiles</code>. The general format is as follows.</p>
|
||||
<pre>
|
||||
; comments are from ';' to end of line
|
||||
options -cmp -dep +log +dbg ; See option descriptions below.
|
||||
libpath ..\ ; X library files directory (requires trailing backslash).
|
||||
appfiles ; Application file pathnames from next line to end of file.
|
||||
App file pathname 1
|
||||
App file pathname 2
|
||||
...
|
||||
App file pathname n
|
||||
</pre>
|
||||
</div>
|
||||
<h4>Options</h4>
|
||||
<div>
|
||||
<p>Following the 'options' directive is a space-delimited list of zero or more of the following. Prefix with '-' for false and '+' (or no prefix) for true.</p>
|
||||
<p><span class='h5i'>cmp</span> true = Compression applied to output lib js file. Default = true.
|
||||
Compression removes leading white space, new lines and blank lines.
|
||||
Also removes "//" comments but does not remove multi-line comments "/* */".</p>
|
||||
<p><span class='h5i'>lws</span> true = Retain leading white space. Default = false.</p>
|
||||
<p><span class='h5i'>nln</span> true = Retain newline chars on non-blank lines. Default = false.</p>
|
||||
<p><span class='h5i'>bln</span> true = Retain blank lines. Default = false.</p>
|
||||
<p><span class='h5i'>log</span> true = Generate log file. Default = false.</p>
|
||||
<p><span class='h5i'>lib</span> true = Generate lib file. Default = true.</p>
|
||||
<p><span class='h5i'>glb</span> true = Include globals.js. Default = true.</p>
|
||||
<p><span class='h5i'>dbg</span> true = Debug info in log file. Sets options.log to true. Default = false.</p>
|
||||
<p><span class='h5i'>dep</span> true = Dependents included in output. Default = true.
|
||||
When false it is useful for creating a lib file from a list of X symbols.
|
||||
I use -dep to create x_core.js, x_event.js, etc.
|
||||
The list of symbols is put in the xcp file (commented with ';')
|
||||
and the only app file is the xcp file itself.
|
||||
See x/x_core.xcp for an example.</p>
|
||||
</div>
|
||||
<h4>Examples</h4>
|
||||
<div>
|
||||
<p>The following project file builds a library that I use for two demos, <i>floater bar</i> and <i>floater box</i>.</p>
|
||||
<pre>
|
||||
; XC Project: floater_xlib
|
||||
|
||||
options
|
||||
libpath ..\
|
||||
appfiles
|
||||
..\..\examples\floater.php
|
||||
..\..\examples\floater_bar.php
|
||||
</pre>
|
||||
<p></p>
|
||||
<p>Before I had all X functions and objects in separate files I had them categorized into x_core.js, x_event.js, etc. For backwards-compatibility I still provide those files, but now I generate those files with XC. In the <code>/x</code> directory you will find these files, along with the .xcp file for each. In that directory is also a batch file, build_all.bat, which will run XC on all .xcp files in that directory.</p>
|
||||
<p>The following is one of the .xcp files from the <code>/x</code> directory.
|
||||
<pre>
|
||||
; XC Project: x_anim
|
||||
|
||||
options -dep -glb
|
||||
|
||||
; If you don't want the library file to be
|
||||
; compressed then add -cmp to the above options.
|
||||
|
||||
libpath lib\
|
||||
|
||||
appfiles
|
||||
|
||||
x_anim.xcp
|
||||
|
||||
; This project file is the only app file fed to XC.
|
||||
; The following X symbols will be included in the
|
||||
; library file. They are commented-out so XC will
|
||||
; not see them as more app files.
|
||||
|
||||
; xEllipse
|
||||
; xParaEq
|
||||
; xSlideCornerTo
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>For X Contributors</h2>
|
||||
|
||||
<h3>X Library Files</h3>
|
||||
<div>
|
||||
<p>By convention all X functions, objects and global variables begin with 'x' and are camel-cased. All X functions and objects should be put in separate files with the following standard header, where 'xSymbol' is the name of the function or object. The name of the file should be xsymbol.js (use all lower-case for the filename). If you are the author you should use your own copyright info instead of mine. I do not require copyright assignment for code contributions to X.</p>
|
||||
<pre>
|
||||
// xSymbol, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
</pre>
|
||||
<p>Since XC's compression option removes newlines, you cannot use implicit statement termination. For example in the following the ';' is required because this is an assignment expression...</p>
|
||||
<pre>
|
||||
xObject.prototype.method = function()
|
||||
{
|
||||
// statements...
|
||||
}; // <- this semicolon is required to support compression
|
||||
</pre>
|
||||
<p>Another example where a semicolon is required in a place where most of us don't usually use a semicolon...</p>
|
||||
<pre>
|
||||
function myObjectPrototype(id)
|
||||
{
|
||||
var img = document.getElementById(id);
|
||||
|
||||
img.onmouseover = function()
|
||||
{
|
||||
this.src = urlOver;
|
||||
}; // <- this semicolon is required to support compression
|
||||
|
||||
function foo()
|
||||
{
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h3>X Documentation Files</h3>
|
||||
<div>
|
||||
<p>For every <code>xsymbol.js</code> file there should be an <code>xsymbol.xml</code> file which contains documentation and author copyright statements for xSymbol. All doc files are now in xml. The xml structure I have for now is as follows.</p>
|
||||
<pre>
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id=''>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
|
||||
<groups>
|
||||
<grp></grp>
|
||||
</groups>
|
||||
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[]]></description>
|
||||
|
||||
<syntax></syntax>
|
||||
|
||||
<parameters>
|
||||
<par><name></name><note><![CDATA[]]></note></par>
|
||||
</parameters>
|
||||
|
||||
<properties>
|
||||
<prop><name></name><note><![CDATA[]]></note></prop>
|
||||
</properties>
|
||||
|
||||
<methods>
|
||||
<meth><name></name><note><![CDATA[]]></note></meth>
|
||||
</methods>
|
||||
|
||||
<return><![CDATA[]]></return>
|
||||
|
||||
<dependencies>
|
||||
<dep></dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo><url>http://cross-browser.com/toys/</url><note><![CDATA[Index of all X demos.]]></note></demo>
|
||||
</demos>
|
||||
|
||||
<tests>
|
||||
<test><date></date><author>mf</author><url></url><note><![CDATA[]]></note></test>
|
||||
</tests>
|
||||
|
||||
<comments>
|
||||
<comment><date></date><author>mf</author><note><![CDATA[]]></note></comment>
|
||||
</comments>
|
||||
|
||||
<revisions>
|
||||
<rev><num></num><date></date><author>mf</author><note><![CDATA[]]></note></rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h3>For XC Developers</h3>
|
||||
<div>
|
||||
<p>If you would like to write XC in a different language or port it to a different platform please adhere to the general specifications in this file so all XC implementations will be compatible. My XC Win32 C code is available under the terms of the GNU LGPL.</p>
|
||||
<p>I'll try to come up with a more formal specification. For now I just have a few odd bits of info.</p>
|
||||
<p>A high-level look at XC's flow of execution:</p>
|
||||
<pre>
|
||||
Read project file:
|
||||
Read options, libpath and appfiles from project file.
|
||||
|
||||
Open log file.
|
||||
|
||||
Read current X version from xversion.js.
|
||||
|
||||
Create symbol table:
|
||||
get_valid_syms
|
||||
All filenames, minus extensions, in the libpath directory
|
||||
which match "x*.js" constitute the set of valid X symbols.
|
||||
get_lib_file_deps:
|
||||
Update symbol table with dependency info from the X lib file symbols[sym_idx].
|
||||
Excludes symbols found in "//" comments.
|
||||
|
||||
Get symbols from app files.
|
||||
Determine which X lib files get included in the output library
|
||||
by searching application files for X symbols.
|
||||
|
||||
Create output lib.
|
||||
For every symbol which has 'symbols[sym_idx].inc == true'
|
||||
include the corresponding X lib file in the output lib.
|
||||
Compression removes all "//" comments but not "/**/" comments.
|
||||
|
||||
Report results.
|
||||
Display filenames created and finalize log file.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<h3>Section Title</h3>
|
||||
<div>
|
||||
<p>section content</p>
|
||||
</div>
|
||||
-->
|
||||
|
||||
</div> <!-- end leftContent -->
|
||||
|
||||
<div id='footer' class='leftContent'>
|
||||
Copyleft © 2001-2005 Michael Foster<br>
|
||||
Javascript distributed under the terms of the <a href='../../license.html'>GNU LGPL</a><br>
|
||||
<a href='../../' title='Offline Index'>Index</a> |
|
||||
<a href='http://cross-browser.com/' title='Cross-Browser.com'>Cross-Browser.com</a> |
|
||||
<a href='http://cross-browser.com/contact.php' title='eMail Mike'>Contact</a> |
|
||||
<a id='footerTopLink' href='#topofpg' title='Top of Page'>Top</a>
|
||||
</div> <!-- end leftContent -->
|
||||
|
||||
</div> <!-- end leftColumn -->
|
||||
|
||||
<div id='rightColumn' class='column'>
|
||||
<div class='rightContent'>
|
||||
<h3>License</h3>
|
||||
<div class='collapsible'>
|
||||
<p>By your use of X and/or CBE and/or any Javascript from this site you consent to the LGPL License - please <a href='../../license.html'>read it</a>.</p>
|
||||
</div> <!-- end collapsible -->
|
||||
<h3>Developer Support</h3>
|
||||
<div class='collapsible'>
|
||||
<p>Get your questions answered faster by posting at one of the following forums. I browse these forums every day.</p>
|
||||
<p><a href='http://www.sitepoint.com/forums/forumdisplay.php?f=15' title='SitePoint Javascript Forum'>SitePoint.com</a></p>
|
||||
<p><a href='http://www.hftonline.com/forum/forumdisplay.php?f=16' title='HFTOnline Web Based Programming Forum'>HFTOnline.com</a></p>
|
||||
<p><a href='http://www.codingforums.com/forumdisplay.php?f=2' title='CodingForums JavaScript Programming Forum'>CodingForums.com</a></p>
|
||||
</div>
|
||||
<h3>Search</h3>
|
||||
<div class='collapsible'>
|
||||
<form method="get" action="http://www.google.com/custom">
|
||||
<p><a class='googlelogo' href="http://www.google.com/"><img src="http://www.google.com/logos/Logo_25wht.gif" border="0" alt="Google"></a></p>
|
||||
<p><input type="text" name="q" size="20" maxlength="255" value="" class="inpTxt"></p>
|
||||
<p><input type="radio" name="sitesearch" value="cross-browser.com" checked> Cross-Browser.com</p>
|
||||
<p><input type="radio" name="sitesearch" value=""> World Wide Web</p>
|
||||
<p><input type="submit" name="sa" value="Search"></p>
|
||||
<div style='margin:0;padding:0'>
|
||||
<input type="hidden" name="domains" value="cross-browser.com">
|
||||
<input type="hidden" name="client" value="pub-6162857333153838">
|
||||
<input type="hidden" name="forid" value="1">
|
||||
<input type="hidden" name="ie" value="ISO-8859-1">
|
||||
<input type="hidden" name="oe" value="ISO-8859-1">
|
||||
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;">
|
||||
<input type="hidden" name="hl" value="en">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div> <!-- end rightContent -->
|
||||
</div> <!-- end rightColumn -->
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,53 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id=''>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
|
||||
<groups>
|
||||
<grp></grp>
|
||||
</groups>
|
||||
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[]]></description>
|
||||
|
||||
<syntax></syntax>
|
||||
|
||||
<parameters>
|
||||
<par><name></name><note><![CDATA[]]></note></par>
|
||||
</parameters>
|
||||
|
||||
<properties>
|
||||
<prop><name></name><note><![CDATA[]]></note></prop>
|
||||
</properties>
|
||||
|
||||
<methods>
|
||||
<meth><name></name><note><![CDATA[]]></note></meth>
|
||||
</methods>
|
||||
|
||||
<return><![CDATA[]]></return>
|
||||
|
||||
<dependencies>
|
||||
<dep></dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo><url>http://cross-browser.com/toys/</url><note><![CDATA[Index of all X demos.]]></note></demo>
|
||||
</demos>
|
||||
|
||||
<tests>
|
||||
<test><date></date><author>mf</author><url></url><note><![CDATA[]]></note></test>
|
||||
</tests>
|
||||
|
||||
<comments>
|
||||
<comment><date></date><author>mf</author><note><![CDATA[]]></note></comment>
|
||||
</comments>
|
||||
|
||||
<revisions>
|
||||
<rev><num></num><date></date><author>mf</author><note><![CDATA[]]></note></rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,19 +0,0 @@
|
|||
// globals, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xNN4,xUA=navigator.userAgent.toLowerCase();
|
||||
if(window.opera){
|
||||
var i=xUA.indexOf('opera');
|
||||
if(i!=-1){
|
||||
var v=parseInt(xUA.charAt(i+6));
|
||||
xOp7Up=v>=7;
|
||||
xOp6Dn=v<7;
|
||||
}
|
||||
}
|
||||
else if(navigator.vendor!='KDE' && document.all && xUA.indexOf('msie')!=-1){
|
||||
xIE4Up=parseFloat(navigator.appVersion)>=4;
|
||||
xIE4=xUA.indexOf('msie 4')!=-1;
|
||||
xIE5=xUA.indexOf('msie 5')!=-1;
|
||||
}
|
||||
else if(document.layers){xNN4=true;}
|
||||
xMac=xUA.indexOf('mac')!=-1;
|
|
@ -1,97 +0,0 @@
|
|||
globals
|
||||
xaddeventlistener
|
||||
xappendchild
|
||||
xbackground
|
||||
xbar
|
||||
xcapitalize
|
||||
xcardinalposition
|
||||
xclientheight
|
||||
xclientwidth
|
||||
xclip
|
||||
xcollapsible
|
||||
xcolor
|
||||
xcreateelement
|
||||
xdef
|
||||
xdeg
|
||||
xdeletecookie
|
||||
xdisabledrag
|
||||
xdisplay
|
||||
xellipse
|
||||
xenabledrag
|
||||
xevaltextarea
|
||||
xevent
|
||||
xfenster
|
||||
xfirstchild
|
||||
xgetcomputedstyle
|
||||
xgetcookie
|
||||
xgetelementbyid
|
||||
xgetelementsbyattribute
|
||||
xgetelementsbyclassname
|
||||
xgetelementsbytagname
|
||||
xgetelepropsarray
|
||||
xgetelepropsstring
|
||||
xgeturlarguments
|
||||
xhaspoint
|
||||
xheight
|
||||
xhex
|
||||
xhide
|
||||
ximgasyncwait
|
||||
ximgrollsetup
|
||||
xinclude
|
||||
xinnerhtml
|
||||
xintersection
|
||||
xleft
|
||||
xlinearscale
|
||||
xloadscript
|
||||
xmenu1
|
||||
xmenu1a
|
||||
xmenu1b
|
||||
xmenu5
|
||||
xmoveto
|
||||
xname
|
||||
xnextsib
|
||||
xnum
|
||||
xoffsetleft
|
||||
xoffsettop
|
||||
xpad
|
||||
xpagex
|
||||
xpagey
|
||||
xparaeq
|
||||
xparent
|
||||
xparentchain
|
||||
xpopup
|
||||
xpreventdefault
|
||||
xprevsib
|
||||
xrad
|
||||
xremoveeventlistener
|
||||
xresizeto
|
||||
xscrollleft
|
||||
xscrolltop
|
||||
xselect
|
||||
xsetcookie
|
||||
xsetietitle
|
||||
xshow
|
||||
xslidecornerto
|
||||
xslideto
|
||||
xstoppropagation
|
||||
xstr
|
||||
xtablecellvisibility
|
||||
xtablecoldisplay
|
||||
xtablecursor
|
||||
xtableiterate
|
||||
xtablerowdisplay
|
||||
xtabpanelgroup
|
||||
xtimer
|
||||
xtooltipgroup
|
||||
xtop
|
||||
xtristateimage
|
||||
xversion
|
||||
xvisibility
|
||||
xwalkeletree
|
||||
xwalktree
|
||||
xwidth
|
||||
xwinclass
|
||||
xwindow
|
||||
xwinopen
|
||||
xwinscrollto
|
||||
xzindex
|
|
@ -1,29 +0,0 @@
|
|||
// xAddEventListener, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xAddEventListener(e,eT,eL,cap)
|
||||
{
|
||||
if(!(e=xGetElementById(e))) return;
|
||||
eT=eT.toLowerCase();
|
||||
if((!xIE4Up && !xOp7Up) && e==window) {
|
||||
if(eT=='resize') { window.xPCW=xClientWidth(); window.xPCH=xClientHeight(); window.xREL=eL; xResizeEvent(); return; }
|
||||
if(eT=='scroll') { window.xPSL=xScrollLeft(); window.xPST=xScrollTop(); window.xSEL=eL; xScrollEvent(); return; }
|
||||
}
|
||||
var eh='e.on'+eT+'=eL';
|
||||
if(e.addEventListener) e.addEventListener(eT,eL,cap);
|
||||
else if(e.attachEvent) e.attachEvent('on'+eT,eL);
|
||||
else eval(eh);
|
||||
}
|
||||
// called only from the above
|
||||
function xResizeEvent()
|
||||
{
|
||||
if (window.xREL) setTimeout('xResizeEvent()', 250);
|
||||
var cw = xClientWidth(), ch = xClientHeight();
|
||||
if (window.xPCW != cw || window.xPCH != ch) { window.xPCW = cw; window.xPCH = ch; if (window.xREL) window.xREL(); }
|
||||
}
|
||||
function xScrollEvent()
|
||||
{
|
||||
if (window.xSEL) setTimeout('xScrollEvent()', 250);
|
||||
var sl = xScrollLeft(), st = xScrollTop();
|
||||
if (window.xPSL != sl || window.xPST != st) { window.xPSL = sl; window.xPST = st; if (window.xSEL) window.xSEL(); }
|
||||
}
|
|
@ -1,82 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xAddEventListener'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Event</grp>
|
||||
<grp>DOM</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Register an event listener on the element. For some browsers the window.onscroll and window.onresize events are simulated.]]></description>
|
||||
|
||||
<syntax>xAddEventListener(ele, sEventType, fnEventListener[, bCapture])</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>ele</name>
|
||||
<note><![CDATA[ID string or object reference.]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>sEventType</name>
|
||||
<note><![CDATA[String event type: 'mousemove', 'click', 'resize', etc.]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>fnEventListener</name>
|
||||
<note><![CDATA[Reference to the listener function.]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>bCapture</name>
|
||||
<note><![CDATA[Boolean capture event flag.]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<dependencies>
|
||||
<dep>xIE4Up</dep>
|
||||
<dep>xOp7Up</dep>
|
||||
<dep>xGetElementById</dep>
|
||||
<dep>xClientWidth</dep>
|
||||
<dep>xClientHeight</dep>
|
||||
<dep>xScrollLeft</dep>
|
||||
<dep>xScrollTop</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/x/examples/drag2.php</url>
|
||||
<note><![CDATA[Many of the demos use xAddEventListener.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<comments>
|
||||
<comment>
|
||||
<date>13Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[The 2 sim events add a lot of weight - find a solution!!!]]></note>
|
||||
</comment>
|
||||
</comments>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>3</num>
|
||||
<date>25Apr05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Use xOp7Up instead of xOp7.]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>14Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Reduced 136 bytes with shorter parameter names.]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>31Mar04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Put in it's own file for use with XC.]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,8 +0,0 @@
|
|||
// xAppendChild, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xAppendChild(oParent, oChild)
|
||||
{
|
||||
if (oParent.appendChild) return oParent.appendChild(oChild);
|
||||
else return null;
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xAppendChild'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>DOM</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[A safe DOM wrapper.]]></description>
|
||||
|
||||
<syntax>xAppendChild(oParent, oChild)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>oParent</name>
|
||||
<note><![CDATA[element reference to parent]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>oChild</name>
|
||||
<note><![CDATA[element reference to new child to append to oParent's child list]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>
|
||||
<note><![CDATA[oChild on success, else null]]></note>
|
||||
</return>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>11Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,18 +0,0 @@
|
|||
// xBackground, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xBackground(e,c,i)
|
||||
{
|
||||
if(!(e=xGetElementById(e))) return '';
|
||||
var bg='';
|
||||
if(e.style) {
|
||||
if(xStr(c)) {
|
||||
if(!xOp6Dn) e.style.backgroundColor=c;
|
||||
else e.style.background=c;
|
||||
}
|
||||
if(xStr(i)) e.style.backgroundImage=(i!='')? 'url('+i+')' : null;
|
||||
if(!xOp6Dn) bg=e.style.backgroundColor;
|
||||
else bg=e.style.background;
|
||||
}
|
||||
return bg;
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xBackground'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Presentation</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Return and optionally set the element's background color and image.]]></description>
|
||||
|
||||
<syntax>xBackground(ele[, sColor[, sImage]])</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>ele</name>
|
||||
<note><![CDATA[id string or object reference]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>sColor</name>
|
||||
<note><![CDATA[background color string]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>sImage</name>
|
||||
<note><![CDATA[background image URL string]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>'style.backgroundColor', a string</return>
|
||||
|
||||
<dependencies>
|
||||
<dep>xGetElementById</dep>
|
||||
<dep>xStr</dep>
|
||||
<dep>xOp6Dn</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>3</num>
|
||||
<date>25Apr05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[use xOp6Dn instead of xOp5or6.]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>15Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[reduced by 42 bytes with shorter parameter names]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>31Mar04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,94 +0,0 @@
|
|||
// xBar, Copyright 2003,2004,2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
// Bar-Graph Object
|
||||
|
||||
function xBar(dir, // direction, 'ltr', 'rtl', 'ttb', or 'btt'
|
||||
conStyle, barStyle) // container and bar style class names
|
||||
{
|
||||
//// Public Properties
|
||||
|
||||
this.value = 0; // current value, read-only
|
||||
|
||||
//// Public Methods
|
||||
|
||||
// Update current value
|
||||
this.update = function(v)
|
||||
{
|
||||
if (v < 0) v = 0;
|
||||
else if (v > this.inMax) v = this.inMax;
|
||||
this.con.title = this.bar.title = this.value = v;
|
||||
switch(this.dir) {
|
||||
case 'ltr': // left to right
|
||||
v = this.scale(v, this.w);
|
||||
xLeft(this.bar, v - this.w);
|
||||
break;
|
||||
case 'rtl': // right to left
|
||||
v = this.scale(v, this.w);
|
||||
xLeft(this.bar, this.w - v);
|
||||
break;
|
||||
case 'btt': // bottom to top
|
||||
v = this.scale(v, this.h);
|
||||
xTop(this.bar, this.h - v);
|
||||
break;
|
||||
case 'ttb': // top to bottom
|
||||
v = this.scale(v, this.h);
|
||||
xTop(this.bar, v - this.h);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
// Change position and/or size
|
||||
this.paint = function(x, y, // container position
|
||||
w, h) // container size
|
||||
{
|
||||
if (xNum(x)) this.x = x;
|
||||
if (xNum(y)) this.y = y;
|
||||
if (xNum(w)) this.w = w;
|
||||
if (xNum(h)) this.h = h;
|
||||
xResizeTo(this.con, this.w, this.h);
|
||||
xMoveTo(this.con, this.x, this.y);
|
||||
xResizeTo(this.bar, this.w, this.h);
|
||||
xMoveTo(this.bar, 0, 0);
|
||||
};
|
||||
|
||||
// Change scale and/or start value
|
||||
this.reset = function(max, start) // non-scaled values
|
||||
{
|
||||
if (xNum(max)) this.inMax = max;
|
||||
if (xNum(start)) this.start = start;
|
||||
this.update(this.start);
|
||||
};
|
||||
|
||||
//// Private Methods
|
||||
|
||||
this.scale = function(v, outMax)
|
||||
{
|
||||
return Math.round(xLinearScale(v, 0, this.inMax, 0, outMax));
|
||||
};
|
||||
|
||||
//// Private Properties
|
||||
|
||||
this.dir = dir;
|
||||
this.x = 0;
|
||||
this.y = 0;
|
||||
this.w = 100;
|
||||
this.h = 100;
|
||||
this.inMax = 100;
|
||||
this.start = 0;
|
||||
this.conStyle = conStyle;
|
||||
this.barStyle = barStyle;
|
||||
|
||||
//// Constructor
|
||||
|
||||
// Create container
|
||||
this.con = document.createElement('DIV');
|
||||
this.con.className = this.conStyle;
|
||||
// Create bar
|
||||
this.bar = document.createElement('DIV');
|
||||
this.bar.className = this.barStyle;
|
||||
// Insert in object tree
|
||||
this.con.appendChild(this.bar);
|
||||
document.body.appendChild(this.con);
|
||||
|
||||
} // end xBar
|
|
@ -1,57 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xBar'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Object</grp>
|
||||
<grp>Animation</grp>
|
||||
</groups>
|
||||
<type>Object</type>
|
||||
|
||||
<description><![CDATA[Bar-Graph Object]]></description>
|
||||
|
||||
<syntax>xBar(sDir, sConStyle, sBarStyle)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>sDir</name>
|
||||
<note><![CDATA[direction string, one of: 'ltr', 'rtl', 'ttb', or 'btt']]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>sConStyle</name>
|
||||
<note><![CDATA[classname for the bar container]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>sBarStyle</name>
|
||||
<note><![CDATA[classname for the bar]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<dependencies>
|
||||
<dep>xLeft</dep>
|
||||
<dep>xTop</dep>
|
||||
<dep>xNum</dep>
|
||||
<dep>xResizeTo</dep>
|
||||
<dep>xMoveTo</dep>
|
||||
<dep>xLinearScale</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/x/examples/bargraph.html</url>
|
||||
<note><![CDATA[Bar-graph object demo.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>1Dec03</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[initial implementation]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,30 +0,0 @@
|
|||
// xCapitalize, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
// Capitalize the first letter of every word in str.
|
||||
|
||||
function xCapitalize(str)
|
||||
{
|
||||
var i, c, wd, s='', cap = true;
|
||||
|
||||
for (i = 0; i < str.length; ++i) {
|
||||
c = str.charAt(i);
|
||||
wd = isWordDelim(c);
|
||||
if (wd) {
|
||||
cap = true;
|
||||
}
|
||||
if (cap && !wd) {
|
||||
c = c.toUpperCase();
|
||||
cap = false;
|
||||
}
|
||||
s += c;
|
||||
}
|
||||
return s;
|
||||
|
||||
function isWordDelim(c)
|
||||
{
|
||||
// add other word delimiters as needed
|
||||
// (for example '-' and other punctuation)
|
||||
return c == ' ' || c == '\n' || c == '\t';
|
||||
}
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xCapitalize'>
|
||||
|
||||
<copyright>Copyright 2003-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>String</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Capitalize the first letter of every word in str.]]></description>
|
||||
|
||||
<syntax>xCapitalize(str)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>str</name>
|
||||
<note><![CDATA[String whose words will be capitalized]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>A string with all words capitalized. Does not modify str.</return>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/x/examples/capitalize.html</url>
|
||||
<note><![CDATA[A simple xCapitalize demo.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>11Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,36 +0,0 @@
|
|||
// xCardinalPosition, Copyright 2004-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xCardinalPosition(e, cp, margin, outside)
|
||||
{
|
||||
if(!(e=xGetElementById(e))) return;
|
||||
if (typeof(cp)!='string'){window.status='xCardinalPosition error: cp=' + cp + ', id=' + e.id; return;}
|
||||
var x=xLeft(e), y=xTop(e), w=xWidth(e), h=xHeight(e);
|
||||
var pw,ph,p = xParent(e);
|
||||
if (p == document || p.nodeName.toLowerCase() == 'html') {pw = xClientWidth(); ph = xClientHeight();}
|
||||
else {pw=xWidth(p); ph=xHeight(p);}
|
||||
var sx=xScrollLeft(p), sy=xScrollTop(p);
|
||||
var right=sx + pw, bottom=sy + ph;
|
||||
var cenLeft=sx + Math.floor((pw-w)/2), cenTop=sy + Math.floor((ph-h)/2);
|
||||
if (!margin) margin=0;
|
||||
else{
|
||||
if (outside) margin=-margin;
|
||||
sx +=margin; sy +=margin; right -=margin; bottom -=margin;
|
||||
}
|
||||
switch (cp.toLowerCase()){
|
||||
case 'n': x=cenLeft; if (outside) y=sy - h; else y=sy; break;
|
||||
case 'ne': if (outside){x=right; y=sy - h;}else{x=right - w; y=sy;}break;
|
||||
case 'e': y=cenTop; if (outside) x=right; else x=right - w; break;
|
||||
case 'se': if (outside){x=right; y=bottom;}else{x=right - w; y=bottom - h}break;
|
||||
case 's': x=cenLeft; if (outside) y=sy - h; else y=bottom - h; break;
|
||||
case 'sw': if (outside){x=sx - w; y=bottom;}else{x=sx; y=bottom - h;}break;
|
||||
case 'w': y=cenTop; if (outside) x=sx - w; else x=sx; break;
|
||||
case 'nw': if (outside){x=sx - w; y=sy - h;}else{x=sx; y=sy;}break;
|
||||
case 'cen': x=cenLeft; y=cenTop; break;
|
||||
case 'cenh': x=cenLeft; break;
|
||||
case 'cenv': y=cenTop; break;
|
||||
}
|
||||
var o = new Object();
|
||||
o.x = x; o.y = y;
|
||||
return o;
|
||||
}
|
|
@ -1,80 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xCardinalPosition'>
|
||||
|
||||
<copyright>Copyright 2004-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Position</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[A convient way to get the coordinates of an element's 'cardinal' (or 'compass') points.]]></description>
|
||||
|
||||
<syntax>xCardinalPosition(ele, cp[, margin[, outside]])</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>ele</name>
|
||||
<note><![CDATA[string element id or object reference]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>cp</name>
|
||||
<note><![CDATA[string, one of: 'n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw', 'cen', 'cenh', 'cenv']]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>margin</name>
|
||||
<note><![CDATA[integer, an offset into the element]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>outside</name>
|
||||
<note><![CDATA[boolean, if true 'margin' is interpreted as negative]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>An object with 'x' and 'y' properties</return>
|
||||
|
||||
<dependencies>
|
||||
<dep>xGetElementById</dep>
|
||||
<dep>xleft</dep>
|
||||
<dep>xtop</dep>
|
||||
<dep>xwidth</dep>
|
||||
<dep>xheight</dep>
|
||||
<dep>xparent</dep>
|
||||
<dep>xclientwidth</dep>
|
||||
<dep>xclientheight</dep>
|
||||
<dep>xscrollleft</dep>
|
||||
<dep>xscrolltop</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<comments>
|
||||
<comment>
|
||||
<date>2004</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Ported from CBE to X - not completely tested. I'd like to rename this thing - got any suggestions?]]></note>
|
||||
</comment>
|
||||
</comments>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>23May05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Use xGetElementById just like all X functions.]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>11Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,17 +0,0 @@
|
|||
// xClientHeight, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xClientHeight()
|
||||
{
|
||||
var h=0;
|
||||
if(xOp6Dn) h=window.innerHeight;
|
||||
else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientHeight)
|
||||
h=document.documentElement.clientHeight;
|
||||
else if(document.body && document.body.clientHeight)
|
||||
h=document.body.clientHeight;
|
||||
else if(xDef(window.innerWidth,window.innerHeight,document.width)) {
|
||||
h=window.innerHeight;
|
||||
if(document.width>window.innerWidth) h-=16;
|
||||
}
|
||||
return h;
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xClientHeight'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Size</grp>
|
||||
<grp>Window</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[The inner height of the window.]]></description>
|
||||
|
||||
<syntax>xClientHeight()</syntax>
|
||||
|
||||
<return>Integer</return>
|
||||
|
||||
<dependencies>
|
||||
<dep>xDef</dep>
|
||||
<dep>xOp6Dn</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>3</num>
|
||||
<date>25Apr05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[use xOp6Dn instead of xOp5or6.]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>27Jan05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Moz update for xClientWidth/xClientHeight, check for 'CSS1Compat' (experimental?).]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>31Mar04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,17 +0,0 @@
|
|||
// xClientWidth, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xClientWidth()
|
||||
{
|
||||
var w=0;
|
||||
if(xOp6Dn) w=window.innerWidth;
|
||||
else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientWidth)
|
||||
w=document.documentElement.clientWidth;
|
||||
else if(document.body && document.body.clientWidth)
|
||||
w=document.body.clientWidth;
|
||||
else if(xDef(window.innerWidth,window.innerHeight,document.height)) {
|
||||
w=window.innerWidth;
|
||||
if(document.height>window.innerHeight) w-=16;
|
||||
}
|
||||
return w;
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xClientWidth'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Size</grp>
|
||||
<grp>Window</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[The inner width of the window.]]></description>
|
||||
|
||||
<syntax>xClientWidth()</syntax>
|
||||
|
||||
<return>Integer</return>
|
||||
|
||||
<dependencies>
|
||||
<dep>xDef</dep>
|
||||
<dep>xOp6Dn</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>3</num>
|
||||
<date>25Apr05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[use xOp6Dn instead of xOp5or6.]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>27Jan05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Moz update for xClientWidth/xClientHeight, check for 'CSS1Compat' (experimental?).]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>31Mar04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,11 +0,0 @@
|
|||
// xClip, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xClip(e,t,r,b,l)
|
||||
{
|
||||
if(!(e=xGetElementById(e))) return;
|
||||
if(e.style) {
|
||||
if (xNum(l)) e.style.clip='rect('+t+'px '+r+'px '+b+'px '+l+'px)';
|
||||
else e.style.clip='rect(0 '+parseInt(e.style.width)+'px '+parseInt(e.style.height)+'px 0)';
|
||||
}
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xClip'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Size</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Set the element's clipping rectangle. If ele is the only argument then set clip to existing width and height.]]></description>
|
||||
|
||||
<syntax>xClip(ele[,iTop,iRight,iBottom,iLeft])</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>ele</name>
|
||||
<note><![CDATA[id string or object reference]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>iTop</name>
|
||||
<note><![CDATA[integer y coordinate of top-left corner]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>iRight</name>
|
||||
<note><![CDATA[integer x coordinate of right-bottom corner]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>iBottom</name>
|
||||
<note><![CDATA[integer y coordinate of right-bottom corner]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>iLeft</name>
|
||||
<note><![CDATA[integer x coordinate of top-left corner]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>element.style.clip</return>
|
||||
|
||||
<dependencies>
|
||||
<dep>xGetElementById</dep>
|
||||
<dep>xNum</dep>
|
||||
<dep>nn4:xWidth</dep>
|
||||
<dep>nn4:xHeight</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>15Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[reduced by 44 bytes with shorter parameter names]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>31Mar04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,62 +0,0 @@
|
|||
// xCollapsible, Copyright 2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xCollapsible(outerEle, bShow) // object prototype
|
||||
{
|
||||
// Constructor
|
||||
|
||||
var container = xGetElementById(outerEle);
|
||||
if (!container) {return null;}
|
||||
var isUL = container.nodeName.toUpperCase() == 'UL';
|
||||
var i, trg, aTgt = xGetElementsByTagName(isUL ? 'UL':'DIV', container);
|
||||
for (i = 0; i < aTgt.length; ++i) {
|
||||
trg = xPrevSib(aTgt[i]);
|
||||
if (trg && (isUL || trg.nodeName.charAt(0).toUpperCase() == 'H')) {
|
||||
aTgt[i].xTrgPtr = trg;
|
||||
aTgt[i].style.display = bShow ? 'block' : 'none';
|
||||
trg.style.cursor = 'pointer';
|
||||
trg.xTgtPtr = aTgt[i];
|
||||
trg.onclick = trg_onClick;
|
||||
}
|
||||
}
|
||||
|
||||
// Private
|
||||
|
||||
function trg_onClick()
|
||||
{
|
||||
var tgt = this.xTgtPtr.style;
|
||||
if (tgt.display == 'none') {
|
||||
tgt.display = 'block';
|
||||
}
|
||||
else {
|
||||
tgt.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
// Public
|
||||
|
||||
this.displayAll = function(bShow)
|
||||
{
|
||||
for (var i = 0; i < aTgt.length; ++i) {
|
||||
if (aTgt[i].xTrgPtr) {
|
||||
xDisplay(aTgt[i], bShow ? "block":"none");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// The unload listener is for IE's circular reference memory leak bug.
|
||||
this.onUnload = function()
|
||||
{
|
||||
if (!xIE4Up || !container || !aTgt) {return;}
|
||||
for (i = 0; i < aTgt.length; ++i) {
|
||||
trg = aTgt[i].xTrgPtr;
|
||||
if (trg) {
|
||||
if (trg.xTgtPtr) {
|
||||
trg.xTgtPtr.TrgPtr = null;
|
||||
trg.xTgtPtr = null;
|
||||
}
|
||||
trg.onclick = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
|
@ -1,90 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xCollapsible'>
|
||||
|
||||
<copyright>Copyright 2004-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Object</grp>
|
||||
</groups>
|
||||
<type>Object</type>
|
||||
|
||||
<description><![CDATA[Creates a collapsible list from nested ULs or nested DIVs.
|
||||
A UL/DIV is a "target" - it will have its display toggled when its
|
||||
"trigger" is clicked (except for the outermost UL/DIV).
|
||||
For ULs the trigger is the UL's previous sibling element.
|
||||
For DIVs the trigger is also the DIV's previous sibling element,
|
||||
but it must be a heading element (H1, H2, etc.).]]></description>
|
||||
|
||||
<syntax>new xCollapsible(outerEle, bShow)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>outerEle</name>
|
||||
<note><![CDATA[the id string (or object reference) of the outermost UL/DIV]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>bShow</name>
|
||||
<note><![CDATA[if true, all targets are displayed initially]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<methods>
|
||||
<meth>
|
||||
<name>displayAll</name>
|
||||
<note><![CDATA[set the display of all targets]]></note>
|
||||
</meth>
|
||||
<meth>
|
||||
<name>onUnload</name>
|
||||
<note><![CDATA[mainly for IE, removes circular references]]></note>
|
||||
</meth>
|
||||
</methods>
|
||||
|
||||
<dependencies>
|
||||
<dep>xGetElementById</dep>
|
||||
<dep>xGetElementsByTagName</dep>
|
||||
<dep>xPrevSib</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/x/examples/xmenu5.php</url>
|
||||
<note><![CDATA[Three xCollapsible examples]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<comments>
|
||||
<comment>
|
||||
<date>28Apr05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[The unload listener is because of IE's circular reference memory leak bug. You have to test for the existence of everything because of Opera's back button feature (which I like). I get around this by only unloading for IE.]]></note>
|
||||
</comment>
|
||||
<comment>
|
||||
<date></date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Note that Opera (currently using 7.54u2) will issue a window.onunload event for this: location.href = '#topofpg']]></note>
|
||||
</comment>
|
||||
</comments>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>3</num>
|
||||
<date>28Apr05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Only run unload for IE]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>25Apr05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Somewhat re-implemented. Added displayAll method]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>7Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Moved from xmenu5.js]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,13 +0,0 @@
|
|||
// xColor, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xColor(e,s)
|
||||
{
|
||||
if(!(e=xGetElementById(e))) return '';
|
||||
var c='';
|
||||
if(e.style && xDef(e.style.color)) {
|
||||
if(xStr(s)) e.style.color=s;
|
||||
c=e.style.color;
|
||||
}
|
||||
return c;
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xColor'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Presentation</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Return and optionally set the element's text color.]]></description>
|
||||
|
||||
<syntax>xColor(ele[, sColor])</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>ele</name>
|
||||
<note><![CDATA[id string or object reference]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>sColor</name>
|
||||
<note><![CDATA[color string]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>string, element.style.color</return>
|
||||
|
||||
<dependencies>
|
||||
<dep>xGetElementById</dep>
|
||||
<dep>xDef</dep>
|
||||
<dep>xStr</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>15Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[reduced by 16 bytes with shorter parameter names]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>31Mar04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,8 +0,0 @@
|
|||
// xCreateElement, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xCreateElement(sTag)
|
||||
{
|
||||
if (document.createElement) return document.createElement(sTag);
|
||||
else return null;
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xCreateElement'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>DOM</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[A safe wrapper for document.createElement]]></description>
|
||||
|
||||
<syntax>xCreateElement(sTag)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>sTag</name>
|
||||
<note><![CDATA[string tagname]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>The object created or null.</return>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>31Mar04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,8 +0,0 @@
|
|||
// xDef, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xDef()
|
||||
{
|
||||
for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])=='undefined') return false;}
|
||||
return true;
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xDef'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Type</grp>
|
||||
<grp></grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Determine if all arguments are 'defined'.]]></description>
|
||||
|
||||
<syntax>xDef(ref[, ...])</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>...</name>
|
||||
<note><![CDATA[Can take any number and any type of arguments]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>True if none of the arguments == 'undefined', else false.</return>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>31Mar04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,7 +0,0 @@
|
|||
// xDeg, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xDeg(rad)
|
||||
{
|
||||
return rad * (180 / Math.PI);
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xDeg'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Math</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Converts from radians to degrees.]]></description>
|
||||
|
||||
<syntax>xDeg(rad)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>rad</name>
|
||||
<note><![CDATA[integer, in radians]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>integer, in degrees</return>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>11Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,11 +0,0 @@
|
|||
// xDeleteCookie, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xDeleteCookie(name, path)
|
||||
{
|
||||
if (xGetCookie(name)) {
|
||||
document.cookie = name + "=" +
|
||||
"; path=" + ((!path) ? "/" : path) +
|
||||
"; expires=" + new Date(0).toGMTString();
|
||||
}
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xDeleteCookie'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Cookie</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Delete a previously set cookie.]]></description>
|
||||
|
||||
<syntax>xDeleteCookie(name, path)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>name</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>path</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<dependencies>
|
||||
<dep>xGetCookie</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>4</num>
|
||||
<date>27Jan05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Bug-fix from Jeff Rose.]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>3</num>
|
||||
<date>2001</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[initial implementation (based on code from Netscape Javascript Guide)]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,17 +0,0 @@
|
|||
// xDisableDrag, Copyright 2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xDisableDrag(id, last)
|
||||
{
|
||||
if (!window._xDrgMgr) return;
|
||||
var ele = xGetElementById(id);
|
||||
ele.xDraggable = false;
|
||||
ele.xODS = null;
|
||||
ele.xOD = null;
|
||||
ele.xODE = null;
|
||||
xRemoveEventListener(ele, 'mousedown', _xOMD, false);
|
||||
if (_xDrgMgr.mm && last) {
|
||||
_xDrgMgr.mm = false;
|
||||
xRemoveEventListener(document, 'mousemove', _xOMM, false);
|
||||
}
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xDisableDrag'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp></grp>
|
||||
<grp></grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Disable dragging for an element previously passed to xEnableDrag.]]></description>
|
||||
|
||||
<syntax>function xDisableDrag(id, last)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>id</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>last</name>
|
||||
<note><![CDATA[If true the document mousemove listener will be removed. Should only be true if id is the last draggable element still enabled.]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<dependencies>
|
||||
<dep>xGetElementById</dep>
|
||||
<dep>xRemoveEventListener</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/x/examples/drag1.php</url>
|
||||
<note><![CDATA[]]></note>
|
||||
</demo>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/x/examples/drag2.php</url>
|
||||
<note><![CDATA[An object-oriented version of drag1.php.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>16Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Renamed variables according to rev2 of xEnableDrag.]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>7Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[initial implementation (suggested by Daniel FAIVRE).]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,12 +0,0 @@
|
|||
// xDisplay, Copyright 2003,2004,2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xDisplay(e,s)
|
||||
{
|
||||
if(!(e=xGetElementById(e))) return null;
|
||||
if(e.style && xDef(e.style.display)) {
|
||||
if (xStr(s)) e.style.display = s;
|
||||
return e.style.display;
|
||||
}
|
||||
return null;
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xDisplay'>
|
||||
|
||||
<copyright>Copyright 2003-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Presentation</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[A safe wrapper for element.style.display.]]></description>
|
||||
|
||||
<syntax>xDisplay(e, sProp)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>e</name>
|
||||
<note><![CDATA[id string or element reference]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>sProp</name>
|
||||
<note><![CDATA[one of the valid CSS strings for this property]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>string, element.style.display if it exists else null</return>
|
||||
|
||||
<dependencies>
|
||||
<dep>xGetElementById</dep>
|
||||
<dep>xDef</dep>
|
||||
<dep>xStr</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>15Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Reduced 13 bytes]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>11Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put into its own file for XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,51 +0,0 @@
|
|||
// xEllipse, Copyright 2004,2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xEllipse(e, xRadius, yRadius, radiusInc, totalTime, startAngle, stopAngle)
|
||||
{
|
||||
if (!(e=xGetElementById(e))) return;
|
||||
if (!e.timeout) e.timeout = 25;
|
||||
e.xA = xRadius;
|
||||
e.yA = yRadius;
|
||||
e.radiusInc = radiusInc;
|
||||
e.slideTime = totalTime;
|
||||
startAngle *= (Math.PI / 180);
|
||||
stopAngle *= (Math.PI / 180);
|
||||
var startTime = (startAngle * e.slideTime) / (stopAngle - startAngle);
|
||||
e.stopTime = e.slideTime + startTime;
|
||||
e.B = (stopAngle - startAngle) / e.slideTime;
|
||||
e.xD = xLeft(e) - Math.round(e.xA * Math.cos(e.B * startTime)); // center point
|
||||
e.yD = xTop(e) - Math.round(e.yA * Math.sin(e.B * startTime));
|
||||
e.xTarget = Math.round(e.xA * Math.cos(e.B * e.stopTime) + e.xD); // end point
|
||||
e.yTarget = Math.round(e.yA * Math.sin(e.B * e.stopTime) + e.yD);
|
||||
var d = new Date();
|
||||
e.C = d.getTime() - startTime;
|
||||
if (!e.moving) {e.stop=false; _xEllipse(e);}
|
||||
}
|
||||
function _xEllipse(e)
|
||||
{
|
||||
if (!(e=xGetElementById(e))) return;
|
||||
var now, t, newY, newX;
|
||||
now = new Date();
|
||||
t = now.getTime() - e.C;
|
||||
if (e.stop) { e.moving = false; }
|
||||
else if (t < e.stopTime) {
|
||||
setTimeout("_xEllipse('"+e.id+"')", e.timeout);
|
||||
if (e.radiusInc) {
|
||||
e.xA += e.radiusInc;
|
||||
e.yA += e.radiusInc;
|
||||
}
|
||||
newX = Math.round(e.xA * Math.cos(e.B * t) + e.xD);
|
||||
newY = Math.round(e.yA * Math.sin(e.B * t) + e.yD);
|
||||
xMoveTo(e, newX, newY);
|
||||
e.moving = true;
|
||||
}
|
||||
else {
|
||||
if (e.radiusInc) {
|
||||
e.xTarget = Math.round(e.xA * Math.cos(e.B * e.slideTime) + e.xD);
|
||||
e.yTarget = Math.round(e.yA * Math.sin(e.B * e.slideTime) + e.yD);
|
||||
}
|
||||
xMoveTo(e, e.xTarget, e.yTarget);
|
||||
e.moving = false;
|
||||
}
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xEllipse'>
|
||||
|
||||
<copyright>Copyright 2004-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Animation</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Animate an element along an elliptical path.]]></description>
|
||||
|
||||
<syntax>xEllipse(ele, xRadius, yRadius, radiusInc, totalTime, startAngle, stopAngle)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>ele</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>xRadius</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>yRadius</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>radiusInc</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>totalTime</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>startAngle</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>stopAngle</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<dependencies>
|
||||
<dep>xGetElementById</dep>
|
||||
<dep>xLeft</dep>
|
||||
<dep>xTop</dep>
|
||||
<dep>xMoveTo</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/x/examples/xellipse.php</url>
|
||||
<note><![CDATA[]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>21Jun04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Ported from CBE to X]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,68 +0,0 @@
|
|||
// xEnableDrag, Copyright 2002,2003,2004,2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
//// Private Data
|
||||
var _xDrgMgr = {ele:null, mm:false};
|
||||
//// Public Functions
|
||||
function xEnableDrag(id,fS,fD,fE)
|
||||
{
|
||||
var ele = xGetElementById(id);
|
||||
ele.xDraggable = true;
|
||||
ele.xODS = fS;
|
||||
ele.xOD = fD;
|
||||
ele.xODE = fE;
|
||||
xAddEventListener(ele, 'mousedown', _xOMD, false);
|
||||
if (!_xDrgMgr.mm) {
|
||||
_xDrgMgr.mm = true;
|
||||
xAddEventListener(document, 'mousemove', _xOMM, false);
|
||||
}
|
||||
}
|
||||
//// Private Event Listeners
|
||||
function _xOMD(e) // drag start
|
||||
{
|
||||
var evt = new xEvent(e);
|
||||
var ele = evt.target;
|
||||
while(ele && !ele.xDraggable) {
|
||||
ele = xParent(ele);
|
||||
}
|
||||
if (ele) {
|
||||
xPreventDefault(e);
|
||||
ele.xDPX = evt.pageX;
|
||||
ele.xDPY = evt.pageY;
|
||||
_xDrgMgr.ele = ele;
|
||||
xAddEventListener(document, 'mouseup', _xOMU, false);
|
||||
if (ele.xODS) {
|
||||
ele.xODS(ele, evt.pageX, evt.pageY);
|
||||
}
|
||||
}
|
||||
}
|
||||
function _xOMM(e) // drag
|
||||
{
|
||||
var evt = new xEvent(e);
|
||||
if (_xDrgMgr.ele) {
|
||||
xPreventDefault(e);
|
||||
var ele = _xDrgMgr.ele;
|
||||
var dx = evt.pageX - ele.xDPX;
|
||||
var dy = evt.pageY - ele.xDPY;
|
||||
ele.xDPX = evt.pageX;
|
||||
ele.xDPY = evt.pageY;
|
||||
if (ele.xOD) {
|
||||
ele.xOD(ele, dx, dy);
|
||||
}
|
||||
else {
|
||||
xMoveTo(ele, xLeft(ele) + dx, xTop(ele) + dy);
|
||||
}
|
||||
}
|
||||
}
|
||||
function _xOMU(e) // drag end
|
||||
{
|
||||
if (_xDrgMgr.ele) {
|
||||
xPreventDefault(e);
|
||||
xRemoveEventListener(document, 'mouseup', _xOMU, false);
|
||||
if (_xDrgMgr.ele.xODE) {
|
||||
var evt = new xEvent(e);
|
||||
_xDrgMgr.ele.xODE(_xDrgMgr.ele, evt.pageX, evt.pageY);
|
||||
}
|
||||
_xDrgMgr.ele = null;
|
||||
}
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xEnableDrag'>
|
||||
|
||||
<copyright>Copyright 2002-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Event</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Enable dragging for the element.]]></description>
|
||||
|
||||
<syntax>xEnableDrag(ele[, fnDragStart[, fnDrag[, fnDragEnd]]])</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>ele</name>
|
||||
<note><![CDATA[id string or element object reference]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>fnDragStart</name>
|
||||
<note><![CDATA[this function will be called on mousedown on ele]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>fnDrag</name>
|
||||
<note><![CDATA[this function will be called on each mousemove during dragging]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>fnDragEnd</name>
|
||||
<note><![CDATA[this function will be called on mouseup on ele]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<dependencies>
|
||||
<dep>xGetElementById</dep>
|
||||
<dep>xAddEventListener</dep>
|
||||
<dep>xRemoveEventListener</dep>
|
||||
<dep>xEvent</dep>
|
||||
<dep>xParent</dep>
|
||||
<dep>xMoveTo</dep>
|
||||
<dep>xPreventDefault</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/x/examples/drag1.php</url>
|
||||
<note><![CDATA[]]></note>
|
||||
</demo>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/x/examples/drag2.php</url>
|
||||
<note><![CDATA[An object-oriented version of drag1.php.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>16Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Reduced 426 bytes! Renamed event listeners, variables and parameters. Calling xPreventDefault instead of inline code.]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,20 +0,0 @@
|
|||
// xEvalTextarea, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xEvalTextarea()
|
||||
{
|
||||
var f = document.createElement('FORM');
|
||||
f.onsubmit = 'return false';
|
||||
var t = document.createElement('TEXTAREA');
|
||||
t.id='xDebugTA';
|
||||
t.name='xDebugTA';
|
||||
t.rows='20';
|
||||
t.cols='60';
|
||||
var b = document.createElement('INPUT');
|
||||
b.type = 'button';
|
||||
b.value = 'Evaluate';
|
||||
b.onclick = function() {eval(this.form.xDebugTA.value);};
|
||||
f.appendChild(t);
|
||||
f.appendChild(b);
|
||||
document.body.appendChild(f);
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xEvalTextarea'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Debug</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Creates a textarea and a button, for executing Javascript in the textarea.]]></description>
|
||||
|
||||
<syntax>xEvalTextarea()</syntax>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/x/examples/bookmarklets.html</url>
|
||||
<note><![CDATA[]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>12Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,93 +0,0 @@
|
|||
// xEvent, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xEvent(evt) // object prototype
|
||||
{
|
||||
var e = evt || window.event;
|
||||
if(!e) return;
|
||||
if(e.type) this.type = e.type;
|
||||
if(e.target) this.target = e.target;
|
||||
else if(e.srcElement) this.target = e.srcElement;
|
||||
|
||||
// Section B
|
||||
if (e.relatedTarget) this.relatedTarget = e.relatedTarget;
|
||||
else if (e.type == 'mouseover' && e.fromElement) this.relatedTarget = e.fromElement;
|
||||
else if (e.type == 'mouseout') this.relatedTarget = e.toElement;
|
||||
// End Section B
|
||||
|
||||
if(xOp6Dn) { this.pageX = e.clientX; this.pageY = e.clientY; }
|
||||
else if(xDef(e.pageX,e.pageY)) { this.pageX = e.pageX; this.pageY = e.pageY; }
|
||||
else if(xDef(e.clientX,e.clientY)) { this.pageX = e.clientX + xScrollLeft(); this.pageY = e.clientY + xScrollTop(); }
|
||||
|
||||
// Section A
|
||||
if (xDef(e.offsetX,e.offsetY)) {
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
}
|
||||
else if (xDef(e.layerX,e.layerY)) {
|
||||
this.offsetX = e.layerX;
|
||||
this.offsetY = e.layerY;
|
||||
}
|
||||
else {
|
||||
this.offsetX = this.pageX - xPageX(this.target);
|
||||
this.offsetY = this.pageY - xPageY(this.target);
|
||||
}
|
||||
// End Section A
|
||||
|
||||
if (e.keyCode) { this.keyCode = e.keyCode; } // for moz/fb, if keyCode==0 use which
|
||||
else if (xDef(e.which) && e.type.indexOf('key')!=-1) { this.keyCode = e.which; }
|
||||
|
||||
this.shiftKey = e.shiftKey;
|
||||
this.ctrlKey = e.ctrlKey;
|
||||
this.altKey = e.altKey;
|
||||
}
|
||||
|
||||
// I need someone with IE/Mac to compare test snippets 1 and 2 in section A.
|
||||
|
||||
// // Snippet 1
|
||||
// if(xDef(e.offsetX,e.offsetY)) {
|
||||
// this.offsetX = e.offsetX;
|
||||
// this.offsetY = e.offsetY;
|
||||
// if (xIE4Up && xMac) {
|
||||
// this.offsetX += xScrollLeft();
|
||||
// this.offsetY += xScrollTop();
|
||||
// }
|
||||
// }
|
||||
// else if (xDef(e.layerX,e.layerY)) {
|
||||
// this.offsetX = e.layerX;
|
||||
// this.offsetY = e.layerY;
|
||||
// }
|
||||
// else {
|
||||
// this.offsetX = this.pageX - xPageX(this.target);
|
||||
// this.offsetY = this.pageY - xPageY(this.target);
|
||||
// }
|
||||
|
||||
// // Snippet 2
|
||||
// if (xDef(e.offsetX,e.offsetY) && !(xIE4Up && xMac)) {
|
||||
// this.offsetX = e.offsetX;
|
||||
// this.offsetY = e.offsetY;
|
||||
// }
|
||||
// else if (xDef(e.layerX,e.layerY)) {
|
||||
// this.offsetX = e.layerX;
|
||||
// this.offsetY = e.layerY;
|
||||
// }
|
||||
// else {
|
||||
// this.offsetX = this.pageX - xPageX(this.target);
|
||||
// this.offsetY = this.pageY - xPageY(this.target);
|
||||
// }
|
||||
|
||||
// This was in section B:
|
||||
|
||||
// if (e.relatedTarget) this.relatedTarget = e.relatedTarget;
|
||||
// else if (xIE4Up) {
|
||||
// if (e.type == 'mouseover') this.relatedTarget = e.fromElement;
|
||||
// else if (e.type == 'mouseout') this.relatedTarget = e.toElement;
|
||||
// }
|
||||
// changed to remove sniffer after discussion with Hallvord
|
||||
|
||||
// Possible optimization:
|
||||
|
||||
// if (e.keyCode) { this.keyCode = e.keyCode; } // for moz/fb, if keyCode==0 use which
|
||||
// else if (xDef(e.which) && e.type.indexOf('key')!=-1) { this.keyCode = e.which; }
|
||||
// // replace the above 2 lines with the following?
|
||||
// // this.keyCode = e.keyCode || e.which || 0;
|
|
@ -1,117 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xEvent'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Event</grp>
|
||||
</groups>
|
||||
<type>Object</type>
|
||||
|
||||
<description><![CDATA[Resolve browser differences for event properties. This is an object prototype. Create an instance with the 'new' operator.]]></description>
|
||||
|
||||
<syntax>new xEvent(oEvent)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>oEvent</name>
|
||||
<note><![CDATA[the native event object passed to your event listener]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<properties>
|
||||
<prop>
|
||||
<name>type</name>
|
||||
<note><![CDATA[string, event type]]></note>
|
||||
</prop>
|
||||
<prop>
|
||||
<name>target</name>
|
||||
<note><![CDATA[element object, target of event]]></note>
|
||||
</prop>
|
||||
<prop>
|
||||
<name>pageX</name>
|
||||
<note><![CDATA[absolute X coordinate of mouse]]></note>
|
||||
</prop>
|
||||
<prop>
|
||||
<name>pageY</name>
|
||||
<note><![CDATA[absolute Y coordinate of mouse]]></note>
|
||||
</prop>
|
||||
<prop>
|
||||
<name>offsetX</name>
|
||||
<note><![CDATA[target-relative X coordinate of mouse]]></note>
|
||||
</prop>
|
||||
<prop>
|
||||
<name>offsetY</name>
|
||||
<note><![CDATA[target-relative Y coordinate of mouse]]></note>
|
||||
</prop>
|
||||
<prop>
|
||||
<name>keyCode</name>
|
||||
<note><![CDATA[unsigned integer]]></note>
|
||||
</prop>
|
||||
<prop>
|
||||
<name>shiftKey</name>
|
||||
<note><![CDATA[boolean]]></note>
|
||||
</prop>
|
||||
<prop>
|
||||
<name>ctrlKey</name>
|
||||
<note><![CDATA[boolean]]></note>
|
||||
</prop>
|
||||
<prop>
|
||||
<name>altKey</name>
|
||||
<note><![CDATA[boolean]]></note>
|
||||
</prop>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dep>xDef</dep>
|
||||
<dep>xScrollLeft</dep>
|
||||
<dep>xScrollTop</dep>
|
||||
<dep>xPageX</dep>
|
||||
<dep>xPageY</dep>
|
||||
<dep>nn4:xLayerFromPoint</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[xEvent is used in many of the demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<comments>
|
||||
<comment>
|
||||
<date>2002</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[I always thought I should have made this a function instead of an object prototype ;-)]]></note>
|
||||
</comment>
|
||||
</comments>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>4</num>
|
||||
<date>2May05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Removed one sniffer (xIE4Up). Thanks very much to Hallvord (hallvord.com).]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>3</num>
|
||||
<date>25Apr05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[use xOp6Dn instead of xOp5or6.]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>24Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Added shiftKey, ctrlKey and altKey.]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>31Mar04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,70 +0,0 @@
|
|||
// xFenster, Copyright 2004-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xFenster(eleId, iniX, iniY, barId, resBtnId, maxBtnId) // object prototype
|
||||
{
|
||||
// Private Properties
|
||||
var me = this;
|
||||
var ele = xGetElementById(eleId);
|
||||
var rBtn = xGetElementById(resBtnId);
|
||||
var mBtn = xGetElementById(maxBtnId);
|
||||
var x, y, w, h, maximized = false;
|
||||
// Public Methods
|
||||
this.onunload = function()
|
||||
{
|
||||
if (xIE4Up) { // clear cir refs
|
||||
xDisableDrag(barId);
|
||||
xDisableDrag(rBtn);
|
||||
mBtn.onclick = ele.onmousedown = null;
|
||||
me = ele = rBtn = mBtn = null;
|
||||
}
|
||||
}
|
||||
this.paint = function()
|
||||
{
|
||||
xMoveTo(rBtn, xWidth(ele) - xWidth(rBtn), xHeight(ele) - xHeight(rBtn));
|
||||
xMoveTo(mBtn, xWidth(ele) - xWidth(rBtn), 0);
|
||||
}
|
||||
// Private Event Listeners
|
||||
function barOnDrag(e, mdx, mdy)
|
||||
{
|
||||
xMoveTo(ele, xLeft(ele) + mdx, xTop(ele) + mdy);
|
||||
}
|
||||
function resOnDrag(e, mdx, mdy)
|
||||
{
|
||||
xResizeTo(ele, xWidth(ele) + mdx, xHeight(ele) + mdy);
|
||||
me.paint();
|
||||
}
|
||||
function fenOnMousedown()
|
||||
{
|
||||
xZIndex(ele, xFenster.z++);
|
||||
}
|
||||
function maxOnClick()
|
||||
{
|
||||
if (maximized) {
|
||||
maximized = false;
|
||||
xResizeTo(ele, w, h);
|
||||
xMoveTo(ele, x, y);
|
||||
}
|
||||
else {
|
||||
w = xWidth(ele);
|
||||
h = xHeight(ele);
|
||||
x = xLeft(ele);
|
||||
y = xTop(ele);
|
||||
xMoveTo(ele, xScrollLeft(), xScrollTop());
|
||||
maximized = true;
|
||||
xResizeTo(ele, xClientWidth(), xClientHeight());
|
||||
}
|
||||
me.paint();
|
||||
}
|
||||
// Constructor Code
|
||||
xFenster.z++;
|
||||
xMoveTo(ele, iniX, iniY);
|
||||
this.paint();
|
||||
xEnableDrag(barId, null, barOnDrag, null);
|
||||
xEnableDrag(rBtn, null, resOnDrag, null);
|
||||
mBtn.onclick = maxOnClick;
|
||||
ele.onmousedown = fenOnMousedown;
|
||||
xShow(ele);
|
||||
} // end xFenster object prototype
|
||||
|
||||
xFenster.z = 0; // xFenster static property
|
|
@ -1,94 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xFenster'>
|
||||
|
||||
<copyright>Copyright 2004-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Event</grp>
|
||||
</groups>
|
||||
<type>Object</type>
|
||||
|
||||
<description><![CDATA[A simple dhtml window object, with drag, resize and max/restore.]]></description>
|
||||
|
||||
<syntax>new xFenster(eleId, iniX, iniY, barId, resBtnId, maxBtnId)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>eleId</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>iniX</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>iniY</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>barId</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>resBtnId</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>maxBtnId</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<properties>
|
||||
<prop>
|
||||
<name></name>
|
||||
<note><![CDATA[]]></note>
|
||||
</prop>
|
||||
<prop>
|
||||
<name></name>
|
||||
<note><![CDATA[]]></note>
|
||||
</prop>
|
||||
<prop>
|
||||
<name></name>
|
||||
<note><![CDATA[]]></note>
|
||||
</prop>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dep>xGetElementById</dep>
|
||||
<dep>xDisableDrag</dep>
|
||||
<dep>xMoveTo</dep>
|
||||
<dep>xWidth</dep>
|
||||
<dep>xHeight</dep>
|
||||
<dep>xResizeTo</dep>
|
||||
<dep>xZIndex</dep>
|
||||
<dep>xEnableDrag</dep>
|
||||
<dep>xShow</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/x/examples/drag2.php</url>
|
||||
<note><![CDATA[]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<comments>
|
||||
<comment>
|
||||
<date></date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[see drag1.php for a procedural version]]></note>
|
||||
</comment>
|
||||
</comments>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>9May05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Put in it's own file for use with XC. Added unload conditional for IE.]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,10 +0,0 @@
|
|||
// xFirstChild, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xFirstChild(e, t)
|
||||
{
|
||||
var c = e ? e.firstChild : null;
|
||||
if (t) while (c && c.nodeName != t) { c = c.nextSibling; }
|
||||
else while (c && c.nodeType != 1) { c = c.nextSibling; }
|
||||
return c;
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xFirstChild'>
|
||||
|
||||
<copyright>Copyright 2004-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>DOM</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[An enhanced wrapper for element.firstChild.]]></description>
|
||||
|
||||
<syntax>xFirstChild(ele[, tag])</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>ele</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>tag</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>If tag is defined, returns first child (or first child's sibling) with nodeName == tag, else with nodeType == 1.</return>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>11Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>27Jan05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Implemented xPrevSib, xNextSib and xFirstChild (need optimizing).]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,25 +0,0 @@
|
|||
// xGetComputedStyle, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xGetComputedStyle(oEle, sProp, bInt)
|
||||
{
|
||||
var s, p = 'undefined';
|
||||
var dv = document.defaultView;
|
||||
if(dv && dv.getComputedStyle){
|
||||
s = dv.getComputedStyle(oEle,'');
|
||||
if (s) p = s.getPropertyValue(sProp);
|
||||
}
|
||||
else if(oEle.currentStyle) {
|
||||
// convert css property name to object property name for IE
|
||||
var a = sProp.split('-');
|
||||
sProp = a[0];
|
||||
for (var i=1; i<a.length; ++i) {
|
||||
c = a[i].charAt(0);
|
||||
sProp += a[i].replace(c, c.toUpperCase());
|
||||
}
|
||||
p = oEle.currentStyle[sProp];
|
||||
}
|
||||
else return null;
|
||||
return bInt ? (parseInt(p) || 0) : p;
|
||||
}
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xGetComputedStyle'>
|
||||
|
||||
<copyright>Copyright 2002-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Style</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[A safe wrapper for getComputedStyle and currentStyle.]]></description>
|
||||
|
||||
<syntax>xGetComputedStyle(oEle, sProp[, bInt])</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>oEle</name>
|
||||
<note><![CDATA[element object]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>sProp</name>
|
||||
<note><![CDATA[css property name]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>bInt</name>
|
||||
<note><![CDATA[if true, return value is an integer]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>String, or integer if bInt is true.</return>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[It is also used by xWidth and xHeight]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<comments>
|
||||
<comment>
|
||||
<date></date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[For sProp use the css property name, not the object property name.
|
||||
For finding width this works in Moz and Op, but in IE this only works if padding and border use pixel units in the CSS.]]></note>
|
||||
</comment>
|
||||
</comments>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>5</num><date>14Mar05</date><author>mf</author>
|
||||
<note><![CDATA[reduced by about 20 bytes]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>4</num><date>12Mar05</date><author>mf</author>
|
||||
<note><![CDATA[return null on error]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>3</num><date></date><author>mf</author>
|
||||
<note><![CDATA[added some error checking]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>2</num><date>23Aug04</date><author>mf</author>
|
||||
<note><![CDATA[option to parseInt or return string]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num><date>31Mar04</date><author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,17 +0,0 @@
|
|||
// xGetCookie, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xGetCookie(name)
|
||||
{
|
||||
var value=null, search=name+"=";
|
||||
if (document.cookie.length > 0) {
|
||||
var offset = document.cookie.indexOf(search);
|
||||
if (offset != -1) {
|
||||
offset += search.length;
|
||||
var end = document.cookie.indexOf(";", offset);
|
||||
if (end == -1) end = document.cookie.length;
|
||||
value = unescape(document.cookie.substring(offset, end));
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xGetCookie'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Cookie</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Get a cookie value]]></description>
|
||||
|
||||
<syntax>xGetCookie(sName)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>sName</name>
|
||||
<note><![CDATA[string]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>string</return>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date></date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[initial implementation based on code from Netscape Javascript Guide]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,11 +0,0 @@
|
|||
// xGetElementById, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xGetElementById(e)
|
||||
{
|
||||
if(typeof(e)!='string') return e;
|
||||
if(document.getElementById) e=document.getElementById(e);
|
||||
else if(document.all) e=document.all[e];
|
||||
else e=null;
|
||||
return e;
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xGetElementById'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>DOM</grp>
|
||||
<grp></grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Get an object reference to the element object with the passed ID.]]></description>
|
||||
|
||||
<syntax>xGetElementById(ele)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>ele</name>
|
||||
<note><![CDATA[id string or object reference]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>object reference or null</return>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[xGetElementById is used in almost all the demos]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>31Mar04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,17 +0,0 @@
|
|||
// xGetElementsByAttribute, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xGetElementsByAttribute(sTag, sAtt, sRE, fn)
|
||||
{
|
||||
var a, list, found = new Array(), re = new RegExp(sRE, 'i');
|
||||
list = xGetElementsByTagName(sTag);
|
||||
for (var i = 0; i < list.length; ++i) {
|
||||
a = list[i].getAttribute(sAtt);
|
||||
if (!a) {a = list[i][sAtt];}
|
||||
if (typeof(a)=='string' && a.search(re) != -1) {
|
||||
found[found.length] = list[i];
|
||||
if (fn) fn(list[i]);
|
||||
}
|
||||
}
|
||||
return found;
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xGetElementsByAttribute'>
|
||||
|
||||
<copyright>Copyright 2002-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>DOM</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Return an array of all sTag elements whose sAtt attribute matches sRE. sAtt can also be a property name but the property must be of type string.]]></description>
|
||||
|
||||
<syntax>xGetElementsByAttribute(sTag, sAtt, sRE[, fn])</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>sTag</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>sAtt</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>sRE</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>fn</name>
|
||||
<note><![CDATA[callback function, iterates thru the returned list]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>array</return>
|
||||
|
||||
<dependencies>
|
||||
<dep>xGetElementsByTagName</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>15May04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[added callback fn]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>31Mar04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,16 +0,0 @@
|
|||
// xGetElementsByClassName, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xGetElementsByClassName(c,p,t,f)
|
||||
{
|
||||
var found = new Array();
|
||||
var re = new RegExp('\\b'+c+'\\b', 'i');
|
||||
var list = xGetElementsByTagName(t, p);
|
||||
for (var i = 0; i < list.length; ++i) {
|
||||
if (list[i].className && list[i].className.search(re) != -1) {
|
||||
found[found.length] = list[i];
|
||||
if (f) f(list[i]);
|
||||
}
|
||||
}
|
||||
return found;
|
||||
}
|
|
@ -1,76 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xGetElementsByClassName'>
|
||||
|
||||
<copyright>Copyright 2002-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>DOM</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Returns an array of elements which are descendants of parentEle and have tagName and clsName. If parentEle is null or not present, document will be used. If tagName is null or not present, "*" will be used.]]></description>
|
||||
|
||||
<syntax>xGetElementsByClassName(sClsName, oParentEle, sTagName, fn)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>sClsName</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>oParentEle</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>sTagName</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>fn</name>
|
||||
<note><![CDATA[callback function, iterates thru the returned list]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>
|
||||
</return>
|
||||
|
||||
<dependencies>
|
||||
<dep>xGetElementsByTagName</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>4</num>
|
||||
<date>15Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Reduced 46 bytes.]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>3</num>
|
||||
<date>7Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Bug-fix from Daniel FAIVRE.]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>15May04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[added callback fn]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>31Mar04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,15 +0,0 @@
|
|||
// xGetElementsByTagName, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xGetElementsByTagName(t,p)
|
||||
{
|
||||
var list = null;
|
||||
t = t || '*';
|
||||
p = p || document;
|
||||
if (xIE4 || xIE5) {
|
||||
if (t == '*') list = p.all;
|
||||
else list = p.all.tags(t);
|
||||
}
|
||||
else if (p.getElementsByTagName) list = p.getElementsByTagName(t);
|
||||
return list || new Array();
|
||||
}
|
|
@ -1,106 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xGetElementsByTagName'>
|
||||
|
||||
<copyright>Copyright 2002-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>DOM</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Returns an array of elements which are descendants of parentEle and have tagName. If parentEle is null or not present, document will be used. If tagName is null or not present, "*" will be used.]]></description>
|
||||
|
||||
<syntax>xGetElementsByTagName(tagName[, parentEle])</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>tagName</name>
|
||||
<note><![CDATA[string]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>parentEle</name>
|
||||
<note><![CDATA[element reference]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>node list</return>
|
||||
|
||||
<dependencies>
|
||||
<dep>xIE4</dep>
|
||||
<dep>xIE5</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<comments>
|
||||
<comment>
|
||||
<date>2May05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[
|
||||
After a discussion with Hallvord on the Opera libraries list on
|
||||
how to eliminate the browser sniff...
|
||||
[code]
|
||||
function xGetElementsByTagName(t,p)
|
||||
{
|
||||
var list = null;
|
||||
t = t || '*';
|
||||
p = p || document;
|
||||
////
|
||||
if (p.getElementsByTagName) { // DOM1
|
||||
list = p.getElementsByTagName(t);
|
||||
if (t=='*' && (!list || !list.length)) list = p.all; // IE5 '*' bug
|
||||
}
|
||||
else { // IE4 object model
|
||||
if (t=='*') list = p.all;
|
||||
else if (p.all && p.all.tags) list = p.all.tags(t);
|
||||
}
|
||||
////
|
||||
return list || new Array();
|
||||
}
|
||||
[/code]
|
||||
I really like this - but I don't like the code-size increase (about 50 bytes).
|
||||
I realize that my additions contributed to the size increase - but I felt they
|
||||
were needed to maintain the semantics of the original function. Perhaps they
|
||||
could be optimized.
|
||||
|
||||
My change to your expression: (t=='*' && list.length == 0)
|
||||
to this: (t=='*' && (!list || !list.length))
|
||||
is perhaps needless paranoia - I don't know
|
||||
|
||||
So we reduced the browser sniff assumption to an assumption (or knowledge) about
|
||||
the effect of the bug - with this expression: (t=='*' && (!list || !list.length)).
|
||||
Excellent! And perhaps the increase of 50 bytes is worth it - knowing
|
||||
that I won't have to maintain a browser sniff for this function.
|
||||
]]></note>
|
||||
</comment>
|
||||
<comment>
|
||||
<date>2002</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[This even works with IE4.]]></note>
|
||||
</comment>
|
||||
</comments>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>16Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Reduced 93 bytes]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>31Mar04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
||||
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
// xGetElePropsArray, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xGetElePropsArray(ele, eleName)
|
||||
{
|
||||
var u = 'undefined';
|
||||
var i = 0, a = new Array();
|
||||
|
||||
nv('Element', eleName);
|
||||
nv('id', (xDef(ele.id) ? ele.id : u));
|
||||
nv('tagName', (xDef(ele.tagName) ? ele.tagName : u));
|
||||
|
||||
nv('xWidth()', xWidth(ele));
|
||||
nv('style.width', (xDef(ele.style) && xDef(ele.style.width) ? ele.style.width : u));
|
||||
nv('offsetWidth', (xDef(ele.offsetWidth) ? ele.offsetWidth : u));
|
||||
nv('scrollWidth', (xDef(ele.offsetWidth) ? ele.offsetWidth : u));
|
||||
nv('clientWidth', (xDef(ele.clientWidth) ? ele.clientWidth : u));
|
||||
|
||||
nv('xHeight()', xHeight(ele));
|
||||
nv('style.height', (xDef(ele.style) && xDef(ele.style.height) ? ele.style.height : u));
|
||||
nv('offsetHeight', (xDef(ele.offsetHeight) ? ele.offsetHeight : u));
|
||||
nv('scrollHeight', (xDef(ele.offsetHeight) ? ele.offsetHeight : u));
|
||||
nv('clientHeight', (xDef(ele.clientHeight) ? ele.clientHeight : u));
|
||||
|
||||
nv('xLeft()', xLeft(ele));
|
||||
nv('style.left', (xDef(ele.style) && xDef(ele.style.left) ? ele.style.left : u));
|
||||
nv('offsetLeft', (xDef(ele.offsetLeft) ? ele.offsetLeft : u));
|
||||
nv('style.pixelLeft', (xDef(ele.style) && xDef(ele.style.pixelLeft) ? ele.style.pixelLeft : u));
|
||||
|
||||
nv('xTop()', xTop(ele));
|
||||
nv('style.top', (xDef(ele.style) && xDef(ele.style.top) ? ele.style.top : u));
|
||||
nv('offsetTop', (xDef(ele.offsetTop) ? ele.offsetTop : u));
|
||||
nv('style.pixelTop', (xDef(ele.style) && xDef(ele.style.pixelTop) ? ele.style.pixelTop : u));
|
||||
|
||||
nv('', '');
|
||||
nv('xGetComputedStyle()', '');
|
||||
|
||||
nv('top');
|
||||
nv('right');
|
||||
nv('bottom');
|
||||
nv('left');
|
||||
|
||||
nv('width');
|
||||
nv('height');
|
||||
|
||||
nv('color');
|
||||
nv('background-color');
|
||||
nv('font-family');
|
||||
nv('font-size');
|
||||
nv('text-align');
|
||||
nv('line-height');
|
||||
nv('content');
|
||||
|
||||
nv('float');
|
||||
nv('clear');
|
||||
|
||||
nv('margin');
|
||||
nv('padding');
|
||||
nv('padding-top');
|
||||
nv('padding-right');
|
||||
nv('padding-bottom');
|
||||
nv('padding-left');
|
||||
|
||||
nv('border-top-width');
|
||||
nv('border-right-width');
|
||||
nv('border-bottom-width');
|
||||
nv('border-left-width');
|
||||
|
||||
nv('position');
|
||||
nv('overflow');
|
||||
nv('visibility');
|
||||
nv('display');
|
||||
nv('z-index');
|
||||
nv('clip');
|
||||
nv('cursor');
|
||||
|
||||
return a;
|
||||
|
||||
function nv(name, value)
|
||||
{
|
||||
a[i] = new Object();
|
||||
a[i].name = name;
|
||||
a[i].value = typeof(value)=='undefined' ? xGetComputedStyle(ele, name) : value;
|
||||
++i;
|
||||
}
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xGetElePropsArray'>
|
||||
|
||||
<copyright>Copyright 2002-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Debug</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Debugging utility.]]></description>
|
||||
|
||||
<syntax>xGetElePropsArray(ele, eleName)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>ele</name>
|
||||
<note><![CDATA[element reference]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>eleName</name>
|
||||
<note><![CDATA[string]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>an array of element properties</return>
|
||||
|
||||
<dependencies>
|
||||
<dep>xDef</dep>
|
||||
<dep>xWidth</dep>
|
||||
<dep>xHeight</dep>
|
||||
<dep>xLeft</dep>
|
||||
<dep>xTop</dep>
|
||||
<dep>xGetComputedStyle</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/x/examples/properties_report.php</url>
|
||||
<note><![CDATA[a simple test]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>12Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,11 +0,0 @@
|
|||
// xGetElePropsString, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xGetElePropsString(ele, eleName, newLine)
|
||||
{
|
||||
var s = '', a = xGetElePropsArray(ele, eleName);
|
||||
for (var i = 0; i < a.length; ++i) {
|
||||
s += a[i].name + ' = ' + a[i].value + (newLine || '\n');
|
||||
}
|
||||
return s;
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xGetElePropsString'>
|
||||
|
||||
<copyright>Copyright 2002-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Debug</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Debugging utility.]]></description>
|
||||
|
||||
<syntax>xGetElePropsString(ele, eleName[, newLine])</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>ele</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>eleName</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>newLine</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>a string of element properties</return>
|
||||
|
||||
<dependencies>
|
||||
<dep>xGetElePropsArray</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/x/examples/properties_report.php</url>
|
||||
<note><![CDATA[a simple test]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>12Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,17 +0,0 @@
|
|||
// xGetURLArguments, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xGetURLArguments()
|
||||
{
|
||||
var idx = location.href.indexOf('?');
|
||||
var params = new Array();
|
||||
if (idx != -1) {
|
||||
var pairs = location.href.substring(idx+1, location.href.length).split('&');
|
||||
for (var i=0; i<pairs.length; i++) {
|
||||
nameVal = pairs[i].split('=');
|
||||
params[i] = nameVal[1];
|
||||
params[nameVal[0]] = nameVal[1];
|
||||
}
|
||||
}
|
||||
return params;
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xGetURLArguments'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>String</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Parses the name/value pairs on the url.]]></description>
|
||||
|
||||
<syntax>xGetURLArguments()</syntax>
|
||||
|
||||
<return>an array of name/value pairs, can be indexed by name</return>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>11Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date></date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Original implementation based on Netscape JavaScript Guide.]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xGlobals'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Var</grp>
|
||||
</groups>
|
||||
<type>Var</type>
|
||||
|
||||
<description><![CDATA[This file documents the global variables which XC includes before any other js if the -glb option is not specified.]]></description>
|
||||
|
||||
<comments>
|
||||
<comment>
|
||||
<date></date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[
|
||||
xUA - lowercase user-agent string
|
||||
xOp7Up - true if browser is Opera 7 or greater
|
||||
xOp6Dn - true if browser is Opera 6.x or less
|
||||
xIE4 - true if browser is IE 4.x
|
||||
xIE5 - true if browser is IE 5.x
|
||||
xIE4Up - true if browser is IE 4 or greater
|
||||
xNN4 - true if browser is Netscape Navigator 4.x
|
||||
xMac - true if OS is Mac
|
||||
|
||||
For some browsers, the window resize and scroll events are simulated.
|
||||
Some of the following variables may be used.
|
||||
|
||||
xPCW - previous clientWidth
|
||||
xPCH - previous clientHeight
|
||||
xREL - resize event listener
|
||||
xPSL - previous scrollLeft
|
||||
xPST - previous scrollTop
|
||||
xSEL - scroll event listener
|
||||
]]></note>
|
||||
</comment>
|
||||
<comment>
|
||||
<date></date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[As much as possible, object-detection is used instead of browser-detection.]]></note>
|
||||
</comment>
|
||||
<comment>
|
||||
<date></date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Some notes from brothercake (thanks bro!):
|
||||
---
|
||||
Looks good as far as Opera's concerned, but Konqueror spoofs document.all, and can also identify as IE, so you'd need to add navigator.vendor != 'KDE' to your second test; but with that addition you no longer need to look for "msie" in the user agent string - having tested for document.all and not konqueror, and already knowing we're not Opera, only IE is left; then you can separate IE4 from IE5+ by testing for getElementById or another DOM1 collection.
|
||||
|
||||
Your gecko test will also identify Safari (which has "like gecko" in its UA string), and Konqueror if it's identifying as gecko - you could test against that with navigator.vendor again, but that wouldn't allow for gecko spoofing as something else - afaik there is no way to identify gecko reliably.
|
||||
|
||||
Why have a mac test? Do you need to know that someone's using a mac, over and above that they're using mac/ie5? For mac ie5 you can test (established IE) against window.attachEvent.
|
||||
|
||||
So all in all - the only UA information we really need is to identify Opera versions
|
||||
cheers
|
||||
James
|
||||
---]]></note>
|
||||
</comment>
|
||||
</comments>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>3</num>
|
||||
<date>27Apr05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[removed xMoz, xOp7 and xOp5or6. Added xOp7Up and xOp6Dn. Thanks very much to brothercake, see notes.]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date></date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[added more sniffer vars.]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>31Mar04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC.]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,12 +0,0 @@
|
|||
// xHasPoint, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xHasPoint(e,x,y,t,r,b,l)
|
||||
{
|
||||
if (!xNum(t)){t=r=b=l=0;}
|
||||
else if (!xNum(r)){r=b=l=t;}
|
||||
else if (!xNum(b)){l=r; b=t;}
|
||||
var eX = xPageX(e), eY = xPageY(e);
|
||||
return (x >= eX + l && x <= eX + xWidth(e) - r &&
|
||||
y >= eY + t && y <= eY + xHeight(e) - b );
|
||||
}
|
|
@ -1,81 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xHasPoint'>
|
||||
|
||||
<name>xHasPoint</name>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Position</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Determines if an element contains an absolute point.]]></description>
|
||||
|
||||
<syntax>xHasPoint(ele, iLeft, iTop[, iClpT[, iClpR[, iClpB[, iClpL]]]])</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>ele</name>
|
||||
<note><![CDATA[id string or object reference]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>iLeft</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>iTop</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>iClpT</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>iClpR</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>iClpB</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>iClpL</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>true if iLeft,iTop is contained within the clipped area of ele</return>
|
||||
|
||||
<dependencies>
|
||||
<dep>xNum</dep>
|
||||
<dep>xPageX</dep>
|
||||
<dep>xPageY</dep>
|
||||
<dep>xWidth</dep>
|
||||
<dep>xHeight</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>16Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Reduced 146 bytes!]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>31Mar04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,45 +0,0 @@
|
|||
// xHeight, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xHeight(e,h)
|
||||
{
|
||||
if(!(e=xGetElementById(e))) return 0;
|
||||
if (xNum(h)) {
|
||||
if (h<0) h = 0;
|
||||
else h=Math.round(h);
|
||||
}
|
||||
else h=-1;
|
||||
var css=xDef(e.style);
|
||||
if (e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {
|
||||
h = xClientHeight();
|
||||
}
|
||||
else if(css && xDef(e.offsetHeight) && xStr(e.style.height)) {
|
||||
if(h>=0) {
|
||||
var pt=0,pb=0,bt=0,bb=0;
|
||||
if (document.compatMode=='CSS1Compat') {
|
||||
var gcs = xGetComputedStyle;
|
||||
pt=gcs(e,'padding-top',1);
|
||||
if (pt !== null) {
|
||||
pb=gcs(e,'padding-bottom',1);
|
||||
bt=gcs(e,'border-top-width',1);
|
||||
bb=gcs(e,'border-bottom-width',1);
|
||||
}
|
||||
// Should we try this as a last resort?
|
||||
// At this point getComputedStyle and currentStyle do not exist.
|
||||
else if(xDef(e.offsetHeight,e.style.height)){
|
||||
e.style.height=h+'px';
|
||||
pt=e.offsetHeight-h;
|
||||
}
|
||||
}
|
||||
h-=(pt+pb+bt+bb);
|
||||
if(isNaN(h)||h<0) return;
|
||||
else e.style.height=h+'px';
|
||||
}
|
||||
h=e.offsetHeight;
|
||||
}
|
||||
else if(css && xDef(e.style.pixelHeight)) {
|
||||
if(h>=0) e.style.pixelHeight=h;
|
||||
h=e.style.pixelHeight;
|
||||
}
|
||||
return h;
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xHeight'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Size</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Return and optionally set the element's height.]]></description>
|
||||
|
||||
<syntax>xHeight(ele[, uH])</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>ele</name>
|
||||
<note><![CDATA[id string or object reference]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>uH</name>
|
||||
<note><![CDATA[unsigned integer height; it is rounded to an integer]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>integer</return>
|
||||
|
||||
<dependencies>
|
||||
<dep>xgetelementbyid</dep>
|
||||
<dep>xnum</dep>
|
||||
<dep>xdef</dep>
|
||||
<dep>xstr</dep>
|
||||
<dep>xgetcomputedstyle</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>4</num>
|
||||
<date>7Apr05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[If ele is document or html or body then return xClientHeight. This needs testing and is somewhat experimental. Also, use (pt !== null) instead of !=]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>3</num>
|
||||
<date>12Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Changed xSetCH to use xGetComputedStyle and removed xGetCS. Made xSetCH inline. Reduces width/height funtions about 200 bytes.]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>14May04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[now accepts zero as valid]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>31Mar04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,13 +0,0 @@
|
|||
// xHex, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xHex(n, digits, prefix)
|
||||
{
|
||||
var p = '', n = Math.ceil(n);
|
||||
if (prefix) p = prefix;
|
||||
n = n.toString(16);
|
||||
for (var i=0; i < digits - n.length; ++i) {
|
||||
p += '0';
|
||||
}
|
||||
return p + n;
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xHex'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>String</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Converts an integer to a hex string.]]></description>
|
||||
|
||||
<syntax>xHex(n, digits, prefix)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>n</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>digits</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>prefix</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>string</return>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>11Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,4 +0,0 @@
|
|||
// xHide, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xHide(e){return xVisibility(e,0);}
|
|
@ -1,58 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xHide'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Style</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Set visibility to 'hidden'.]]></description>
|
||||
|
||||
<syntax>xHide(ele)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>ele</name>
|
||||
<note><![CDATA[id string or element reference]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>element.style.visibility</return>
|
||||
|
||||
<dependencies>
|
||||
<dep>xVisibility</dep>
|
||||
</dependencies>
|
||||
|
||||
<comments>
|
||||
<comment>
|
||||
<date>2004</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[simply calls xVisibility]]></note>
|
||||
</comment>
|
||||
</comments>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>3</num>
|
||||
<date>27Jan05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Bug-fixes for xShow/xHide (Dave/dlowther)]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>2004</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[changed to use xVisibility]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>31Mar04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,76 +0,0 @@
|
|||
// xImgAsyncWait, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xImgAsyncWait(fnStatus, fnInit, fnError, sErrorImg, sAbortImg, imgArray)
|
||||
{
|
||||
var i, imgs = imgArray || document.images;
|
||||
|
||||
for (i = 0; i < imgs.length; ++i) {
|
||||
imgs[i].onload = imgOnLoad;
|
||||
imgs[i].onerror = imgOnError;
|
||||
imgs[i].onabort = imgOnAbort;
|
||||
}
|
||||
|
||||
xIAW.fnStatus = fnStatus;
|
||||
xIAW.fnInit = fnInit;
|
||||
xIAW.fnError = fnError;
|
||||
xIAW.imgArray = imgArray;
|
||||
|
||||
xIAW();
|
||||
|
||||
function imgOnLoad()
|
||||
{
|
||||
this.wasLoaded = true;
|
||||
}
|
||||
function imgOnError()
|
||||
{
|
||||
if (sErrorImg && !this.wasError) {
|
||||
this.src = sErrorImg;
|
||||
}
|
||||
this.wasError = true;
|
||||
}
|
||||
function imgOnAbort()
|
||||
{
|
||||
if (sAbortImg && !this.wasAborted) {
|
||||
this.src = sAbortImg;
|
||||
}
|
||||
this.wasAborted = true;
|
||||
}
|
||||
}
|
||||
// end xImgAsyncWait()
|
||||
|
||||
// Don't call xIAW() directly. It is only called from xImgAsyncWait().
|
||||
|
||||
function xIAW()
|
||||
{
|
||||
var me = arguments.callee;
|
||||
if (!me) {
|
||||
return; // I could have used a global object instead of callee
|
||||
}
|
||||
var i, imgs = me.imgArray ? me.imgArray : document.images;
|
||||
var c = 0, e = 0, a = 0, n = imgs.length;
|
||||
for (i = 0; i < n; ++i) {
|
||||
if (imgs[i].wasError) {
|
||||
++e;
|
||||
}
|
||||
else if (imgs[i].wasAborted) {
|
||||
++a;
|
||||
}
|
||||
else if (imgs[i].complete || imgs[i].wasLoaded) {
|
||||
++c;
|
||||
}
|
||||
}
|
||||
if (me.fnStatus) {
|
||||
me.fnStatus(n, c, e, a);
|
||||
}
|
||||
if (c + e + a == n) {
|
||||
if ((e || a) && me.fnError) {
|
||||
me.fnError(n, c, e, a);
|
||||
}
|
||||
else if (me.fnInit) {
|
||||
me.fnInit();
|
||||
}
|
||||
}
|
||||
else setTimeout('xIAW()', 250);
|
||||
}
|
||||
// end xIAW()
|
|
@ -1,67 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xImgAsyncWait'>
|
||||
|
||||
<copyright>Copyright 2003-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Image</grp>
|
||||
<grp>Event</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Asynchronously waits (and monitors the status) of newly created or static images. Can be called before or after window.onload, or in the HTML following the last IMG element. During monitoring of image load status, your status function will be called at each iteration. After all images successfully load, your app initialization function is called. If any image fails to load, your error function is called. You can provide error and abort images for those that fail to load.]]></description>
|
||||
|
||||
<syntax>xImgAsyncWait(fnStatus, fnInit, fnError, sErrorImg, sAbortImg, imgArray)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>fnStatus</name><note><![CDATA[A reference to a function which will be called at each iteration. It will be passed the same arguments as fnError. This is optional. Pass null if not needed.]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>fnInit</name><note><![CDATA[A reference to your application initialization function. It will be called after all images have successfully loaded.]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>fnError</name><note><![CDATA[A reference to your error function. After all images have loaded (or failed to load), it will be called if there was an error or abort. This is optional. Pass null if not needed.
|
||||
fnError will receive the following arguments:
|
||||
n - Total number of images monitored.
|
||||
c - Number of images successfully loaded.
|
||||
e - Number of images which had an error.
|
||||
a - Number of images which were aborted.
|
||||
]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>sErrorImg</name><note><![CDATA[A URL to an image which will be used for any images that fail to load due to an error.]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>sAbortImg</name><note><![CDATA[A URL to an image which will be used for any images that fail to load due to an abort.]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>imgArray</name><note><![CDATA[An array of newly created Image objects. These images will be monitored. If you want all static images (document.images) to be monitored then omit this argument.]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/x/examples/ximgasyncwait.php</url>
|
||||
<note><![CDATA[just an experiment]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>28Jul04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date></date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[First implementation, optimizations and fixes probably needed.]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
// xImgRollSetup, Copyright 2002,2003,2004,2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xImgRollSetup(p,s,x)
|
||||
{
|
||||
var ele, id;
|
||||
for (var i=3; i<arguments.length; ++i) {
|
||||
id = arguments[i];
|
||||
if (ele = xGetElementById(id)) {
|
||||
ele.xIOU = p + id + x;
|
||||
ele.xIOO = new Image();
|
||||
ele.xIOO.src = p + id + s + x;
|
||||
ele.onmouseout = imgOnMouseout;
|
||||
ele.onmouseover = imgOnMouseover;
|
||||
}
|
||||
}
|
||||
function imgOnMouseout(e)
|
||||
{
|
||||
if (this.xIOU) {
|
||||
this.src = this.xIOU;
|
||||
}
|
||||
}
|
||||
function imgOnMouseover(e)
|
||||
{
|
||||
if (this.xIOO && this.xIOO.complete) {
|
||||
this.src = this.xIOO.src;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xImgRollSetup'>
|
||||
|
||||
<copyright>Copyright 2002-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Image</grp>
|
||||
<grp>Event</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Image rollover setup. Can not be called before the window onload event. Pass image IDs starting with 4th argument. The only html requirement is for each IMG tag to have an ID. Assumes this image file naming convention:
|
||||
out img = path + imgEleId + fileExt
|
||||
over img = path + imgEleId + ovrSuffix + fileExt
|
||||
]]></description>
|
||||
|
||||
<syntax>xImgRollSetup(sPath, sOvrSuffix, sFileExt, sImgEleId[, ...])</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>sPath</name>
|
||||
<note><![CDATA[path to image files (requires trailing slash)]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>sOvrSuffix</name>
|
||||
<note><![CDATA[see the file name convention]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>sFileExt</name>
|
||||
<note><![CDATA[see the file name convention (requires dot)]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>sImgEleId</name>
|
||||
<note><![CDATA[pass all img ele IDs starting with the 4th argument]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<dependencies>
|
||||
<dep>xGetElementById</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>3</num>
|
||||
<date>16Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Reduced 69 bytes.]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>28Jul04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[made the event listeners private]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>31Mar04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,59 +0,0 @@
|
|||
// xInclude, Copyright 2004,2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xInclude(url1, url2, etc)
|
||||
{
|
||||
if (document.getElementById || document.all || document.layers) { // minimum dhtml support required
|
||||
var h, f, i, j, a, n, inc;
|
||||
|
||||
for (var i=0; i<arguments.length; ++i) { // loop thru all the url arguments
|
||||
|
||||
h = ''; // html (script or link element) to be written into the document
|
||||
f = arguments[i].toLowerCase(); // f is current url in lowercase
|
||||
inc = false; // if true the file has already been included
|
||||
|
||||
// Extract the filename from the url
|
||||
|
||||
// Should I extract the file name? What if there are two files with the same name
|
||||
// but in different directories? If I don't extract it what about: '../foo.js' and '../../foo.js' ?
|
||||
|
||||
a = f.split('/');
|
||||
n = a[a.length-1]; // the file name
|
||||
|
||||
// loop thru the list to see if this file has already been included
|
||||
for (j = 0; j < xIncludeList.length; ++j) {
|
||||
if (n == xIncludeList[j]) { // should I use '==' or a string cmp func?
|
||||
inc = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!inc) { // if the file has not yet been included
|
||||
|
||||
xIncludeList[xIncludeList.length] = n; // add it to the list of included files
|
||||
|
||||
// is it a .js file?
|
||||
if (f.indexOf('.js') != -1) {
|
||||
if (xNN4) { // if nn4 use nn4 versions of certain lib files
|
||||
var c='x_core', e='x_event', d='x_dom', n='_n4';
|
||||
if (f.indexOf(c) != -1) { f = f.replace(c, c+n); }
|
||||
else if (f.indexOf(e) != -1) { f = f.replace(e, e+n); }
|
||||
else if (f.indexOf(d) != -1) { f = f.replace(d, d+n); }
|
||||
}
|
||||
h = "<script type='text/javascript' src='" + f + "'></script>";
|
||||
}
|
||||
|
||||
// else is it a .css file?
|
||||
else if (f.indexOf('.css') != -1) { // CSS file
|
||||
h = "<link rel='stylesheet' type='text/css' href='" + f + "'>";
|
||||
}
|
||||
|
||||
// write the link or script element into the document
|
||||
if (h.length) { document.writeln(h); }
|
||||
|
||||
} // end if (!inc)
|
||||
} // end outer for
|
||||
return true;
|
||||
} // end if (min dhtml support)
|
||||
return false;
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xInclude'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Warning: This was an interesting experiment but I don't advise that you use it. This should really be done server-side. It would be a fun PHP project ;-)]]></description>
|
||||
|
||||
<syntax>xInclude(url1, url2, etc)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>url</name>
|
||||
<note><![CDATA[will accept any number of URLs]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,10 +0,0 @@
|
|||
// xInnerHtml, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xInnerHtml(e,h)
|
||||
{
|
||||
if(!(e=xGetElementById(e)) || !xStr(e.innerHTML)) return null;
|
||||
var s = e.innerHTML;
|
||||
if (xStr(h)) {e.innerHTML = h;}
|
||||
return s;
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xInnerHtml'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp></grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[A safe wrapper for element.innerHTML]]></description>
|
||||
|
||||
<syntax>xInnerHtml(e, sHtml)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>e</name>
|
||||
<note><![CDATA[id string or element reference]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>sHtml</name>
|
||||
<note><![CDATA[string of text which can include html markup]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>string, element.innerHTML if it exists else null</return>
|
||||
|
||||
<dependencies>
|
||||
<dep>xGetElementById</dep>
|
||||
<dep>xStr</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>31Mar04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,45 +0,0 @@
|
|||
// xIntersection, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xIntersection(e1, e2, o)
|
||||
{
|
||||
var ix1, iy2, iw, ih, intersect = true;
|
||||
var e1x1 = xPageX(e1);
|
||||
var e1x2 = e1x1 + xWidth(e1);
|
||||
var e1y1 = xPageY(e1);
|
||||
var e1y2 = e1y1 + xHeight(e1);
|
||||
var e2x1 = xPageX(e2);
|
||||
var e2x2 = e2x1 + xWidth(e2);
|
||||
var e2y1 = xPageY(e2);
|
||||
var e2y2 = e2y1 + xHeight(e2);
|
||||
// horizontal
|
||||
if (e1x1 <= e2x1) {
|
||||
ix1 = e2x1;
|
||||
if (e1x2 < e2x1) intersect = false;
|
||||
else iw = Math.min(e1x2, e2x2) - e2x1;
|
||||
}
|
||||
else {
|
||||
ix1 = e1x1;
|
||||
if (e2x2 < e1x1) intersect = false;
|
||||
else iw = Math.min(e1x2, e2x2) - e1x1;
|
||||
}
|
||||
// vertical
|
||||
if (e1y2 >= e2y2) {
|
||||
iy2 = e2y2;
|
||||
if (e1y1 > e2y2) intersect = false;
|
||||
else ih = e2y2 - Math.max(e1y1, e2y1);
|
||||
}
|
||||
else {
|
||||
iy2 = e1y2;
|
||||
if (e2y1 > e1y2) intersect = false;
|
||||
else ih = e1y2 - Math.max(e1y1, e2y1);
|
||||
}
|
||||
// intersected rectangle
|
||||
if (intersect && typeof(o)=='object') {
|
||||
o.x = ix1;
|
||||
o.y = iy2 - ih;
|
||||
o.w = iw;
|
||||
o.h = ih;
|
||||
}
|
||||
return intersect;
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xIntersection'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Position</grp>
|
||||
<grp>Size</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Determine the intersecting rectangle of two elements.]]></description>
|
||||
|
||||
<syntax>xIntersection(ele1, ele2, obj)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>ele1</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>ele2</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>obj</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>Returns true if the two elements intersect and assigns properties to obj which describe the intersected rectangle: x, y, w, and h.</return>
|
||||
|
||||
<dependencies>
|
||||
<dep>xpagex</dep>
|
||||
<dep>xwidth</dep>
|
||||
<dep>xpagey</dep>
|
||||
<dep>xheight</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>21Apr04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[finished porting to X ;-) thanks Nick]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>31Mar04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,20 +0,0 @@
|
|||
// xLeft, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xLeft(e, iX)
|
||||
{
|
||||
if(!(e=xGetElementById(e))) return 0;
|
||||
var css=xDef(e.style);
|
||||
if (css && xStr(e.style.left)) {
|
||||
if(xNum(iX)) e.style.left=iX+'px';
|
||||
else {
|
||||
iX=parseInt(e.style.left);
|
||||
if(isNaN(iX)) iX=0;
|
||||
}
|
||||
}
|
||||
else if(css && xDef(e.style.pixelLeft)) {
|
||||
if(xNum(iX)) e.style.pixelLeft=iX;
|
||||
else iX=e.style.pixelLeft;
|
||||
}
|
||||
return iX;
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xLeft'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Position</grp>
|
||||
<grp>Style</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Return and optionally set the element's x coordinate.]]></description>
|
||||
|
||||
<syntax>xLeft(ele[, iX])</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>ele</name>
|
||||
<note><![CDATA[id string or object reference]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>iX</name>
|
||||
<note><![CDATA[integer x coordinate]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>integer</return>
|
||||
|
||||
<dependencies>
|
||||
<dep>xGetElementById</dep>
|
||||
<dep>xDef</dep>
|
||||
<dep>xStr</dep>
|
||||
<dep>xNum</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>31Mar04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,9 +0,0 @@
|
|||
// xLinearScale, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xLinearScale(val,iL,iH,oL,oH)
|
||||
{
|
||||
var m=(oH-oL)/(iH-iL);
|
||||
var b=oL-(iL*m);
|
||||
return m*val+b;
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xLinearScale'>
|
||||
|
||||
<name>xLinearScale</name>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Math</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Get a scaled value]]></description>
|
||||
|
||||
<syntax>xLinearScale(value, inMin, inMax, outMin, outMax)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>value</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>inMin</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>inMax</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>outMin</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>outMax</name>
|
||||
<note><![CDATA[]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<return>the scaled value</return>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/x/examples/bargraph.html</url>
|
||||
<note><![CDATA[xBar uses it]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>2</num>
|
||||
<date>16Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[Reduced 53 bytes.]]></note>
|
||||
</rev>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>31Mar04</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,14 +0,0 @@
|
|||
// xLoadScript, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xLoadScript(url)
|
||||
{
|
||||
if (document.createElement && document.getElementsByTagName) {
|
||||
var s = document.createElement('script');
|
||||
var h = document.getElementsByTagName('head');
|
||||
if (s && h.length) {
|
||||
s.src = url;
|
||||
h[0].appendChild(s);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xLoadScript'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Debug</grp>
|
||||
</groups>
|
||||
<type>Function</type>
|
||||
|
||||
<description><![CDATA[Debug utility. Dynamically load a js file.]]></description>
|
||||
|
||||
<syntax>xLoadScript(url)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>url</name>
|
||||
<note><![CDATA[address of js file]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.com/toys/</url>
|
||||
<note><![CDATA[Index of all X demos.]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
<revisions>
|
||||
<rev>
|
||||
<num>1</num>
|
||||
<date>12Mar05</date>
|
||||
<author>mf</author>
|
||||
<note><![CDATA[put in it's own file for use with XC]]></note>
|
||||
</rev>
|
||||
</revisions>
|
||||
|
||||
</xlib_symbol>
|
|
@ -1,32 +0,0 @@
|
|||
// xMenu1, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
||||
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
||||
|
||||
function xMenu1(triggerId, menuId, mouseMargin, openEvent)
|
||||
{
|
||||
var isOpen = false;
|
||||
var trg = xGetElementById(triggerId);
|
||||
var mnu = xGetElementById(menuId);
|
||||
if (trg && mnu) {
|
||||
xAddEventListener(trg, openEvent, onOpen, false);
|
||||
}
|
||||
function onOpen()
|
||||
{
|
||||
if (!isOpen) {
|
||||
xMoveTo(mnu, xPageX(trg), xPageY(trg) + xHeight(trg));
|
||||
xShow(mnu);
|
||||
xAddEventListener(document, 'mousemove', onMousemove, false);
|
||||
isOpen = true;
|
||||
}
|
||||
}
|
||||
function onMousemove(ev)
|
||||
{
|
||||
var e = new xEvent(ev);
|
||||
if (!xHasPoint(mnu, e.pageX, e.pageY, -mouseMargin) &&
|
||||
!xHasPoint(trg, e.pageX, e.pageY, -mouseMargin))
|
||||
{
|
||||
xHide(mnu);
|
||||
xRemoveEventListener(document, 'mousemove', onMousemove, false);
|
||||
isOpen = false;
|
||||
}
|
||||
}
|
||||
} // end xMenu1
|
|
@ -1,63 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<xlib_symbol id='xMenu1'>
|
||||
|
||||
<copyright>Copyright 2001-2005 Michael Foster (Cross-Browser.com)</copyright>
|
||||
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
||||
<groups>
|
||||
<grp>Navigation</grp>
|
||||
</groups>
|
||||
<type>Object</type>
|
||||
|
||||
<description><![CDATA[xMenu1 Object Prototype]]></description>
|
||||
|
||||
<syntax>new xMenu1(triggerId, menuId, mouseMargin, openEvent)</syntax>
|
||||
|
||||
<parameters>
|
||||
<par>
|
||||
<name>triggerId</name>
|
||||
<note><![CDATA[id string of trigger element.]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>menuId</name>
|
||||
<note><![CDATA[id string of menu.]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>mouseMargin</name>
|
||||
<note><![CDATA[integer margin around menu; when mouse is outside this margin the menu is hid.]]></note>
|
||||
</par>
|
||||
<par>
|
||||
<name>openEvent</name>
|
||||
<note><![CDATA[string name of event on which to open menu ('click', 'mouseover', etc).]]></note>
|
||||
</par>
|
||||
</parameters>
|
||||
|
||||
<properties>
|
||||
<prop>
|
||||
<name></name>
|
||||
<note><![CDATA[]]></note>
|
||||
</prop>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dep>xgetelementbyid</dep>
|
||||
<dep>xaddeventlistener</dep>
|
||||
<dep>xmoveto</dep>
|
||||
<dep>xpagex</dep>
|
||||
<dep>xpagey</dep>
|
||||
<dep>xheight</dep>
|
||||
<dep>xshow</dep>
|
||||
<dep>xevent</dep>
|
||||
<dep>xhaspoint</dep>
|
||||
<dep>xhide</dep>
|
||||
<dep>xremoveeventlistener</dep>
|
||||
</dependencies>
|
||||
|
||||
<demos>
|
||||
<demo>
|
||||
<url>http://cross-browser.loc/x/menus/xmenu1.php</url>
|
||||
<note><![CDATA[simple menus with plenty of potential]]></note>
|
||||
</demo>
|
||||
</demos>
|
||||
|
||||
</xlib_symbol>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue