|
From: <ian...@us...> - 2007-08-23 00:14:04
|
Revision: 259
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=259&view=rev
Author: iansmith
Date: 2007-08-22 17:14:01 -0700 (Wed, 22 Aug 2007)
Log Message:
-----------
safety checkin
Modified Paths:
--------------
maven/trunk/ogoglio-server/pom.xml
Added Paths:
-----------
maven/trunk/ogoglio-server/src/main/webapp/GrayCheckmark.gif
maven/trunk/ogoglio-server/src/main/webapp/GreenCheckmark.gif
maven/trunk/ogoglio-server/src/main/webapp/account.html
maven/trunk/ogoglio-server/src/main/webapp/admin.html
maven/trunk/ogoglio-server/src/main/webapp/body.html
maven/trunk/ogoglio-server/src/main/webapp/browserTests.js
maven/trunk/ogoglio-server/src/main/webapp/createAccount.html
maven/trunk/ogoglio-server/src/main/webapp/doorPopup.html
maven/trunk/ogoglio-server/src/main/webapp/icons/
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-angel.png
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-crying.png
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-devil-grin.png
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-glasses.png
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-kiss.png
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-monkey.png
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-plain.png
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-sad.png
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-smile-big.png
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-smile.png
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-surprise.png
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-wink.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-angel.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-crying.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-devil-grin.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-glasses.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-kiss.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-monkey.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-plain.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-sad.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-smile-big.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-smile.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-surprise.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-wink.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-angel.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-crying.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-devil-grin.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-glasses.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-kiss.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-monkey.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-plain.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-sad.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-smile-big.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-smile.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-surprise.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-wink.png
maven/trunk/ogoglio-server/src/main/webapp/icons/index.html
maven/trunk/ogoglio-server/src/main/webapp/index.html
maven/trunk/ogoglio-server/src/main/webapp/inventory.html
maven/trunk/ogoglio-server/src/main/webapp/licenses.html
maven/trunk/ogoglio-server/src/main/webapp/ogoglio.js
maven/trunk/ogoglio-server/src/main/webapp/reset.css
maven/trunk/ogoglio-server/src/main/webapp/signin.html
maven/trunk/ogoglio-server/src/main/webapp/site.js
maven/trunk/ogoglio-server/src/main/webapp/space.html
maven/trunk/ogoglio-server/src/main/webapp/spaceEditor.html
maven/trunk/ogoglio-server/src/main/webapp/spaceEmbed.html
maven/trunk/ogoglio-server/src/main/webapp/spacePopulation.html
maven/trunk/ogoglio-server/src/main/webapp/spaceSettings.html
maven/trunk/ogoglio-server/src/main/webapp/spaceui.js
maven/trunk/ogoglio-server/src/main/webapp/style.css
maven/trunk/ogoglio-server/src/main/webapp/templateEditor.html
maven/trunk/ogoglio-server/src/main/webapp/thingPopup.html
Modified: maven/trunk/ogoglio-server/pom.xml
===================================================================
--- maven/trunk/ogoglio-server/pom.xml 2007-08-23 00:13:07 UTC (rev 258)
+++ maven/trunk/ogoglio-server/pom.xml 2007-08-23 00:14:01 UTC (rev 259)
@@ -37,13 +37,14 @@
<!-- PLUGINS -->
<plugins>
- <!-- SUREFIRE INTEGRATION TEST HACK -->
+ <!-- SUREFIRE INTEGRATION TEST -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip><!-- this is critical to avoid running unit tests, sets default value for skip -->
+ <childDelegation>false</childDelegation>
</configuration>
<executions>
<execution>
@@ -57,7 +58,12 @@
<!-- we seem to like plurals -->
<include>**/*Tests.java</include>
</includes>
- <skip>false</skip><!-- don't skip unit tests -->
+ <excludes>
+ <exclude>
+ **/SpaceDuplicatorTests.java
+ </exclude>
+ </excludes>
+ <skip>false</skip><!-- don't skip integration tests -->
</configuration>
</execution>
</executions>
@@ -76,13 +82,20 @@
<goals>
<goal>start</goal>
</goals>
+ <configuration>
+ <wait>false</wait>
+ </configuration>
</execution>
+
<execution>
<id>get-down</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
+ <configuration>
+ <wait>true</wait>
+ </configuration>
</execution>
</executions>
@@ -132,11 +145,11 @@
<groupId>com.ogoglio</groupId>
<artifactId>ogoglio-server</artifactId>
<type>war</type>
-
- <properties>
+
+ <properties>
<context>ogoglio-server</context>
- </properties>
-
+ </properties>
+
</deployable>
</deployables>
@@ -144,8 +157,31 @@
</configuration>
</plugin>
+
+ <!-- dependencies to pull in applets via deps-->
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-applets</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>
+ ${project.build.directory}/ogoglio-server-0.0.1
+ </outputDirectory>
+ <overWriteReleases>false</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ <excludeTransitive>true</excludeTransitive>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
-
</build>
<!-- where to get cargo -->
@@ -159,6 +195,7 @@
</pluginRepository>
</pluginRepositories>
+
<!-- stuff we need -->
<dependencies>
<dependency>
@@ -197,12 +234,38 @@
<version>1.2</version>
<scope>compile</scope>
</dependency>
+
<dependency>
<groupId>com.ogoglio</groupId>
<artifactId>ogoglio-common</artifactId>
<version>0.0.1</version>
<scope>compile</scope>
</dependency>
+
+ <dependency>
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio-viewer-applet</artifactId>
+ <version>0.0.1</version>
+ <scope>runtime</scope>
+ <classifier>common</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio-test-applet</artifactId>
+ <version>0.0.1</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio-body-editor-applet</artifactId>
+ <version>0.0.1</version>
+ <scope>runtime</scope>
+ <classifier>common</classifier>
+ </dependency>
+
+
</dependencies>
</project>
Added: maven/trunk/ogoglio-server/src/main/webapp/GrayCheckmark.gif
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/GrayCheckmark.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/GreenCheckmark.gif
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/GreenCheckmark.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/account.html
===================================================================
--- maven/trunk/ogoglio-server/src/main/webapp/account.html (rev 0)
+++ maven/trunk/ogoglio-server/src/main/webapp/account.html 2007-08-23 00:14:01 UTC (rev 259)
@@ -0,0 +1,269 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<link rel="stylesheet" href="style.css" type="text/css" />
+<script type="text/javascript" src="ogoglio.js"></script>
+<script type="text/javascript" src="site.js"></script>
+
+<title>Ogoglio Example: account</title>
+<style type="text/css">
+#main {
+ overflow: hidden;
+ width: 750px;
+}
+
+#content {
+ width: 500px;
+ border-right: 250px solid #FFF;
+ margin-right: -250px;
+ float: left;
+}
+
+#rail {
+ background-color: #FFF;
+ width: 250px;
+ float: left;
+}
+
+.section {
+ border: solid 1px #CCD;
+ border-top: solid 5px #CCD;
+ margin: 0px 25px 10px 0px;
+ padding: 0px 5px 5px 5px;
+}
+
+#profileTable th {
+ text-align: right;
+}
+
+.includedFeedItem {
+ margin-top: 10px;
+}
+</style>
+<script type="text/javascript">
+var requestedUsername = locationParameters['username'];
+var spaceListXML = null;
+
+var mainElement = null;
+var titleUserElement = null;
+//var titleAccountElement = null;
+var inventoryLink = null;
+var spaceListTable = null;
+var spaceMembershipTable = null;
+var profileTable = null;
+var profileGoButton = null;
+var bodyLink = null;
+
+function handleAuth(){
+ if(requestedUsername == null){
+ mainElement.innerHTML = "<h2>No Account Requested</h2>";
+ return;
+ }
+
+ if(authedUsername == null || (authedUsername != requestedUsername)){
+ mainElement.innerHTML = "<h2>You're not logged in to this account.</h2>";
+ return;
+ }
+
+ inventoryLink.innerHTML = "<a href='inventory.html?username=" + requestedUsername + "'>Check your inventory »</a>"
+
+ requestAccountDocument(requestedUsername, handleAccount);
+ requestSpaceList(requestedUsername, handleSpaceList);
+ requestAccountMembership(requestedUsername, handleMembership);
+}
+
+function handleMembership(membershipXML){
+ if(membershipXML == null) return;
+
+ var tableHTML = "";
+ for(var i=0; i < membershipXML.childNodes.length; i++){
+ var spaceID = membershipXML.childNodes[i].getAttribute("spaceid");
+ var banned = membershipXML.childNodes[i].getAttribute("banned");
+ var role = membershipXML.childNodes[i].getAttribute("role");
+ if(i == 0){
+ tableHTML += "<tr><th>role</th><th>space</th></tr>"
+ }
+ tableHTML += "<tr>";
+ if("true" == banned){
+ tableHTML += "<td>banned</td>";
+ } else {
+ tableHTML += "<td>" + escapeHTML(role) + "</td>";
+ }
+ tableHTML += "<td><a href='space.html?spaceID=" + spaceID + "'>Space " + escapeHTML(spaceID) + "</a></td>";
+ tableHTML += "</tr>";
+ }
+ spaceMembershipTable.innerHTML = "<table>" + tableHTML + "</table>";
+}
+
+function createNewSpace(spaceName){
+ createSpace(requestedUsername, spaceName, handleNewSpace);
+}
+
+function handleNewSpace(xml){
+ requestSpaceList(requestedUsername, handleSpaceList);
+}
+
+function handleSpaceList(xml){
+ if(xml == null) return;
+
+ spaceListXML = xml;
+ setSpaceListFromSpaceListXML();
+}
+
+function setSpaceListFromSpaceListXML() {
+ if(spaceListXML == null){
+ return;
+ }
+ var tableHTML = "";
+ for(var i=0; i < spaceListXML.childNodes.length; i++){
+ var spaceID = spaceListXML.childNodes[i].getAttribute("spaceid");
+ var displayName = spaceListXML.childNodes[i].getAttribute("displayname");
+ tableHTML += "<tr>";
+ tableHTML += "<td>" + escapeHTML(displayName) + "</td>";
+ tableHTML += "<td><form onsubmit='document.location.href=\"space.html?spaceID=" + spaceID + "\"; return false;'><input type='submit' value='view'/></form></td>";
+ tableHTML += "<td><form onsubmit='document.location.href=\"spaceEditor.html?spaceID=" + spaceID + "\"; return false;'><input type='submit' value='edit'/></form></td>";
+ tableHTML += "</tr>";
+ }
+ spaceListTable.innerHTML = "<table>" + tableHTML + "</table>";
+}
+
+function handleAccount(xml){
+ if(xml == null){
+ return;
+ }
+ accountXML = xml;
+
+ titleUserElement.innerHTML = "User: " + accountXML.getAttribute("username");
+ //titleAccountElement.innerHTML = "Account Type: " + accountXML.getAttribute("accountlevel");
+ bodyLink.innerHTML = "<a href='body.html?bodyID=" + accountXML.getAttribute('defaultbodyid') + "'>Edit your body »</a>"
+ setProfileFromAccountXML();
+}
+
+function setProfileFromAccountXML(){
+ var tableHTML = generateProfileRow("email", "email", accountXML.getAttribute("email"), false);
+ tableHTML += generateProfileRow("first name", "firstname", accountXML.getAttribute("firstname"), false);
+ tableHTML += generateProfileRow("last name", "lastname", accountXML.getAttribute("lastname"), false);
+ tableHTML += generateProfileRow("homepage", "homepage", accountXML.getAttribute("homepage"), true);
+ profileTable.innerHTML = "<table>" + tableHTML + "</table>";
+}
+
+function profileGo(){
+ if(profileGoButton.value == "edit"){
+ var tableHTML = "<tr><th>email:</th><td>" + accountXML.getAttribute("email") + "</td><td></td></tr>";
+ tableHTML += generateProfileInput("first name", "firstname", accountXML.getAttribute("firstname"));
+ tableHTML += generateProfileInput("last name", "lastname", accountXML.getAttribute("lastname"));
+ tableHTML += generateProfileInput("homepage", "homepage", accountXML.getAttribute("homepage"));
+ tableHTML += generateProfileInput("password", "password", null, "blank leaves as-is");
+ tableHTML += generateProfileInput("again", "password2", null);
+ profileTable.innerHTML = "<table>" + tableHTML + "</table>";
+ profileGoButton.value = "save";
+ } else if(profileGoButton.value == "save"){
+ if(document.getElementById('password').value != document.getElementById('password2').value){
+ alert("Passwords 1 and 2 don't match.");
+ return;
+ }
+
+ profileGoButton.value = "edit";
+
+ accountXML.setAttribute("firstname", escapeHTML(document.getElementById("firstname").value));
+ accountXML.setAttribute("lastname", escapeHTML(document.getElementById("lastname").value));
+ accountXML.setAttribute("homepage", escapeHTML(document.getElementById("homepage").value));
+ accountXML.setAttribute("password", escapeHTML(document.getElementById("password").value));
+ updateAccountDocument(accountXML, handleAccount);
+ profileTable.innerHTML = "saving...";
+ }
+}
+
+function generateProfileRow(heading, field, value, link){
+ if(value == null || value.length === 0){
+ return "";
+ }
+ if(link){
+ return "<tr><th>" + heading + ":</th><td><a rel='nofollow' href='" + escapeHTML(value) +"'>" + escapeHTML(value) + "</a></td></tr>\n";
+ } else {
+ return "<tr><th>" + heading + ":</th><td>" + escapeHTML(value) + "</td></tr>\n";
+ }
+}
+
+function generateProfileInput(heading, field, value, comment) {
+ var nonNullValue = value == null ? "" : value;
+ var nonNullComment = comment == null ? "" : comment;
+ var result = "<tr><th>" + heading + ":</th><td><input id='" + field + "' name='" + field + "' type='text' value='" + escapeHTML(nonNullValue) + "' /></td><td>" + escapeHTML(nonNullComment) + "</td></tr>\n";
+ return result;
+}
+
+function init(){
+ populateMemberMenuItem();
+
+ titleUserElement = document.getElementById("titleUser");
+ //titleAccountElement = document.getElementById("titleAccount");
+ mainElement = document.getElementById("main");
+ inventoryLink = document.getElementById("inventoryLink");
+ spaceListTable = document.getElementById("spaceListTable");
+ spaceMembershipTable = document.getElementById("spaceMembershipTable");
+ profileGoButton = document.getElementById("profileGoButton");
+ profileTable = document.getElementById("profileTable");
+ bodyLink = document.getElementById("bodyLink");
+
+ addAuthListeners(handleAuth, handleAuth);
+}
+</script>
+</head>
+<body onload="init();">
+<div id="header">
+ <strong><a href="index.html">Ogoglio Example</a></strong>
+ <span id="search">
+ <!-- <form style="margin: 0px;" method="get" action="http://www.google.com/search">
+ <input type="text" size="20" name="q"/>
+ <input type="hidden" name="q" value="site:example.com"/>
+ <input type="submit" value="find"/>
+ </form> -->
+ </span>
+</div> <!-- end header -->
+
+<div id="headerMenu">
+ <a href="index.html">Home</a>
+ <span id="memberMenuItem"> </span>
+</div> <!-- end header menu -->
+
+<div id="main">
+ <h2 id="titleUser">User: loading...</h2>
+ <!-- <h3 id="titleAccount">Account Type: loading...</h3> -->
+
+ <div id="content">
+ <div class="section">
+ <h3>Profile: <input id="profileGoButton" onclick="profileGo(); return false;" type="submit" value="edit"/></h3>
+ <form id='profileForm'>
+ <div id="profileTable">
+ loading...
+ </div>
+ </form>
+ </div>
+
+ <div class="section">
+ <h3>Your spaces:</h3>
+ <div id="spaceListTable">
+ loading...
+ </div>
+ <form onsubmit="createNewSpace('New Space'); return false;"><input type="submit" value="create a new space"/></form>
+ </div>
+
+ <p class="navLink" id="bodyLink"></p>
+ <p class="navLink" id="inventoryLink"></p>
+ </div><!-- end content -->
+
+ <div id="rail">
+ <div class="section">
+ <h3>Space membership:</h3>
+ <div id="spaceMembershipTable">
+ loading...
+ </div>
+ </div>
+ </div><!-- end rail -->
+</div> <!-- end main -->
+<div id="footer">
+
+</div>
+<!-- Copyright 2007 Transmutable (http://transmutable.com/) 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.-->
+</body>
+</html>
\ No newline at end of file
Added: maven/trunk/ogoglio-server/src/main/webapp/admin.html
===================================================================
--- maven/trunk/ogoglio-server/src/main/webapp/admin.html (rev 0)
+++ maven/trunk/ogoglio-server/src/main/webapp/admin.html 2007-08-23 00:14:01 UTC (rev 259)
@@ -0,0 +1,264 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<link rel="stylesheet" href="style.css" type="text/css" />
+<script type="text/javascript" src="/og/ogoglio.js"></script>
+<script type="text/javascript" src="site.js"></script>
+
+<title>Ogoglio Example: admin</title>
+
+<style type="text/css">
+#main {
+ overflow: hidden;
+ width: 7680px;
+}
+
+#content {
+ width: 768px;
+ float: left;
+}
+
+#rail {
+ background-color: #FFF;
+ width: 250px;
+ float: left;
+}
+
+.section {
+ border: solid 1px #CCD;
+ border-top: solid 5px #CCD;
+ margin: 0px 25px 10px 0px;
+ padding: 0px 5px 5px 5px;
+}
+
+#profileTable th {
+ text-align: right;
+}
+
+.includedFeedItem {
+ margin-top: 10px;
+}
+</style>
+<script type="text/javascript">
+var requestedUsername = locationParameters['username'];
+
+var mainElement = null;
+var titleUserElement = null;
+var profileTable = null;
+var profileGoButton = null;
+var freezeDiv = null;
+var levelDiv = null;
+
+function handleAuth(){
+ if(requestedUsername == null){
+ mainElement.innerHTML = "<h2>No Account Requested</h2>";
+ return;
+ }
+
+ if(authedUsername == null){
+ mainElement.innerHTML = "<h2>You must log in as an admin.</h2>";
+ return;
+ }
+ requestAccountDocument(authedUsername, handleAdminTest);
+}
+
+function handleAdminTest(xml){
+ if(xml == null){
+ mainElement.innerHTML = "<h2>There was an error checking your account for admin access.</h2>";
+ return;
+ }
+ if("admin" != xml.getAttribute("accountlevel")){
+ mainElement.innerHTML = "<h2>You must be an admin to use this page.</h2>";
+ return;
+ }
+ requestAccountDocument(requestedUsername, handleAccount);
+}
+
+function handleAccount(xml){
+ if(xml == null){
+ mainElement.innerHTML = "<h2>Could not find that user: " + requestedUsername + "</h2>";
+ return;
+ }
+ accountXML = xml;
+
+ titleUserElement.innerHTML = "Administer User: " + accountXML.getAttribute("username");
+ setProfileFromAccountXML();
+}
+
+function setProfileFromAccountXML(){
+ var tableHTML = generateProfileRow("email", "email", accountXML.getAttribute("email"), false);
+ tableHTML += generateProfileRow("first name", "firstname", accountXML.getAttribute("firstname"), false);
+ tableHTML += generateProfileRow("last name", "lastname", accountXML.getAttribute("lastname"), false);
+ tableHTML += generateProfileRow("homepage", "homepage", accountXML.getAttribute("homepage"), true);
+ profileTable.innerHTML = "<table>" + tableHTML + "</table>";
+
+ var freezeHTML = "";
+ if(accountXML.getAttribute("frozenuntil")){
+ var date = new Date();
+ date.setTime(accountXML.getAttribute("frozenuntil"));
+ freezeHTML += "frozen until:<div style='color: #F00; margin: 10px;'>" + date + "</div>";
+ freezeHTML += "<form onsubmit='freezeGo(); return false;'><input type='submit' value='thaw' /></form>";
+ } else {
+ freezeHTML += "not frozen:<br/><br/>";
+ freezeHTML += "<form onsubmit='freezeGo(); return false;'><input type='submit' value='freeze' /></form>";
+ }
+ freezeDiv.innerHTML = freezeHTML;
+
+ //basic, advanced, pro, or admin
+ var levelHTML = "";
+ levelHTML += '<form id="levelForm">';
+ levelHTML += '<select onchange="levelFormGo(); return false;" id="levelSelect" name="level">';
+ levelHTML += '<option value="basic">basic</option>';
+ levelHTML += '<option value="advanced">advanced</option>';
+ levelHTML += '<option value="pro">pro</option>';
+ levelHTML += '<option value="admin">admin</option>';
+ levelHTML += '</select>';
+ levelHTML += '</form>';
+ levelDiv.innerHTML = levelHTML;
+
+ var currentLevel = accountXML.getAttribute("accountlevel");
+ var levelForm = document.getElementById("levelForm");
+ if(currentLevel == 'basic'){
+ levelForm.levelSelect.selectedIndex = 0;
+ } else if (currentLevel == 'advanced'){
+ levelForm.levelSelect.selectedIndex = 1;
+ } else if (currentLevel == 'pro'){
+ levelForm.levelSelect.selectedIndex = 2;
+ } else if (currentLevel == 'admin'){
+ levelForm.levelSelect.selectedIndex = 3;
+ }
+}
+
+function levelFormGo(){
+ var currentLevel = accountXML.getAttribute("accountlevel");
+ var levelForm = document.getElementById("levelForm");
+ var newLevel = levelForm.levelSelect.options[levelForm.levelSelect.selectedIndex].value;
+ if(newLevel == currentLevel){
+ return;
+ }
+ accountXML.setAttribute("accountlevel", newLevel);
+ updateAccountDocument(accountXML, handleAccount);
+}
+
+function freezeGo(){
+ if(accountXML.getAttribute("frozenuntil")){
+ accountXML.setAttribute("frozenuntil", 1000);
+ updateAccountDocument(accountXML, handleAccount);
+ profileTable.innerHTML = "thawing...";
+ } else {
+ accountXML.setAttribute("frozenuntil", new Date().getTime() + 1135296000000);
+ updateAccountDocument(accountXML, handleAccount);
+ profileTable.innerHTML = "freezing...";
+ }
+}
+
+function profileGo(){
+ if(profileGoButton.value == "edit"){
+ var tableHTML = "<tr><th>email:</th><td>" + accountXML.getAttribute("email") + "</td><td></td></tr>";
+ tableHTML += generateProfileInput("first name", "firstname", accountXML.getAttribute("firstname"));
+ tableHTML += generateProfileInput("last name", "lastname", accountXML.getAttribute("lastname"));
+ tableHTML += generateProfileInput("homepage", "homepage", accountXML.getAttribute("homepage"));
+ tableHTML += generateProfileInput("password", "password", null, "blank leaves as-is");
+ tableHTML += generateProfileInput("again", "password2", null);
+
+ profileTable.innerHTML = "<table>" + tableHTML + "</table>";
+ profileGoButton.value = "save";
+ } else if(profileGoButton.value == "save"){
+ if(document.getElementById('password').value != document.getElementById('password2').value){
+ alert("Passwords 1 and 2 don't match.");
+ return;
+ }
+
+ profileGoButton.value = "edit";
+
+ accountXML.setAttribute("firstname", escapeHTML(document.getElementById("firstname").value));
+ accountXML.setAttribute("lastname", escapeHTML(document.getElementById("lastname").value));
+ accountXML.setAttribute("homepage", escapeHTML(document.getElementById("homepage").value));
+ accountXML.setAttribute("password", escapeHTML(document.getElementById("password").value));
+ updateAccountDocument(accountXML, handleAccount);
+ profileTable.innerHTML = "saving...";
+ }
+}
+
+function generateProfileRow(heading, field, value, link){
+ if(value == null || value.length === 0){
+ return "";
+ }
+ if(link){
+ return "<tr><th>" + heading + ":</th><td><a rel='nofollow' href='" + escapeHTML(value) +"'>" + escapeHTML(value) + "</a></td></tr>\n";
+ } else {
+ return "<tr><th>" + heading + ":</th><td>" + escapeHTML(value) + "</td></tr>\n";
+ }
+}
+
+function generateProfileInput(heading, field, value, comment) {
+ var nonNullValue = value == null ? "" : value;
+ var nonNullComment = comment == null ? "" : comment;
+ var result = "<tr><th>" + heading + ":</th><td><input id='" + field + "' name='" + field + "' type='text' value='" + escapeHTML(nonNullValue) + "' /></td><td>" + escapeHTML(nonNullComment) + "</td></tr>\n";
+ return result;
+}
+
+function init(){
+ populateMemberMenuItem();
+
+ titleUserElement = document.getElementById("titleUser");
+ mainElement = document.getElementById("main");
+ profileGoButton = document.getElementById("profileGoButton");
+ profileTable = document.getElementById("profileTable");
+ freezeDiv = document.getElementById("freezeDiv");
+ levelDiv = document.getElementById("levelDiv");
+
+ addAuthListeners(handleAuth, handleAuth);
+}
+</script>
+</head>
+<body onload="init();">
+<div id="header">
+ <strong><a href="index.html">Ogoglio Example</a></strong>
+ <span id="search">
+ <!-- <form style="margin: 0px;" method="get" action="http://www.google.com/search">
+ <input type="text" size="20" name="q"/>
+ <input type="hidden" name="q" value="site:example.com"/>
+ <input type="submit" value="find"/>
+ </form> -->
+ </span>
+</div> <!-- end header -->
+
+<div id="headerMenu">
+ <a href="index.html">Home</a>
+ <span id="memberMenuItem"> </span>
+</div> <!-- end header menu -->
+
+<div id="main">
+ <h2 style="color: #4F4;" id="titleUser">Administer User: loading...</h2>
+
+ <div id="content">
+ <div class="section">
+ <h3>Profile: <input id="profileGoButton" onclick="profileGo(); return false;" type="submit" value="edit"/></h3>
+ <form id='profileForm'>
+ <div id="profileTable">
+ loading...
+ </div>
+ </form>
+ </div>
+ <div class="section">
+ <h3>Account level:</h3>
+ <div id="levelDiv">
+ loading...
+ </div>
+ </div>
+
+ <div class="section">
+ <h3>Account status:</h3>
+ <div id="freezeDiv">
+ loading...
+ </div>
+ </div>
+ </div><!-- end content -->
+</div> <!-- end main -->
+<div id="footer">
+
+</div>
+<!-- Copyright 2007 Transmutable (http://transmutable.com/) 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.-->
+</body>
+</html>
\ No newline at end of file
Added: maven/trunk/ogoglio-server/src/main/webapp/body.html
===================================================================
--- maven/trunk/ogoglio-server/src/main/webapp/body.html (rev 0)
+++ maven/trunk/ogoglio-server/src/main/webapp/body.html 2007-08-23 00:14:01 UTC (rev 259)
@@ -0,0 +1,127 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<link rel="stylesheet" href="style.css" type="text/css" />
+<script type="text/javascript" src="/og/ogoglio.js"></script>
+<script type="text/javascript" src="site.js"></script>
+
+<title>Ogoglio Example: body</title>
+<style type="text/css">
+#main {
+ overflow: hidden;
+ width: 750px;
+}
+
+.section {
+ border: solid 1px #CCD;
+ border-top: solid 5px #CCD;
+ margin: 0px 25px 10px 0px;
+ padding: 0px 5px 5px 5px;
+}
+
+p {
+ margin: 10px 0px 10px 0px;
+}
+
+#appletDiv {
+ width: 500px;
+ height: 500px;
+}
+</style>
+
+<script type="text/javascript">
+var bodyID = locationParameters['bodyID'];
+var loginCookie = getCookie('loginCookie');
+
+var titleElement = null;
+var mainElement = null;
+var titleElement = null;
+var appletDiv = null;
+
+var bodyXML = null;
+
+function handleAuth(){
+ if(loginCookie == null){
+ mainElement.innerHTML = "<h2>Pleae sign in to use this page.</h2>";
+ return;
+ }
+
+ if(bodyID == null){
+ mainElement.innerHTML = "<h2>Error: somehow you arrived here without the parameters.</h2> (dang)";
+ return;
+ }
+
+ if(authedUsername == null){
+ mainElement.innerHTML = "<h2>Please log in.</h2>";
+ return;
+ }
+
+ requestBodyDocument(authedUsername, bodyID, handleBody);
+}
+
+function handleBody(xml){
+ if(xml == null) {
+ mainElement.innerHTML = "Couldn't read body information.";
+ return;
+ }
+ bodyXML = xml;
+ titleElement.innerHTML = escapeHTML(bodyXML.getAttribute("displayname"));
+ writeApplet();
+}
+
+function writeApplet(){
+ if(loginCookie == null){
+ appletDiv.innerHTML = "No cookie. Please sign in or register as a guest.";
+ return;
+ }
+
+ var html = "<applet id='viewer' code='com.ogoglio.viewer.applet.BodyEditorApplet' archive='/og/ogoglio-body-editor-applet-0.0.1-common.jar' width='500' height='500' mayscript='true'>";
+ html += "<param name='loginCookie' value='" + loginCookie + "' />";
+ html += "<param name='serviceURI' value='" + getServiceURI() + "' />";
+ html += "<param name='image' value='" + appPath + "/icons/32x32/face-monkey.png' />";
+ html += "</applet>";
+
+ appletDiv.innerHTML = html;
+}
+
+function init(){
+ populateMemberMenuItem();
+
+ titleElement = document.getElementById("title");
+ mainElement = document.getElementById("main");
+ appletDiv = document.getElementById("appletDiv");
+
+ addAuthListeners(handleAuth, handleAuth);
+}
+</script>
+</head>
+<body onload="init();">
+
+<div id="header">
+ <strong><a href="index.html">Ogoglio Example</a></strong>
+ <span id="search">
+ <!-- <form style="margin: 0px;" method="get" action="http://www.google.com/search">
+ <input type="text" size="20" name="q"/>
+ <input type="hidden" name="q" value="site:example.com"/>
+ <input type="submit" value="find"/>
+ </form> -->
+ </span>
+</div> <!-- end header -->
+
+<div id="headerMenu">
+ <a href="index.html">Home</a>
+ <span id="memberMenuItem"> </span>
+</div> <!-- end header menu -->
+
+<div id="main">
+ <h2 id="title">Loading...</h2>
+ <div id="appletDiv"> </div>
+
+</div> <!-- end main -->
+
+<div id="footer">
+
+</div>
+<!-- Copyright 2007 Transmutable (http://transmutable.com/) 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.-->
+</body>
+</html>
\ No newline at end of file
Added: maven/trunk/ogoglio-server/src/main/webapp/browserTests.js
===================================================================
--- maven/trunk/ogoglio-server/src/main/webapp/browserTests.js (rev 0)
+++ maven/trunk/ogoglio-server/src/main/webapp/browserTests.js 2007-08-23 00:14:01 UTC (rev 259)
@@ -0,0 +1,160 @@
+var testedCookieName = 'ogoglioBrowserTested';
+
+var requirementTests = new Array();
+var hasTestedCookie = getCookie(testedCookieName) == "true";
+
+function PlatformTest(theTitle, theDescription, theFailureMessage, theTestFunction){
+ var that = this;
+ this.title = theTitle;
+ this.description = theDescription;
+ this.failureMessage = theFailureMessage;
+ this.testFunction = theTestFunction;
+}
+
+PlatformTest.prototype.runTest = function (testSpan) {
+ return this.testFunction(testSpan);
+}
+
+function testJavascript(){
+ return true;
+}
+requirementTests[requirementTests.length] = new PlatformTest("Checking that Javascript is enabled", "", "You must enable Javascript.", testJavascript);
+
+
+function testJava(testSpan){
+ try {
+ var jarURI = getServiceURI() + "/ogoglio-test-applet-0.0.1.jar";
+ var appletHTML = "<applet id='testApplet' name='testApplet' code='com.ogoglio.viewer.applet.TestApplet' archive='" + jarURI + "' width='1' height='1'></applet>";
+ testSpan.innerHTML = appletHTML;
+ while(typeof document.testApplet == "undefined"){
+ for(i=0; i < 100; i++) setTimeout('this = "something";', 5000);
+ }
+ if((typeof document.testApplet == "undefined")) {
+ requirementTests[1].failureMessage = "Unfortunately, Java support was not found in this browser.<br/>" + javaErrorMessage;
+ return false;
+ }
+ if(!document.testApplet.doesExist()){
+ requirementTests[1].failureMessage = "Unfortunately, we could not communicate with the applet.<br/>" + javaErrorMessage;
+ return false;
+ }
+ if(!document.testApplet.hasAcceptableJava()){
+ requirementTests[1].failureMessage = "Unfortunately, this version of java is not supported: " + document.testApplet.getJavaVersion() + "<br/>" + javaErrorMessage;
+ return false;
+ }
+ if(!document.testApplet.hasJava3D()){
+ var j3dVersion = document.testApplet.getJava3DVersion();
+ if(j3dVersion == null){
+ requirementTests[1].failureMessage = "Unfortunately, you do not have Java3D installed.<br/>" + javaErrorMessage;
+ } else {
+ requirementTests[1].failureMessage = "Unfortunately, this version of Java3D is not supported: " + j3dVersion + javaErrorMessage + "<br/>";
+ }
+ return false;
+ }
+ if(!document.testApplet.canStartJava3D()){
+ requirementTests[1].failureMessage = "Unfortunately, you have Java3D but it can not initialize." + javaErrorMessage + "<br/>";
+ }
+ return true;
+ } catch (error){
+ requirementTests[1].failureMessage = "Unfortunately, Java support was not found in this browser." + javaErrorMessage + "<br/>";
+ return false;
+ }
+ return false;
+}
+var javaErrorMessage = "<br/><br/>Please check that Java support is enabled in your browser preferences.";
+javaErrorMessage += "<br/>If your computer needs Java, use the online installer from <a href='http://java.com/en/download/manual.jsp'>Java.com</a>.<br/>";
+javaErrorMessage += "<br/>If your computer needs Java3D, a quick installer is available <a href='http://java.sun.com/products/java-media/3D/download.html'>here</a>.";
+requirementTests[requirementTests.length] = new PlatformTest("Checking for Java support", "Java displays the 3D views.", javaErrorMessage, testJava);
+
+var currentTestIndex = -1;
+var running = false;
+
+function BrowserTester(){
+ this.listener = null;
+}
+
+BrowserTester.prototype.runTests = function(aCallback){
+ this.callback = aCallback;
+ currentTestIndex = 0;
+ running = true;
+ setTimeout("browserTester.test();", 100);
+}
+
+BrowserTester.prototype.test = function(){
+ var watchdog = setTimeout("browserTester.timedOut();", 10000);
+
+ var title = document.getElementById("requirementTitle" + currentTestIndex);
+ var description = document.getElementById("requirementDescription" + currentTestIndex);
+ var testSpan = document.getElementById("requirementTest" + currentTestIndex);
+
+ title.style.color = "#000";
+ description.style.color = "#000";
+
+ if(requirementTests[currentTestIndex].runTest(testSpan) == true){
+ clearTimeout(watchdog);
+ this.succeed();
+ } else {
+ clearTimeout(watchdog);
+ this.fail();
+ }
+}
+
+BrowserTester.prototype.succeed = function(){
+ if(running == false) return;
+
+ var title = document.getElementById("requirementTitle" + currentTestIndex);
+ var description = document.getElementById("requirementDescription" + currentTestIndex);
+ var testSpan = document.getElementById("requirementTest" + currentTestIndex);
+
+ title.style.color = "#0F0";
+ title.innerHTML = title.innerHTML + "<img id='requirementCheck" + currentTestIndex + "' align='center' src='" + getServiceURI() + "/GreenCheckmark.gif'/>";
+ description.style.color = "#0F0";
+
+ currentTestIndex++;
+ if(currentTestIndex >= requirementTests.length){
+ running = false;
+ this.callback(true);
+ } else {
+ setTimeout("browserTester.test(" + currentTestIndex + ");", 100);
+ }
+}
+
+BrowserTester.prototype.fail = function(){
+ if(running == false) return;
+ running = false;
+
+ var title = document.getElementById("requirementTitle" + currentTestIndex);
+ var description = document.getElementById("requirementDescription" + currentTestIndex);
+ var testSpan = document.getElementById("requirementTest" + currentTestIndex);
+
+ title.style.color = "#FF0000";
+ description.style.color = "#000";
+ var message = requirementTests[currentTestIndex].failureMessage;
+ description.innerHTML = message;
+ this.callback(false);
+}
+
+BrowserTester.prototype.timedOut = function(){
+ if(running == false) return;
+ running = false;
+ this.fail();
+}
+
+var browserTester = new BrowserTester();
+
+
+function writeRequirementTestUI(targetElement){
+ var html = "<ol style='margin: 10px;'>";
+ for(var i=0; i < requirementTests.length; i++){
+ html += "<li id='requirementLI" + i + "'>";
+ html += "<h2 id='requirementTitle" + i + "'>";
+ html += requirementTests[i].title + ": ";
+ html += "</h2>";
+ html += "<p id='requirementDescription" + i + "' >" + requirementTests[i].description + "</p>";
+ html += "<span id='requirementTest" + i + "'> </span>";
+ html += "</li>";
+ }
+ html += "</ol>";
+ targetElement.innerHTML = html;
+}
+
+// Copyright 2007 Transmutable (http://transmutable.com/) 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.
Added: maven/trunk/ogoglio-server/src/main/webapp/createAccount.html
===================================================================
--- maven/trunk/ogoglio-server/src/main/webapp/createAccount.html (rev 0)
+++ maven/trunk/ogoglio-server/src/main/webapp/createAccount.html 2007-08-23 00:14:01 UTC (rev 259)
@@ -0,0 +1,138 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<link rel="stylesheet" href="style.css" type="text/css" />
+<script type="text/javascript" src="/og/ogoglio.js"></script>
+<script type="text/javascript" src="site.js"></script>
+
+<title>Ogoglio Example: create account</title>
+
+<style type="text/css">
+#main {
+ overflow: hidden;
+ width: 750px;
+}
+
+#content {
+ width: 750px;
+ border-right: 1px solid #FFF;
+ margin-right: 1px;
+ float: left;
+}
+
+.section form {
+ margin-top: 10px;
+}
+
+.section {
+ border: solid 1px #CCD;
+ border-top: solid 5px #CCD;
+ margin: 0px 25px 10px 0px;
+ padding: 0px 5px 5px 5px;
+}
+
+#profileTable th {
+ text-align: right;
+}
+
+.includedFeedItem {
+ margin-top: 10px;
+}
+</style>
+<script type="text/javascript">
+
+var mainElement = null;
+var newUserDiv = null;
+
+function handleAuth(){
+ if(authedUsername == null){
+ mainElement.innerHTML = "<h2>You must log in as an admin.</h2>";
+ return;
+ }
+ requestAccountDocument(authedUsername, handleAdminTest);
+}
+
+function handleAdminTest(xml){
+ if(xml == null){
+ mainElement.innerHTML = "<h2>There was an error checking your account for admin access.</h2>";
+ return;
+ }
+ if("admin" != xml.getAttribute("accountlevel")){
+ mainElement.innerHTML = "<h2>You must be an admin to use this page.</h2>";
+ return;
+ }
+
+ writeNewUserForm();
+}
+
+function writeNewUserForm(){
+ var html = "<form id='newUserForm' onsubmit='newUserGo(); return false;'>";
+ html += "<table>"
+ html += "<tr><th>username:</th><td><input type='text' name='username' /></td><td> all lower case, number and letters</td></tr>"
+ html += "<tr><th>email:</th><td><input type='text' name='email' /></td><td></td></tr>"
+ html += "<tr><td></td><td><input type='submit' value='create account' /></td></tr>";
+ html += "</form>";
+ newUserDiv.innerHTML = html;
+}
+
+function newUserGo(){
+ var form = document.getElementById("newUserForm");
+ if(form == null){
+ return;
+ }
+ var username = form.username.value;
+ var email = form.email.value;
+ createAccount(username, email, handleNewAccount);
+}
+
+function handleNewAccount(xml){
+ if(xml == null){
+ alert("Could not create that account.");
+ } else {
+ document.location.href = "admin.html?username=" + xml.getAttribute('username');
+ }
+}
+
+function init(){
+ populateMemberMenuItem();
+
+ mainElement = document.getElementById("main");
+ newUserDiv = document.getElementById("newUserDiv");
+
+ addAuthListeners(handleAuth, handleAuth);
+}
+</script>
+</head>
+<body onload="init();">
+<div id="header">
+ <strong><a href="index.html">Ogoglio Example</a></strong>
+ <span id="search">
+ <!-- <form style="margin: 0px;" method="get" action="http://www.google.com/search">
+ <input type="text" size="20" name="q"/>
+ <input type="hidden" name="q" value="site:example.com"/>
+ <input type="submit" value="find"/>
+ </form> -->
+ </span>
+</div> <!-- end header -->
+
+<div id="headerMenu">
+ <a href="index.html">Home</a>
+ <span id="memberMenuItem"> </span>
+</div> <!-- end header menu -->
+
+<div id="main">
+ <h2 style="color: #4F4;">Create User:</h2>
+
+ <div id="content">
+ <div class="section">
+ <div id="newUserDiv">
+ </div>
+ </div>
+ </div><!-- end content -->
+</div> <!-- end main -->
+<div id="footer">
+
+</div>
+<!-- Copyright 2007 Transmutable (http://transmutable.com/) 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.-->
+</body>
+</html>
\ No newline at end of file
Added: maven/trunk/ogoglio-server/src/main/webapp/doorPopup.html
===================================================================
--- maven/trunk/ogoglio-server/src/main/webapp/doorPopup.html (rev 0)
+++ maven/trunk/ogoglio-server/src/main/webapp/doorPopup.html 2007-08-23 00:14:01 UTC (rev 259)
@@ -0,0 +1,288 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+
+<link rel="stylesheet" href="site.css" type="text/css" />
+
+<script type="text/javascript" src="ogoglio.js"></script>
+
+<title>door editor</title>
+
+<script type="text/javascript">
+var doorID = locationParameters['doorID'];
+var spaceID = locationParameters['spaceID'];
+
+var title = null;
+var main = null;
+var xPosInput = null;
+var yPosInput = null;
+var zPosInput = null;
+var xRotInput = null;
+var yRotInput = null;
+var zRotInput = null;
+var scaleInput = null;
+var linkForm = null;
+
+var doorXML = null;
+
+function init(){
+ main = document.getElementById('main');
+ title = document.getElementById('title');
+ linkForm = document.getElementById('linkForm');
+ xPosInput = document.getElementById('xPosInput');
+ yPosInput = document.getElementById('yPosInput');
+ zPosInput = document.getElementById('zPosInput');
+ xRotInput = document.getElementById('xRotInput');
+ yRotInput = document.getElementById('yRotInput');
+ zRotInput = document.getElementById('zRotInput');
+ scaleInput = document.getElementById('scaleInput');
+
+ if(doorID == null || spaceID == null){
+ main.innerHTML = "<h2>No door</h2><p>Whoops, no door was found for that ID.</p>";
+ return;
+ }
+ addAuthListeners(doorAuthHandler, doorAuthHandler);
+}
+
+function doorAuthHandler(){
+ if(authedUsername == null){
+ main.innerHTML = "<h2>Not logged in.</h2><p>Whoops, you must be logged in to use this page.</p>";
+ return;
+ }
+
+ requestDoor(spaceID, doorID, handleDoorDocument);
+}
+
+function linkChangeGo(){
+ if(linkForm.goButton.value == 'change'){
+ linkForm.innerHTML = "<input id='linkInput' type='text' value='" + escapeHTML(doorXML.getAttribute('link')) + "' size='30' style='font-size: 1.2em;' />";
+ linkForm.innerHTML += "<input id='goButton' type='submit' onclick='linkChangeGo(); return false;' value='save' />";
+ } else {
+ var linkValue = trim(linkForm.linkInput.value);
+ if(linkValue != null && linkValue.length > 0){
+ doorXML.setAttribute('link', linkValue);
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+ }
+ linkForm.innerHTML = escapeHTML(doorXML.getAttribute('link'));
+ linkForm.innerHTML += "<input id='goButton' type='submit' onclick='linkChangeGo(); return false;' value='change' />";
+ }
+}
+
+function handleDoorDocument(xml){
+ if(xml == null){
+ main.innerHTML = "<h2>No door</h2><p>Whoops, that door couldn't be located.</p>";
+ return;
+ }
+ doorXML = xml;
+
+ title.innerHTML = "Door: " + xml.getAttribute('displayname');
+ xPosInput.value = parseFloat(doorXML.getAttribute('x')).toFixed(2);
+ yPosInput.value = parseFloat(doorXML.getAttribute('y')).toFixed(2);
+ zPosInput.value = parseFloat(doorXML.getAttribute('z')).toFixed(2);
+
+ var quat = new Quaternion(doorXML.getAttribute('rw'), doorXML.getAttribute('rx'), doorXML.getAttribute('ry'), doorXML.getAttribute('rz'));
+ var euler = quat.getEuler();
+ xRotInput.value = euler[0];
+ yRotInput.value = euler[1];
+ zRotInput.value = euler[2];
+
+ //NOTE: the current viewer currently scales all dimensions using scalex
+ scaleInput.value = parseFloat(doorXML.getAttribute('scalex')).toFixed(4);
+
+ linkForm.innerHTML = escapeHTML(doorXML.getAttribute('link')) + " <input type='submit' id='goButton' onclick='linkChangeGo(); return false;' value='change' />";
+
+}
+
+function scaleTo(scale){
+ if(scale <= 0.001){
+ alert("Can't scale that small");
+ return;
+ }
+ //NOTE: the current viewer currently scales all dimensions using scalex
+ doorXML.setAttribute('scalex', scale);
+ doorXML.setAttribute('scaley', scale);
+ doorXML.setAttribute('scalez', scale);
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+function move(x, y, z){
+ if(doorXML == null){
+ return;
+ }
+
+ doorXML.setAttribute('x', x + parseFloat(doorXML.getAttribute('x')));
+ doorXML.setAttribute('y', y + parseFloat(doorXML.getAttribute('y')));
+ doorXML.setAttribute('z', z + parseFloat(doorXML.getAttribute('z')));
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+function moveToX(x){
+ if(doorXML == null) return;
+ doorXML.setAttribute('x', x);
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+function moveToY(y){
+ if(doorXML == null) return;
+ doorXML.setAttribute('y', y);
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+function moveToZ(z){
+ if(doorXML == null) return;
+ doorXML.setAttribute('z', z);
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+function resetPosition(){
+ if(doorXML == null){
+ return;
+ }
+
+ doorXML.setAttribute('x', '0');
+ doorXML.setAttribute('y', '0');
+ doorXML.setAttribute('z', '0');
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+function getCurrentQuat(){
+ if(doorXML == null) return;
+ return new Quaternion(parseFloat(doorXML.getAttribute('rw')), parseFloat(doorXML.getAttribute('rx')), parseFloat(doorXML.getAttribute('ry')), parseFloat(doorXML.getAttribute('rz')));
+}
+
+function setXMLQuat(quat){
+ doorXML.setAttribute('rw', quat.w);
+ doorXML.setAttribute('rx', quat.x);
+ doorXML.setAttribute('ry', quat.y);
+ doorXML.setAttribute('rz', quat.z);
+}
+
+function rotateToX(x){
+ if(doorXML == null) return;
+ var quat = getCurrentQuat();
+ var euler = quat.getEuler();
+ quat.setEuler(x, euler[1], euler[2]);
+ setXMLQuat(quat);
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+function rotateToY(y){
+ if(doorXML == null) return;
+ var quat = getCurrentQuat();
+ var euler = quat.getEuler();
+ quat.setEuler(euler[0], y, euler[2]);
+ setXMLQuat(quat);
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+function rotateToZ(z){
+ if(doorXML == null) return;
+ var quat = getCurrentQuat();
+ var euler = quat.getEuler();
+ quat.setEuler(euler[0], euler[1], z);
+ setXMLQuat(quat);
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+function rotate(x, y, z){
+ if(x == 0 && y == 0 && z == 0){
+ return;
+ }
+ var quat = getCurrentQuat();
+ quat.rotateEuler(x, y, z);
+ setXMLQuat(quat);
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+function resetVerticalRotation(){
+ doorXML.setAttribute('rw', doorXML.getAttribute('rw'));
+ doorXML.setAttribute('rx', doorXML.getAttribute('rx'));
+ doorXML.setAttribute('ry', '0');
+ doorXML.setAttribute('rz', doorXML.getAttribute('rz'));
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+function resetHorizontalRotation(){
+ doorXML.setAttribute('rw', doorXML.getAttribute('rw'));
+ doorXML.setAttribute('rx', '0');
+ doorXML.setAttribute('ry', doorXML.getAttribute('ry'));
+ doorXML.setAttribute('rz', '0');
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+</script>
+
+<style type="text/css">
+ .section input[type=submit] {
+ width: 100px;
+ }
+ .section input[type=text] {
+ width: 70px;
+ text-align: right;
+ }
+
+ .section form {
+ display: inline;
+ }
+</style>
+
+</head>
+<body onload="init();">
+<div id="content">
+
+<div id="main" style="">
+ <h2 id="title">Door:</h2>
+ <div class="section">
+ <h3>Translate:</h3>
+ <input type='submit' onclick='move(0, 1, 0); return false;' value='Up'/>
+ <input type='submit' onclick='move(0, -1, 0); return false;' value='Down'/>
+
+ <form onsubmit='moveToY(this.yPosInput.value); return false;'><input type='text' size='3' id='yPosInput' /></form>
+ <br/>
+ <input type='submit' onclick='move(0, 0, -1); return false;' value='North'/>
+ <input type='submit' onclick='move(0, 0, 1); return false;' value='South'/>
+ <form onsubmit='moveToZ(this.zPosInput.value); return false;'><input type='text' size='3' id='zPosInput' /></form>
+ <br/>
+ <input type='submit' onclick='move(1, 0, 0); return false;' value='East'/>
+ <input type='submit' onclick='move(-1, 0, 0); return false;' value='West'/>
+ <form onsubmit='moveToX(this.xPosInput.value); return false;'><input type='text' size='3' id='xPosInput' /></form>
+
+ <br/>
+ <input type='submit' onclick='resetPosition(); return false;' value='Reset'/>
+ </div> <!-- end section -->
+
+ <div class="section">
+ <h3>Vertical Rotate:</h3>
+ <input type='submit' onclick='rotate(0, 0.5, 0); return false;' value='Y'/>
+ <input type='submit' onclick='rotate(0, -0.5, 0); return false;' value='-Y'/>
+
+ <form onsubmit='rotateToY(this.yRotInput.value); return false;'><input type='text' size='3' id='yRotInput' /></form>
+ <br/>
+ <input type='submit' onclick='resetVerticalRotation(); return false;' value='Reset'/>
+ <h3>Horizontal Rotate:</h3>
+ <input type='submit' onclick='rotate(0.5, 0, 0); return false;' value='X'/>
+ <input type='submit' onclick='rotate(-0.5, 0, 0); return false;' value='-X'/>
+ <form onsubmit='rotateToX(this.xRotInput.value); return false;'><input type='text' size='3' id='xRotInput' /></form>
+ <br/>
+
+ <input type='submit' onclick='rotate(0, 0, 0.5); return false;' value='Z'/>
+ <input type='submit' onclick='rotate(0, 0, -0.5); return false;' value='-Z'/>
+ <form onsubmit='rotateToZ(this.zRotInput.value); return false;'><input type='text' size='3' id='zRotInput' /></form>
+ <br/>
+ <input type='submit' onclick='resetHorizontalRotation(); return false;' value='Reset'/>
+ </div> <!-- end section -->
+
+ <div class="section">
+ <h3>Scale: <form onsubmit='scaleTo(this.scaleInput.value); return false;'><input type='text' size='3' id='scaleInput' /></form></h3>
+ </div>
+
+ <div class="section">
+ <h3>Link:</h3>
+ <form id="linkForm"></form>
+ </div>
+</div>
+
+</div><!-- end content -->
+</body>
+<!-- Copyright 2007 Transmutable (http://transmutable.com/) 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.-->
+</html>
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-angel.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-angel.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-crying.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-crying.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-devil-grin.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-devil-grin.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-glasses.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-glasses.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-kiss.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-kiss.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-monkey.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-monkey.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-plain.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-plain.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-sad.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-sad.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-smile-big.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-smile-big.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-smile.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-smile.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-surprise.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-surprise.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-wink.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-wink.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-angel.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-angel.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-crying.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-crying.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-devil-grin.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-devil-grin.png
___________________________________________________________________
Name: sv...
[truncated message content] |