Browse files

Remove trailing whitespaces in regular file

Change-Id: Iba81fd861db4dfc00d41275a26cdbc8b6e07ab38
  • Loading branch information...
1 parent edaec6a commit 13a2de080323b0a56a04707a0eae331f0b461311 @hudayou hudayou committed Mar 9, 2012
View
52 openstack-identity-api/pom.xml
@@ -1,4 +1,4 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!-- POM Build file for the Keystone Developer Guide -->
@@ -9,27 +9,27 @@
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Keystone Dev Guide</name>
- <profiles>
- <profile>
- <id>Rackspace Research Repositories</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <repositories>
- <repository>
- <id>rackspace-research</id>
- <name>Rackspace Research Repository</name>
- <url>http://maven.research.rackspacecloud.com/content/groups/public/</url>
- </repository>
- </repositories>
- <pluginRepositories>
- <pluginRepository>
- <id>rackspace-research</id>
- <name>Rackspace Research Repository</name>
- <url>http://maven.research.rackspacecloud.com/content/groups/public/</url>
- </pluginRepository>
- </pluginRepositories>
- </profile>
+ <profiles>
+ <profile>
+ <id>Rackspace Research Repositories</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <repositories>
+ <repository>
+ <id>rackspace-research</id>
+ <name>Rackspace Research Repository</name>
+ <url>http://maven.research.rackspacecloud.com/content/groups/public/</url>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>rackspace-research</id>
+ <name>Rackspace Research Repository</name>
+ <url>http://maven.research.rackspacecloud.com/content/groups/public/</url>
+ </pluginRepository>
+ </pluginRepositories>
+ </profile>
</profiles>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -219,7 +219,7 @@
<include name="**/*.svg" />
</fileset>
</copy>
- <!-- Copies HTML to a release folder for web site-->
+ <!-- Copies HTML to a release folder for web site-->
<copy
todir="${basedir}/target/docbkx/webhelp/api/openstack-identity-service/2.0">
@@ -232,11 +232,11 @@
<move failonerror="false"
file="${basedir}/target/docbkx/pdf/identity-dev-guide.pdf"
tofile="${basedir}/target/docbkx/webhelp/api/openstack-identity-service/2.0/identity-dev-guide-2.0.pdf"/>
-
+
<!-- Moves extension PDF and keeps name of the main dev guide -->
<!--<copy failonerror="false"
file="${basedir}/target/docbkx/webhelp/api/openstack-identity-service/2.0/identity-dev-guide-2.0.pdf"
- tofile="${basedir}/target/docbkx/webhelp/identity-dev-guide/identity-dev-guide.pdf"/>
+ tofile="${basedir}/target/docbkx/webhelp/identity-dev-guide/identity-dev-guide.pdf"/>
<move failonerror="false"
file="${basedir}/target/docbkx/pdf/RAX-KSKEY-service-devguide.pdf"
tofile="${basedir}/target/docbkx/webhelp/identitydevguide/service/RAX-KSKEY-service-devguide.pdf"/>
@@ -248,7 +248,7 @@
tofile="${basedir}/target/docbkx/webhelp/identitydevguide/admin/OS-KSCATALOG-admin-devguide.pdf"/>
<move failonerror="false"
file="${basedir}/target/docbkx/pdf/OS-KSEC2-service-devguide.pdf"
- tofile="${basedir}/target/docbkx/webhelp/identitydevguide/service/OS-KSEC2-service-devguide.pdf"/>
+ tofile="${basedir}/target/docbkx/webhelp/identitydevguide/service/OS-KSEC2-service-devguide.pdf"/>
<move failonerror="false"
file="${basedir}/target/docbkx/pdf/OS-KSEC2-service-devguide.pdf"
tofile="${basedir}/target/docbkx/webhelp/identitydevguide/service/OS-KSEC2-service-devguide.pdf"/>
View
212 openstack-identity-api/src/docbkx/RAX-KS/RAX-KSQA-admin.wadl
@@ -1,106 +1,106 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (C) 2011 OpenStack LLC., All Rights Reserved -->
-<!--*******************************************************-->
-<!-- Import Common XML Entities -->
-<!-- -->
-<!-- You can resolve the entites with xmllint -->
-<!-- -->
-<!-- xmllint -noent RAX-KSQA-admin.wadl -->
-<!--*******************************************************-->
-<!DOCTYPE application [
-<!ENTITY % common SYSTEM "common.ent">
-%common;
-]>
-<application xmlns="http://wadl.dev.java.net/2009/02"
- xmlns:identity="http://docs.openstack.org/identity/api/v2.0"
- xmlns:RAX-KSQA="http://docs.openstack.org/identity/api/ext/RAX-KSQA/v1.0"
- xmlns:capi="http://docs.openstack.oapi/v1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xsdxt="http://docs.rackspacecloud.com/xsd-ext/v1.0"
- xsi:schemaLocation="http://docs.openstack.org/identity/api/v2.0 xsd/api.xsd
- http://docs.openstack.oapi/v1.0 xsd/api-common.xsd
- http://wadl.dev.java.net/2009/02 http://www.w3.org/Submission/wadl/wadl.xsd
- http://docs.openstack.org/identity/api/ext/RAX-KSQA/v1.0 xsd/RAX-KSQA-secretQA.xsd
- ">
-
- <grammars>
- <include href="xsd/api.xsd"/>
- <include href="xsd/api-common.xsd"/>
- <include href="xsd/RAX-KSQA-secretQA.xsd"/>
- </grammars>
- <!--*******************************************************-->
- <!-- All Resources -->
- <!--*******************************************************-->
-
- <!-- We should use SSL in production -->
- <resources base="http://localhost:35357">
- <resource id="version" path="v2.0">
- <param name="X-Auth-Token" style="header" type="xsd:string" required="true">
- <doc>You need a valid admin token for access.</doc>
- </param>
- <resource id="users" path="users">
- <resource id="userById" path="{userId}">
- <param name="userId" style="template" type="xsd:string"/>
- <resource id="user-RAX-KSQA" path="RAX-KSQA">
- <resource id="secretqa" path="secretqa">
- <method href="#getUserSecretQA"/>
- <method href="#updateUserSecretQA"/>
- </resource>
- </resource>
- </resource>
- </resource>
- </resource>
- </resources>
-
- <method name="GET" id="getUserSecretQA">
- <doc xml:lang="EN" title="Get User SecretQA">
- <p xmlns="http://www.w3.org/1999/xhtml">Gets a User secret Question and Answer.</p>
- </doc>
- <response status="200 203">
- <representation mediaType="application/xml" element="RAX-KSQA:secretQA">
- <doc xml:lang="EN">
- <xsdxt:code href="samples/RAX-KSQA-secretQA.xml"/>
- </doc>
- </representation>
- <representation mediaType="application/json">
- <doc xml:lang="EN">
- <xsdxt:code href="samples/RAX-KSQA-secretQA.json"/>
- </doc>
- </representation>
- </response>
- &commonFaults;
- &getFaults;
- </method>
- <method name="PUT" id="updateUserSecretQA">
- <doc xml:lang="EN" title="Update User SecretQA">
- <p xmlns="http://www.w3.org/1999/xhtml">Updates a User secret Question and Answer.</p>
- </doc>
- <request>
- <representation mediaType="application/xml" element="RAX-KSQA:secretQA">
- <doc xml:lang="EN">
- <xsdxt:code href="samples/RAX-KSQA-secretQA.xml"/>
- </doc>
- </representation>
- <representation mediaType="application/json">
- <doc xml:lang="EN">
- <xsdxt:code href="samples/RAX-KSQA-secretQA.json"/>
- </doc>
- </representation>
- </request>
- <response status="200">
- <representation mediaType="application/xml" element="RAX-KSQA:secretQA">
- <doc xml:lang="EN">
- <xsdxt:code href="samples/RAX-KSQA-secretQA.xml"/>
- </doc>
- </representation>
- <representation mediaType="application/json">
- <doc xml:lang="EN">
- <xsdxt:code href="samples/RAX-KSQA-secretQA.json"/>
- </doc>
- </representation>
- </response>
- &commonFaults;
- &postPutFaults;
- </method>
- </application>
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- (C) 2011 OpenStack LLC., All Rights Reserved -->
+<!--*******************************************************-->
+<!-- Import Common XML Entities -->
+<!-- -->
+<!-- You can resolve the entites with xmllint -->
+<!-- -->
+<!-- xmllint -noent RAX-KSQA-admin.wadl -->
+<!--*******************************************************-->
+<!DOCTYPE application [
+<!ENTITY % common SYSTEM "common.ent">
+%common;
+]>
+<application xmlns="http://wadl.dev.java.net/2009/02"
+ xmlns:identity="http://docs.openstack.org/identity/api/v2.0"
+ xmlns:RAX-KSQA="http://docs.openstack.org/identity/api/ext/RAX-KSQA/v1.0"
+ xmlns:capi="http://docs.openstack.oapi/v1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsdxt="http://docs.rackspacecloud.com/xsd-ext/v1.0"
+ xsi:schemaLocation="http://docs.openstack.org/identity/api/v2.0 xsd/api.xsd
+ http://docs.openstack.oapi/v1.0 xsd/api-common.xsd
+ http://wadl.dev.java.net/2009/02 http://www.w3.org/Submission/wadl/wadl.xsd
+ http://docs.openstack.org/identity/api/ext/RAX-KSQA/v1.0 xsd/RAX-KSQA-secretQA.xsd
+ ">
+
+ <grammars>
+ <include href="xsd/api.xsd"/>
+ <include href="xsd/api-common.xsd"/>
+ <include href="xsd/RAX-KSQA-secretQA.xsd"/>
+ </grammars>
+ <!--*******************************************************-->
+ <!-- All Resources -->
+ <!--*******************************************************-->
+
+ <!-- We should use SSL in production -->
+ <resources base="http://localhost:35357">
+ <resource id="version" path="v2.0">
+ <param name="X-Auth-Token" style="header" type="xsd:string" required="true">
+ <doc>You need a valid admin token for access.</doc>
+ </param>
+ <resource id="users" path="users">
+ <resource id="userById" path="{userId}">
+ <param name="userId" style="template" type="xsd:string"/>
+ <resource id="user-RAX-KSQA" path="RAX-KSQA">
+ <resource id="secretqa" path="secretqa">
+ <method href="#getUserSecretQA"/>
+ <method href="#updateUserSecretQA"/>
+ </resource>
+ </resource>
+ </resource>
+ </resource>
+ </resource>
+ </resources>
+
+ <method name="GET" id="getUserSecretQA">
+ <doc xml:lang="EN" title="Get User SecretQA">
+ <p xmlns="http://www.w3.org/1999/xhtml">Gets a User secret Question and Answer.</p>
+ </doc>
+ <response status="200 203">
+ <representation mediaType="application/xml" element="RAX-KSQA:secretQA">
+ <doc xml:lang="EN">
+ <xsdxt:code href="samples/RAX-KSQA-secretQA.xml"/>
+ </doc>
+ </representation>
+ <representation mediaType="application/json">
+ <doc xml:lang="EN">
+ <xsdxt:code href="samples/RAX-KSQA-secretQA.json"/>
+ </doc>
+ </representation>
+ </response>
+ &commonFaults;
+ &getFaults;
+ </method>
+ <method name="PUT" id="updateUserSecretQA">
+ <doc xml:lang="EN" title="Update User SecretQA">
+ <p xmlns="http://www.w3.org/1999/xhtml">Updates a User secret Question and Answer.</p>
+ </doc>
+ <request>
+ <representation mediaType="application/xml" element="RAX-KSQA:secretQA">
+ <doc xml:lang="EN">
+ <xsdxt:code href="samples/RAX-KSQA-secretQA.xml"/>
+ </doc>
+ </representation>
+ <representation mediaType="application/json">
+ <doc xml:lang="EN">
+ <xsdxt:code href="samples/RAX-KSQA-secretQA.json"/>
+ </doc>
+ </representation>
+ </request>
+ <response status="200">
+ <representation mediaType="application/xml" element="RAX-KSQA:secretQA">
+ <doc xml:lang="EN">
+ <xsdxt:code href="samples/RAX-KSQA-secretQA.xml"/>
+ </doc>
+ </representation>
+ <representation mediaType="application/json">
+ <doc xml:lang="EN">
+ <xsdxt:code href="samples/RAX-KSQA-secretQA.json"/>
+ </doc>
+ </representation>
+ </response>
+ &commonFaults;
+ &postPutFaults;
+ </method>
+ </application>
View
76 openstack-identity-api/src/docbkx/admin/OS-KSADM-admin.wadl
@@ -14,11 +14,11 @@
<application xmlns="http://wadl.dev.java.net/2009/02"
xmlns:identity="http://docs.openstack.org/identity/api/v2.0"
- xmlns:OS-KSADM="http://docs.openstack.org/identity/api/ext/OS-KSADM/v1.0"
+ xmlns:OS-KSADM="http://docs.openstack.org/identity/api/ext/OS-KSADM/v1.0"
xmlns:capi="http://docs.openstack.org/common/api/v1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xsdxt="http://docs.rackspacecloud.com/xsd-ext/v1.0"
+ xmlns:xsdxt="http://docs.rackspacecloud.com/xsd-ext/v1.0"
xsi:schemaLocation="http://docs.openstack.org/identity/api/v2.0 ../common/xsd/api.xsd
http://docs.openstack.org/common/api/v1.0 ../common/xsd/api-common.xsd
http://wadl.dev.java.net/2009/02 http://www.w3.org/Submission/wadl/wadl.xsd
@@ -39,7 +39,7 @@
<resource id="version" path="v2.0">
<param name="X-Auth-Token" style="header" type="xsd:string" required="true">
<doc>You need a valid admin token for access.</doc>
- </param>
+ </param>
<resource id="users" path="users">
<method href="#listUsers"/>
<method href="#addUser"/>
@@ -57,12 +57,12 @@
</resource>
</resource>
</resource>
-
+
<resource id="user-OS-KSADM" path="OS-KSADM">
<resource id="enabled" path="enabled">
<method href="#setUserEnabled"/>
</resource>
-
+
<resource id="userCredentials" path="credentials">
<method href="#addUserCredential"/>
<method href="#listCredentials"/>
@@ -213,12 +213,12 @@
&commonFaults;
&getFaults;
</method>
-
+
<method name="GET" id="listUsersForTenant">
<doc xml:lang="EN" title="List users for a Tenant.">
<p xmlns="http://www.w3.org/1999/xhtml" class="shortdesc">Lists all the users for a tenant.</p>
<p xmlns="http://www.w3.org/1999/xhtml">Lists all the users for a tenant.</p>
-
+
</doc>
<request>
<param name="marker" style="query" required="false" type="xsd:string"/>
@@ -239,7 +239,7 @@
&commonFaults;
&getFaults;
</method>
-
+
<method name="PUT" id="addRolesToUserOnTenant">
<doc xml:lang="EN" title="Add roles to a user on a tenant.">
<p xmlns="http://www.w3.org/1999/xhtml">Adds a specific role to a user for a tenant.</p>
@@ -248,7 +248,7 @@
&commonFaults;
&postPutFaults;
&getFaults;
- </method>
+ </method>
<method name="DELETE" id="deleteRoleFromUserOnTenant">
<doc xml:lang="EN" title="Delete roles from a user on tenant.">
@@ -257,13 +257,13 @@
<response status="204"/>
&commonFaults;
&getFaults;
- </method>
-
+ </method>
+
<!--User Operations-->
<method name="GET" id="listUsers">
<doc xml:lang="EN" title="List users">
<p xmlns="http://www.w3.org/1999/xhtml">List users.</p>
-
+
</doc>
<response status="200 203">
<representation mediaType="application/xml" element="identity:userss">
@@ -280,8 +280,8 @@
&commonFaults;
&getFaults;
</method>
-
-
+
+
<method name="POST" id="addUser">
<doc xml:lang="EN" title="Add user">
<p xmlns="http://www.w3.org/1999/xhtml">Adds a user.</p>
@@ -314,7 +314,7 @@
&getFaults;
&postPutFaults;
</method>
-
+
<method name="POST" id="updateUser">
<doc xml:lang="EN" title="Update user">
<p xmlns="http://www.w3.org/1999/xhtml">Update a user.</p>
@@ -347,7 +347,7 @@
&postPutFaults;
&getFaults;
</method>
-
+
<method name="DELETE" id="deleteUser">
<doc xml:lang="EN" title="Delete user">
<p xmlns="http://www.w3.org/1999/xhtml">Delete a user.</p>
@@ -356,12 +356,12 @@
&commonFaults;
&getFaults;
</method>
-
+
<method name="PUT" id="setUserEnabled">
<doc xml:lang="EN" title="Set user enabled.">
<p xmlns="http://www.w3.org/1999/xhtml">Enable user.</p>
-
-
+
+
</doc>
<request>
<representation mediaType="application/xml" element="identity:user">
@@ -401,18 +401,18 @@
&commonFaults;
&postPutFaults;
&getFaults;
- </method>
-
+ </method>
+
<method name="DELETE" id="deleteUserRole">
<doc xml:lang="EN" title="Delete Global Roles on User.">
<p xmlns="http://www.w3.org/1999/xhtml">Deletes a specific global role from a user.</p>
</doc>
<response status="204"/>
&commonFaults;
&getFaults;
- </method>
-
-
+ </method>
+
+
<!-- User Credentials-->
<method name="POST" id="addUserCredential">
<doc xml:lang="EN" title="Add user Credential.">
@@ -450,7 +450,7 @@
<method name="GET" id="listCredentials">
<doc xml:lang="EN" title="List Credentials">
<p xmlns="http://www.w3.org/1999/xhtml">List credentials.</p>
-
+
</doc>
<request>
<param name="marker" style="query" required="false" type="xsd:string"/>
@@ -471,11 +471,11 @@
&commonFaults;
&getFaults;
</method>
-
+
<method name="GET" id="listCredentialsByType">
<doc xml:lang="EN" title="List Credentials by type">
<p xmlns="http://www.w3.org/1999/xhtml">List credentials by type.</p>
-
+
</doc>
<request>
<param name="marker" style="query" required="false" type="xsd:string"/>
@@ -495,12 +495,12 @@
</response>
&commonFaults;
&getFaults;
- </method>
+ </method>
<method name="POST" id="updateUserCredential">
<doc xml:lang="EN" title="Update user credential">
<p xmlns="http://www.w3.org/1999/xhtml">Update credentials.</p>
-
+
</doc>
<request>
<representation mediaType="application/xml" element="identity:credential">
@@ -530,7 +530,7 @@
&postPutFaults;
&getFaults;
</method>
-
+
<method name="DELETE" id="deleteUserCredential">
<doc xml:lang="EN" title="Delete user credential">
<p xmlns="http://www.w3.org/1999/xhtml">Delete User credentials.</p>
@@ -540,11 +540,11 @@
&postPutFaults;
&getFaults;
</method>
-
+
<method name="GET" id="getUserCredential">
<doc xml:lang="EN" title="Get user Credentials">
<p xmlns="http://www.w3.org/1999/xhtml">Get user credentials.</p>
-
+
</doc>
<response status="200 203">
<representation mediaType="application/xml" element="identity:credential">
@@ -561,12 +561,12 @@
&commonFaults;
&getFaults;
</method>
-
+
<!--Roles-->
<method name="GET" id="listRoles">
<doc xml:lang="EN" title="List Roles">
<p xmlns="http://www.w3.org/1999/xhtml">List roles.</p>
-
+
</doc>
<request>
<param name="serviceId" style="query" required="false" type="xsd:string"/>
@@ -592,7 +592,7 @@
<method name="POST" id="addRole">
<doc xml:lang="EN" title="Add Role">
<p xmlns="http://www.w3.org/1999/xhtml">Add a Role.</p>
- </doc>
+ </doc>
<request>
<representation mediaType="application/xml" element="identity:role">
<doc xml:lang="EN">
@@ -673,7 +673,7 @@
&postPutFaults;
&getFaults;
</method>
-
+
<method name="DELETE" id="deleteRole">
<doc xml:lang="EN" title="Delete Role">
<p xmlns="http://www.w3.org/1999/xhtml">Delete a role.</p>
@@ -751,7 +751,7 @@
<method name="POST" id="addService">
<doc xml:lang="EN" title="Add Service">
<p xmlns="http://www.w3.org/1999/xhtml">Add a service.</p>
- </doc>
+ </doc>
<request>
<representation mediaType="application/xml" element="OS-KSADM:service">
<doc xml:lang="EN">
@@ -785,7 +785,7 @@
<method name="DELETE" id="deleteService">
<doc xml:lang="EN" title="Delete Service">
<p xmlns="http://www.w3.org/1999/xhtml">Delete a service.</p>
- </doc>
+ </doc>
<response status="204"/>
&commonFaults;
&getFaults;
View
46 openstack-identity-api/src/docbkx/admin/OS-KSCATALOG-admin.wadl
@@ -42,7 +42,7 @@
<param name="X-Auth-Token" style="header" type="xsd:string" required="true"/>
<resource id="tenantId" path="{tenantId}">
<param name="tenantId" style="template" type="xsd:string"/>
- <resource id="endpoints-OS-KSCATALOG" path="OS-KSCATALOG">
+ <resource id="endpoints-OS-KSCATALOG" path="OS-KSCATALOG">
<resource id="endpoints" path="endpoints">
<method href="#listEndpoints"/>
<method href="#addEndpoint"/>
@@ -53,9 +53,9 @@
</resource>
</resource>
</resource>
- </resource>
+ </resource>
</resource>
-
+
<resource id="role-service-OS-KSCATALOG" path="OS-KSCATALOG">
<resource id="endpointTemplates" path="endpointTemplates">
<param name="X-Auth-Token" style="header" type="xsd:string" required="true"/>
@@ -77,12 +77,12 @@
<!--*******************************************************-->
<!-- EndPoint Templates -->
-
+
<method name="GET" id="listEndpointTemplates">
<doc xml:lang="EN" title="List Endpoint Templates">
<p xmlns="http://www.w3.org/1999/xhtml">List Endpoint Templates.</p>
-
- </doc>
+
+ </doc>
<request>
<param name="serviceId" style="query" required="false" type="xsd:string"/>
</request>
@@ -101,11 +101,11 @@
&commonFaults;
&getFaults;
</method>
-
+
<method name="GET" id="getEndpointTemplate">
<doc xml:lang="EN" title="Get Endpoint Template">
<p xmlns="http://www.w3.org/1999/xhtml">Get Endpoint Template.</p>
-
+
</doc>
<response status="200 203">
<representation mediaType="application/xml" element="OS-KSCATALOG:endpointTemplate">
@@ -122,12 +122,12 @@
&commonFaults;
&getFaults;
</method>
-
+
<method name="POST" id="addEndpointTemplate">
<doc xml:lang="EN" title="Add Endpoint Template">
<p xmlns="http://www.w3.org/1999/xhtml">Add Endpoint Template.</p>
-
-
+
+
</doc>
<request>
<representation mediaType="application/xml" element="OS-KSCATALOG:endpointTemplate">
@@ -159,21 +159,21 @@
&getFaults;
&postPutFaults;
</method>
-
+
<method name="DELETE" id="deleteEndpointTemplate">
<doc xml:lang="EN" title="Delete Endpoint Template.">
<p xmlns="http://www.w3.org/1999/xhtml">Delete a Endpoint Template.</p>
- </doc>
+ </doc>
<response status="204"/>
&commonFaults;
&getFaults;
</method>
-
+
<method name="POST" id="addEndpoint">
<doc xml:lang="EN" title="Add Endpoint">
<p xmlns="http://www.w3.org/1999/xhtml">Add Endpoint to a tenant.</p>
-
-
+
+
</doc>
<request>
<representation mediaType="application/xml" element="OS-KSCATALOG:endpointTemplate">
@@ -207,12 +207,12 @@
&getFaults;
&postPutFaults;
</method>
-
+
<method name="GET" id="listEndpoints">
<doc xml:lang="EN" title="List Endpoints">
<p xmlns="http://www.w3.org/1999/xhtml">List Endpoints of a Tenant.</p>
-
- </doc>
+
+ </doc>
<response status="200 203">
<representation mediaType="application/xml" element="identity:endpoints">
<doc xml:lang="EN">
@@ -228,11 +228,11 @@
&commonFaults;
&getFaults;
</method>
-
+
<method name="GET" id="getEndpoint">
<doc xml:lang="EN" title="Get Endpoint">
<p xmlns="http://www.w3.org/1999/xhtml">Get Endpoint of a Tenant.</p>
-
+
</doc>
<response status="200 203">
<representation mediaType="application/xml" element="identity:endpoint">
@@ -249,11 +249,11 @@
&commonFaults;
&getFaults;
</method>
-
+
<method name="DELETE" id="deleteEndpoint">
<doc xml:lang="EN" title="Delete Endpoint.">
<p xmlns="http://www.w3.org/1999/xhtml">Delete a Endpoint from a Tenant.</p>
- </doc>
+ </doc>
<response status="204"/>
&commonFaults;
&getFaults;
View
18 openstack-identity-api/src/docbkx/admin/OS-KSEC2-admin.wadl
@@ -14,7 +14,7 @@
<application xmlns="http://wadl.dev.java.net/2009/02"
xmlns:identity="http://docs.openstack.org/identity/api/v2.0"
- xmlns:OS-KSEC2="http://docs.openstack.org/identity/api/ext/OS-KSEC2/v1.0"
+ xmlns:OS-KSEC2="http://docs.openstack.org/identity/api/ext/OS-KSEC2/v1.0"
xmlns:capi="http://docs.openstack.org/common/api/v1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
@@ -39,7 +39,7 @@
<resource id="version" path="v2.0">
<param name="X-Auth-Token" style="header" type="xsd:string" required="true">
<doc>You need a valid admin token for access.</doc>
- </param>
+ </param>
<resource id="users" path="users">
<resource id="userById" path="{userId}">
<param name="userId" style="template" required="true" type="xsd:string"/>
@@ -54,7 +54,7 @@
</resource>
</resource>
</resource>
- </resource>
+ </resource>
</resource>
</resource>
</resources>
@@ -63,8 +63,8 @@
<!-- All Methods -->
<!--*******************************************************-->
-
-
+
+
<!-- User Credentials-->
<method name="POST" id="addUserCredential">
<doc xml:lang="EN" title="Add user Credential.">
@@ -122,7 +122,7 @@
&commonFaults;
&getFaults;
</method>
-
+
<method name="GET" id="listCredentialsByType">
<doc xml:lang="EN" title="List Credentials by type">
<p xmlns="http://www.w3.org/1999/xhtml">List credentials by type.</p>
@@ -145,7 +145,7 @@
</response>
&commonFaults;
&getFaults;
- </method>
+ </method>
<method name="POST" id="updateUserCredential">
<doc xml:lang="EN" title="Update user credential">
@@ -179,7 +179,7 @@
&postPutFaults;
&getFaults;
</method>
-
+
<method name="DELETE" id="deleteUserCredential">
<doc xml:lang="EN" title="Delete user credential">
<p xmlns="http://www.w3.org/1999/xhtml">Delete User credentials.</p>
@@ -189,7 +189,7 @@
&postPutFaults;
&getFaults;
</method>
-
+
<method name="GET" id="getUserCredential">
<doc xml:lang="EN" title="Get user Credentials">
<p xmlns="http://www.w3.org/1999/xhtml">Get user credentials.</p>
View
18 openstack-identity-api/src/docbkx/admin/RAX-KSGRP-admin.wadl
@@ -13,17 +13,17 @@
]>
<application xmlns="http://wadl.dev.java.net/2009/02"
xmlns:identity="http://docs.openstack.org/identity/api/v2.0"
- xmlns:RAX-KSGRP="http://docs.openstack.org/identity/api/ext/RAX-KSGRP/v1.0"
+ xmlns:RAX-KSGRP="http://docs.openstack.org/identity/api/ext/RAX-KSGRP/v1.0"
xmlns:capi="http://docs.openstack.org/common/api/v1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xsdxt="http://docs.rackspacecloud.com/xsd-ext/v1.0"
+ xmlns:xsdxt="http://docs.rackspacecloud.com/xsd-ext/v1.0"
xsi:schemaLocation="http://docs.openstack.org/identity/api/v2.0 ../common/xsd/api.xsd
http://docs.openstack.org/common/api/v1.0 ../common/xsd/api-common.xsd
http://wadl.dev.java.net/2009/02 http://www.w3.org/Submission/wadl/wadl.xsd
http://docs.openstack.org/identity/api/ext/RAX-KSGRP/v1.0 ../common/xsd/RAX-KSGRP-groups.xsd
">
-
+
<grammars>
<include href="../common/xsd/api.xsd"/>
<include href="../common/xsd/api-common.xsd"/>
@@ -32,13 +32,13 @@
<!--*******************************************************-->
<!-- All Resources -->
<!--*******************************************************-->
-
+
<!-- We should use SSL in production -->
<resources base="http://localhost:35357">
<resource id="version" path="v2.0">
<param name="X-Auth-Token" style="header" type="xsd:string" required="true">
<doc>You need a valid admin token for access.</doc>
- </param>
+ </param>
<resource id="users" path="users">
<resource id="userById" path="{userId}">
<param name="userId" style="template" type="xsd:string"/>
@@ -49,11 +49,11 @@
</resource>
</resource>
</resources>
-
+
<method name="GET" id="listUserGroups">
<doc xml:lang="EN" title="List Groups for a User">
<p xmlns="http://www.w3.org/1999/xhtml">List all the groups for a user.</p>
-
+
</doc>
<response status="200 203">
<representation mediaType="application/xml" element="RAX-KSGRP:groups">
@@ -70,5 +70,5 @@
&commonFaults;
&getFaults;
</method>
- </application>
-
+ </application>
+
View
16 openstack-identity-api/src/docbkx/admin/RAX-KSKEY-admin.wadl
@@ -14,7 +14,7 @@
<application xmlns="http://wadl.dev.java.net/2009/02"
xmlns:identity="http://docs.openstack.org/identity/api/v2.0"
- xmlns:RAX-KSKEY="http://docs.openstack.org/identity/api/ext/RAX-KSKEY/v1.0"
+ xmlns:RAX-KSKEY="http://docs.openstack.org/identity/api/ext/RAX-KSKEY/v1.0"
xmlns:capi="http://docs.openstack.org/common/api/v1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
@@ -39,7 +39,7 @@
<resource id="version" path="v2.0">
<param name="X-Auth-Token" style="header" type="xsd:string" required="true">
<doc>You need a valid admin token for access.</doc>
- </param>
+ </param>
<resource id="users" path="users">
<resource id="userById" path="{userId}">
<param name="userId" style="template" required="true" type="xsd:string"/>
@@ -62,7 +62,7 @@
<!--*******************************************************-->
<!-- All Methods -->
<!--*******************************************************-->
-
+
<!-- User Credentials-->
<method name="POST" id="addUserCredential">
<doc xml:lang="EN" title="Add user Credential.">
@@ -120,11 +120,11 @@
&commonFaults;
&getFaults;
</method>
-
+
<method name="GET" id="listCredentialsByType">
<doc xml:lang="EN" title="List Credentials by type">
<p xmlns="http://www.w3.org/1999/xhtml">List credentials by type.</p>
-
+
</doc>
<request>
<param name="marker" style="query" required="false" type="xsd:string"/>
@@ -144,7 +144,7 @@
</response>
&commonFaults;
&getFaults;
- </method>
+ </method>
<method name="POST" id="updateUserCredential">
<doc xml:lang="EN" title="Update user credential">
@@ -178,7 +178,7 @@
&postPutFaults;
&getFaults;
</method>
-
+
<method name="DELETE" id="deleteUserCredential">
<doc xml:lang="EN" title="Delete user credential">
<p xmlns="http://www.w3.org/1999/xhtml">Delete User credentials.</p>
@@ -188,7 +188,7 @@
&postPutFaults;
&getFaults;
</method>
-
+
<method name="GET" id="getUserCredential">
<doc xml:lang="EN" title="Get user Credentials">
<p xmlns="http://www.w3.org/1999/xhtml">Get user credentials.</p>
View
212 openstack-identity-api/src/docbkx/admin/RAX-KSQA-admin.wadl
@@ -1,106 +1,106 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (C) 2011 OpenStack LLC., All Rights Reserved -->
-<!--*******************************************************-->
-<!-- Import Common XML Entities -->
-<!-- -->
-<!-- You can resolve the entites with xmllint -->
-<!-- -->
-<!-- xmllint -noent RAX-KSQA-admin.wadl -->
-<!--*******************************************************-->
-<!DOCTYPE application [
-<!ENTITY % common SYSTEM "../common/common.ent">
-%common;
-]>
-<application xmlns="http://wadl.dev.java.net/2009/02"
- xmlns:identity="http://docs.openstack.org/identity/api/v2.0"
- xmlns:RAX-KSQA="http://docs.openstack.org/identity/api/ext/RAX-KSQA/v1.0"
- xmlns:capi="http://docs.openstack.org/common/api/v1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xsdxt="http://docs.rackspacecloud.com/xsd-ext/v1.0"
- xsi:schemaLocation="http://docs.openstack.org/identity/api/v2.0 ../common/xsd/api.xsd
- http://docs.openstack.org/common/api/v1.0 ../common/xsd/api-common.xsd
- http://wadl.dev.java.net/2009/02 http://www.w3.org/Submission/wadl/wadl.xsd
- http://docs.openstack.org/identity/api/ext/RAX-KSQA/v1.0 ../common/xsd/RAX-KSQA-secretQA.xsd
- ">
-
- <grammars>
- <include href="../common/xsd/api.xsd"/>
- <include href="../common/xsd/api-common.xsd"/>
- <include href="../common/xsd/RAX-KSQA-secretQA.xsd"/>
- </grammars>
- <!--*******************************************************-->
- <!-- All Resources -->
- <!--*******************************************************-->
-
- <!-- We should use SSL in production -->
- <resources base="http://localhost:35357">
- <resource id="version" path="v2.0">
- <param name="X-Auth-Token" style="header" type="xsd:string" required="true">
- <doc>You need a valid admin token for access.</doc>
- </param>
- <resource id="users" path="users">
- <resource id="userById" path="{userId}">
- <param name="userId" style="template" type="xsd:string"/>
- <resource id="user-RAX-KSQA" path="RAX-KSQA">
- <resource id="secretqa" path="secretqa">
- <method href="#getUserSecretQA"/>
- <method href="#updateUserSecretQA"/>
- </resource>
- </resource>
- </resource>
- </resource>
- </resource>
- </resources>
-
- <method name="GET" id="getUserSecretQA">
- <doc xml:lang="EN" title="Get User SecretQA">
- <p xmlns="http://www.w3.org/1999/xhtml">Gets a User secret Question and Answer.</p>
- </doc>
- <response status="200 203">
- <representation mediaType="application/xml" element="RAX-KSQA:secretQA">
- <doc xml:lang="EN">
- <xsdxt:code href="../common/samples/RAX-KSQA-secretQA.xml"/>
- </doc>
- </representation>
- <representation mediaType="application/json">
- <doc xml:lang="EN">
- <xsdxt:code href="../common/samples/RAX-KSQA-secretQA.json"/>
- </doc>
- </representation>
- </response>
- &commonFaults;
- &getFaults;
- </method>
- <method name="PUT" id="updateUserSecretQA">
- <doc xml:lang="EN" title="Update User SecretQA">
- <p xmlns="http://www.w3.org/1999/xhtml">Updates a User secret Question and Answer.</p>
- </doc>
- <request>
- <representation mediaType="application/xml" element="RAX-KSQA:secretQA">
- <doc xml:lang="EN">
- <xsdxt:code href="../common/samples/RAX-KSQA-secretQA.xml"/>
- </doc>
- </representation>
- <representation mediaType="application/json">
- <doc xml:lang="EN">
- <xsdxt:code href="../common/samples/RAX-KSQA-secretQA.json"/>
- </doc>
- </representation>
- </request>
- <response status="200">
- <representation mediaType="application/xml" element="RAX-KSQA:secretQA">
- <doc xml:lang="EN">
- <xsdxt:code href="../common/samples/RAX-KSQA-secretQA.xml"/>
- </doc>
- </representation>
- <representation mediaType="application/json">
- <doc xml:lang="EN">
- <xsdxt:code href="../common/samples/RAX-KSQA-secretQA.json"/>
- </doc>
- </representation>
- </response>
- &commonFaults;
- &postPutFaults;
- </method>
- </application>
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- (C) 2011 OpenStack LLC., All Rights Reserved -->
+<!--*******************************************************-->
+<!-- Import Common XML Entities -->
+<!-- -->
+<!-- You can resolve the entites with xmllint -->
+<!-- -->
+<!-- xmllint -noent RAX-KSQA-admin.wadl -->
+<!--*******************************************************-->
+<!DOCTYPE application [
+<!ENTITY % common SYSTEM "../common/common.ent">
+%common;
+]>
+<application xmlns="http://wadl.dev.java.net/2009/02"
+ xmlns:identity="http://docs.openstack.org/identity/api/v2.0"
+ xmlns:RAX-KSQA="http://docs.openstack.org/identity/api/ext/RAX-KSQA/v1.0"
+ xmlns:capi="http://docs.openstack.org/common/api/v1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsdxt="http://docs.rackspacecloud.com/xsd-ext/v1.0"
+ xsi:schemaLocation="http://docs.openstack.org/identity/api/v2.0 ../common/xsd/api.xsd
+ http://docs.openstack.org/common/api/v1.0 ../common/xsd/api-common.xsd
+ http://wadl.dev.java.net/2009/02 http://www.w3.org/Submission/wadl/wadl.xsd
+ http://docs.openstack.org/identity/api/ext/RAX-KSQA/v1.0 ../common/xsd/RAX-KSQA-secretQA.xsd
+ ">
+
+ <grammars>
+ <include href="../common/xsd/api.xsd"/>
+ <include href="../common/xsd/api-common.xsd"/>
+ <include href="../common/xsd/RAX-KSQA-secretQA.xsd"/>
+ </grammars>
+ <!--*******************************************************-->
+ <!-- All Resources -->
+ <!--*******************************************************-->
+
+ <!-- We should use SSL in production -->
+ <resources base="http://localhost:35357">
+ <resource id="version" path="v2.0">
+ <param name="X-Auth-Token" style="header" type="xsd:string" required="true">
+ <doc>You need a valid admin token for access.</doc>
+ </param>
+ <resource id="users" path="users">
+ <resource id="userById" path="{userId}">
+ <param name="userId" style="template" type="xsd:string"/>
+ <resource id="user-RAX-KSQA" path="RAX-KSQA">
+ <resource id="secretqa" path="secretqa">
+ <method href="#getUserSecretQA"/>
+ <method href="#updateUserSecretQA"/>
+ </resource>
+ </resource>
+ </resource>
+ </resource>
+ </resource>
+ </resources>
+
+ <method name="GET" id="getUserSecretQA">
+ <doc xml:lang="EN" title="Get User SecretQA">
+ <p xmlns="http://www.w3.org/1999/xhtml">Gets a User secret Question and Answer.</p>
+ </doc>
+ <response status="200 203">
+ <representation mediaType="application/xml" element="RAX-KSQA:secretQA">
+ <doc xml:lang="EN">
+ <xsdxt:code href="../common/samples/RAX-KSQA-secretQA.xml"/>
+ </doc>
+ </representation>
+ <representation mediaType="application/json">
+ <doc xml:lang="EN">
+ <xsdxt:code href="../common/samples/RAX-KSQA-secretQA.json"/>
+ </doc>
+ </representation>
+ </response>
+ &commonFaults;
+ &getFaults;
+ </method>
+ <method name="PUT" id="updateUserSecretQA">
+ <doc xml:lang="EN" title="Update User SecretQA">
+ <p xmlns="http://www.w3.org/1999/xhtml">Updates a User secret Question and Answer.</p>
+ </doc>
+ <request>
+ <representation mediaType="application/xml" element="RAX-KSQA:secretQA">
+ <doc xml:lang="EN">
+ <xsdxt:code href="../common/samples/RAX-KSQA-secretQA.xml"/>
+ </doc>
+ </representation>
+ <representation mediaType="application/json">
+ <doc xml:lang="EN">
+ <xsdxt:code href="../common/samples/RAX-KSQA-secretQA.json"/>
+ </doc>
+ </representation>
+ </request>
+ <response status="200">
+ <representation mediaType="application/xml" element="RAX-KSQA:secretQA">
+ <doc xml:lang="EN">
+ <xsdxt:code href="../common/samples/RAX-KSQA-secretQA.xml"/>
+ </doc>
+ </representation>
+ <representation mediaType="application/json">
+ <doc xml:lang="EN">
+ <xsdxt:code href="../common/samples/RAX-KSQA-secretQA.json"/>
+ </doc>
+ </representation>
+ </response>
+ &commonFaults;
+ &postPutFaults;
+ </method>
+ </application>
View
20 openstack-identity-api/src/docbkx/admin/identity-admin.wadl
@@ -16,7 +16,7 @@
xmlns:capi="http://docs.openstack.org/common/api/v1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xsdxt="http://docs.rackspacecloud.com/xsd-ext/v1.0"
+ xmlns:xsdxt="http://docs.rackspacecloud.com/xsd-ext/v1.0"
xsi:schemaLocation="http://docs.openstack.org/identity/api/v2.0 ../common/xsd/api.xsd
http://docs.openstack.org/common/api/v1.0 ../common/xsd/api-common.xsd
http://wadl.dev.java.net/2009/02 http://www.w3.org/Submission/wadl/wadl.xsd
@@ -64,7 +64,7 @@
<resource id="users" path="users">
<param name="X-Auth-Token" style="header" type="xsd:string" required="true">
<doc>You need a valid admin token for access.</doc>
- </param>
+ </param>
<method href="#getUserByName"/>
<resource id="userid" path="{user_id}">
<param name="user_id" style="template" type="xsd:string" required="true"/>
@@ -107,11 +107,11 @@
<!--*******************************************************-->
<!-- Resource Types -->
<!--*******************************************************-->
-
+
<resource_type id="VersionDetails">
<method href="#getVersionInfo"/>
</resource_type>
-
+
<resource_type id="ExtensionList">
<doc xml:lang="EN" title="Extension List">
<p xmlns="http://www.w3.org/1999/xhtml">
@@ -120,7 +120,7 @@
</doc>
<method href="#listExtensions"/>
</resource_type>
-
+
<!--*******************************************************-->
<!-- All Methods -->
<!--*******************************************************-->
@@ -227,7 +227,7 @@
</representation>
<representation mediaType="application/json">
<doc>
- <xsdxt:code href="../common/samples/auth.json"/>
+ <xsdxt:code href="../common/samples/auth.json"/>
</doc>
</representation>
</response>
@@ -343,7 +343,7 @@
</doc>
<response status="200 203">
<representation mediaType="application/xml" element="identity:user">
- <doc>
+ <doc>
<xsdxt:code href="../common/samples/user.xml"/>
</doc>
</representation>
@@ -360,7 +360,7 @@
<doc xml:lang="EN" title="List User Global Roles">
<p xmlns="http://www.w3.org/1999/xhtml" class="shortdesc">
Returns global roles for a specific user (excludes tenant roles).
- </p>
+ </p>
<p xmlns="http://www.w3.org/1999/xhtml">Returns a list of global roles associated with a specific
user (excludes tenant roles).</p>
</doc>
@@ -390,7 +390,7 @@
<p xmlns="http://www.w3.org/1999/xhtml">
The operation returns a list of tenants which the supplied token provides
access to. This call must be authenticated, so a valid token must
- be passed in as a header.
+ be passed in as a header.
</p>
<xsdxt:samples>
<xsdxt:sample xmlns="http://docs.rackspace.com/api" title="Tenants Request with Auth Token">
@@ -483,7 +483,7 @@
&commonFaults;
&getFaults;
</method>
-
+
<method name="GET" id="listRolesForUserOnTenant">
<doc xml:lang="EN" title="List Roles for User on Tenant">
<p xmlns="http://www.w3.org/1999/xhtml">
View
1,076 openstack-identity-api/src/docbkx/common/js/shjs/sh_main.js
@@ -1,538 +1,538 @@
-/*
-SHJS - Syntax Highlighting in JavaScript
-Copyright (C) 2007, 2008 gnombat@users.sourceforge.net
-License: http://shjs.sourceforge.net/doc/gplv3.html
-*/
-
-if (! this.sh_languages) {
- this.sh_languages = {};
-}
-var sh_requests = {};
-
-function sh_isEmailAddress(url) {
- if (/^mailto:/.test(url)) {
- return false;
- }
- return url.indexOf('@') !== -1;
-}
-
-function sh_setHref(tags, numTags, inputString) {
- var url = inputString.substring(tags[numTags - 2].pos, tags[numTags - 1].pos);
- if (url.length >= 2 && url.charAt(0) === '<' && url.charAt(url.length - 1) === '>') {
- url = url.substr(1, url.length - 2);
- }
- if (sh_isEmailAddress(url)) {
- url = 'mailto:' + url;
- }
- tags[numTags - 2].node.href = url;
-}
-
-/*
-Konqueror has a bug where the regular expression /$/g will not match at the end
-of a line more than once:
-
- var regex = /$/g;
- var match;
-
- var line = '1234567890';
- regex.lastIndex = 10;
- match = regex.exec(line);
-
- var line2 = 'abcde';
- regex.lastIndex = 5;
- match = regex.exec(line2); // fails
-*/
-function sh_konquerorExec(s) {
- var result = [''];
- result.index = s.length;
- result.input = s;
- return result;
-}
-
-/**
-Highlights all elements containing source code in a text string. The return
-value is an array of objects, each representing an HTML start or end tag. Each
-object has a property named pos, which is an integer representing the text
-offset of the tag. Every start tag also has a property named node, which is the
-DOM element started by the tag. End tags do not have this property.
-@param inputString a text string
-@param language a language definition object
-@return an array of tag objects
-*/
-function sh_highlightString(inputString, language) {
- if (/Konqueror/.test(navigator.userAgent)) {
- if (! language.konquered) {
- for (var s = 0; s < language.length; s++) {
- for (var p = 0; p < language[s].length; p++) {
- var r = language[s][p][0];
- if (r.source === '$') {
- r.exec = sh_konquerorExec;
- }
- }
- }
- language.konquered = true;
- }
- }
-
- var a = document.createElement('a');
- var span = document.createElement('span');
-
- // the result
- var tags = [];
- var numTags = 0;
-
- // each element is a pattern object from language
- var patternStack = [];
-
- // the current position within inputString
- var pos = 0;
-
- // the name of the current style, or null if there is no current style
- var currentStyle = null;
-
- var output = function(s, style) {
- var length = s.length;
- // this is more than just an optimization - we don't want to output empty <span></span> elements
- if (length === 0) {
- return;
- }
- if (! style) {
- var stackLength = patternStack.length;
- if (stackLength !== 0) {
- var pattern = patternStack[stackLength - 1];
- // check whether this is a state or an environment
- if (! pattern[3]) {
- // it's not a state - it's an environment; use the style for this environment
- style = pattern[1];
- }
- }
- }
- if (currentStyle !== style) {
- if (currentStyle) {
- tags[numTags++] = {pos: pos};
- if (currentStyle === 'sh_url') {
- sh_setHref(tags, numTags, inputString);
- }
- }
- if (style) {
- var clone;
- if (style === 'sh_url') {
- clone = a.cloneNode(false);
- }
- else {
- clone = span.cloneNode(false);
- }
- clone.className = style;
- tags[numTags++] = {node: clone, pos: pos};
- }
- }
- pos += length;
- currentStyle = style;
- };
-
- var endOfLinePattern = /\r\n|\r|\n/g;
- endOfLinePattern.lastIndex = 0;
- var inputStringLength = inputString.length;
- while (pos < inputStringLength) {
- var start = pos;
- var end;
- var startOfNextLine;
- var endOfLineMatch = endOfLinePattern.exec(inputString);
- if (endOfLineMatch === null) {
- end = inputStringLength;
- startOfNextLine = inputStringLength;
- }
- else {
- end = endOfLineMatch.index;
- startOfNextLine = endOfLinePattern.lastIndex;
- }
-
- var line = inputString.substring(start, end);
-
- var matchCache = [];
- for (;;) {
- var posWithinLine = pos - start;
-
- var stateIndex;
- var stackLength = patternStack.length;
- if (stackLength === 0) {
- stateIndex = 0;
- }
- else {
- // get the next state
- stateIndex = patternStack[stackLength - 1][2];
- }
-
- var state = language[stateIndex];
- var numPatterns = state.length;
- var mc = matchCache[stateIndex];
- if (! mc) {
- mc = matchCache[stateIndex] = [];
- }
- var bestMatch = null;
- var bestPatternIndex = -1;
- for (var i = 0; i < numPatterns; i++) {
- var match;
- if (i < mc.length && (mc[i] === null || posWithinLine <= mc[i].index)) {
- match = mc[i];
- }
- else {
- var regex = state[i][0];
- regex.lastIndex = posWithinLine;
- match = regex.exec(line);
- mc[i] = match;
- }
- if (match !== null && (bestMatch === null || match.index < bestMatch.index)) {
- bestMatch = match;
- bestPatternIndex = i;
- if (match.index === posWithinLine) {
- break;
- }
- }
- }
-
- if (bestMatch === null) {
- output(line.substring(posWithinLine), null);
- break;
- }
- else {
- // got a match
- if (bestMatch.index > posWithinLine) {
- output(line.substring(posWithinLine, bestMatch.index), null);
- }
-
- var pattern = state[bestPatternIndex];
-
- var newStyle = pattern[1];
- var matchedString;
- if (newStyle instanceof Array) {
- for (var subexpression = 0; subexpression < newStyle.length; subexpression++) {
- matchedString = bestMatch[subexpression + 1];
- output(matchedString, newStyle[subexpression]);
- }
- }
- else {
- matchedString = bestMatch[0];
- output(matchedString, newStyle);
- }
-
- switch (pattern[2]) {
- case -1:
- // do nothing
- break;
- case -2:
- // exit
- patternStack.pop();
- break;
- case -3:
- // exitall
- patternStack.length = 0;
- break;
- default:
- // this was the start of a delimited pattern or a state/environment
- patternStack.push(pattern);
- break;
- }
- }
- }
-
- // end of the line
- if (currentStyle) {
- tags[numTags++] = {pos: pos};
- if (currentStyle === 'sh_url') {
- sh_setHref(tags, numTags, inputString);
- }
- currentStyle = null;
- }
- pos = startOfNextLine;
- }
-
- return tags;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// DOM-dependent functions
-
-function sh_getClasses(element) {
- var result = [];
- var htmlClass = element.className;
- if (htmlClass && htmlClass.length > 0) {
- var htmlClasses = htmlClass.split(' ');
- for (var i = 0; i < htmlClasses.length; i++) {
- if (htmlClasses[i].length > 0) {
- result.push(htmlClasses[i]);
- }
- }
- }
- return result;
-}
-
-function sh_addClass(element, name) {
- var htmlClasses = sh_getClasses(element);
- for (var i = 0; i < htmlClasses.length; i++) {
- if (name.toLowerCase() === htmlClasses[i].toLowerCase()) {
- return;
- }
- }
- htmlClasses.push(name);
- element.className = htmlClasses.join(' ');
-}
-
-/**
-Extracts the tags from an HTML DOM NodeList.
-@param nodeList a DOM NodeList
-@param result an object with text, tags and pos properties
-*/
-function sh_extractTagsFromNodeList(nodeList, result) {
- var length = nodeList.length;
- for (var i = 0; i < length; i++) {
- var node = nodeList.item(i);
- switch (node.nodeType) {
- case 1:
- if (node.nodeName.toLowerCase() === 'br') {
- var terminator;
- if (/MSIE/.test(navigator.userAgent)) {
- terminator = '\r';
- }
- else {
- terminator = '\n';
- }
- result.text.push(terminator);
- result.pos++;
- }
- else {
- result.tags.push({node: node.cloneNode(false), pos: result.pos});
- sh_extractTagsFromNodeList(node.childNodes, result);
- result.tags.push({pos: result.pos});
- }
- break;
- case 3:
- case 4:
- result.text.push(node.data);
- result.pos += node.length;
- break;
- }
- }
-}
-
-/**
-Extracts the tags from the text of an HTML element. The extracted tags will be
-returned as an array of tag objects. See sh_highlightString for the format of
-the tag objects.
-@param element a DOM element
-@param tags an empty array; the extracted tag objects will be returned in it
-@return the text of the element
-@see sh_highlightString
-*/
-function sh_extractTags(element, tags) {
- var result = {};
- result.text = [];
- result.tags = tags;
- result.pos = 0;
- sh_extractTagsFromNodeList(element.childNodes, result);
- return result.text.join('');
-}
-
-/**
-Merges the original tags from an element with the tags produced by highlighting.
-@param originalTags an array containing the original tags
-@param highlightTags an array containing the highlighting tags - these must not overlap
-@result an array containing the merged tags
-*/
-function sh_mergeTags(originalTags, highlightTags) {
- var numOriginalTags = originalTags.length;
- if (numOriginalTags === 0) {
- return highlightTags;
- }
-
- var numHighlightTags = highlightTags.length;
- if (numHighlightTags === 0) {
- return originalTags;
- }
-
- var result = [];
- var originalIndex = 0;
- var highlightIndex = 0;
-
- while (originalIndex < numOriginalTags && highlightIndex < numHighlightTags) {
- var originalTag = originalTags[originalIndex];
- var highlightTag = highlightTags[highlightIndex];
-
- if (originalTag.pos <= highlightTag.pos) {
- result.push(originalTag);
- originalIndex++;
- }
- else {
- result.push(highlightTag);
- if (highlightTags[highlightIndex + 1].pos <= originalTag.pos) {
- highlightIndex++;
- result.push(highlightTags[highlightIndex]);
- highlightIndex++;
- }
- else {
- // new end tag
- result.push({pos: originalTag.pos});
-
- // new start tag
- highlightTags[highlightIndex] = {node: highlightTag.node.cloneNode(false), pos: originalTag.pos};
- }
- }
- }
-
- while (originalIndex < numOriginalTags) {
- result.push(originalTags[originalIndex]);
- originalIndex++;
- }
-
- while (highlightIndex < numHighlightTags) {
- result.push(highlightTags[highlightIndex]);
- highlightIndex++;
- }
-
- return result;
-}
-
-/**
-Inserts tags into text.
-@param tags an array of tag objects
-@param text a string representing the text
-@return a DOM DocumentFragment representing the resulting HTML
-*/
-function sh_insertTags(tags, text) {
- var doc = document;
-
- var result = document.createDocumentFragment();
- var tagIndex = 0;
- var numTags = tags.length;
- var textPos = 0;
- var textLength = text.length;
- var currentNode = result;
-
- // output one tag or text node every iteration
- while (textPos < textLength || tagIndex < numTags) {
- var tag;
- var tagPos;
- if (tagIndex < numTags) {
- tag = tags[tagIndex];
- tagPos = tag.pos;
- }
- else {
- tagPos = textLength;
- }
-
- if (tagPos <= textPos) {
- // output the tag
- if (tag.node) {
- // start tag
- var newNode = tag.node;
- currentNode.appendChild(newNode);
- currentNode = newNode;
- }
- else {
- // end tag
- currentNode = currentNode.parentNode;
- }
- tagIndex++;
- }
- else {
- // output text
- currentNode.appendChild(doc.createTextNode(text.substring(textPos, tagPos)));
- textPos = tagPos;
- }
- }
-
- return result;
-}
-
-/**
-Highlights an element containing source code. Upon completion of this function,
-the element will have been placed in the "sh_sourceCode" class.
-@param element a DOM <pre> element containing the source code to be highlighted
-@param language a language definition object
-*/
-function sh_highlightElement(element, language) {
- sh_addClass(element, 'sh_sourceCode');
- var originalTags = [];
- var inputString = sh_extractTags(element, originalTags);
- var highlightTags = sh_highlightString(inputString, language);
- var tags = sh_mergeTags(originalTags, highlightTags);
- var documentFragment = sh_insertTags(tags, inputString);
- while (element.hasChildNodes()) {
- element.removeChild(element.firstChild);
- }
- element.appendChild(documentFragment);
-}
-
-function sh_getXMLHttpRequest() {
- if (window.ActiveXObject) {
- return new ActiveXObject('Msxml2.XMLHTTP');
- }
- else if (window.XMLHttpRequest) {
- return new XMLHttpRequest();
- }
- throw 'No XMLHttpRequest implementation available';
-}
-
-function sh_load(language, element, prefix, suffix) {
- if (language in sh_requests) {
- sh_requests[language].push(element);
- return;
- }
- sh_requests[language] = [element];
- var request = sh_getXMLHttpRequest();
- var url = prefix + 'sh_' + language + suffix;
- request.open('GET', url, true);
- request.onreadystatechange = function () {
- if (request.readyState === 4) {
- try {
- if (! request.status || request.status === 200) {
- eval(request.responseText);
- var elements = sh_requests[language];
- for (var i = 0; i < elements.length; i++) {
- sh_highlightElement(elements[i], sh_languages[language]);
- }
- }
- else {
- throw 'HTTP error: status ' + request.status;
- }
- }
- finally {
- request = null;
- }
- }
- };
- request.send(null);
-}
-
-/**
-Highlights all elements containing source code on the current page. Elements
-containing source code must be "pre" elements with a "class" attribute of
-"sh_LANGUAGE", where LANGUAGE is a valid language identifier; e.g., "sh_java"
-identifies the element as containing "java" language source code.
-*/
-function sh_highlightDocument(prefix, suffix) {
- var nodeList = document.getElementsByTagName('pre');
- for (var i = 0; i < nodeList.length; i++) {
- var element = nodeList.item(i);
- var htmlClasses = sh_getClasses(element);
- for (var j = 0; j < htmlClasses.length; j++) {
- var htmlClass = htmlClasses[j].toLowerCase();
- if (htmlClass === 'sh_sourcecode') {
- continue;
- }
- if (htmlClass.substr(0, 3) === 'sh_') {
- var language = htmlClass.substring(3);
- if (language in sh_languages) {
- sh_highlightElement(element, sh_languages[language]);
- }
- else if (typeof(prefix) === 'string' && typeof(suffix) === 'string') {
- sh_load(language, element, prefix, suffix);
- }
- else {
- throw 'Found <pre> element with class="' + htmlClass + '", but no such language exists';
- }
- break;
- }
- }
- }
-}
+/*
+SHJS - Syntax Highlighting in JavaScript
+Copyright (C) 2007, 2008 gnombat@users.sourceforge.net
+License: http://shjs.sourceforge.net/doc/gplv3.html
+*/
+
+if (! this.sh_languages) {
+ this.sh_languages = {};
+}
+var sh_requests = {};
+
+function sh_isEmailAddress(url) {
+ if (/^mailto:/.test(url)) {
+ return false;
+ }
+ return url.indexOf('@') !== -1;
+}
+
+function sh_setHref(tags, numTags, inputString) {
+ var url = inputString.substring(tags[numTags - 2].pos, tags[numTags - 1].pos);
+ if (url.length >= 2 && url.charAt(0) === '<' && url.charAt(url.length - 1) === '>') {
+ url = url.substr(1, url.length - 2);
+ }
+ if (sh_isEmailAddress(url)) {
+ url = 'mailto:' + url;
+ }
+ tags[numTags - 2].node.href = url;
+}
+
+/*
+Konqueror has a bug where the regular expression /$/g will not match at the end
+of a line more than once:
+
+ var regex = /$/g;
+ var match;
+
+ var line = '1234567890';
+ regex.lastIndex = 10;
+ match = regex.exec(line);
+
+ var line2 = 'abcde';
+ regex.lastIndex = 5;
+ match = regex.exec(line2); // fails
+*/
+function sh_konquerorExec(s) {
+ var result = [''];
+ result.index = s.length;
+ result.input = s;
+ return result;
+}
+
+/**
+Highlights all elements containing source code in a text string. The return
+value is an array of objects, each representing an HTML start or end tag. Each
+object has a property named pos, which is an integer representing the text
+offset of the tag. Every start tag also has a property named node, which is the
+DOM element started by the tag. End tags do not have this property.
+@param inputString a text string
+@param language a language definition object
+@return an array of tag objects
+*/
+function sh_highlightString(inputString, language) {
+ if (/Konqueror/.test(navigator.userAgent)) {
+ if (! language.konquered) {
+ for (var s = 0; s < language.length; s++) {
+ for (var p = 0; p < language[s].length; p++) {
+ var r = language[s][p][0];
+ if (r.source === '$') {
+ r.exec = sh_konquerorExec;
+ }
+ }
+ }
+ language.konquered = true;
+ }
+ }
+
+ var a = document.createElement('a');
+ var span = document.createElement('span');
+
+ // the result
+ var tags = [];
+ var numTags = 0;
+
+ // each element is a pattern object from language
+ var patternStack = [];
+
+ // the current position within inputString
+ var pos = 0;
+
+ // the name of the current style, or null if there is no current style
+ var currentStyle = null;
+
+ var output = function(s, style) {
+ var length = s.length;
+ // this is more than just an optimization - we don't want to output empty <span></span> elements
+ if (length === 0) {
+ return;
+ }
+ if (! style) {
+ var stackLength = patternStack.length;
+ if (stackLength !== 0) {
+ var pattern = patternStack[stackLength - 1];
+ // check whether this is a state or an environment
+ if (! pattern[3]) {
+ // it's not a state - it's an environment; use the style for this environment
+ style = pattern[1];
+ }
+ }
+ }
+ if (currentStyle !== style) {
+ if (currentStyle) {
+ tags[numTags++] = {pos: pos};
+ if (currentStyle === 'sh_url') {
+ sh_setHref(tags, numTags, inputString);
+ }
+ }
+ if (style) {
+ var clone;
+ if (style === 'sh_url') {
+ clone = a.cloneNode(false);
+ }
+ else {
+ clone = span.cloneNode(false);
+ }
+ clone.className = style;
+ tags[numTags++] = {node: clone, pos: pos};
+ }
+ }
+ pos += length;
+ currentStyle = style;
+ };
+
+ var endOfLinePattern = /\r\n|\r|\n/g;
+ endOfLinePattern.lastIndex = 0;
+ var inputStringLength = inputString.length;
+ while (pos < inputStringLength) {
+ var start = pos;
+ var end;
+ var startOfNextLine;
+ var endOfLineMatch = endOfLinePattern.exec(inputString);
+ if (endOfLineMatch === null) {
+ end = inputStringLength;
+ startOfNextLine = inputStringLength;
+ }
+ else {
+ end = endOfLineMatch.index;
+ startOfNextLine = endOfLinePattern.lastIndex;
+ }
+
+ var line = inputString.substring(start, end);
+
+ var matchCache = [];
+ for (;;) {
+ var posWithinLine = pos - start;
+
+ var stateIndex;
+ var stackLength = patternStack.length;
+ if (stackLength === 0) {
+ stateIndex = 0;
+ }
+ else {
+ // get the next state
+ stateIndex = patternStack[stackLength - 1][2];
+ }
+
+ var state = language[stateIndex];
+ var numPatterns = state.length;
+ var mc = matchCache[stateIndex];
+ if (! mc) {
+ mc = matchCache[stateIndex] = [];
+ }
+ var bestMatch = null;
+ var bestPatternIndex = -1;
+ for (var i = 0; i < numPatterns; i++) {
+ var match;
+ if (i < mc.length && (mc[i] === null || posWithinLine <= mc[i].index)) {
+ match = mc[i];
+ }
+ else {
+ var regex = state[i][0];
+ regex.lastIndex = posWithinLine;
+ match = regex.exec(line);
+ mc[i] = match;
+ }
+ if (match !== null && (bestMatch === null || match.index < bestMatch.index)) {
+ bestMatch = match;
+ bestPatternIndex = i;
+ if (match.index === posWithinLine) {
+ break;
+ }
+ }
+ }
+
+ if (bestMatch === null) {
+ output(line.substring(posWithinLine), null);
+ break;
+ }
+ else {
+ // got a match
+ if (bestMatch.index > posWithinLine) {
+ output(line.substring(posWithinLine, bestMatch.index), null);
+ }
+
+ var pattern = state[bestPatternIndex];
+
+ var newStyle = pattern[1];
+ var matchedString;
+ if (newStyle instanceof Array) {
+ for (var subexpression = 0; subexpression < newStyle.length; subexpression++) {
+ matchedString = bestMatch[subexpression + 1];
+ output(matchedString, newStyle[subexpression]);
+ }
+ }
+ else {
+ matchedString = bestMatch[0];
+ output(matchedString, newStyle);
+ }
+
+ switch (pattern[2]) {
+ case -1:
+ // do nothing
+ break;
+ case -2:
+ // exit
+ patternStack.pop();
+ break;
+ case -3:
+ // exitall
+ patternStack.length = 0;
+ break;
+ default:
+ // this was the start of a delimited pattern or a state/environment
+ patternStack.push(pattern);
+ break;
+ }
+ }
+ }
+
+ // end of the line
+ if (currentStyle) {
+ tags[numTags++] = {pos: pos};
+ if (currentStyle === 'sh_url') {
+ sh_setHref(tags, numTags, inputString);
+ }
+ currentStyle = null;
+ }
+ pos = startOfNextLine;
+ }
+
+ return tags;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// DOM-dependent functions
+
+function sh_getClasses(element) {
+ var result = [];
+ var htmlClass = element.className;
+ if (htmlClass && htmlClass.length > 0) {
+ var htmlClasses = htmlClass.split(' ');
+ for (var i = 0; i < htmlClasses.length; i++) {
+ if (htmlClasses[i].length > 0) {
+ result.push(htmlClasses[i]);
+ }
+ }
+ }
+ return result;
+}
+
+function sh_addClass(element, name) {
+ var htmlClasses = sh_getClasses(element);
+ for (var i = 0; i < htmlClasses.length; i++) {
+ if (name.toLowerCase() === htmlClasses[i].toLowerCase()) {
+ return;
+ }
+ }
+ htmlClasses.push(name);
+ element.className = htmlClasses.join(' ');
+}
+
+/**
+Extracts the tags from an HTML DOM NodeList.
+@param nodeList a DOM NodeList
+@param result an object with text, tags and pos properties
+*/
+function sh_extractTagsFromNodeList(nodeList, result) {
+ var length = nodeList.length;
+ for (var i = 0; i < length; i++) {
+ var node = nodeList.item(i);
+ switch (node.nodeType) {
+ case 1:
+ if (node.nodeName.toLowerCase() === 'br') {
+ var terminator;
+ if (/MSIE/.test(navigator.userAgent)) {
+ terminator = '\r';
+ }
+ else {
+ terminator = '\n';
+ }
+ result.text.push(terminator);
+ result.pos++;
+ }
+ else {
+ result.tags.push({node: node.cloneNode(false), pos: result.pos});
+ sh_extractTagsFromNodeList(node.childNodes, result);
+ result.tags.push({pos: result.pos});
+ }
+ break;
+ case 3:
+ case 4:
+ result.text.push(node.data);
+ result.pos += node.length;
+ break;
+ }
+ }
+}
+
+/**
+Extracts the tags from the text of an HTML element. The extracted tags will be
+returned as an array of tag objects. See sh_highlightString for the format of
+the tag objects.
+@param element a DOM element
+@param tags an empty array; the extracted tag objects will be returned in it
+@return the text of the element
+@see sh_highlightString
+*/
+function sh_extractTags(element, tags) {
+ var result = {};
+ result.text = [];
+ result.tags = tags;
+ result.pos = 0;
+ sh_extractTagsFromNodeList(element.childNodes, result);
+ return result.text.join('');
+}
+
+/**
+Merges the original tags from an element with the tags produced by highlighting.
+@param originalTags an array containing the original tags
+@param highlightTags an array containing the highlighting tags - these must not overlap
+@result an array containing the merged tags
+*/
+function sh_mergeTags(originalTags, highlightTags) {
+ var numOriginalTags = originalTags.length;
+ if (numOriginalTags === 0) {
+ return highlightTags;
+ }
+
+ var numHighlightTags = highlightTags.length;
+ if (numHighlightTags === 0) {
+ return originalTags;
+ }
+
+ var result = [];
+ var originalIndex = 0;
+ var highlightIndex = 0;
+
+ while (originalIndex < numOriginalTags && highlightIndex < numHighlightTags) {
+ var originalTag = originalTags[originalIndex];
+ var highlightTag = highlightTags[highlightIndex];
+
+ if (originalTag.pos <= highlightTag.pos) {
+ result.push(originalTag);
+ originalIndex++;
+ }
+ else {
+ result.push(highlightTag);
+ if (highlightTags[highlightIndex + 1].pos <= originalTag.pos) {
+ highlightIndex++;
+ result.push(highlightTags[highlightIndex]);
+ highlightIndex++;
+ }
+ else {
+ // new end tag
+ result.push({pos: originalTag.pos});
+
+ // new start tag
+ highlightTags[highlightIndex] = {node: highlightTag.node.cloneNode(false), pos: originalTag.pos};
+ }
+ }
+ }
+
+ while (originalIndex < numOriginalTags) {
+ result.push(originalTags[originalIndex]);
+ originalIndex++;
+ }
+
+ while (highlightIndex < numHighlightTags) {
+ result.push(highlightTags[highlightIndex]);
+ highlightIndex++;
+ }
+
+ return result;
+}
+
+/**
+Inserts tags into text.
+@param tags an array of tag objects
+@param text a string representing the text
+@return a DOM DocumentFragment representing the resulting HTML
+*/
+function sh_insertTags(tags, text) {
+ var doc = document;
+
+ var result = document.createDocumentFragment();
+ var tagIndex = 0;
+ var numTags = tags.length;
+ var textPos = 0;
+ var textLength = text.length;
+ var currentNode = result;
+
+ // output one tag or text node every iteration
+ while (textPos < textLength || tagIndex < numTags) {
+ var tag;
+ var tagPos;
+ if (tagIndex < numTags) {
+ tag = tags[tagIndex];
+ tagPos = tag.pos;
+ }
+ else {
+ tagPos = textLength;
+ }
+
+ if (tagPos <= textPos) {
+ // output the tag
+ if (tag.node) {
+ // start tag
+ var newNode = tag.node;
+ currentNode.appendChild(newNode);
+ currentNode = newNode;
+ }
+ else {
+ // end tag
+ currentNode = currentNode.parentNode;
+ }
+ tagIndex++;
+ }
+ else {
+ // output text
+ currentNode.appendChild(doc.createTextNode(text.substring(textPos, tagPos)));
+ textPos = tagPos;
+ }
+ }
+
+ return result;
+}
+
+/**
+Highlights an element containing source code. Upon completion of this function,
+the element will have been placed in the "sh_sourceCode" class.
+@param element a DOM <pre> element containing the source code to be highlighted
+@param language a language definition object
+*/
+function sh_highlightElement(element, language) {
+ sh_addClass(element, 'sh_sourceCode');
+ var originalTags = [];
+ var inputString = sh_extractTags(element, originalTags);
+ var highlightTags = sh_highlightString(inputString, language);
+ var tags = sh_mergeTags(originalTags, highlightTags);
+ var documentFragment = sh_insertTags(tags, inputString);
+ while (element.hasChildNodes()) {
+ element.removeChild(element.firstChild);
+ }
+ element.appendChild(documentFragment);
+}
+
+function sh_getXMLHttpRequest() {
+ if (window.ActiveXObject) {
+ return new ActiveXObject('Msxml2.XMLHTTP');
+ }
+ else if (window.XMLHttpRequest) {
+ return new XMLHttpRequest();
+ }
+ throw 'No XMLHttpRequest implementation available';
+}
+
+function sh_load(language, element, prefix, suffix) {
+ if (language in sh_requests) {
+ sh_requests[language].push(element);
+ return;
+ }
+ sh_requests[language] = [element];
+ var request = sh_getXMLHttpRequest();
+ var url = prefix + 'sh_' + language + suffix;
+ request.open('GET', url, true);
+ request.onreadystatechange = function () {
+ if (request.readyState === 4) {
+ try {
+ if (! request.status || request.status === 200) {
+ eval(request.responseText);
+ var elements = sh_requests[language];
+ for (var i = 0; i < elements.length; i++) {
+ sh_highlightElement(elements[i], sh_languages[language]);
+ }
+ }
+ else {
+ throw 'HTTP error: status ' + request.status;
+ }
+ }
+ finally {
+ request = null;
+ }
+ }
+ };
+ request.send(null);
+}
+
+/**
+Highlights all elements containing source code on the current page. Elements
+containing source code must be "pre" elements with a "class" attribute of