You are viewing a plain text version of this content. The canonical link for it is here.
Posted to portalapps-dev@portals.apache.org by wo...@apache.org on 2010/05/04 17:13:11 UTC

svn commit: r940896 - in /portals/applications/sandbox/csre/trunk/src/main/webapp: index.jsp themes/gogreen/css/styles.css

Author: woonsan
Date: Tue May  4 15:13:10 2010
New Revision: 940896

URL: http://svn.apache.org/viewvc?rev=940896&view=rev
Log:
CSRE: adding client codes.

Modified:
    portals/applications/sandbox/csre/trunk/src/main/webapp/index.jsp
    portals/applications/sandbox/csre/trunk/src/main/webapp/themes/gogreen/css/styles.css

Modified: portals/applications/sandbox/csre/trunk/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/csre/trunk/src/main/webapp/index.jsp?rev=940896&r1=940895&r2=940896&view=diff
==============================================================================
--- portals/applications/sandbox/csre/trunk/src/main/webapp/index.jsp (original)
+++ portals/applications/sandbox/csre/trunk/src/main/webapp/index.jsp Tue May  4 15:13:10 2010
@@ -8,17 +8,26 @@ var csre_config = { base: "/csre" };
 </script>
 <script type="text/javascript" src="javascript/csre/csre.js"></script>
 <script type="text/javascript">
+var desktop = null;
+
 function test_onclick() {
     // initialize desktop and workspace
-    var desktop = csre_desktop;
-    var workspace = desktop.createWorkspace();
-    desktop.addWorkspace(workspace);
-
-    // add widgets
+    if (!desktop) {
+        desktop = csre_desktop;
+        var workspace = desktop.createWorkspace();
+        desktop.addWorkspace(workspace);
+    }
+    
+    // create a dom element for a widget
+    var widgetDom = document.getElementById("widgetTemplate").cloneNode(true);
+    widgetDom.id = "awidget" + new Date().getTime();
+    widgetDom.style.display = "";
+    document.body.appendChild(widgetDom);
+    
+    // create a widget and attach the dom element to the widget. 
     var widget = desktop.createWidget();
     desktop.get("workspace").addWidget(widget);
-    document.getElementById("awidget").style.display = "";
-    widget.set("node", "#awidget");
+    widget.set("node", "#" + widgetDom.id);
     widget.render();
 }
 </script>
@@ -35,14 +44,14 @@ function test_onclick() {
 <div class="workspace" style="WIDTH: 800; HEIGHT: 600; OVERFLOW: auto">
 </div>
 
-<div id="awidget" style="DISPLAY: none" style="border: 1px">
-  <div class="yui3-widget-hd" style="border: black solid 1px">
-    <span><strong>Title</strong></span>
+<div id="widgetTemplate" class="widget" style="DISPLAY: none">
+  <div class="yui3-widget-hd">
+    <span><strong>A Widget</strong></span>
   </div>
-  <div class="yui3-widget-bd" style="border: black solid 1px">
+  <div class="yui3-widget-bd">
     <h3>Widget Example</h3>
   </div>
-  <div class="yui3-widget-ft" style="border: black solid 1px">
+  <div class="yui3-widget-ft">
     <span><strong>Footer</strong></span>
   </div>
 </div>

Modified: portals/applications/sandbox/csre/trunk/src/main/webapp/themes/gogreen/css/styles.css
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/csre/trunk/src/main/webapp/themes/gogreen/css/styles.css?rev=940896&r1=940895&r2=940896&view=diff
==============================================================================
--- portals/applications/sandbox/csre/trunk/src/main/webapp/themes/gogreen/css/styles.css (original)
+++ portals/applications/sandbox/csre/trunk/src/main/webapp/themes/gogreen/css/styles.css Tue May  4 15:13:10 2010
@@ -15,4 +15,25 @@ See the License for the specific languag
 limitations under the License.
 */
 
-.workspace { background-color: #efe }
+.workspace { 
+    background-color: #efe;
+}
+
+.widget {
+    background-color: #fff;
+}
+
+.yui3-widget-hd {
+    background-color: #eef;
+	border: black solid 1px;
+}
+
+.yui3-widget-bd {
+    background-color: #fff;
+	border: black solid 1px;
+}
+
+.yui3-widget-ft {
+    background-color: #eef;
+	border: black solid 1px;
+}