rave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scot...@apache.org
Subject svn commit: r1101981 - in /incubator/rave/trunk/rave-portal/src/main/webapp: WEB-INF/views/home.jsp script/rave_wookie.js
Date Wed, 11 May 2011 17:08:15 GMT
Author: scottbw
Date: Wed May 11 17:08:15 2011
New Revision: 1101981

URL: http://svn.apache.org/viewvc?rev=1101981&view=rev
Log:
Added scripting to support using W3C Widgets in Iframes on a page (see RAVE-30)

Added:
    incubator/rave/trunk/rave-portal/src/main/webapp/script/rave_wookie.js
Modified:
    incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/home.jsp

Modified: incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/home.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/home.jsp?rev=1101981&r1=1101980&r2=1101981&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/home.jsp (original)
+++ incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/home.jsp Wed May 11 17:08:15
2011
@@ -58,6 +58,7 @@
 <script src="${opensocial_engine_url}/js/container.js?c=1&container=default&debug=1"
type="text/javascript"></script>
 <script src="<spring:url value="/script/rave.js"/>" type="text/javascript"></script>
 <script src="<spring:url value="/script/rave_opensocial.js"/>" type="text/javascript"></script>
+<script src="<spring:url value="/script/rave_wookie.js"/>" type="text/javascript"></script>
 
 <script type="text/javascript">
     rave.opensocial.init();
@@ -72,6 +73,7 @@
     //Get a map of widgets keyed by their type
     var widgetMap = rave.createWidgetMap(widgets);
     rave.opensocial.initGadgets(widgetMap[rave.opensocial.TYPE]);
+    rave.wookie.initWidgets(widgetMap[rave.wookie.TYPE]);
 </script>
 
 </body>

Added: incubator/rave/trunk/rave-portal/src/main/webapp/script/rave_wookie.js
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/webapp/script/rave_wookie.js?rev=1101981&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/webapp/script/rave_wookie.js (added)
+++ incubator/rave/trunk/rave-portal/src/main/webapp/script/rave_wookie.js Wed May 11 17:08:15
2011
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+var rave = rave || {};
+rave.wookie = rave.wookie || (function() {
+
+    var WIDGET_TYPE = "W3C";
+
+    function createWidgets(widgets){
+        alert("Wookieeee!");
+        if(!widgets || widgets.length == 0) return;
+        
+        for(var i = 0; i < widgets.length; i++){
+            var widgetBodyElement = document.getElementById(["widget-", widgets[i].regionWidgetId,
"-body"].join(""));
+            var widgetIframe = document.createElement("iframe");
+            widgetIframe.setAttribute("height",250);
+            widgetIframe.setAttribute("width",250);
+            widgetIframe.setAttribute("src",widgets[i].widgetUrl);
+            widgetBodyElement.appendChild(widgetIframe);
+        }
+    }
+
+    /**
+     * Exposed public API calls
+     */
+    return {
+        TYPE : WIDGET_TYPE,
+        
+        /**
+         * Renders the given Widgets list
+         * @param a list of widgets to render
+         */
+        initWidgets: createWidgets
+
+    };
+
+
+})();
\ No newline at end of file



Mime
View raw message