+if (typeof(Bytex64) == 'undefined') Bytex64 = {};
+Bytex64.DOM = {};
+Bytex64.DOM.version = 1.0;
+
+// Quick Element
+Bytex64.DOM.qe = function(name, attrs) {
+ var e = document.createElement(name);
+
+ for (i in attrs)
+ e[i] = attrs[i];
+
+ return e;
+}
+
+// Shims for IE retardedness
+Bytex64.DOM.addEventListener = function(elem, etype, func) {
+ if (elem.addEventListener) {
+ elem.addEventListener(etype, func, false);
+ } else if (elem.attachEvent) {
+ elem.attachEvent("on" + etype, func);
+ }
+}
+
+Bytex64.DOM.removeEventListener = function(elem, etype, func) {
+ if (elem.removeEventListener) {
+ elem.removeEventListener(etype, func, false);
+ } else if (elem.detachEvent) {
+ elem.detachEvent("on" + etype, func);
+ }
+}
+
+Bytex64.DOM.preventDefault = function(e) {
+ if (e.preventDefault) {
+ e.preventDefault();
+ } else if (e.returnValue) {
+ e.returnValue = false;
+ }
+}
+
+/* vim: set ts=4 sts=4 sw=4 expandtab: */
+<html>
+<head>
+<title>Bytex64.js demo</title>
+<script type="text/javascript" src="Bytex64.DOM.js"></script>
+</head>
+<body>
+
+<h1>Bytex64.DOM</h1>
+
+<script type="text/javascript">
+function createButton() {
+ container = document.getElementById('buttoncontainer');
+ button = Bytex64.DOM.qe('button', {onclick: 'createButton()'});
+ button.appendChild(document.createTextNode('click'));
+ container.appendChild(button);
+}
+</script>
+
+<div id="buttoncontainer"><button onclick="createButton()">click</button></div>
+
+</body>
+</html>
+$TITLE = 'Bytex64.DOM';
+
+$CONTENT = <<'EOD';
+<h2>Concepts</h2>
+
+<p>The Bytex64.DOM library provides simple routines to create and
+manipulate DOM elements. In particular, it provides a quick element
+creation function, and provides functions that shim "missing"
+functionality in Internet Explorer. Those who want to get started
+should skip to the Class Variables section; the rest of this is a rant
+against IE developers.
+
+<p>Modern Internet Explorer has shaped up quite nicely. In standards
+mode, it supports CSS in a sane way that no longer requires box model
+hacks. Its DOM support is now quite good, except for one niggling
+little bit: <a
+href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/">DOM
+Level 2 Events</a>.
+
+<p>For some unfathomable reason, the IE devs have decided to stick with
+their DHTML events API even though DOM L2 Events has been a W3C
+Specification (i.e., not a draft or work-in-progress) since the turn of
+the century. Because of this continued incompatibility, web devs are
+forced to work around it. This module contains my workarounds, which
+mimic the W3C API but internally call IE-specific event model functions
+on IE.
+
+<h2>Class Variables</h2>
+
+<dd>
+ <dt>Bytex64.DOM.version</dt>
+ <dd>The version of the library, in case you want to check for a
+ specific version</dd>
+</dd>
+
+<h2>Global Functions</h2>
+
+<dl>
+ <dt>Bytex64.DOM.qe(name, attrs)</dt>
+ <dd>Creates a DOM element with the given name and attributes.
+ <code>Attrs</code> is an object with key/value pairs for the object's
+ attributes.</dd>
+
+ <dt>Bytex64.DOM.addEventListener(elem, etype, func)</dt>
+ <dd>Like the W3C DOM function of the same name, attaches an event
+ listener for the event <code>etype</code> to the element
+ <code>elem</code>. <code>Func</code> is the function to run when the
+ event fires.</dd>
+
+ <dt>Bytex64.DOM.removeEventListener(elem, etype, func)</dt>
+ <dd>The reverse of addEventListener; removes the given listener.</dd>
+
+ <dt>Bytex64.DOM.preventDefault(e)</dt>
+ <dd>Like the W3C DOM function of the same name, prevents the default
+ action from occurring when the event is done processing.
+ <code>E</code> is the event object currently being handled. This can
+ be used, for example, to prevent links from being followed after they
+ are clicked.</dd>
+</dl>
+
+EOD
+<html>
+<head>
+<title>Bytex64.DOM</title>
+<link rel="stylesheet" href="doc.css">
+</head>
+<body>
+<h1>Bytex64.DOM</h1>
+
+<h2>Concepts</h2>
+
+<p>The Bytex64.DOM library provides simple routines to create and
+manipulate DOM elements. In particular, it provides a quick element
+creation function, and provides functions that shim "missing"
+functionality in Internet Explorer. Those who want to get started
+should skip to the Class Variables section; the rest of this is a rant
+against IE developers.
+
+<p>Modern Internet Explorer has shaped up quite nicely. In standards
+mode, it supports CSS in a sane way that no longer requires box model
+hacks. Its DOM support is now quite good, except for one niggling
+little bit: <a
+href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/">DOM
+Level 2 Events</a>.
+
+<p>For some unfathomable reason, the IE devs have decided to stick with
+their DHTML events API even though DOM L2 Events has been a W3C
+Specification (i.e., not a draft or work-in-progress) since the turn of
+the century. Because of this continued incompatibility, web devs are
+forced to work around it. This module contains my workarounds, which
+mimic the W3C API but internally call IE-specific event model functions
+on IE.
+
+<h2>Class Variables</h2>
+
+<dd>
+ <dt>Bytex64.DOM.version</dt>
+ <dd>The version of the library, in case you want to check for a
+ specific version</dd>
+</dd>
+
+<h2>Global Functions</h2>
+
+<dl>
+ <dt>Bytex64.DOM.qe(name, attrs)</dt>
+ <dd>Creates a DOM element with the given name and attributes.
+ <code>Attrs</code> is an object with key/value pairs for the object's
+ attributes.</dd>
+
+ <dt>Bytex64.DOM.addEventListener(elem, etype, func)</dt>
+ <dd>Like the W3C DOM function of the same name, attaches an event
+ listener for the event <code>etype</code> to the element
+ <code>elem</code>. <code>Func</code> is the function to run when the
+ event fires.</dd>
+
+ <dt>Bytex64.DOM.removeEventListener(elem, etype, func)</dt>
+ <dd>The reverse of addEventListener; removes the given listener.</dd>
+
+ <dt>Bytex64.DOM.preventDefault(e)</dt>
+ <dd>Like the W3C DOM function of the same name, prevents the default
+ action from occurring when the event is done processing.
+ <code>E</code> is the event object currently being handled. This can
+ be used, for example, to prevent links from being followed after they
+ are clicked.</dd>
+</dl>
+
+
+</body>
+</html>
-DOCS = Bytex64.FX
+DOCS = Bytex64.FX Bytex64.DOM
all: $(addsuffix .html,$(DOCS))