rave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ja...@apache.org
Subject svn commit: r1141548 - /incubator/rave/trunk/rave-portal/src/main/webapp/script/rave_api.js
Date Thu, 30 Jun 2011 14:18:26 GMT
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);
       }



Mime
View raw message