You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rave.apache.org by ja...@apache.org on 2011/06/30 16:18:26 UTC

svn commit: r1141548 - /incubator/rave/trunk/rave-portal/src/main/webapp/script/rave_api.js

Author: jasha
Date: Thu Jun 30 14:18:25 2011
New Revision: 1141548

URL: http://svn.apache.org/viewvc?rev=1141548&view=rev
Log:
RAVE-44 Need message display to user confirming widget addition from repository

Modified:
    incubator/rave/trunk/rave-portal/src/main/webapp/script/rave_api.js

Modified: incubator/rave/trunk/rave-portal/src/main/webapp/script/rave_api.js
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/webapp/script/rave_api.js?rev=1141548&r1=1141547&r2=1141548&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/webapp/script/rave_api.js (original)
+++ incubator/rave/trunk/rave-portal/src/main/webapp/script/rave_api.js Thu Jun 30 14:18:25 2011
@@ -46,7 +46,7 @@ rave.api = rave.api || (function() {
                         }
                     }
             ).error(handleError);
-				console.log("moveWidgetOnPage parameters: WidgetID: "+widgetObjectId+" "+"toRegion: "+toRegionObjectId+" "+"fromRegion: "+fromRegionObjectId);
+            console.log("moveWidgetOnPage parameters: WidgetID: "+widgetObjectId+" "+"toRegion: "+toRegionObjectId+" "+"fromRegion: "+fromRegionObjectId);
         }
 
         function addWidgetToPage(args) {
@@ -57,6 +57,14 @@ rave.api = rave.api || (function() {
                     function(result) {
                         if (result.error) {
                             handleRpcError(result);
+                        } else {
+                            var widgetTitle = "The widget";
+                            var addedWidget = result.result != undefined ? result.result.widget : undefined;
+                            
+                            if (addedWidget != undefined && addedWidget.title != undefined && addedWidget.title.length > 0) {
+                                widgetTitle = addedWidget.title;
+                            }
+                            alert(widgetTitle + " has been added to your page");
                         }
                     }).error(handleError);
         }
@@ -72,8 +80,9 @@ rave.api = rave.api || (function() {
                   handleRpcError(result);
                 } else {
                     rave.mapGadgetToRegion(args.regionWidgetId, null);
-                	if (args.succCB != null && typeof args.succCB == 'function')
-                		args.succCB();
+                    if (args.succCB != null && typeof args.succCB == 'function') {
+                        args.succCB();
+                    }
                 }
              }).error(handleError);
       }