|
From: <tre...@us...> - 2007-06-28 23:15:40
|
Revision: 202
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=202&view=rev
Author: trevorolio
Date: 2007-06-28 16:14:43 -0700 (Thu, 28 Jun 2007)
Log Message:
-----------
Significantly improve the example HTML so as not to scare off budding space owners.
Modified Paths:
--------------
spaces/trunk/war/account.html
spaces/trunk/war/body.html
spaces/trunk/war/browserTests.js
spaces/trunk/war/index.html
spaces/trunk/war/licenses.html
spaces/trunk/war/ogoglio.js
spaces/trunk/war/signin.html
spaces/trunk/war/site.js
spaces/trunk/war/space.html
spaces/trunk/war/spaceEditor.html
spaces/trunk/war/spaceEmbed.html
spaces/trunk/war/spacePopulation.html
spaces/trunk/war/spaceui.js
spaces/trunk/war/templateEditor.html
spaces/trunk/war/thingPopup.html
Added Paths:
-----------
spaces/trunk/war/admin.html
spaces/trunk/war/createAccount.html
spaces/trunk/war/inventory.html
spaces/trunk/war/reset.css
spaces/trunk/war/spaceSettings.html
spaces/trunk/war/style.css
Removed Paths:
-------------
spaces/trunk/war/appletTest.html
spaces/trunk/war/feature.jpg
spaces/trunk/war/footerInclude.js
spaces/trunk/war/headerInclude.js
spaces/trunk/war/help.html
spaces/trunk/war/inputTest.html
spaces/trunk/war/liveConnectTest.html
spaces/trunk/war/notFound.html
spaces/trunk/war/renderingTest.html
spaces/trunk/war/site.css
spaces/trunk/war/support.html
Modified: spaces/trunk/war/account.html
===================================================================
--- spaces/trunk/war/account.html 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/account.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -1,45 +1,59 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
-<title>Account</title>
-<link rel="stylesheet" href="site.css" type="text/css" />
+<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>
-<style type="text/css">
-h3 {
- margin: 10px 0px 0px 0px;
+<title>Ogoglio Example: account</title>
+<style type="text/css">
+#main {
+ overflow: hidden;
+ width: 750px;
}
-#spaces{
+#content {
+ width: 500px;
+ border-right: 250px solid #FFF;
+ margin-right: -250px;
+ float: left;
}
-#main {
- position: relative;
- top: 0px;
+#rail {
+ background-color: #FFF;
+ width: 250px;
+ float: left;
}
-</style>
-<script type="text/javascript" src="ogoglio.js"></script>
-<script type="text/javascript" src="site.js"></script>
-
-<script type="text/javascript">
+.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 titleElement = null;
-var profileTable = null;
-var bodyListTable = null;
-var spaceListTable = null;
-var templateListTable = 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 possListTable = null;
-var possForm = null;
+var bodyLink = null;
-var accountXML = null;
-var bodyListXML = null;
-var spaceListXML = null;
-var possessionListXML = null;
-
function handleAuth(){
if(requestedUsername == null){
mainElement.innerHTML = "<h2>No Account Requested</h2>";
@@ -51,124 +65,44 @@
return;
}
+ inventoryLink.innerHTML = "<a href='inventory.html?username=" + requestedUsername + "'>Check your inventory »</a>"
+
requestAccountDocument(requestedUsername, handleAccount);
- requestBodyList(requestedUsername, handleBodyList);
requestSpaceList(requestedUsername, handleSpaceList);
- requestTemplateList(requestedUsername, handleTemplateList);
- requestPossessionList(requestedUsername, handlePossessionList);
+ requestAccountMembership(requestedUsername, handleMembership);
}
-function changePossessionSpace(possID, select){
- var selectedValue = select[select.selectedIndex].value;
- for(var i=0; i < possessionListXML.childNodes.length; i++){
- var listPossID = possessionListXML.childNodes[i].getAttribute("possessionid");
- var listSpaceID = possessionListXML.childNodes[i].getAttribute("spaceid");
- if(possID == listPossID){
- if(selectedValue == listSpaceID){
- return;
- }
- possessionListXML.childNodes[i].setAttribute("spaceid", selectedValue);
- possessionListXML.childNodes[i].setAttribute("thingid", -1);
- updatePossession(possessionListXML.childNodes[i], handleChangePossession);
- return;
- }
- }
- alert("Error");
-}
+function handleMembership(membershipXML){
+ if(membershipXML == null) return;
-function handleChangePossession(xml){
- requestPossessionList(requestedUsername, handlePossessionList);
-}
-
-function handlePossessionList(xml){
- possessionListXML = xml;
-
- var tableHTML = "<tr><th>id</th><th>template id</th><th>space id</th><th>thing id</th></tr>";
- for(var i=0; i < xml.childNodes.length; i++){
- var id = xml.childNodes[i].getAttribute("possessionid");
- var templateID = xml.childNodes[i].getAttribute("templateid");
- var spaceID = xml.childNodes[i].getAttribute("spaceid");
- var thingID = xml.childNodes[i].getAttribute("thingid");
+ 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>";
- tableHTML += "<td>" + id + "</td>";
- tableHTML += "<td>" + templateID + "</td>";
- tableHTML += "<td><select onchange='changePossessionSpace(" + id + ", this);'>";
- if(spaceID == null){
- tableHTML += "<option selected='selected' value='0'></option>";
+ if("true" == banned){
+ tableHTML += "<td>banned</td>";
} else {
- tableHTML += "<option selected='selected' value='0'></option>";
+ tableHTML += "<td>" + escape(role) + "</td>";
}
- for(var j=0; j < spaceListXML.childNodes.length; j++){
- var listSpaceID = spaceListXML.childNodes[j].getAttribute('spaceid');
- var spaceName = spaceListXML.childNodes[j].getAttribute('displayname');
- if(spaceID == listSpaceID){
- tableHTML += "<option selected='selected' value='" + listSpaceID + "'>" + escape(spaceName) + "</option>";
- } else {
- tableHTML += "<option value='" + listSpaceID + "'>" + escape(spaceName) + "</option>";
- }
- }
- tableHTML += "</select></td>";
-
- if(thingID != null){
- tableHTML += "<td><a href='thingPopup.html?spaceID=" + spaceID + "&thingID=" + thingID + "'>" + thingID + "</a></td>";
- tableHTML += "<td><form onsubmit='reloadThing(" + spaceID + ", "+ thingID + "); return false;'><input type='submit' value='reload'/></form></td>";
- } else {
- tableHTML += "<td></td>";
- tableHTML += "<td><form onsubmit='deletePossession(\"" + requestedUsername + "\", "+ id + ", handleChangePossession); return false;'><input type='submit' value='delete'/></form></td>";
- }
+ tableHTML += "<td><a href='space.html?spaceID=" + spaceID + "'>Space " + escape(spaceID) + "</a></td>";
tableHTML += "</tr>";
}
- possListTable.innerHTML = "<table>" + tableHTML + "</table>";
-
- possForm.innerHTML = "<label for='templateIDInput'>template id:</label>";
- possForm.innerHTML += "<input id='templateIDInput' type='text' size='5' /><input type='submit' value='create possession' />";
-
+ spaceMembershipTable.innerHTML = "<table>" + tableHTML + "</table>";
}
-function emptyOrValue(value){
- if(value == null){
- return "";
- } else if (typeof value == "undefined"){
- return "";
- }
- return value;
+function createNewSpace(spaceName){
+ createSpace(requestedUsername, spaceName, handleNewSpace);
}
-function possFormGo(){
- var inputID = possForm.templateIDInput.value;
- if(inputID == null || trim(inputID).length == 0){
- return;
- }
- var templateID = parseInt(inputID);
- createPossession(requestedUsername, templateID, handlePossessionCreate);
+function handleNewSpace(xml){
+ requestSpaceList(requestedUsername, handleSpaceList);
}
-function handlePossessionCreate(xml){
- requestPossessionList(requestedUsername, handlePossessionList);
-}
-
-function handleTemplateList(xml){
- var tableHTML = "<tr><th>id</th><th>name</th><td></td></tr>";
- for(var i=0; i < xml.childNodes.length; i++){
- var id = xml.childNodes[i].getAttribute("templateid");
- var displayName = xml.childNodes[i].getAttribute("displayname");
- tableHTML += "<tr>";
- tableHTML += "<td>" + id + "</td>";
- tableHTML += "<td>" + escape(displayName) + "</td>";
- tableHTML += "<td><input type='submit' onclick='document.location.href=\"templateEditor.html?templateID=" + id +"\"' value='edit' /></td>";
- tableHTML += "</tr>";
- }
- templateListTable.innerHTML = "<table>" + tableHTML + "</table>";
-}
-
-function createNewTemplate(templateName){
- createTemplate(requestedUsername, templateName, handleNewTemplate);
-}
-
-function handleNewTemplate(xml){
- requestTemplateList(requestedUsername, handleTemplateList);
-}
-
function handleSpaceList(xml){
if(xml == null) return;
@@ -185,59 +119,23 @@
var spaceID = spaceListXML.childNodes[i].getAttribute("spaceid");
var displayName = spaceListXML.childNodes[i].getAttribute("displayname");
tableHTML += "<tr>";
- tableHTML += "<td><a href='space.html?spaceID=" + spaceID + "'>" + escape(displayName) + "</a></td>";
+ tableHTML += "<td>" + escape(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 += "<td><a href='space/" + spaceID + "/log'>log</a></td>"
tableHTML += "</tr>";
}
spaceListTable.innerHTML = "<table>" + tableHTML + "</table>";
}
-function createNewSpace(spaceName){
- createSpace(authedUsername, spaceName, handleNewSpace);
-}
-
-function handleNewSpace(xml){
- requestSpaceList(requestedUsername, handleSpaceList);
-}
-
-function createNewBody(bodyName){
- createBody(authedUsername, bodyName, handleBodyList);
-}
-
-function handleBodyList(xml){
- if(xml == null){
- return;
- }
-
- bodyListXML = xml;
- setBodyListFromBodyListXML();
-}
-
-function setBodyListFromBodyListXML() {
- if(bodyListXML == null){
- return;
- }
- var tableHTML = "";
- for(var i=0; i < bodyListXML.childNodes.length; i++){
- tableHTML += "<tr><td>" + bodyListXML.childNodes[i].getAttribute("bodyid") + ": " + escape(bodyListXML.childNodes[i].getAttribute("displayname"));
- var onsubmit = 'document.location.href = "body.html?bodyID=' + bodyListXML.childNodes[i].getAttribute("bodyid") + '"';
- tableHTML += "</td><td><form onsubmit='" + onsubmit + "; return false;'><input type='submit' value='edit'/></form></td></tr>";
- }
- bodyListTable.innerHTML = "<table>" + tableHTML + "</table>";
-}
-
-function handleBodyUpdate(xml){
- alert(serializeXML(xml));
-}
-
function handleAccount(xml){
if(xml == null){
return;
}
accountXML = xml;
- titleElement.innerHTML = "Account: " + accountXML.getAttribute("username");
+ 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();
}
@@ -251,12 +149,12 @@
function profileGo(){
if(profileGoButton.value == "edit"){
- var tableHTML = "<tr><th>email</th><td>" + accountXML.getAttribute("email") + "</td><td></td></tr>";
+ 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 means leave as-is");
- tableHTML += generateProfileInput("password again", "password2", null);
+ 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"){
@@ -295,69 +193,77 @@
}
function init(){
- populateLoginDiv();
+ populateMemberMenuItem();
+
+ titleUserElement = document.getElementById("titleUser");
+ //titleAccountElement = document.getElementById("titleAccount");
mainElement = document.getElementById("main");
- titleElement = document.getElementById("title");
- profileTable = document.getElementById("profileTable");
- bodyListTable = document.getElementById("bodyListTable");
+ inventoryLink = document.getElementById("inventoryLink");
spaceListTable = document.getElementById("spaceListTable");
+ spaceMembershipTable = document.getElementById("spaceMembershipTable");
profileGoButton = document.getElementById("profileGoButton");
- templateListTable = document.getElementById("templateListTable");
- possForm = document.getElementById("possForm");
- possListTable = document.getElementById("possListTable");
+ profileTable = document.getElementById("profileTable");
+ bodyLink = document.getElementById("bodyLink");
+
addAuthListeners(handleAuth, handleAuth);
}
-
</script>
-
-
</head>
<body onload="init();">
-<div id="content">
+<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 -->
-<script src="headerInclude.js"></script>
+<div id="headerMenu">
+ <a href="index.html">Home</a>
+ <span id="memberMenuItem"> </span>
+</div> <!-- end header menu -->
-<div id="main">
-<h2 id="title">Account: loading...</h2>
+<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>
-<h3>Profile: <input id="profileGoButton" onclick="profileGo(); return false;" type="submit" value="edit"/></h3>
-<form id='profileForm'>
-<div id="profileTable">
- loading...
-</div>
-</form>
+ <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>
-<hr/>
-<h3>Spaces:</h3>
-<div id="spaceListTable">
- loading...
-</div>
-<form onsubmit="createNewSpace('New Space'); return false;"><input type="submit" value="create a new space"/></form>
+ <p class="navLink" id="bodyLink"></p>
+ <p class="navLink" id="inventoryLink"></p>
+ </div><!-- end content -->
-<hr/>
-<h3>Templates:</h3>
-<div id="templateListTable">
- <tr><td>loading...</td></tr>
+ <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>
-<form onsubmit="createNewTemplate('New Template'); return false;"><input type="submit" value="create a new template"/></form>
-
-<hr/>
-<h3>Possessions:</h3>
-<div id="possListTable">
- <tr><td>loading...</td></tr>
-</div>
-<form onsubmit='possFormGo(); return false;' action='account.html' id="possForm"></form>
-
-<hr/>
-<h3>Bodies:</h3>
-<div id="bodyListTable">
- <tr><td>loading...</td></tr>
-</div>
-<form onsubmit="createNewBody('New Body'); return false;"><input type="submit" value="create a new body"/></form>
-
-</div><!-- end main -->
-</div><!-- end content -->
-<script src="footerInclude.js"></script>
<!-- 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>
+</html>
\ No newline at end of file
Added: spaces/trunk/war/admin.html
===================================================================
--- spaces/trunk/war/admin.html (rev 0)
+++ spaces/trunk/war/admin.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -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", escape(document.getElementById("firstname").value));
+ accountXML.setAttribute("lastname", escape(document.getElementById("lastname").value));
+ accountXML.setAttribute("homepage", escape(document.getElementById("homepage").value));
+ accountXML.setAttribute("password", escape(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='" + escape(value) +"'>" + escape(value) + "</a></td></tr>\n";
+ } else {
+ return "<tr><th>" + heading + ":</th><td>" + escape(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='" + escape(nonNullValue) + "' /></td><td>" + escape(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
Deleted: spaces/trunk/war/appletTest.html
===================================================================
--- spaces/trunk/war/appletTest.html 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/appletTest.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -1,31 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>Rendering test</title>
-<link rel="stylesheet" href="site.css" type="text/css" />
-
-<style type="text/css">
-
-#main {
- position: relative;
- top: 0px;
-}
-
-</style>
-
-</head>
-<body>
-<div id="content">
-
-<div id="main">
-<h2>Applet test:</h2>
-<p>Attempting to load an applet.</p>
-<applet id='viewer' code='com.ogoglio.viewer.applet.TestApplet' archive='/og/testApplet.jar' width='300' height='75' mayscript='true'>
-</applet>
-
-</div><!-- end main -->
-</div><!-- end content -->
-<script src="footerInclude.js"></script>
-<!-- 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>
Modified: spaces/trunk/war/body.html
===================================================================
--- spaces/trunk/war/body.html 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/body.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -1,32 +1,42 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
-<title>Account</title>
-<link rel="stylesheet" href="site.css" type="text/css" />
+<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>
-<style type="text/css">
-
+<title>Ogoglio Example: body</title>
+<style type="text/css">
#main {
- position: relative;
- top: 0px;
+ overflow: hidden;
+ width: 750px;
}
-#spaceDiv {
+.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" src="ogoglio.js"></script>
-<script type="text/javascript" src="site.js"></script>
-
<script type="text/javascript">
-
var bodyID = locationParameters['bodyID'];
var loginCookie = getCookie('loginCookie');
var titleElement = null;
var mainElement = null;
-var spaceDiv = null;
+var titleElement = null;
+var appletDiv = null;
var bodyXML = null;
@@ -61,7 +71,7 @@
function writeApplet(){
if(loginCookie == null){
- spaceDiv.innerHTML = "No cookie. Please sign in or register as a guest.";
+ appletDiv.innerHTML = "No cookie. Please sign in or register as a guest.";
return;
}
@@ -71,36 +81,47 @@
html += "<param name='image' value='" + appPath + "/icons/32x32/face-monkey.png' />";
html += "</applet>";
- spaceDiv.innerHTML = html;
+ appletDiv.innerHTML = html;
}
+function init(){
+ populateMemberMenuItem();
-function init(){
- populateLoginDiv();
+ titleElement = document.getElementById("title");
mainElement = document.getElementById("main");
- titleElement = document.getElementById("title");
- spaceDiv = document.getElementById("spaceDiv");
-
+ appletDiv = document.getElementById("appletDiv");
+
addAuthListeners(handleAuth, handleAuth);
}
-
</script>
-
-
</head>
<body onload="init();">
-<div id="content">
-<script src="headerInclude.js"></script>
+<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="main">
-<h2 id="title"></h2>
-<div id="spaceDiv"> </div>
+<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><!-- end content -->
-<script src="footerInclude.js"></script>
+</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>
+</html>
\ No newline at end of file
Modified: spaces/trunk/war/browserTests.js
===================================================================
--- spaces/trunk/war/browserTests.js 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/browserTests.js 2007-06-28 23:14:43 UTC (rev 202)
@@ -156,3 +156,5 @@
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: spaces/trunk/war/createAccount.html
===================================================================
--- spaces/trunk/war/createAccount.html (rev 0)
+++ spaces/trunk/war/createAccount.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -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
Deleted: spaces/trunk/war/feature.jpg
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/footerInclude.js
===================================================================
--- spaces/trunk/war/footerInclude.js 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/footerInclude.js 2007-06-28 23:14:43 UTC (rev 202)
@@ -1,4 +0,0 @@
-
-var content = '<br clear="all" /><!-- <div id="final">This is where copyright would go.</div> -->';
-
-document.write(content);
\ No newline at end of file
Deleted: spaces/trunk/war/headerInclude.js
===================================================================
--- spaces/trunk/war/headerInclude.js 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/headerInclude.js 2007-06-28 23:14:43 UTC (rev 202)
@@ -1,8 +0,0 @@
-var content = '<div id="loginDiv">\
- <a href="signin.html">sign in</a> | <a href="support.html">support</a>\
-</div>';
-
-content += '<h2><a href="index.html">ogoglio</a></h2><hr style="margin-top: 0px;" />';
-
-document.write(content);
-
Deleted: spaces/trunk/war/help.html
===================================================================
--- spaces/trunk/war/help.html 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/help.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -1,50 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>Space Editor</title>
-
-<link rel="stylesheet" href="site.css" type="text/css" />
-
-<style type="text/css">
-th {
- background-color: #CCC;
- padding: 0px 10px 0px 10px;
-}
-</style>
-
-<script type="text/javascript" src="ogoglio.js"></script>
-<script type="text/javascript" src="site.js"></script>
-
-<script type="text/javascript">
-function init(){
- populateLoginDiv();
-}
-</script>
-
-
-</head>
-<body onload="init();">
-<div id="content">
-
-<script src="headerInclude.js"></script>
-
-<h2>Help:</h2>
-<h3 id="publicity">Public/Private:</h3>
-<p>Some helpful text.</p>
-
-<h3 id="membership">Membership:</h3>
-<p>Some helpful text.</p>
-
-<h3 id="guests">Guests:</h3>
-<p>Some helpful text.</p>
-
-<h3 id="banning">Banning:</h3>
-<p>Some helpful text.</p>
-
-<h3 id="java">Java:</h3>
-<p>Some helpful text, including a note about not using Rosetta'ed browsers on Intel macs (e.g. you copied PPC Mozilla from your old Mac to your new MacBookPro)</p>
-</div><!-- end content -->
-<script src="footerInclude.js"></script>
-</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>
Modified: spaces/trunk/war/index.html
===================================================================
--- spaces/trunk/war/index.html 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/index.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -1,42 +1,52 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
-<title></title>
+<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>
-<link rel="stylesheet" href="site.css" type="text/css" />
-
-<style type="text/css">
-
-h4 {
- font-size: 1em;
- line-height: 1em;
- margin: 0px;
+<title>Ogoglio Example</title>
+<style type="text/css">
+#main {
+ overflow: hidden;
+ width: 761px;
+ margin: 10px 0px 0px 0px;
padding: 0px;
+ text-align: center;
}
-</style>
-
-<script type="text/javascript" src="ogoglio.js"></script>
-<script type="text/javascript" src="site.js"></script>
-
-<script type="text/javascript">
-function init(){
- populateLoginDiv();
+#content {
+ width: 768px;
}
-</script>
-
+</style>
</head>
-<body onload="init();">
-<div id="content">
+<body onload="populateMemberMenuItem();">
- <script src="headerInclude.js"></script>
+<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="main" style="width: 100%; height: 300px; text-align: center; padding-top: 100px;">
- <h1>ogoglio is changing</h1>
- (don't be alarmed)
+<div id="headerMenu">
+ <a href="index.html">Home</a>
+ <span id="memberMenuItem"> </span>
+</div> <!-- end header menu -->
+
+<div id="main">
+ <div id="content">
+ <span style="font-size: 110px; line-height: 140px">Coming Soon</span>
+ </div><!-- end rail -->
</div>
-</div><!-- end content -->
+<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>
-<!-- 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>
+</html>
\ No newline at end of file
Deleted: spaces/trunk/war/inputTest.html
===================================================================
--- spaces/trunk/war/inputTest.html 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/inputTest.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -1,31 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>Rendering test</title>
-<link rel="stylesheet" href="site.css" type="text/css" />
-
-<style type="text/css">
-
-#main {
- position: relative;
- top: 0px;
-}
-
-</style>
-
-</head>
-<body>
-<div id="content">
-
-<div id="main">
-<h2>Input test:</h2>
-<p>Attempting to respond to button presses.</p>
-<applet id='viewer' code='com.ogoglio.viewer.applet.InputTest' archive='/og/testApplet.jar' width='220' height='75' mayscript='true'>
-</applet>
-
-</div><!-- end main -->
-</div><!-- end content -->
-<script src="footerInclude.js"></script>
-<!-- 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>
Added: spaces/trunk/war/inventory.html
===================================================================
--- spaces/trunk/war/inventory.html (rev 0)
+++ spaces/trunk/war/inventory.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -0,0 +1,313 @@
+<!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: inventory</title>
+
+<style type="text/css">
+#main {
+ overflow: hidden;
+ width: 750px;
+}
+
+#content {
+ width: 370px;
+ border-right: 360px solid #FFF;
+ margin-right: -350px;
+ float: left;
+}
+
+#rail {
+ background-color: #FFF;
+ width: 370px;
+ float: left;
+}
+
+#popOver {
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 0px;
+ background-color: #FFF;
+ border: solid 2px #000;
+ visibility: hidden;
+ padding: 0px;
+ margin: 0px;
+}
+
+.section {
+ border: solid 1px #CCD;
+ border-top: solid 5px #CCD;
+ margin: 0px 0px 10px 0px;
+ padding: 0px 5px 5px 5px;
+}
+
+</style>
+
+<script type="text/javascript">
+
+var requestedUsername = locationParameters['username'];
+var mainElement = null;
+var titleElement = null;
+var possListTable = null;
+var templateListTable = null;
+var popOver = null;
+
+var spaceListXML = null;
+var templateListXML = null;
+var possessionListXML = null;
+
+function handleAuth(){
+ if(authedUsername == null || (authedUsername != requestedUsername)){
+ mainElement.innerHTML = "<h2>You must log in to see your inventory.</h2>";
+ return;
+ }
+ requestSpaceList(requestedUsername, handleSpaceList);
+ requestTemplateList(requestedUsername, handleTemplateList);
+}
+
+function handleSpaceList(xml){
+ if(xml == null){
+ main.innerHTML = "<h2>There is an error.</h2> Could not list your inventory. Sorry.";
+ return;
+ }
+ spaceListXML = xml;
+ requestPossessionList(requestedUsername, handlePossessionList);
+}
+
+function handlePossessionList(xml){
+ possessionListXML = xml;
+
+ var templateIDMap = new Array();
+ for(var i=0; i < possessionListXML.childNodes.length; i++){
+ var templateID = possessionListXML.childNodes[i].getAttribute("templateid");
+ templateIDMap[i] = parseInt(templateID);
+ }
+
+ if(templateIDMap.length == 0){
+ possListTable.innerHTML = "You have nothing at the moment.";
+ }
+
+ var idArray = new Array();
+ for(var i = 0; i < templateIDMap.length; i++){
+ idArray[idArray.length] = templateIDMap[i];
+ }
+ requestTemplates(idArray, handleTemplates);
+}
+
+function handleTemplates(xml){
+ if(xml == null){
+ alert("Could not fetch templates");
+ return;
+ }
+ templateListXML = xml;
+ updatePossListTable();
+}
+
+function updatePossListTable(){
+
+ var templateArray = new Array();
+ for(var i =0 ; i < templateListXML.childNodes.length; i++){
+ var templateID = templateListXML.childNodes[i].getAttribute("templateid");
+ templateArray[templateID] = new Array();
+ templateArray[templateID][0] = templateListXML.childNodes[i];
+ }
+
+ for(var i=0; i < possessionListXML.childNodes.length; i++){
+ if(possessionListXML.childNodes[i].getAttribute("spaceid") != null){
+ continue;
+ }
+ var templateID = possessionListXML.childNodes[i].getAttribute("templateid");
+ templateArray[templateID][templateArray[templateID].length] = possessionListXML.childNodes[i];
+ }
+
+ var tableHTML = "<tr><th>template name</th><th>count</th><th></th><th></th></tr>";
+ for(var i =0 ; i < templateListXML.childNodes.length; i++){
+ var templateID = templateListXML.childNodes[i].getAttribute("templateid");
+ if(templateArray[templateID].length == 1){
+ continue;
+ }
+ tableHTML += "<tr>";
+ tableHTML += "<td>" + escape(templateListXML.childNodes[i].getAttribute('displayname')) + "</td>";
+ tableHTML += "<td>" + (templateArray[templateID].length - 1) + "</td>";
+ tableHTML += "<td><form onsubmit='addToGo(" + templateID + "); return false;'><input type='submit' value='add to...'/></form></td>";
+ var possID = templateArray[templateID][1].getAttribute("possessionid");
+ tableHTML += "<td><form onsubmit='deletePossession(\"" + escape(requestedUsername) + "\", " + possID + ", handleChangePossession); return false;'><input type='submit' value='delete'/></form></td>";
+ tableHTML += "</tr>";
+ }
+
+ possListTable.innerHTML = "<table>" + tableHTML + "</table>";
+}
+
+function addToGo(templateID){
+ for(var i=0; i < possessionListXML.childNodes.length; i++){
+ var possTemplateID = possessionListXML.childNodes[i].getAttribute("templateid");
+ var spaceID = possessionListXML.childNodes[i].getAttribute("spaceid");
+ if(spaceID == null && templateID == possTemplateID){
+ var possID = possessionListXML.childNodes[i].getAttribute("possessionid");
+ var html = "<form>Add to: <select onchange='spaceSelectGo(" + possID + ", this); hidePopOver();'>";
+ html += "<option selected='selected' value='0'></option>";
+
+ for(var j=0; j < spaceListXML.childNodes.length; j++){
+ var listSpaceID = spaceListXML.childNodes[j].getAttribute('spaceid');
+ var spaceName = spaceListXML.childNodes[j].getAttribute('displayname');
+ html += "<option value='" + listSpaceID + "'>" + escape(spaceName) + "</option>";
+ }
+ html += "</select></form>";
+
+ html += "<div style='text-align: right; width: 100%'><form onsubmit='hidePopOver(); return false;'><input type='submit' value='cancel'/></form></div>"
+ showPopOver(html);
+ break;
+ }
+ }
+}
+
+function showPopOver(html){
+ popOver.innerHTML = html;
+ popOver.style.width = "300px";
+ popOver.style.top = "100px";
+ popOver.style.left = "100px";
+ popOver.style.visibility = "visible";
+ popOver.style.padding = "10px";
+}
+
+function hidePopOver(){
+ popOver.visibility = "hidden";
+ popOver.innerHTML = "";
+ popOver.style.width = "0px";
+ popOver.style.top = "0px";
+ popOver.style.left = "0px";
+ popOver.style.padding = "0px";
+ popOver.style.margin = "0px";
+}
+
+function spaceSelectGo(possID, select){
+ var selectedValue = select[select.selectedIndex].value;
+ for(var i=0; i < possessionListXML.childNodes.length; i++){
+ var listPossID = possessionListXML.childNodes[i].getAttribute("possessionid");
+ var listSpaceID = possessionListXML.childNodes[i].getAttribute("spaceid");
+ if(possID == listPossID){
+ if(selectedValue == listSpaceID){
+ return;
+ }
+ changePossessionSpace(possessionListXML.childNodes[i], selectedValue)
+ return;
+ }
+ }
+ alert("Error");
+}
+
+function changePossessionSpace(possessionXML, newSpaceID){
+ possessionXML.setAttribute("spaceid", newSpaceID);
+ possessionXML.setAttribute("thingid", -1);
+ updatePossession(possessionXML, handleChangePossession);
+}
+
+function handleChangePossession(xml){
+ requestPossessionList(requestedUsername, handlePossessionList);
+}
+
+function handleTemplateList(xml){
+ if(xml.childNodes.length == 0){
+ templateListTable.innerHTML = "You have no templates.";
+ return;
+ }
+ var tableHTML = "<tr><th>template name</th><th></th><th></th></tr>";
+ for(var i=0; i < xml.childNodes.length; i++){
+ var id = xml.childNodes[i].getAttribute("templateid");
+ var displayName = xml.childNodes[i].getAttribute("displayname");
+ tableHTML += "<tr>";
+ tableHTML += "<td>" + escape(displayName) + "</td>";
+ tableHTML += "<td><input type='submit' onclick='document.location.href=\"templateEditor.html?templateID=" + id +"\"' value='edit' /></td>";
+ tableHTML += "<td><input type='submit' onclick='addMyTemplateToInventoryGo(" + id + "); return false;' value='add to inventory' /></td>";
+ tableHTML += "</tr>";
+ }
+ templateListTable.innerHTML = "<table>" + tableHTML + "</table>";
+}
+
+function createNewTemplate(templateName){
+ createTemplate(requestedUsername, templateName, handleNewTemplate);
+}
+
+function handleNewTemplate(xml){
+ requestTemplateList(requestedUsername, handleTemplateList);
+}
+
+function addMyTemplateToInventoryGo(templateID){
+ createPossession(authedUsername, templateID, handleCreatePossession);
+}
+
+function handleCreatePossession(xml){
+ if(xml == null){
+ alert("Could not add. Sorry.");
+ return;
+ }
+ requestPossessionList(requestedUsername, handlePossessionList);
+}
+
+function init(){
+ populateMemberMenuItem();
+ titleElement = document.getElementById("title");
+ mainElement = document.getElementById("main");
+ possListTable = document.getElementById("possListTable");
+ templateListTable = document.getElementById("templateListTable");
+ popOver = document.getElementById("popOver");
+
+ if(requestedUsername == null){
+ mainElement.innerHTML = "<h2>There is an error.</h2> There is no username parameter. Sorry."
+ return;
+ }
+
+ 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">Inventory:</h2>
+ <div id="content">
+
+ <div class="section">
+ <h3>Your Things:</h3>
+ <div id="possListTable">loading...</div>
+ </div>
+ </div><!-- end content -->
+
+ <div id="rail">
+ <div class="section">
+ <h3>Your Templates:</h3>
+ <div id="templateListTable">
+ <tr><td>loading...</td></tr>
+ </div>
+ <form style="margin-top: 10px;" onsubmit="createNewTemplate('New Template'); return false;"><input type="submit" value="create a new template"/></form>
+ </div>
+
+ </div><!-- end rail -->
+</div> <!-- end main -->
+<div id="popOver"> </div>
+
+<div id="footer">
+
+</div>
+</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>
\ No newline at end of file
Modified: spaces/trunk/war/licenses.html
===================================================================
--- spaces/trunk/war/licenses.html 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/licenses.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -59,5 +59,6 @@
</div>
</div><!-- end content -->
+<!-- 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>
Deleted: spaces/trunk/war/liveConnectTest.html
===================================================================
--- spaces/trunk/war/liveConnectTest.html 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/liveConnectTest.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -1,53 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>Rendering test</title>
-<link rel="stylesheet" href="site.css" type="text/css" />
-
-<style type="text/css">
-
-#main {
- position: relative;
- top: 0px;
-}
-
-</style>
-<script type="text/javascript">
-function testLiveConnect(){
- var results = document.getElementById("results");
-
- if(typeof document.viewer == "undefined" || document.viewer == null){
- results.innerHTML = "Dang. I could not communicate with the applet.";
- return;
- }
- try {
- if(document.viewer.doesExist()){
- results.innerHTML = "Great! Live connect works."
- return;
- } else {
- results.innerHTML = "Dang. Could not use live connect."
- }
- } catch (error){
- results.innerHTML = "Dang. There was an error: " + error;
- return;
- }
-}
-</script>
-</head>
-<body>
-<div id="content">
-
-<div id="main">
-<h2>Applet test:</h2>
-<p>Attempting to load an applet and respond via button press.</p>
-<applet id='viewer' code='com.ogoglio.viewer.applet.TestApplet' archive='/og/testApplet.jar' width='300' height='50' mayscript='true'>
-</applet>
-
-<form onsubmit="testLiveConnect(); return false;"><input type="submit" value="Press Me" /></form>
-<div id="results"></div>
-</div><!-- end main -->
-</div><!-- end content -->
-<script src="footerInclude.js"></script>
-<!-- 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>
Deleted: spaces/trunk/war/notFound.html
===================================================================
--- spaces/trunk/war/notFound.html 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/notFound.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -1,33 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>Not Found: 404</title>
-
-<link rel="stylesheet" href="/site.css" type="text/css" />
-
-<style type="text/css">
-</style>
-
-<script type="text/javascript" src="ogoglio.js"></script>
-<script type="text/javascript" src="site.js"></script>
-
-<script type="text/javascript">
-function init(){
- populateLoginDiv();
-}
-</script>
-
-
-</head>
-<body onload="init();">
-<div id="content">
-
-<script src="headerInclude.js"></script>
-
-<h2>Sorry, that page was not found.</h2>
-
-<h3>Dang.</h3>
-</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....
[truncated message content] |