|
From: <tre...@us...> - 2007-08-30 00:59:00
|
Revision: 292
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=292&view=rev
Author: trevorolio
Date: 2007-08-29 17:58:59 -0700 (Wed, 29 Aug 2007)
Log Message:
-----------
Added the path from a template script to the info panel.
Cannot send information in the other direction, yet.
Modified Paths:
--------------
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/ScriptSpace.java
maven/trunk/ogoglio-server/src/main/webapp/space.html
maven/trunk/ogoglio-server/src/main/webapp/spaceui.js
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.java 2007-08-29 21:43:58 UTC (rev 291)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.java 2007-08-30 00:58:59 UTC (rev 292)
@@ -454,6 +454,14 @@
listener.generatedSpaceEventForUser(username, spaceEvent, this);
}
+ public void showInfoPanelToUser(long sourceThingID, String username, String infoPanelHTML) {
+ SpaceEvent spaceEvent = new SpaceEvent(SpaceEvent.SHOW_INFO_PANEL_EVENT);
+ spaceEvent.setProperty(SpaceEvent.USERNAME, username);
+ spaceEvent.setProperty(SpaceEvent.THING_ID, new Long(sourceThingID));
+ spaceEvent.setProperty(SpaceEvent.INFO_PANEL_HTML, infoPanelHTML);
+ listener.generatedSpaceEventForUser(username, spaceEvent, this);
+ }
+
public DoorDocument addDoor(String displayName, long templateID, String templateOwner, URI link, Transform3D transform) {
Template template = getTemplate(templateID);
Door door = new Door(space, template, -1, displayName, link, transform);
@@ -1048,5 +1056,4 @@
public void mouseContextClickedThing(Thing thing, String name, int x, int y) {
}
}
-
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/ScriptSpace.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/ScriptSpace.java 2007-08-29 21:43:58 UTC (rev 291)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/ScriptSpace.java 2007-08-30 00:58:59 UTC (rev 292)
@@ -98,6 +98,10 @@
return spaceSimulator.removeSetting(key);
}
+ public void jsFunction_showInfoPanel(double sourceThingID, String username, String infoPanelHTML){
+ spaceSimulator.showInfoPanelToUser((long)sourceThingID, username, infoPanelHTML);
+ }
+
public void jsFunction_log(String message) {
spaceSimulator.log(message);
}
Modified: maven/trunk/ogoglio-server/src/main/webapp/space.html
===================================================================
--- maven/trunk/ogoglio-server/src/main/webapp/space.html 2007-08-29 21:43:58 UTC (rev 291)
+++ maven/trunk/ogoglio-server/src/main/webapp/space.html 2007-08-30 00:58:59 UTC (rev 292)
@@ -11,6 +11,10 @@
<script type="text/javascript" src="/og/spaceui.js"></script>
<style type="text/css">
+body {
+ width: 1050px;
+}
+
#spaceDiv {
width: 758px;
height: 500px;
@@ -41,6 +45,23 @@
#sendCommandButton {
width: 90px;
}
+
+#infoDiv {
+ float:right;
+ padding: 10px 0px 10px 0px;
+ width: 270px;
+ height: 580px;
+ background-color: #FFF;
+}
+
+.infoPanel {
+ width: 100%;
+ padding: 2px;
+ margin: 0px 0px 10px 0px;
+ border-style: solid;
+ border-width: 10px 1px 1px 1px;
+ border-color: #CCD;
+}
</style>
<script type="text/javascript">
@@ -70,6 +91,9 @@
</div> <!-- end header menu -->
<div style="margin: 0px;">
+ <div id="infoDiv"> </div>
+
+ </div>
<div id="spaceDiv">
<noscript><div style="width: 100%; text-align: center; color: #911;">You must enable javascript to view this page.</div></noscript>
</div>
Modified: maven/trunk/ogoglio-server/src/main/webapp/spaceui.js
===================================================================
--- maven/trunk/ogoglio-server/src/main/webapp/spaceui.js 2007-08-29 21:43:58 UTC (rev 291)
+++ maven/trunk/ogoglio-server/src/main/webapp/spaceui.js 2007-08-30 00:58:59 UTC (rev 292)
@@ -136,6 +136,7 @@
chatHistory.innerHTML += "<strong>" + username + "</strong>: " + markupChatMessage(text) + "<br />";
chatHistory.scrollTop = chatHistory.scrollHeight;
+ focusCommandField();
}
var emoteIconBase = appPath + "/icons/16x16/";
@@ -196,4 +197,43 @@
addAuthListeners(spaceHandleAuth, spaceHandleAuth);
}
+//############## Start Info Panel Functions ##################
+var infoPanels = new Array();
+
+function addInfoPanel(id, panelHTML){
+ var infoDiv = document.getElementById("infoDiv");
+ if(infoDiv == null){
+ return;
+ }
+ var panelID = "infoPanel-" + id;
+ var infoPanelElement = document.createElement("div");
+ infoPanelElement.setAttribute("id", panelID);
+ infoPanelElement.setAttribute("class", "infoPanel");
+ infoPanelElement.innerHTML = panelHTML;
+
+ if(infoPanels[id] != null){
+ infoDiv.replaceChild(infoPanelElement, infoPanels[id]);
+ infoPanels[id] = infoPanelElement;
+ } else {
+ var tempElement = document.createElement("div");
+ infoDiv.appendChild(tempElement);
+ infoDiv.appendChild(infoPanelElement);
+ infoDiv.removeChild(tempElement);
+ infoPanels[id] = infoPanelElement;
+ infoPanels[id].focus();
+ }
+}
+
+function removeInfoPanel(id){
+ var infoDiv = document.getElementById("infoDiv");
+ if(infoDiv == null){
+ return;
+ }
+ if(infoPanels[id] == null){
+ return;
+ }
+ infoDiv.removeChild(infoPanels[id]);
+ infoPanels[id] = null;
+}
+
// 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.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|