You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rave.apache.org by sc...@apache.org on 2011/11/03 17:27:45 UTC
svn commit: r1197206 -
/incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_wookie.js
Author: scottbw
Date: Thu Nov 3 16:27:45 2011
New Revision: 1197206
URL: http://svn.apache.org/viewvc?rev=1197206&view=rev
Log:
Provide better styling for the W3C Widget iFrame, and put in support for Widget-specific min-height and min-width
Modified:
incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_wookie.js
Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_wookie.js
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_wookie.js?rev=1197206&r1=1197205&r2=1197206&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_wookie.js (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_wookie.js Thu Nov 3 16:27:45 2011
@@ -25,12 +25,30 @@ rave.wookie = rave.wookie || (function()
var container;
function validateAndRenderWidget(widget){
+
var widgetBodyElement = document.getElementById(["widget-", widget.regionWidgetId, "-body"].join(""));
var widgetIframe = document.createElement("iframe");
- widgetIframe.setAttribute("height",250);
- widgetIframe.setAttribute("width",250);
+
+ if (widget.height){
+ widgetIframe.setAttribute("height",widget.height);
+ widgetIframe.setAttribute("min-height",MIN_HEIGHT+"px");
+ } else {
+ widgetIframe.setAttribute("height",MIN_HEIGHT+"px");
+ widgetIframe.setAttribute("min-height",MIN_HEIGHT+"px");
+ }
+ if (widget.width) {
+ widgetIframe.setAttribute("style","width: 100%; min-width: "+widget.width);
+ } else {
+ widgetIframe.setAttribute("style","width: 100%");
+ }
widgetIframe.setAttribute("src",widget.widgetUrl);
+ widgetIframe.setAttribute("scroll","no");
+ widgetIframe.setAttribute("frameborder","0");
+ widgetIframe.setAttribute("vspace","0");
+ widgetIframe.setAttribute("hspace","0");
+ widgetIframe.setAttribute("marginheight","0");
+ widgetIframe.setAttribute("marginwidth","0");
widgetBodyElement.appendChild(widgetIframe);
}