aboutsummaryrefslogtreecommitdiffstats
path: root/WebContent
diff options
context:
space:
mode:
authorJani Laakso <jani.laakso@itmill.com>2007-04-02 14:25:00 +0000
committerJani Laakso <jani.laakso@itmill.com>2007-04-02 14:25:00 +0000
commitdc6043cba8ec3e51a75d7c0f339ad94f39e8f2c3 (patch)
tree6d9c978fb0e180e0e48ee41e63eb6bf8cd9b9c4a /WebContent
parentb8af142a83a6331faf1a0d0c28c968bdc77a2d7d (diff)
downloadvaadin-framework-dc6043cba8ec3e51a75d7c0f339ad94f39e8f2c3.tar.gz
vaadin-framework-dc6043cba8ec3e51a75d7c0f339ad94f39e8f2c3.zip
Added many new demos.
svn changeset:1096/svn branch:trunk
Diffstat (limited to 'WebContent')
-rw-r--r--WebContent/EmbeddedToolkit.jsp65
-rw-r--r--WebContent/WEB-INF/web.xml130
-rw-r--r--WebContent/index.html122
-rw-r--r--WebContent/openajax/HubTest-BasicConformance.js62
-rw-r--r--WebContent/openajax/OpenAjax.js1063
-rw-r--r--WebContent/openajax/index.html212
-rw-r--r--WebContent/styles/demos.css282
7 files changed, 1777 insertions, 159 deletions
diff --git a/WebContent/EmbeddedToolkit.jsp b/WebContent/EmbeddedToolkit.jsp
new file mode 100644
index 0000000000..d8fce6280a
--- /dev/null
+++ b/WebContent/EmbeddedToolkit.jsp
@@ -0,0 +1,65 @@
+<%
+ //
+ // Demonstrates how Toolkit application can be integrated into jsp pages
+ //
+ String test = "This text comes from EmbeddedToolkit.jsp file";
+ // Toolkit application name. This is servlet URL pattern, see web.xml
+ String applicationName = "TableDemo";
+%>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ITMillToolkit40="http://itmill.com/toolkit">
+
+ <head>
+ <title>Embedding Toolkit to JSP pages</title>
+
+ <!-- Toolkit code block starts -->
+
+ <NOSCRIPT><META http-equiv="refresh" content="0; url=?WA_NOSCRIPT=1" /></NOSCRIPT>
+ <link rel="stylesheet" href="<%=applicationName %>/RES/base/css/base-ajax.css" type="text/css" />
+ <link rel="stylesheet" href="<%=applicationName %>/RES/base/css/calendar-default.css" type="text/css" />
+ <script src="<%=applicationName %>/RES/base/script/ajax-client.js" type="text/javascript"></script>
+ <script src="<%=applicationName %>/RES/base/script/base-ajax-components.js" type="text/javascript"></script>
+ <script src="<%=applicationName %>/RES/base/ext/jscalendar/calendar.js" type="text/javascript"></script>
+ <script src="<%=applicationName %>/RES/base/ext/jscalendar/lang/calendar-en.js" type="text/javascript"></script>
+ <script src="<%=applicationName %>/RES/base/ext/jscalendar/calendar-setup.js" type="text/javascript"></script>
+ <script src="<%=applicationName %>/RES/base/ext/firebug/firebugx.js" type="text/javascript"></script>
+ <link rel="stylesheet" href="<%=applicationName %>/RES/corporate/css/corporate-ajax.css" type="text/css" />
+ <script src="<%=applicationName %>/RES/corporate/script/corporate-ajax-components.js" type="text/javascript"></script>
+
+ <!-- Toolkit code block ends -->
+
+ </head>
+
+ <!-- Toolkit code: for body set tag class with value itmtk -->
+ <body class="itmtk">
+ <center>
+ <h3><%=test %> before Toolkit application.</h3>
+ <hr />
+
+ <!-- Toolkit code block starts -->
+
+ <div id="ajax-wait">Loading...</div>
+ <div id="ajax-window"></div>
+ <script language="JavaScript">
+ itmill.tmp = new itmill.Client(document.getElementById('ajax-window'),"<%=applicationName %>/UIDL/","<%=applicationName %>/RES/base/client/",document.getElementById('ajax-wait'));
+ (new itmill.themes.Base("<%=applicationName %>/RES/base/")).registerTo(itmill.tmp);
+ itmill.tmp.start();
+ delete itmill.tmp;
+ </script>
+
+ <!-- Toolkit code block ends -->
+
+ </tr></td></table>
+
+ <hr />
+ <h3><%=test %> after Toolkit application.</h3>
+ <br />
+ <br />
+ </center>
+ </body>
+
+ </html>
+ \ No newline at end of file
diff --git a/WebContent/WEB-INF/web.xml b/WebContent/WEB-INF/web.xml
index 30fa1923ee..0ce0ba0bd4 100644
--- a/WebContent/WEB-INF/web.xml
+++ b/WebContent/WEB-INF/web.xml
@@ -2,37 +2,125 @@
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>IT Mill Toolkit</display-name>
-<!-- APPLICATION: ...demo.Hello -->
<servlet>
- <servlet-name>hello</servlet-name>
+ <servlet-name>features</servlet-name>
<servlet-class>com.itmill.toolkit.terminal.web.ApplicationServlet</servlet-class>
<init-param>
<param-name>application</param-name>
- <param-value>com.itmill.toolkit.demo.HelloWorld</param-value>
+ <param-value>com.itmill.toolkit.demo.features.FeaturesApplication</param-value>
</init-param>
</servlet>
<servlet-mapping>
- <servlet-name>hello</servlet-name>
- <url-pattern>/hello/*</url-pattern>
+ <servlet-name>features</servlet-name>
+ <url-pattern>/features/*</url-pattern>
</servlet-mapping>
-<!-- APPLICATION: ...demo.features -->
+ <servlet>
+ <servlet-name>Parameters</servlet-name>
+ <servlet-class>com.itmill.toolkit.terminal.web.ApplicationServlet</servlet-class>
+ <init-param>
+ <param-name>application</param-name>
+ <param-value>com.itmill.toolkit.example.Parameters</param-value>
+ </init-param>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Parameters</servlet-name>
+ <url-pattern>/Parameters/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet>
+ <servlet-name>Login</servlet-name>
+ <servlet-class>com.itmill.toolkit.terminal.web.ApplicationServlet</servlet-class>
+ <init-param>
+ <param-name>application</param-name>
+ <param-value>com.itmill.toolkit.demo.Login</param-value>
+ </init-param>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Login</servlet-name>
+ <url-pattern>/Login/*</url-pattern>
+ </servlet-mapping>
+
<servlet>
- <servlet-name>features</servlet-name>
+ <servlet-name>QueryContainerDemo</servlet-name>
<servlet-class>com.itmill.toolkit.terminal.web.ApplicationServlet</servlet-class>
<init-param>
<param-name>application</param-name>
- <param-value>com.itmill.toolkit.demo.features.FeaturesApplication</param-value>
+ <param-value>com.itmill.toolkit.demo.QueryContainerDemo</param-value>
</init-param>
</servlet>
<servlet-mapping>
- <servlet-name>features</servlet-name>
- <url-pattern>/features/*</url-pattern>
+ <servlet-name>QueryContainerDemo</servlet-name>
+ <url-pattern>/QueryContainerDemo/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet>
+ <servlet-name>TableDemo</servlet-name>
+ <servlet-class>com.itmill.toolkit.terminal.web.ApplicationServlet</servlet-class>
+ <init-param>
+ <param-name>application</param-name>
+ <param-value>com.itmill.toolkit.demo.TableDemo</param-value>
+ </init-param>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TableDemo</servlet-name>
+ <url-pattern>/TableDemo/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet>
+ <servlet-name>TreeFilesystemContainer</servlet-name>
+ <servlet-class>com.itmill.toolkit.terminal.web.ApplicationServlet</servlet-class>
+ <init-param>
+ <param-name>application</param-name>
+ <param-value>com.itmill.toolkit.demo.TreeFilesystemContainer</param-value>
+ </init-param>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TreeFilesystemContainer</servlet-name>
+ <url-pattern>/TreeFilesystemContainer/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet>
+ <servlet-name>TreeFilesystem</servlet-name>
+ <servlet-class>com.itmill.toolkit.terminal.web.ApplicationServlet</servlet-class>
+ <init-param>
+ <param-name>application</param-name>
+ <param-value>com.itmill.toolkit.demo.TreeFilesystem</param-value>
+ </init-param>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TreeFilesystem</servlet-name>
+ <url-pattern>/TreeFilesystem/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet>
+ <servlet-name>ModalWindow</servlet-name>
+ <servlet-class>com.itmill.toolkit.terminal.web.ApplicationServlet</servlet-class>
+ <init-param>
+ <param-name>application</param-name>
+ <param-value>com.itmill.toolkit.demo.ModalWindow</param-value>
+ </init-param>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>ModalWindow</servlet-name>
+ <url-pattern>/ModalWindow/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet>
+ <servlet-name>HelloWorld</servlet-name>
+ <servlet-class>com.itmill.toolkit.terminal.web.ApplicationServlet</servlet-class>
+ <init-param>
+ <param-name>application</param-name>
+ <param-value>com.itmill.toolkit.demo.HelloWorld</param-value>
+ </init-param>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>HelloWorld</servlet-name>
+ <url-pattern>/HelloWorld/*</url-pattern>
</servlet-mapping>
-<!-- APPLICATION: ...demo.calc -->
<servlet>
- <servlet-name>calc</servlet-name>
+ <servlet-name>Calc</servlet-name>
<servlet-class>com.itmill.toolkit.terminal.web.ApplicationServlet</servlet-class>
<init-param>
<param-name>application</param-name>
@@ -40,9 +128,23 @@
</init-param>
</servlet>
<servlet-mapping>
- <servlet-name>calc</servlet-name>
- <url-pattern>/calc/*</url-pattern>
+ <servlet-name>Calc</servlet-name>
+ <url-pattern>/Calc/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet>
+ <servlet-name>KeyboardShortcut</servlet-name>
+ <servlet-class>com.itmill.toolkit.terminal.web.ApplicationServlet</servlet-class>
+ <init-param>
+ <param-name>application</param-name>
+ <param-value>com.itmill.toolkit.demo.Shortcut</param-value>
+ </init-param>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>KeyboardShortcut</servlet-name>
+ <url-pattern>/shortcut/*</url-pattern>
</servlet-mapping>
+
<welcome-file-list>
<welcome-file>index.html</welcome-file>
diff --git a/WebContent/index.html b/WebContent/index.html
index 971990a86a..fe2acbc698 100644
--- a/WebContent/index.html
+++ b/WebContent/index.html
@@ -10,28 +10,137 @@
<div id="itmilllogo"><h1>IT Mill Toolkit</h1></div>
<div id="toolkit"></div>
-<!--
-<h2>IT Mill Toolkit Demo</h2>
--->
+
<div id="feature-browser">
<h3>Feature Browser</h3>
<div class="option">
<span class="link"><a href="features/?renderingMode=detect">Autodetected mode</a></span>
<span class="desc">Use AJAX if supported by browser, otherwise fallback to HTML mode</span>
</div>
-
<div class="option">
<span class="link"><a href="features/?renderingMode=ajax">AJAX mode</a></span>
<span class="desc">Select AJAX-based technology mode</span>
</div>
-
<div class="option">
<span class="link"><a href="features/?renderingMode=html">HTML mode</a></span>
<span class="desc">Select page based request/response technology mode</span>
</div>
-
+ <br />
+ </div>
+
+ <div id="sample-code">
+ <h4>Simple applications</h4>
+ <div class="option">
+ <span class="link"><a href="HelloWorld">HelloWorld</a></span>
+ <span class="desc">Simple Toolkit application.</span>
+ </div>
+ <div class="option">
+ <span class="link"><a href="Calc">Calc</a></span>
+ <span class="desc">Simple Toolkit application where events are used.</span>
+ </div>
+ <br />
+ </div>
+
+ <div id="feature-browser">
+ <h3><a href="openajax/index.html">OpenAjax Hub Conformance tests</a></h3>
+ <div class="option">
+ Integrates sample Toolkit application to HTML page which performs basic OpenAjax hub conformance tests.
+ See HTML source what is required for integration.
+ <b>Note:</b> Embedded FeatureBrowser application is the same
+ application instance that can be accessed as standalone application, see <code>FeatureBrowser</code>.
+ </div>
+ </div>
+
+ <div id="feature-browser">
+ <h3><a href="EmbeddedToolkit.jsp">Embedding Toolkit application to other frameworks</a></h3>
+ <div class="option">
+ Integrates sample Toolkit application to JSP page. See HTML source or respective jsp
+ file what is required for integration. <b>Note:</b> Embedded TableDemo application is the same
+ application instance that can be accessed as standalone application, see <code>TableDemo</code>.
+ </div>
+ </div>
+
+ <div id="feature-browser">
+ <h3><a href="QueryContainerDemo">QueryContainerDemo</a></h3>
+ <div class="option">
+ This example shows how Table, Select and Tree UI components can use Containers.
+ QueryContainer is used to bind SQL table rows into Toolkit UI components.
+ Table has few example actions added. Also embedding XHTML through Label components is used.
+ Demonstrates: how to create <code>com.itmill.toolkit.data.Container</code> and set it as
+ datasource to UI components <code>com.itmill.toolkit.ui.Component.Tree</code>, how to
+ receive ExpandEvent and implement <code>com.itmill.toolkit.ui.Tree.ExpandListener</code>,
+ how to use <code>com.itmill.toolkit.event.Action</code>.
+ </div>
+ </div>
+
+ <div id="feature-browser">
+ <h3><a href="TableDemo">TableDemo</a></h3>
+ <div class="option">
+ Similar to QueryContainerDemo but uses table only. Two buttons demonstrate another
+ possibility how event framework works, in this example specific methods are
+ registered for button click events. <b>Note:</b> This application instance is embedded
+ to jsp page also, see <code>EmbeddedToolkit.jsp</code> above.
+ </div>
+ </div>
+
+ <div id="feature-browser">
+ <h3><a href="TreeFilesystemContainer">TreeFilesystemContainer</a></h3>
+ <div class="option">
+ Browsable file explorer using Toolkit Tree component. Demonstrates: how to
+ use <code>com.itmill.toolkit.ui.Component.Tree</code> datasource container,
+ how to create <code>com.itmill.toolkit.data.util.FilesystemContainer</code>,
+ how to read <code>com.itmill.toolkit.ui.Component.Event</code> objects, how
+ to receive and handle any event by implementing
+ <code>com.itmill.toolkit.ui.Component.Listener</code>.
+ </div>
+ </div>
+
+ <div id="feature-browser">
+ <h3><a href="TreeFilesystem">TreeFilesystem</a></h3>
+ <div class="option">
+ Browsable file explorer using Toolkit Tree component. Demonstrates: how
+ to add items hierarchially into
+ <code>com.itmill.toolkit.ui.Component.Tree</code>, how to receive
+ ExpandEvent and implement
+ <code>com.itmill.toolkit.ui.Tree.ExpandListener</code>.
+ </div>
+ </div>
+
+ <div id="feature-browser">
+ <h3><a href="ModalWindow">Modal window</a></h3>
+ <div class="option">
+ Example of Modal Window.
+ </div>
+ </div>
+
+ <div id="feature-browser">
+ <h3><a href="shortcut">Keyboard events demo</a></h3>
+ <div class="option">
+ Contains few Toolkit UI components that can be interacted by pressing keys in keyboard.
+ </div>
+ </div>
+
+ <div id="feature-browser">
+ <h3><a href="Parameters">URI and Parameter handling demo</a></h3>
+ <div class="option">
+ This is a demonstration of how URL parameters can be recieved and handled.
+ Parameters and URL:s can be received trough the windows by registering
+ URIHandler and ParameterHandler classes window.
+ </div>
</div>
+
+ <div id="sample-code">
+ <h4>Upgrading from Millstone 3 to Toolkit 4.0.0</h4>
+ <div class="option">
+ <span class="link"><a href="Login">Login</a></span>
+ <span class="desc">Simple Millstone 3.1.1 application that was upgraded to Toolkit 4.0.0 by updating three import rows.</span>
+ </div>
+ <br />
+ <br />
+ </div>
+
+<!--
<div id="sample-code">
<h3>IT Mill Toolkit Sample Code</h3>
@@ -59,6 +168,7 @@
<span class="desc">See source code how a simple Toolkit application is created</span>
</div>
</div>
+-->
</div><!-- // Container -->
diff --git a/WebContent/openajax/HubTest-BasicConformance.js b/WebContent/openajax/HubTest-BasicConformance.js
new file mode 100644
index 0000000000..ca8ce23d50
--- /dev/null
+++ b/WebContent/openajax/HubTest-BasicConformance.js
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * HubTest-BasicConformance.js:
+ * JavaScript for test case HubTest-BasicConformance.html.
+ *
+ * This JavaScript MUST NOT BE CHANGED.
+ *
+ * Copyright 2007 OpenAjax Alliance
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless
+ * required by applicable law or agreed to in writing, software distributed
+ * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ ******************************************************************************/
+
+var checkPrefix = HubTest_BasicConformance_MyPrefix;
+var publishSubscribeWorking = false;
+var markupScannerWorking = false;
+var loadHandlerWorking = false;
+
+function TestWasSuccessful(idstring) {
+ var elem = document.getElementById(idstring);
+ elem.innerHTML = '<span style="color:green">TEST SUCCEEDED!!!</span>';
+}
+
+function subscribeTestCB(prefix, name, subscriberData, publisherData) {
+ publishSubscribeWorking = true;
+}
+
+/* This function updates the HTML DOM based on whether the various test succeeded.
+ It is invoked when the document 'load' event is raised. */
+function ConformanceChecks() {
+ var elem = document.getElementById("LibraryName");
+ elem.innerHTML = '<span style="color:green">For library: '+checkPrefix+'</span>';
+ if (OpenAjax.libraries[checkPrefix]) {
+ TestWasSuccessful("registerLibraryResult");
+ }
+ if (OpenAjax.globals[checkPrefix]) {
+ TestWasSuccessful("registerGlobalsResult");
+ }
+ if (loadHandlerWorking) {
+ TestWasSuccessful("addOnLoadResult");
+ }
+ OpenAjax.subscribe("foo","bar",subscribeTestCB);
+ OpenAjax.publish("foo","bar");
+ if (publishSubscribeWorking) {
+ TestWasSuccessful("PublishSubscribeResult");
+ }
+ if (markupScannerWorking) {
+ TestWasSuccessful("MarkupScannerResult");
+ }
+}
+
+/* This logic verifies that the markup scanner is working */
+function markupScannerCB(element) {
+ markupScannerWorking = true;
+}
+OpenAjax.registerAttrScanCB("foo", "class", "match", "HubTestResult", markupScannerCB);
+
diff --git a/WebContent/openajax/OpenAjax.js b/WebContent/openajax/OpenAjax.js
new file mode 100644
index 0000000000..9f50c09a81
--- /dev/null
+++ b/WebContent/openajax/OpenAjax.js
@@ -0,0 +1,1063 @@
+/*******************************************************************************
+ * OpenAjax.js / OpenAjaxBootstrap.js:
+ *
+ * Component of the OpenAjax Hub, as specified by OpenAjax Alliance.
+ * Specification is under development at:
+ *
+ * http://www.openajax.org/member/wiki/OpenAjax_Hub_Specification
+ *
+ * In the current implementation, the OpenAjax.js file is created by simply
+ * concatenating the individual component JavaScript files in a particular order, with
+ * where this file must be the first one in the list.
+ *
+ * Copyright 2006-2007 OpenAjax Alliance
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless
+ * required by applicable law or agreed to in writing, software distributed
+ * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ ******************************************************************************/
+
+/*
+ * OpenAjax Hub configuration parameters.
+ * These configuration parameters are meant for use by the application developer,
+ * not the Ajax runtime library developer.
+ *
+ * The following is a quick summary of available parameters.
+ * Refer to the OpenAjax Hub Specification for the official and detailed definition of these features.
+ *
+ * bootstrapFile = string
+ * Holds name of JavaScript file that initializes OpenAjax object and includes definition of
+ * OpenAjax.require() function for dynamic module loading.
+ * idsToScan = array of strings (Default is [])
+ * Provides to the OpenAjax Hub a list of element IDs upon which to invoke the
+ * markup scanner.
+ * scanPage = boolean (Default is true)
+ * Tells the OpenAjax Hub whether to auto-invoke its markup scanner
+ * on the BODY element in the document.
+ */
+if (typeof OpenAjaxConfig == "undefined") {
+ OpenAjaxConfig = {};
+}
+
+/*
+ * Only create an OpenAjax object if it doesn't exist already.
+ * (If it already exists, then assume the prior instance provides the services that are needed.
+ * Also, attempts to initialize a second time probably will clobber key data from existing OpenAjax object.)
+ */
+if (typeof OpenAjax == "undefined") {
+
+ OpenAjax = {
+
+ implementer: "http://openajax.org",
+ implVersion: "0.3",
+ specVersion: "0.3",
+ implExtraData: {},
+ _allModules: {"Libraries":1,"LoadUnload":1,"Globals":1,"PublishSubscribe":1,"MarkupScanner":1},
+ loadDone: false,
+ unloadDone: false,
+
+
+ // Public function. If module has not been loaded already, load it now.
+ require: function(modules) {
+ var head = document.head;
+ if (!head) {
+ // Overcome bug in Mozilla when XSLT generates the HTML document.
+ head = document.getElementsByTagName("head").item(0);
+ }
+ if (!head) {
+ return;
+ }
+ var reqmods = modules.split(",");
+ var allmods = OpenAjax._allModules;
+ for (var i=0; i<reqmods.length; i++) {
+ var module = reqmods[i];
+ if (!allmods[module]) {
+ break;
+ }
+ if (OpenAjax["__module"+module]){
+ break;
+ }
+ var fname=OpenAjax._path+module+".js";
+ var se = document.createElement("script");
+ se.setAttribute("type", "text/javascript");
+ se.setAttribute("src", fname);
+ head.appendChild(se);
+ }
+ }
+ };
+
+
+ // Find path to bootstrap file (for case where bootstrapping approach is used).
+ // Note: can't get script tags via document.getElementsByTagName("script") due to Mozilla bug.
+ // Instead, have to loop through children of HEAD looking for SCRIPT elements.
+ var head = document.getElementsByTagName("head").item(0);
+ var children = head.childNodes;
+ var re = new RegExp((OpenAjaxConfig.bootstrapFile || "OpenAjaxBootstrap.js")+".*$");
+ for (var i=0; i < children.length; i++) {
+ var s = children[i];
+ if (s.nodeType != 1 || s.nodeName != "SCRIPT") {
+ continue;
+ }
+ if (s.src && s.src.match(re)) {
+ // FIXME: We need automated tests for all of this bootstrapping logic.
+ // FIXME: load= has yet to be tested. May not work at all.
+ OpenAjax._path = s.src.replace(re,'');
+ var requiredModules = s.src.match(/\?.*load=([A-Za-z,]*)/);
+ if (requiredModules) {
+ OpenAjax.require(requiredModules);
+ } else {
+ // Note: We do not load all modules by default.
+ OpenAjax.require("Libraries,LoadUnload,Globals,PublishSubscribe,MarkupScanner");
+ }
+ break;
+ }
+ }
+
+}
+
+/* For single-file distribution of entire Hub, the other OpenAjax Hub JavaScript files
+ should be concatenated after this comment into file OpenAjax.js. */
+
+/*******************************************************************************
+ * Libraries.js:
+ *
+ * A component of the OpenAjax Hub, as specified by OpenAjax Alliance.
+ * Specification is under development at:
+ *
+ * http://www.openajax.org/member/wiki/OpenAjax_Hub_Specification
+ *
+ * This file manages the Ajax libraries that register themselves with
+ * the OpenAjax Hub via the OpenAjax.registerLibrary() method.
+ *
+ * The logic from OpenAjaxBootstrap.js must have been loaded before this file.
+ *
+ * Copyright 2006-2007 OpenAjax Alliance
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless
+ * required by applicable law or agreed to in writing, software distributed
+ * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ ******************************************************************************/
+
+ OpenAjax.__moduleLibraries = 1;
+
+ // holds the libraries that have been registered so far.
+ OpenAjax.libraries = {};
+
+ /*
+ * Registers an Ajax library with the OpenAjax Hub.
+ */
+ OpenAjax.registerLibrary = function (
+ prefix, // Unique library ID string, suitable as prefix in xmlns declaration
+ namespaceURI, // Namespace URI string suitable for use with xmlns attribute
+ version, // Library version in the form of #[.#]*, such as "1", "1.1" or "1.20.2".
+ extraData){ // Optional, can be null. Arbitrary Object holding extra info about library.
+ if (this.libraries[prefix]) {
+ throw new Error("Repeat attempt to register library: " + prefix);
+ }
+ this.libraries[prefix] = {
+ prefix: prefix,
+ namespaceURI: namespaceURI,
+ version: version,
+ extraData: extraData
+ };
+ };
+
+ /*
+ * Unregisters an Ajax library with the OpenAjax Hub.
+ */
+
+ OpenAjax.unregisterLibrary = function(
+ prefix ){ // Library prefix that was passed to registerLibrary().
+
+ // Remove references to any globals registered to this library.
+ // (See Globals.js)
+ if (this.globals) {
+ delete this.globals[prefix];
+ }
+
+ // Remove registration for this library.
+ delete this.libraries[prefix];
+ };
+
+ // Register the OpenAjax Hub itself as a library.
+ OpenAjax.registerLibrary("OpenAjax", "http://openajax.org/hub", "0.3", {});
+/*******************************************************************************
+ * LoadUnload.js:
+ *
+ * A component of the OpenAjax Hub, as specified by OpenAjax Alliance.
+ * Specification is under development at:
+ *
+ * http://www.openajax.org/member/wiki/OpenAjax_Hub_Specification
+ *
+ * This file manages load and unload event handlers on the BODY element.
+ *
+ * The logic from OpenAjaxBootstrap.js must have been loaded before this file.
+ *
+ * Copyright 2006-2007 OpenAjax Alliance
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless
+ * required by applicable law or agreed to in writing, software distributed
+ * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ ******************************************************************************/
+
+ OpenAjax.__moduleLoadUnload = 1;
+
+ OpenAjax._callbacks = {load: {}, unload: {}};
+
+(function(){
+ var addCallback = function(
+ eventName, // load or unload
+ funcOrName, // callback function or string that holds name of function
+ scope, // object, default is window
+ phase) { // "library", "component", or "application", default is "application"
+ if(typeof funcOrName == "string"){
+ // get a function object
+ scope = scope || window;
+ funcOrName = scope[funcOrName];
+ }
+ phase = phase || "application";
+ var cb = OpenAjax._callbacks[eventName];
+ (cb[phase]=cb[phase]||[]).push(funcOrName);
+ };
+
+ /*
+ * Registers an event handler non-destructively to be fired
+ * when the window's onload handler is executed
+ */
+ OpenAjax.addOnLoad = function(
+ funcOrName, // callback function or string that holds name of function
+ scope, // object, defaults is window
+ phase){ // "library", "component", or "application", default is "application"
+
+ addCallback("load", funcOrName, scope, phase);
+ };
+
+ /*
+ * Registers an event handler non-destructively to be fired
+ * when the window's onunload handler is executed
+ */
+ OpenAjax.addOnUnload = function(
+ funcOrName, // callback function or string that holds name of function
+ scope, // object, defaults is window
+ phase){ // "library", "component", or "application", default is "application"
+
+ addCallback("unload", funcOrName, scope, phase);
+ };
+})();
+
+(function(){
+ var invokeCallbacks = function(phase, eventName) {
+ var arr = OpenAjax._callbacks[eventName][phase]||[];
+ for (var i=0; i < arr.length; i++) {
+ arr[i].call();
+ }
+ // Callbacks have been called, so clear array.
+ OpenAjax._callbacks[eventName][phase] = [];
+ };
+
+ /*
+ * This is the OpenAjax onload event handler that the OpenAjax library
+ * registers on the BODY element.
+ */
+ OpenAjax.OnLoadHandler = function() {
+ // Invoke registered load event handlers for "library" phase.
+ invokeCallbacks("library", "load");
+ // Invoke registered load event handlers for "component" phase.
+ invokeCallbacks("component", "load");
+
+ // Invoke markup scanner if markup scanner module is loaded.
+ // FIXME: Need to add a test for this check.
+ if (OpenAjax.__moduleMarkupScanner) {
+ OpenAjax.scanDocument();
+ }
+
+ // Invoke registered load event handlers for "application" phase.
+ invokeCallbacks("application", "load");
+
+ // Set flag indicating that OpenAjax load handling is done.
+ // FIXME: Need to add a test for this.
+ OpenAjax.loadDone = true;
+ };
+
+
+ /*
+ * This is the OpenAjax onunload event handler that the OpenAjax library
+ * registers on the BODY element.
+ */
+ OpenAjax.OnUnloadHandler = function() {
+ // Invoke registered unload event handlers for "application" phase.
+ invokeCallbacks("application", "unload");
+
+ // Invoke registered unload event handlers for "component" phase.
+ invokeCallbacks("component", "unload");
+
+ // Invoke registered unload event handlers for "library" phase.
+ invokeCallbacks("library", "unload");
+
+ // Set flag indicating that OpenAjax unload handling is done.
+ // FIXME: Need to add a test for this.
+ OpenAjax.unloadDone = true;
+ };
+})();
+
+(function(){
+ /*
+ * Private function that attaches an event listener for a given event
+ * on the specified target object.
+ */
+ var addOnEvent = function(
+ type, // event type string
+ funcOrName, // callback function or string that holds name of function
+ scope){ // object, defaults is window
+
+ if(typeof funcOrName == "string"){
+ scope = scope || window;
+ funcOrName = scope[funcOrName];
+ }
+ var enclosedFunc = function(){ return funcOrName.apply(scope, arguments); };
+
+ if(window["attachEvent"]){
+ window.attachEvent("on"+type, enclosedFunc);
+ } else if(window["addEventListener"]){
+ window.addEventListener(type, enclosedFunc, false);
+ } else if(document["addEventListener"]){
+ document.addEventListener(type, enclosedFunc, false);
+ }
+ };
+
+ /*
+ * Register the OpenAjax load and unload event handlers on the BODY element.
+ */
+ addOnEvent("load", OpenAjax.OnLoadHandler);
+ addOnEvent("unload", OpenAjax.OnUnloadHandler);
+})();
+/*******************************************************************************
+ * Globals.js:
+ *
+ * A component of the OpenAjax Hub, as specified by OpenAjax Alliance.
+ * Specification is under development at:
+ *
+ * http://www.openajax.org/member/wiki/OpenAjax_Hub_Specification
+ *
+ * This file manages the global objects that are added to the JavaScript
+ * runtime environment by the Ajax libraries.
+ *
+ * Includes function OpenAjax.globalsCollisionCheck(globals, prefix),
+ * which determines whether the list of global objects in array 'globals'
+ * collides with any of the global objects used by currently
+ * registered Ajax libraries.
+ *
+ * The logic from OpenAjaxBootstrap.js must have been loaded before this file.
+ *
+ * Copyright 2006-2007 OpenAjax Alliance
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless
+ * required by applicable law or agreed to in writing, software distributed
+ * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ ******************************************************************************/
+
+ OpenAjax.__moduleGlobals = 1;
+
+ // Hash mapping libraries registered so far to a list of their global object names
+ OpenAjax.globals = {};
+
+ /*
+ * Identifies the global objects that the given Ajax library is adding to
+ * the JavaScript runtime environment. If any collisions are found,
+ * a runtime error will be raised.
+ */
+ OpenAjax.registerGlobals = function (
+ prefix, // Library prefix that was passed to registerLibrary().
+ globals){ // An array of strings that identify the globals added
+ // to the JavaScript runtime environment by this library.
+
+ // Check the list of globals against the previously registered globals.
+ var err = this.globalsCollisionCheck(globals, prefix);
+ if (err) {
+ throw new Error(err);
+ }
+
+ // Everything is OK, so register the globals for this library.
+ this.globals[prefix] = globals;
+ };
+
+
+ /*
+ * Determines whether the list of global objects in array 'candidates'
+ * collides with any of the global objects that have been listed by currently
+ * registered Ajax libraries.
+ */
+ //FIXME: Would be better if this returned an array of collisions, where the array was machine-parsable.
+ OpenAjax.globalsCollisionCheck = function (
+ candidates, // An array of strings that identify the globals against which we want to check
+ prefix){ // If provided, then don't compare 'globals' against globals registered by 'prefix'.
+ var err = null;
+
+ // see if there are collisions
+ for (var registered in this.globals) {
+ // do not check the list of globals for 'prefix'.
+ if (registered != prefix) {
+ var names = this.globals[registered];
+ for (var x=0; x<candidates.length; x++) {
+ candidate_global = candidates[x];
+ for (var y=0; y<names.length; y++) {
+ if (candidate_global == names[y]) {
+ err = "Global object collision for object '"+candidate_global+"'. "+
+ "Previously registered by library '"+registered+"'.";
+ if (prefix) {
+ err += " Library attempting to register this global: '"+prefix+"'.";
+ }
+ break;
+ }
+ }
+ if (err) {
+ break;
+ }
+ }
+ }
+ if (err) {
+ break;
+ }
+ }
+ return err;
+ }
+
+
+
+ // Register the OpenAjax Hub's globals
+ OpenAjax.registerGlobals("OpenAjax", ["OpenAjax","OpenAjaxConfig"]);
+/*******************************************************************************
+ * PublishSubscribe.js:
+ *
+ * A component of the OpenAjax Hub, as specified by OpenAjax Alliance.
+ * Specification is under development at:
+ *
+ * http://www.openajax.org/member/wiki/OpenAjax_Hub_Specification
+ *
+ * This file provides a publish/subscribe mechanism such that Ajax libraries
+ * can communication with each other. An Ajax library can publish events
+ * to which other Ajax libraries can subscribe.
+ *
+ * The logic from OpenAjaxBootstrap.js must have been loaded before this file.
+ *
+ * Copyright 2006-2007 OpenAjax Alliance
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless
+ * required by applicable law or agreed to in writing, software distributed
+ * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ ******************************************************************************/
+
+/* FIXME
+add unsubcribe method
+*/
+
+ OpenAjax.__modulePublishSubscribe = 1;
+
+ // Private variable, holds the listeners that Ajax libraries have registered.
+ OpenAjax._listeners = { "*": { "*": [] } };
+
+ /*
+ * Allows registration of interest in named events based on
+ * toolkit-specific prefix and event name. Global event
+ * matching is provided by passing "*" in the prefix and/or
+ * name arguments. Optional arguments may be specified for
+ * executing the specified handler function in a provided
+ * scope and for further filtering events prior to application
+ */
+ OpenAjax.subscribe = function (
+ prefix, // Library prefix that was passed to registerLibrary().string, or null, or "*" to match all.
+ name, // Event name. Can be "*" to match all.
+ refOrName, // callback function or string that holds name of function
+ scope, // object, default is window
+ subscriberData, // arbitrary object, can be null
+ filter){ // function
+
+ // NOTE: the following code is written in a verbose style for the
+ // sake of readability. Non-reference implementations should use a
+ // terser variant.
+
+ if (prefix == null || prefix == "") {
+ prefix = "__null__";
+ }
+
+ if(!this._listeners[prefix]){
+ this._listeners[prefix] = { "*": [] };
+ }
+
+ if(!this._listeners[prefix][name]){
+ this._listeners[prefix][name] = [];
+ }
+
+ if (typeof subscriberData == 'undefined') {
+ subscriberData = null;
+ }
+
+ if(!scope){
+ scope = window;
+ }
+
+ if(typeof refOrName == "string"){
+ // get a function object
+ refOrName = scope[refOrName];
+ }
+
+ this._listeners[prefix][name].push({
+ "func": refOrName,
+ "data": subscriberData,
+ "scope": scope,
+ "filter": filter
+ });
+ }
+
+
+ /*
+ * Publish events based on toolkit-specific prefix and event name.
+ */
+ OpenAjax.publish = function (
+ prefix, // Library prefix that was passed to registerLibrary().string, or null.
+ name, // Event name.
+ publisherData){ // arbitrary object, can be null
+
+ // NOTE: the following code is written in a verbose style for the
+ // sake of readability. Non-reference implementations should use a
+ // terser variant.
+
+ if (prefix == null || prefix == "") {
+ prefix = "__null__";
+ }
+ if (typeof publisherData == 'undefined') {
+ publisherData = null;
+ }
+
+ var globals = this._listeners["*"]["*"];
+
+ var handlers = [];
+
+ // aggregate the various handler sets to form a single list of handlers
+ if(this._listeners[prefix]){
+
+ if(this._listeners[prefix][name]){
+ handlers = handlers.concat( this._listeners[prefix][name] );
+ }
+
+ if(this._listeners[prefix]["*"]){
+ handlers = handlers.concat( this._listeners[prefix]["*"] );
+ }
+
+ }else{
+ handlers = globals;
+ }
+
+ if(this._listeners["*"][name]){
+ handlers = handlers.concat( this._listeners["*"][name] );
+ }
+
+ if(handlers.length == 0){
+ // avoid iterations if we aren't going to call any listeners anyway
+ return false;
+ }
+
+ for(var x=0; x<handlers.length; x++){
+
+ var argsArr = [prefix, name, handlers[x].data, publisherData];
+ if(typeof handlers[x].filter == "function"){
+ if( !handlers[x].filter.apply(window, argsArr) ){ continue; }
+ }
+
+ handlers[x].func.apply(handlers[x].scope, argsArr);
+
+ }
+ return true;
+ }/*******************************************************************************
+ * MarkupScanner.js:
+ *
+ * A component of the OpenAjax Hub, as specified by OpenAjax Alliance.
+ * Specification is under development at:
+ *
+ * http://www.openajax.org/member/wiki/OpenAjax_Hub_Specification
+ *
+ * This file manages the process of dispatching particular elements within
+ * the document to particular Ajax runtime libraries in order to
+ * perform that library's DOM transformation on the subtree headed by
+ * that particular element.
+ *
+ * An Ajax library registers callbacks which are invoked either
+ * before, during, or after a top-down analysis of the document DOM.
+ *
+ * The logic from OpenAjaxBootstrap.js must have been loaded before this file.
+ *
+ * Copyright 2006-2007 OpenAjax Alliance
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless
+ * required by applicable law or agreed to in writing, software distributed
+ * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ ******************************************************************************/
+
+ OpenAjax.__moduleMarkupScanner = 1;
+
+ /* -------------- PRIVATE VARIABLES AND FUNCTIONS -------------------- */
+
+ // Private variables, holds the markup scanner callbacks to invoke in response
+ // to various built-in scanning features.
+ // The value of each is an array of objects, where each object
+ // holds the parameters from the corresponding register function.
+ OpenAjax._TagNameCBs = []; // Examine element's tagname, possibly prefixed
+ OpenAjax._AttrNameCBs = []; // Look for a particular attribute, possibly prefixed
+
+ // Private variable, holds the custom markup scanner callbacks that have been registered so far.
+ // The value of each entry is a function pointer to the registered markup scanner callback.
+ OpenAjax._CustomScannerCBs = { };
+
+ /*
+ * Utility routines used by the public functions listed further down in the file.
+ */
+
+ /* Add a given callback function that the appropriate private array. */
+ OpenAjax._regScanCB = function (
+ functionName, // Public function name for error messages
+ arrayToAdjust, // The array to which this registration will be added.
+ prefix, // The prefix that corresponds to this library.
+ nodeName, // For attributes: attr name. For elements: tag name. Can have namespace prefix.
+ checkType, // "match"=must match entire string, "match-start"=must match initial characters
+ // For attribute matching, additional options are available for space-separated
+ // value lists, such as 'class' attribute:
+ // "token"=must match entire token, "token-start"=must mast initial characters
+ // For element matching, additional options are available.
+ // "match-namespace"=matches given namespace URI, "match-prefix"=matches given prefix.
+ checkString, // string to check
+ refOrName, // function or string that will be called with the HTML subtree root element
+ scope){ // object, default is window
+
+ var nsuri;
+ if(!scope){
+ scope = window;
+ }
+ if(typeof refOrName == "string"){
+ // get a function object
+ refOrName = scope[refOrName];
+ }
+ if(typeof refOrName != "function"){
+ throw new Error("invalid function reference passed to "+functionName+"()");
+ }
+ if (nodeName) {
+ if(typeof nodeName != "string"){
+ throw new Error("nodeName is not a string in "+functionName+"()");
+ }
+ var t = nodeName.split(":");
+ // To save space, we assume parameters passed according to rules, so if there is at least one colon, assume there is only one.
+ if (t.length >= 2) {
+ nsuri = OpenAjax.libraries[t[0]].namespaceURI;
+ nodeName = t[1];
+ } else {
+ nsuri = null;
+ // No namespace prefix, so nodeName already has correct value.
+ }
+ }
+ arrayToAdjust.push({
+ "prefix": prefix,
+ "nsuri": nsuri,
+ "nodeName": nodeName,
+ "checkType": checkType,
+ "checkString": checkString,
+ "func": refOrName
+ });
+ }
+
+ /* Remove callback functions from the appropriate private array. */
+ OpenAjax._unregScanCB = function (
+ functionName, // Public function name for error messages
+ arrayToAdjust, // The array from which registrations will be removed.
+ prefix){ // The prefix that corresponds to this library.
+ for (var i=arrayToAdjust.length-1; i >=0 ; i--) {
+ if (arrayToAdjust[i].prefix == prefix) {
+ // Use 'slice' instead of 'splice' due to bug in IE7.
+ var tail = arrayToAdjust.slice(i+1);
+ var len = arrayToAdjust.length;
+ for (var p=i; p<len; p++) {
+ arrayToAdjust.pop();
+ }
+ arrayToAdjust = arrayToAdjust.concat(tail);
+ }
+ }
+ return(arrayToAdjust);
+ }
+
+ /* -------------- PUBLIC FUNCTIONS -------------------- */
+ /* -------------- BUILT-IN SCANNER CHECKS ------------- */
+
+ /*
+ * Registers a callback function that is invoked for element nodes in the document
+ * that have a particular attribute set to a particular value.
+ */
+ OpenAjax.registerAttrScanCB = function (
+ prefix, // The prefix that corresponds to this library.
+ attrName, // attribute to check
+ checkType, // "match"=must match entire string, "match-start"=must match initial characters
+ // For attributes with space-separated values,
+ // "token"=must match entire token, "token-start"=must mast initial characters
+ checkString, // value string to check
+ refOrName, // function or string that will be called with the HTML subtree root element
+ scope){ // object, default is window
+ if (OpenAjax._error) {
+ throw OpenAjax._error; // Hub is in bad state. Bail with error message.
+ }
+ if (arguments.length < 5) {
+ throw new Error("Insufficient number of arguments in OpenAjax.registerAttrScanCB");
+ }
+ OpenAjax._regScanCB("registerAttrScanCB", OpenAjax._AttrNameCBs,
+ prefix, attrName, checkType, checkString, refOrName, scope);
+ }
+
+ /*
+ * Unregisters all callback functions registered by the given library for the attribute.
+ */
+ OpenAjax.unregisterAttrScanCB = function(prefix){
+ OpenAjax._AttrNameCBs = OpenAjax._unregScanCB("unregisterAttrScanCB", OpenAjax._AttrNameCBs, prefix);
+ }
+
+ /*
+ * Registers a callback function that is invoked for element nodes in the document
+ * that have a particular tagName (with or without NS), namespace, or prefix.
+ */
+ OpenAjax.registerTagnameScanCB = function (
+ prefix, // The prefix that corresponds to this library.
+ checkType, // "match"=must match localName exactly, along with NS or prefix if not null.
+ // "match-start"=must match first N chars of localName, along with NS or prefix if not null.
+ // "match-namespace"=must be in a given NS (requires DOM Level 2 namespaces),
+ // "match-prefix"=must have given prefix (with or without DOM Level 2 namespaces).
+ checkString, // value string to check
+ refOrName, // function or string that will be called with the HTML subtree root element
+ scope){ // object, default is window
+ if (OpenAjax._error) {
+ throw OpenAjax._error; // Hub is in bad state. Bail with error message.
+ }
+ if (arguments.length < 4) {
+ throw new Error("Insufficient number of arguments in OpenAjax.registerTagnameScanCB");
+ }
+ OpenAjax._regScanCB("registerTagnameScanCB", OpenAjax._TagNameCBs,
+ prefix, checkString, checkType, null, refOrName, scope);
+ }
+
+ /*
+ * Unregisters all callback functions registered by the given library for the attribute.
+ */
+ OpenAjax.unregisterTagnameScanCB = function(prefix){
+ OpenAjax._TagNameCBs = OpenAjax._unregScanCB("unregisterTagnameScanCB", OpenAjax._TagNameCBs, prefix);
+ }
+
+ /* -------------- PUBLIC FUNCTIONS -------------------- */
+ /* -------------- CUSTOM SCANNER CHECKS ------------- */
+
+ /*
+ * Registers a custom callback function to invoke for element nodes in the document
+ * during the (top-to-bottom) document scanning process.
+ */
+ OpenAjax.registerCustomScannerCB = function (
+ prefix, // Library prefix that was passed to registerLibrary().
+ refOrName, // The callback function object reference or the name of a function to be called.
+ scope){ // Optional. An Object in which to execute refOrName. If null, default is window.
+
+ if (OpenAjax._error) {
+ throw OpenAjax._error; // Hub is in bad state. Bail with error message.
+ }
+ if (arguments.length < 2)
+ throw new Error("Insufficient number of arguments in OpenAjax.registerCustomScanner");
+ if (prefix == null)
+ throw new Error("prefix cannot be null in OpenAjax.registerCustomScanner()");
+ if (prefix == "")
+ throw new Error("prefix cannot be empty string in OpenAjax.registerCustomScanner()");
+
+ if(!scope){
+ scope = window;
+ }
+
+ if(typeof refOrName == "string"){
+ // get a function object
+ refOrName = scope[refOrName];
+ }
+
+ if(typeof refOrName != "function"){
+ throw new Error("invalid function reference passed to OpenAjax.registerCustomScanner()");
+ }
+
+ OpenAjax._CustomScannerCBs[prefix] = refOrName;
+ }
+
+ /*
+ * Unregisters a custom callback function .
+ */
+ OpenAjax.unregisterCustomScannerCB = function(
+ prefix){ // Library prefix that was passed to registerLibrary().
+
+ if (!OpenAjax._CustomScannerCBs[prefix]) {
+ throw new Error("Attempt to unregister a CustomScannerCB for '" + prefix + "' that has not been registered.");
+ } else {
+ // Remove registration for this library.
+ delete OpenAjax._CustomScannerCBs[prefix];
+ }
+ }
+
+ /* -------------- PUBLIC FUNCTIONS -------------------- */
+ /* -------------- DOCUMENT AND NODE SCANNERS ---------- */
+
+ /*
+ * Perform markup scanning on the document.
+ */
+ OpenAjax.scanDocument = function() {
+ var any = false;
+
+ if (OpenAjax._error) {
+ throw OpenAjax._error; // Hub is in bad state. Bail with error message.
+ }
+
+ // See if any attr=value scanner CBs have been registered.
+ if (OpenAjax._AttrNameCBs.length) {
+ any = true;
+ }
+
+ // See if any tagname scanner CBs have been registered.
+ if (OpenAjax._TagNameCBs.length) {
+ any = true;
+ }
+
+ // See if OpenAjax._CustomScannerCBs has any entries.
+ for (prefix in OpenAjax._CustomScannerCBs) {
+ any = true;
+ break;
+ }
+
+ if (any) {
+ var ids = OpenAjaxConfig.idsToScan;
+ if (ids && ids.length) {
+ for (var i = 0 ; i<ids.length; i++){
+ OpenAjax.scanNode(document.getElementById(ids[i]));
+ }
+ } else if (OpenAjaxConfig.scanPage !== false) {
+ OpenAjax.scanNode(document.body);
+ }
+ }
+ }
+
+ /*
+ * Invoke any registered markup handler callbacks on this element node.
+ */
+ OpenAjax.scanNode = function (
+ node , //the node to recursively process
+ shallowScan ){ //if true, only scan this node not any children. defaults to false=deep scan.
+ var returnValue;
+
+ // Ignore everything but element nodes (nodeType==1)
+ if (!node || node.nodeType!=1) {
+ return;
+ }
+ // IE has a bug where it sometimes treats close tag as an open tag.
+ // So, ignore any so-called elements where first character of nodeName is "/"
+ if (!node.nodeName || node.nodeName.charAt(0) == "/") {
+ return;
+ }
+ if (typeof shallowScan == 'undefined') {
+ shallowScan = false;
+ }
+
+ var stopScanChildNodes = false;
+ var stopScanThisNode = false;
+
+ // Check if any attribute=value callbacks have been registered.
+ if (!stopScanThisNode) {
+ if (OpenAjax._AttrNameCBs.length) {
+ for (var i=0; i<OpenAjax._AttrNameCBs.length; i++) {
+ var attrValue = null;
+ var cbObject = OpenAjax._AttrNameCBs[i];
+ var nsuri = cbObject.nsuri;
+ var attrName = cbObject.nodeName;
+ if (nsuri) {
+ if (node.getAttributeNS) {
+ attrValue = node.getAttributeNS(nsuri, attrName);
+ // Workaround for Safari 2.0.4, which incorrectly implements getAttributeNS
+ // where it matches against any old nsuri.
+ var tempValue = node.getAttributeNS("zzz-bogus-uri", attrName);
+ if (tempValue == attrValue) {
+ attrValue = null;
+ }
+ }
+ // Look for prefix:attrName for browsers that do not have namespace support
+ // or which choose to treat the document as HTML4 without namespace support.
+ if (!attrValue || attrValue == "") {
+ attrValue = node.getAttribute(cbObject.prefix+":"+attrName);
+ }
+ } else {
+ attrValue = node.getAttribute(attrName);
+ }
+ // IE has a bug where it doesn't support 'class' via getAttribute.
+ if (!attrValue && !nsuri && attrName == "class" && node.className) {
+ attrValue = node.className;
+ }
+ if (attrValue) {
+ returnValue = null;
+ var checkType = cbObject.checkType;
+ if (checkType == "match") {
+ if (attrValue.length == cbObject.checkString.length && attrValue.indexOf(cbObject.checkString) == 0) {
+ returnValue = cbObject.func.call(window, node);
+ }
+ } else if (checkType == "match-start") {
+ if (attrValue.indexOf(cbObject.checkString) == 0) {
+ returnValue = cbObject.func.call(window, node);
+ }
+ } else if (checkType == "token" || checkType == "token-start") {
+ var str_array = attrValue.split(" ");
+ for (var j=0; j < str_array.length; j++) {
+ var token = str_array[j];
+ if (checkType == "token") {
+ if (token.length == cbObject.checkString.length && token.indexOf(cbObject.checkString) == 0) {
+ returnValue = cbObject.func.call(window, node);
+ break;
+ }
+ } else if (checkType == "token-start") {
+ if (token.indexOf(cbObject.checkString) == 0) {
+ returnValue = cbObject.func.call(window, node);
+ break;
+ }
+ }
+ }
+ }
+ if (returnValue) {
+ // If any callbacks sets stopScanChildNodes to true, then don't scan child nodes.
+ if (returnValue.stopScanChildNodes) {
+ stopScanChildNodes = true;
+ }
+ // If returnValue says to cancel all further scanning, then break out of this loop.
+ if (returnValue.stopScanThisNode) {
+ stopScanThisNode = true;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // Check if any tagname callbacks have been registered.
+ if (!stopScanThisNode) {
+ if (OpenAjax._TagNameCBs.length) {
+ for (var i=0; i<OpenAjax._TagNameCBs.length; i++) {
+ var cbObject = OpenAjax._TagNameCBs[i];
+ var tagPrefix = null;
+ var tagNS = null;
+ var tagLocalName = null;
+ if (node.prefix && node.namespaceURI && node.localName) {
+ // DOM Level 2 namespaces is supported.
+ tagPrefix = node.prefix;
+ tagNS = node.namespaceURI;
+ tagLocalName = node.localName;
+ } else {
+ if (node.tagName) {
+ var tagName = node.tagName;
+ if (tagName.indexOf(":") != -1) {
+ var temp_array = tagName.split(":");
+ tagPrefix = temp_array[0];
+ tagLocalName = temp_array[1];
+ } else {
+ tagLocalName = tagName;
+ }
+ }
+ }
+ if (tagLocalName) {
+ returnValue = null;
+ var checkType = cbObject.checkType;
+ if (checkType == "match-namespace") {
+ // FIXME: Need to create test cases for namespace option.
+ // FIXME: May need to uppercase the namespace URIs before comparisons.
+ if (tagNS && tagNS == cbObject.nsuri) {
+ // FIXME - Need to review code associated with 3rd and 4th params on callbacks.
+ returnValue = cbObject.func.call(window, node);
+ }
+ } else if (checkType == "match-prefix") {
+ var checkPrefix = cbObject.prefix.toUpperCase();
+ if (tagPrefix && tagPrefix == checkPrefix) {
+ returnValue = cbObject.func.call(window, node);
+ }
+ } else if (checkType == "match" || checkType == "match-start") {
+ var checkPrefix = cbObject.prefix.toUpperCase();
+ var checkNS = cbObject.nsuri;
+ var checkLocalName = cbObject.nodeName.toUpperCase();
+ if ((checkType == "match" && checkLocalName == tagLocalName) ||
+ (checkType == "match-start" && tagLocalName.indexOf(checkLocalName) == 0)) {
+ if ((!tagPrefix && !tagNS) ||
+ (tagNS && tagNS == checkNS) ||
+ (tagPrefix && tagPrefix == checkPrefix)) {
+ // FIXME - Need to review code associated with 3rd and 4th params on callbacks.
+ returnValue = cbObject.func.call(window, node);
+ }
+ }
+ }
+ if (returnValue) {
+ // If any callbacks sets stopScanChildNodes to true, then don't scan child nodes.
+ if (returnValue.stopScanChildNodes) {
+ stopScanChildNodes = true;
+ }
+ // If returnValue says to cancel all further scanning, then break out of this loop.
+ if (returnValue.stopScanThisNode) {
+ stopScanThisNode = true;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (!stopScanThisNode) {
+ for (prefix in OpenAjax._CustomScannerCBs) {
+ returnValue = OpenAjax._CustomScannerCBs[prefix].call(window, node);
+ if (returnValue) {
+ // If any callbacks sets stopScanChildNodes to true, then don't scan child nodes.
+ if (returnValue.stopScanChildNodes) {
+ stopScanChildNodes = true;
+ }
+ // If returnValue says to cancel all further scanning, then break out of this loop.
+ if (returnValue.stopScanThisNode) {
+ stopScanThisNode = true;
+ break;
+ }
+ }
+ }
+ }
+ if (!shallowScan && !stopScanChildNodes) {
+ var childNode, i = 0, childNodes = node.childNodes;
+ while(childNode = childNodes[i++]){
+ if (childNode.nodeType!=1)
+ continue;
+ OpenAjax.scanNode(childNode);
+ }
+ }
+ }
diff --git a/WebContent/openajax/index.html b/WebContent/openajax/index.html
new file mode 100644
index 0000000000..222d01b477
--- /dev/null
+++ b/WebContent/openajax/index.html
@@ -0,0 +1,212 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<!--
+/*******************************************************************************
+ * HubTest-BasicConformance.html:
+ * Test case for Ajax libraries that verifies whether a given library
+ * supports the most basic requirements from the OpenAjax Hub Specification.
+ *
+ * To use this test case against a given Ajax library, this test case
+ * needs to be customized. At a minimum, you will need to replace the
+ * following line:
+ *
+ * <script language="JavaScript" type="text/javascript" src="SampleAjaxLibrary.js"></script>
+ *
+ * with a <script> element that loads your Ajax library instead of SampleAjaxLibrary.js.
+ *
+ * Libraries can make other modifications, but the <div> block
+ * with id=HubTest_BasicConformance" must be left intact.
+ *
+ * Other customization instructions are included within the comments in the
+ * various files.
+ *
+ * Copyright 2007 OpenAjax Alliance
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless
+ * required by applicable law or agreed to in writing, software distributed
+ * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ ******************************************************************************/
+-->
+
+<!-- ****************************************************************************
+ The xmlns declarations are included in this test case below because they are required
+ by the OpenAjax Hub Specification which is forward looking to when browsers
+ support XML/XHTML properly. Note, however, that xmlns declarations generally have
+ no effect with browsers shipping at the time this test case was developed (early 2007).
+
+ The xmlns:SampleAjaxLibrary declaration should be changed such that
+ - "SampleAjaxLibrary" is changed to the prefix used by the given library
+ - "http://example.com/SampleAjaxLibrary" is changed to the namespaceURI for the library
+ (See documentation on OpenAjax.registerLibrary() for more about prefix and namespaceURI.)
+ **************************************************************************** -->
+
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ITMillToolkit40="http://itmill.com/toolkit">
+<head>
+ <!-- ****************************************************************************
+ THE CONTENTS OF THE FOLLOWING HEAD ELEMENTS MUST NOT BE CHANGED
+ (except it is OK to change the location of the referenced files).
+ **************************************************************************** -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title>OpenAjax Hub Basic Conformance Test: IT Mill Toolkit 4</title>
+ <link rel="StyleSheet" href="stylesheets/hubtest.css" type="text/css" />
+
+ <!-- ****************************************************************************
+ THE FOLLOWING SCRIPT ELEMENTS USUALLY NEED TO BE AT THE TOP OF THE HTML FILE.
+ HERE IS THE LIST OF CUSTOMIZATIONS YOU MUST OR MAY DO TO THIS SECTION:
+
+ YOU MUST CUSTOMIZE IT AS FOLLOWS.
+ - You must change HubTest-BasicConformance-MyPrefix from "SampleAjaxLibrary"
+ to the prefix used by your library.
+
+ YOU MAY CUSTOMIZE THE FOLLOWING LOGIC AS FOLLOWS.
+ - Your toolkit might include the OpenAjax Hub (i.e., ../../release/OpenAjax.js)
+ within your toolkit distribution or might put the Hub source code in a different
+ location than ../../release/OpenAjax.js. Therefore, it is OK to change
+ the 'src' attribute or remove the SCRIPT tag for OpenAjax.js entirely
+ (if you include the Hub within your toolkit).
+ (But be aware that if the Hub is part of your toolkit, you probably have to move
+ the SCRIPT tag for HubTest-BasicConformance.js such that it is loaded
+ after your toolkit because it makes calls into various OpenAjax.* functions.)
+
+ - If you are using a different implementation of the Hub than the
+ Alliance's reference implementation at http://openajaxallianc.sourceforge.net,
+ and your library register load event handlers with the Hub,
+ you probably need to change the logic within function HubTest_BasicConformance_Verify_Load()
+ to look at your implementation's private variables.
+ **************************************************************************** -->
+ <script language="JavaScript" type="text/javascript" src="OpenAjax.js"></script>
+
+ <script language="JavaScript" type="text/javascript">
+ var HubTest_BasicConformance_MyPrefix = "ITMillToolkit40";
+
+ function HubTest_BasicConformance_Verify_Load() {
+ if ((OpenAjax._callbacks.load.library && OpenAjax._callbacks.load.library.length) ||
+ (OpenAjax._callbacks.load.component && OpenAjax._callbacks.load.component.length)) {
+ loadHandlerWorking = true;
+ }
+ }
+
+ // Invoke HubTest_BasicConformance_Verify_Load as the first thing that happens
+ // during OnLoad event processing. (Determine if callback arrays have been set properly.)
+ OpenAjax.addOnLoad("HubTest_BasicConformance_Verify_Load", null, "library");
+ </script>
+
+ <script language="JavaScript" type="text/javascript" src="HubTest-BasicConformance.js"></script>
+
+ <!-- ****************************************************************************
+ YOU MUST REMOVE/REPLACE THE FOLLOWING SCRIPT ELEMENT.
+ The <script> tag below that references SampleAjaxLibrary.js must be removed and
+ instead you will need to have your own Ajax library loaded instead.
+ **************************************************************************** -->
+ <link rel="stylesheet" href="../features/RES/base/css/base-ajax.css" type="text/css" />
+ <link rel="stylesheet" href="../features/RES/base/css/calendar-default.css" type="text/css" />
+ <script src="../features/RES/base/script/ajax-client.js" type="text/javascript"></script>
+ <script src="../features/RES/base/script/base-ajax-components.js" type="text/javascript"></script>
+ <script src="../features/RES/base/ext/jscalendar/calendar.js" type="text/javascript"></script>
+ <script src="../features/RES/base/ext/jscalendar/lang/calendar-en.js" type="text/javascript"></script>
+ <script src="../features/RES/base/ext/jscalendar/calendar-setup.js" type="text/javascript"></script>
+ <script src="../features/RES/base/ext/firebug/firebug.js" type="text/javascript"></script>
+ <link rel="stylesheet" href="../features/RES/corporate/css/corporate-ajax.css" type="text/css" />
+ <script src="../features/RES/corporate/script/corporate-ajax-components.js" type="text/javascript"></script>
+ <script src="../features/RES/demo/featurebrowser/components.js" type="text/javascript"></script>
+ <link rel="stylesheet" href="../features/RES/demo/featurebrowser/featurebrowser.css" type="text/css" />
+
+ <!-- ****************************************************************************
+ YOU MAY CUSTOMIZE THE FOLLOWING LOGIC.
+ - Instead of having the ConformanceChecks() happen at the end of OnLoad processing
+ (as the code below does),
+ you might want instead to invoke ConformanaceChecks() manually, particularly if your toolkit
+ performs some of its initialization after the OnLoad event has completed.
+ **************************************************************************** -->
+ <script language="JavaScript" type="text/javascript">
+ // Invoke ConformanceChecks so that they happen at the end of OnLoad processing.
+ OpenAjax.addOnLoad("ConformanceChecks");
+ </script>
+
+
+</head>
+
+<body class="itmtk">
+ <div id="hubtestwin" style="position:absolute; z-index: 40000; background-color: white; border: 4px ridge gray; margin: 80px;">
+ <div style="position: absolute; width: 16px; height: 16px; padding-top: 4px; text-align: center; top: 0; right: 0; background-color: red; border: 1px outset red; cursor: pointer; " onclick="document.getElementById('hubtestwin').style.display='none';">X</div>
+
+
+ <!-- ****************************************************************************
+ THE CONTENTS OF THE FOLLOWING DIV BLOCK MUST NOT BE CHANGED.
+ (But it's OK if your library needs to move this block elsewhere
+ within the document hierarchy and OK if you need to add other
+ elements to the BODY.)
+ **************************************************************************** -->
+ <div id="HubTest_BasicConformance">
+ <p id="OpenAjaxBanner" class="imageContainer">
+ <a href="http://www.openajax.org">
+ <img id="OpenAjaxBanner" src="images/OpenAjaxAllianceBanner.jpg" border="0" width="846px" alt="OpenAjax Alliance banner"/>
+ </a>
+ </p>
+ <h1 class="HubTestTitle">OpenAjax Hub Basic Conformance Test</h1>
+ <p id="LibraryName">For library: (unknown)</p>
+ <table id="HubTestResults" class="HubTestResults">
+ <tbody>
+ <tr>
+ <td class="HubTestNumber">1</td>
+ <td class="HubTestLabel">OpenAjax Conformance Requirement (Libraries): Library Registration</td>
+ <td class="HubTestResult" id="registerLibraryResult"><span style="color:red">TEST NOT SUCCESSFUL</span></td>
+ </tr>
+ <tr>
+ <td class="HubTestNumber">2</td>
+ <td class="HubTestLabel">OpenAjax Conformance Requirement (Libraries): Globals Registration</td>
+ <td class="HubTestResult" id="registerGlobalsResult"><span style="color:red">TEST NOT SUCCESSFUL</span></td>
+ </tr>
+ <tr>
+ <td class="HubTestNumber">3</td>
+ <td class="HubTestLabel">OpenAjax Conformance Requirement (Libraries): Load/Unload Handlers Registered Indirectly Through the Hub</td>
+ <td class="HubTestResult" id="addOnLoadResult"><span style="color:blue">TEST NOT APPLICABLE</span></td>
+ </tr>
+ <tr>
+ <td class="HubTestNumber">4</td>
+ <td class="HubTestLabel">OpenAjax Hub Publish/Subscribe Test</td>
+ <td class="HubTestResult" id="PublishSubscribeResult"><span style="color:red">TEST NOT SUCCESSFUL</span></td>
+ </tr>
+ <tr>
+ <td class="HubTestNumber">5</td>
+ <td class="HubTestLabel">OpenAjax Hub Markup Scanner Test</td>
+ <td class="HubTestResult" id="MarkupScannerResult"><span style="color:red">TEST NOT SUCCESSFUL</span></td>
+ </tr>
+ </tbody>
+ </table>
+ <p>Notes:</p>
+ <ul>
+ <li>A library completely passes this test if all boxes say TEST SUCCEEDED.</li>
+ <li>Some toolkits do not initialize themselves during 'load' event processing.
+ Because of these situations, it is OK if the load/unload test case says TEST NOT APPLICABLE.</li>
+ </ul>
+ </div>
+
+
+ </div>
+
+ <!-- ****************************************************************************
+ Extra credit: A library developer might want to include a snippet of content that uses
+ his Ajax library to include extra graphical content in order spice up the
+ visual result from the test.
+ **************************************************************************** -->
+
+<div id="ajax-wait">Loading...</div>
+<div id="ajax-window"></div>
+<script language="JavaScript">
+ // Initialize client part of the IT Mill Toolkit and start it
+ function ITMillToolkit_Start () {
+ var client = new itmill.Client(document.getElementById('ajax-window'),"../features/UIDL/","../features/RES/base/client/",document.getElementById('ajax-wait'));
+ (new itmill.themes.Demo("../features/RES/demo/")).registerTo(client);
+ client.start();
+ }
+ OpenAjax.addOnLoad("ITMillToolkit_Start", null, "library");
+</script>
+
+</body>
+</html> \ No newline at end of file
diff --git a/WebContent/styles/demos.css b/WebContent/styles/demos.css
index fc4f082d2f..c0501a5aec 100644
--- a/WebContent/styles/demos.css
+++ b/WebContent/styles/demos.css
@@ -1,140 +1,144 @@
-/* Basic styles */
-
-body {
- background-color: #c7e4ff;
- font-family: Georgia, Arial, Tahoma, Verdana, sans-serif;
- margin: 0;
- padding: 0;
- letter-spacing: 0.01em;
- color: #4c4c4c;
- font-size: 62.5%;
-}
-
-h1,h2,h3,h4,h5,h6 {
- font-family: Arial, Tahoma, Verdana, sans-serif;
- color: #ee4411;
- font-weight: normal;
-}
-h1 {
- font-size: 3em;
-}
-h2 {
- font-size: 2.4em;
-}
-h3 {
- font-size: 2em;
-}
-h4 {
- font-size: 1.8em;
- color: #3798f3;
- margin-bottom: 0.4em;
-}
-h5 {
- font-size: 1.5em;
-}
-h6 {
- font-size: 1.2em;
- font-weight: bold;
-}
-
-a:link {
- color: #ee4411;
- text-decoration: none;
- border-bottom: dotted 1px #539dc9;
-}
-a:visited {
- color: #5d7178;
- text-decoration: none;
- border-bottom: dotted 1px #539dc9;
-}
-a:active {
- color: #3a9bff;
- text-decoration: none;
-}
-a:hover {
- color: #3b62b1;
- background-color: #e7f3fa;
- border-bottom: solid 1px #ee4411;
- text-decoration: none;
-}
-
-ul {
- list-style-type: square;
-}
-
-/* Layout */
-
-#container {
- margin: 30px 30px;
- text-align: left;
- padding: 35px 30px 30px 30px;
- overflow: hidden;
- margin-right: 30px;
- background-color: #fff;
-}
-
-#itmilllogo {
- background-image: url(itmill-logo-small.gif);
- width: 195px;
- height: 32px;
- overflow: hidden;
- text-indent: -90000px;
- float: left;
-}
-
-#toolkit {
- float: left;
- width: 100px;
- height: 25px;
- background: transparent url(frontpage_logo.png) no-repeat;
- margin: 3px 0 30px 10px;
-}
-
-pre {
- background-color: #f7f7f7;
- border: solid 2px #e6e6e6;
- font-family: monospace;
- font-size: 1.1em;
- padding: 0.5em 1em;
-}
-
-hr {
- height: 1px;
- overflow: hidden;
- color: #b2d2e5;
- background-color: #b2d2e5;
- border: none;
-}
-
-#feature-browser,
-#sample-code {
- clear: both;
- padding: 10px 10px 20px 50px;
- background-color: #f7f7f7;
- border: solid 2px #e6e6e6;
- font-size: 1.2em;
- line-height: 1.6em;
- margin: 30px 0;
-}
-
-#feature-browser {
- background: #f7f7f7 url(feature_browser_bg.gif) no-repeat top right;
-}
-
-#sample-code {
- background: #f7f7f7 url(sample_code_bg.gif) no-repeat top right;
-}
-
-.option {
- clear: both;
- height: 2em;
- overflow: hidden;
-}
-
-.option .link {
- float: left;
- width: 15em;
-}
-.option .desc {
- float: left;
+/* Basic styles */
+
+body {
+ background-color: #c7e4ff;
+ font-family: Georgia, Arial, Tahoma, Verdana, sans-serif;
+ margin: 0;
+ padding: 0;
+ letter-spacing: 0.01em;
+ color: #4c4c4c;
+ font-size: 62.5%;
+}
+
+h1,h2,h3,h4,h5,h6 {
+ font-family: Arial, Tahoma, Verdana, sans-serif;
+ color: #ee4411;
+ font-weight: normal;
+}
+h3 a {
+ color: #ee4411;
+}
+h3 a:visited {
+ color: #ee4411;
+}
+h1 {
+ font-size: 3em;
+}
+h2 {
+ font-size: 2.4em;
+}
+h3 {
+ font-size: 2em;
+}
+h4 {
+ font-size: 1.8em;
+ color: #3798f3;
+ margin-bottom: 0.4em;
+}
+h5 {
+ font-size: 1.5em;
+}
+h6 {
+ font-size: 1.2em;
+ font-weight: bold;
+}
+
+a:link {
+ color: #ee4411;
+ text-decoration: none;
+ border-bottom: dotted 1px #539dc9;
+}
+a:visited {
+ color: #5d7178;
+ text-decoration: none;
+ border-bottom: dotted 1px #539dc9;
+}
+a:active {
+ color: #3a9bff;
+ text-decoration: none;
+}
+a:hover {
+ color: #3b62b1;
+ background-color: #e7f3fa;
+ border-bottom: solid 1px #ee4411;
+ text-decoration: none;
+}
+
+ul {
+ list-style-type: square;
+}
+
+/* Layout */
+
+#container {
+ margin: 30px 30px;
+ text-align: left;
+ padding: 35px 30px 30px 30px;
+ overflow: hidden;
+ margin-right: 30px;
+ background-color: #fff;
+}
+
+#itmilllogo {
+ background-image: url(itmill-logo-small.gif);
+ width: 195px;
+ height: 32px;
+ overflow: hidden;
+ text-indent: -90000px;
+ float: left;
+}
+
+#toolkit {
+ float: left;
+ width: 100px;
+ height: 25px;
+ background: transparent url(frontpage_logo.png) no-repeat;
+ margin: 3px 0 30px 10px;
+}
+
+pre {
+ background-color: #f7f7f7;
+ border: solid 2px #e6e6e6;
+ font-family: monospace;
+ font-size: 1.1em;
+ padding: 0.5em 1em;
+}
+
+hr {
+ height: 1px;
+ overflow: hidden;
+ color: #b2d2e5;
+ background-color: #b2d2e5;
+ border: none;
+}
+
+#feature-browser,
+#sample-code {
+ clear: both;
+ padding: 10px 10px 20px 50px;
+ background-color: #f7f7f7;
+ border: solid 2px #e6e6e6;
+ font-size: 1.2em;
+ line-height: 1.6em;
+ margin: 30px 0;
+}
+
+#feature-browser {
+ background: #f7f7f7 url(feature_browser_bg.gif) no-repeat top right;
+}
+
+#sample-code {
+ background: #f7f7f7 url(sample_code_bg.gif) no-repeat top right;
+}
+
+.option {
+ clear: both;
+}
+
+.option .link {
+ float: left;
+ width: 15em;
+}
+.option .desc {
+ float: left;
} \ No newline at end of file