You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rave.apache.org by ca...@apache.org on 2012/08/27 19:45:04 UTC
svn commit: r1377768 - in
/rave/trunk/rave-portal-resources/src/main/webapp/static: css/rave-css.less
script/rave.js script/rave_opensocial.js
Author: carlucci
Date: Mon Aug 27 17:45:04 2012
New Revision: 1377768
URL: http://svn.apache.org/viewvc?rev=1377768&view=rev
Log:
RAVE-770: Update slideout popup to respect preferredWidth & preferredHeight module prefs. Patch supplied by Erin Noe-Payne
Modified:
rave/trunk/rave-portal-resources/src/main/webapp/static/css/rave-css.less
rave/trunk/rave-portal-resources/src/main/webapp/static/script/rave.js
rave/trunk/rave-portal-resources/src/main/webapp/static/script/rave_opensocial.js
Modified: rave/trunk/rave-portal-resources/src/main/webapp/static/css/rave-css.less
URL: http://svn.apache.org/viewvc/rave/trunk/rave-portal-resources/src/main/webapp/static/css/rave-css.less?rev=1377768&r1=1377767&r2=1377768&view=diff
==============================================================================
--- rave/trunk/rave-portal-resources/src/main/webapp/static/css/rave-css.less (original)
+++ rave/trunk/rave-portal-resources/src/main/webapp/static/css/rave-css.less Mon Aug 27 17:45:04 2012
@@ -1158,8 +1158,7 @@ span.error, label.error {
width: 451px;
height: 90%;
padding: 15px;
- overflow-y: auto;
- overflow-x: visible;
+ overflow: hidden;
z-index: 5000
}
Modified: rave/trunk/rave-portal-resources/src/main/webapp/static/script/rave.js
URL: http://svn.apache.org/viewvc/rave/trunk/rave-portal-resources/src/main/webapp/static/script/rave.js?rev=1377768&r1=1377767&r2=1377768&view=diff
==============================================================================
--- rave/trunk/rave-portal-resources/src/main/webapp/static/script/rave.js (original)
+++ rave/trunk/rave-portal-resources/src/main/webapp/static/script/rave.js Mon Aug 27 17:45:04 2012
@@ -430,7 +430,10 @@ var rave = rave || (function () {
}
}
- function createPopup(popupType) {
+ function createPopup(popupType, prefs) {
+ var height = (prefs && prefs.preferredHeight);
+ var width = (prefs && prefs.preferredWidth);
+
var target = POPUPS[popupType.toLowerCase()];
if (!target) {
@@ -442,6 +445,12 @@ var rave = rave || (function () {
}
var container = $(target.markup);
+ if(height) {
+ container.height(height);
+ }
+ if(width) {
+ container.width(width);
+ }
$("#pageContent").prepend(container);
if ($.type(target.initialize) == 'function') target.initialize(container);
@@ -955,11 +964,11 @@ var rave = rave || (function () {
function resetOpenAjaxHubInstance() {
openAjaxHub = null;
}
-
+
function renderNewWidget(regionWidgetId){
// When run as the callback argument supplied to rave.api.rpc.addWidgetToPage
// this method will render the widget in the current page.
-
+
// load widget into a placeholder element
var placeholder = document.createElement("div");
$(placeholder).load(rave.getContext()+"/api/rest/regionwidget/"+regionWidgetId, function(){
@@ -970,8 +979,7 @@ var rave = rave || (function () {
region.children(":first").children(":first").unwrap();
// initialize
initializeWidgets();
- }
- );
+ });
}
function initializeWidgets() {
@@ -1030,7 +1038,6 @@ var rave = rave || (function () {
}
function initializeWidget(widget) {
-
// Widget has been deleted on the page but not removed from list
var widgetBody = $(["#widget-", widget.regionWidgetId, "-body"].join(""));
if(widgetBody.length === 0){
@@ -1041,7 +1048,7 @@ var rave = rave || (function () {
return;
}
}
-
+
if (widget.type == "DISABLED") {
renderDisabledWidget(widget.regionWidgetId, unescape(widget.disabledMessage));
return;
Modified: rave/trunk/rave-portal-resources/src/main/webapp/static/script/rave_opensocial.js
URL: http://svn.apache.org/viewvc/rave/trunk/rave-portal-resources/src/main/webapp/static/script/rave_opensocial.js?rev=1377768&r1=1377767&r2=1377768&view=diff
==============================================================================
--- rave/trunk/rave-portal-resources/src/main/webapp/static/script/rave_opensocial.js (original)
+++ rave/trunk/rave-portal-resources/src/main/webapp/static/script/rave_opensocial.js Mon Aug 27 17:45:04 2012
@@ -86,7 +86,8 @@ rave.opensocial = rave.opensocial || (fu
container.views.createElementForGadget = function (metadata, rel, opt_view, opt_viewTarget, opt_coordinates, parentSite, opt_callback) {
if (opt_viewTarget) {
- return rave.createPopup(opt_viewTarget);
+ var prefs = (metadata && metadata.views && metadata.views[opt_view])
+ return rave.createPopup(opt_viewTarget, prefs);
}
};