Author: erinnp
Date: Fri Apr  5 18:34:53 2013
New Revision: 1465087

URL: http://svn.apache.org/r1465087
Log:
RAVE-946, RAVE-947, RAVE-948

Fixed widget cog menu items for rate, comment on, and about this widget to 
correctly to resolve by widgetId, not regionWidgetId
Wrote rave.log to wrap console.log rather than apply arguments.
Keyed wookie widgets off of provider name w3c rather than wookie.
Manually declared order of js resources for minification to prevent errors with 
js debug mode off.
Implemented collapse and expand on HomeView.


Modified:
    rave/branches/0.21.1/rave-portal-resources/src/main/resources/wro.xml
    
rave/branches/0.21.1/rave-portal-resources/src/main/webapp/static/script/core/rave_core.js
    
rave/branches/0.21.1/rave-portal-resources/src/main/webapp/static/script/core/rave_wookie.js
    
rave/branches/0.21.1/rave-portal-resources/src/main/webapp/static/script/portal/rave_admin.js
    
rave/branches/0.21.1/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js

Modified: rave/branches/0.21.1/rave-portal-resources/src/main/resources/wro.xml
URL: 
http://svn.apache.org/viewvc/rave/branches/0.21.1/rave-portal-resources/src/main/resources/wro.xml?rev=1465087&r1=1465086&r2=1465087&view=diff
==============================================================================
--- rave/branches/0.21.1/rave-portal-resources/src/main/resources/wro.xml 
(original)
+++ rave/branches/0.21.1/rave-portal-resources/src/main/resources/wro.xml Fri 
Apr  5 18:34:53 2013
@@ -20,10 +20,23 @@ under the License.
 <groups xmlns="http://www.isdc.ro/wro";>
     <!-- defines a wro4j group called rave-all.min which represents all of our 
javascript files -->
     <group name="rave.core.min">
-        <js>/static/script/core/*.js</js>
+        <js>/static/script/core/rave_core.js</js>
+        <js>/static/script/core/rave_ajax.js</js>
+        <js>/static/script/core/rave_api.js</js>
+        <js>/static/script/core/rave_widget.js</js>
+        <js>/static/script/core/rave_opensocial.js</js>
+        <js>/static/script/core/rave_wookie.js</js>
     </group>
     <group name="rave.portal.min">
-        <js>/static/script/portal/*.js</js>
+        <js>/static/script/portal/rave_portal.js</js>
+        <js>/static/script/portal/rave_backbone.js</js>
+        <js>/static/script/portal/rave_models.js</js>
+        <js>/static/script/portal/rave_layout.js</js>
+        <js>/static/script/portal/rave_ui.js</js>
+        <js>/static/script/portal/rave_forms.js</js>
+        <js>/static/script/portal/rave_person_profile.js</js>
+        <js>/static/script/portal/rave_store.js</js>
+        <js>/static/script/portal/rave_admin.js</js>
     </group>
     <!-- defines a wro4j group called rave_css which represents the rave less 
file -->
     <group name="rave">

Modified: 
rave/branches/0.21.1/rave-portal-resources/src/main/webapp/static/script/core/rave_core.js
URL: 
http://svn.apache.org/viewvc/rave/branches/0.21.1/rave-portal-resources/src/main/webapp/static/script/core/rave_core.js?rev=1465087&r1=1465086&r2=1465087&view=diff
==============================================================================
--- 
rave/branches/0.21.1/rave-portal-resources/src/main/webapp/static/script/core/rave_core.js
 (original)
+++ 
rave/branches/0.21.1/rave-portal-resources/src/main/webapp/static/script/core/rave_core.js
 Fri Apr  5 18:34:53 2013
@@ -174,8 +174,11 @@ rave = (function () {
     }
 
     //wrap a safe version of console.log
-    exports.log = (console && console.log) || function () {
-    };
+    exports.log = function(msg){
+        if  (console && console.log) {
+            console.log(msg);
+        }
+    }
 
     //reset internal data - used for testing cleanup
     exports.reset = function () {

Modified: 
rave/branches/0.21.1/rave-portal-resources/src/main/webapp/static/script/core/rave_wookie.js
URL: 
http://svn.apache.org/viewvc/rave/branches/0.21.1/rave-portal-resources/src/main/webapp/static/script/core/rave_wookie.js?rev=1465087&r1=1465086&r2=1465087&view=diff
==============================================================================
--- 
rave/branches/0.21.1/rave-portal-resources/src/main/webapp/static/script/core/rave_wookie.js
 (original)
+++ 
rave/branches/0.21.1/rave-portal-resources/src/main/webapp/static/script/core/rave_wookie.js
 Fri Apr  5 18:34:53 2013
@@ -18,7 +18,7 @@
  */
 
 rave.registerProvider(
-    'wookie',
+    'w3c',
     (function () {
         var exports = {}
 

Modified: 
rave/branches/0.21.1/rave-portal-resources/src/main/webapp/static/script/portal/rave_admin.js
URL: 
http://svn.apache.org/viewvc/rave/branches/0.21.1/rave-portal-resources/src/main/webapp/static/script/portal/rave_admin.js?rev=1465087&r1=1465086&r2=1465087&view=diff
==============================================================================
--- 
rave/branches/0.21.1/rave-portal-resources/src/main/webapp/static/script/portal/rave_admin.js
 (original)
+++ 
rave/branches/0.21.1/rave-portal-resources/src/main/webapp/static/script/portal/rave_admin.js
 Fri Apr  5 18:34:53 2013
@@ -17,3 +17,51 @@
  * under the License.
  */
 
+var rave = rave || {};
+rave.admin = rave.admin || (function() {
+
+    var adminUi = (function() {
+
+        function datatableClick() {
+            $('.datatable tr').bind('click', function() {
+                var link = $(this).attr('data-detaillink');
+                if (link != undefined && link != '') {
+                    window.location = link;
+                }
+            });
+        }
+
+        //Resize bootstrap modal & adjust margins to size of image.
+        function resizeImageModal(){
+            $('#thumbnailModal, #screenshotModal').on('shown', function () {
+                if(!$(this).hasClass("sized")){
+                    var imageWidth = $(this).find("img").width(),
+                        imageHeight = $(this).find("img").height(),
+                        footerHeight = 
$(this).find(".modal-footer").outerHeight(),
+                        headerHeight = 
$(this).find(".modal-header").outerHeight(),
+                        totalHeight = imageHeight + footerHeight + 
headerHeight;
+
+                    $(this).css({
+                        width: imageWidth + "px",
+                        'margin-top': "-" + Math.round(totalHeight/2) + "px",
+                        'margin-left': "-" + Math.round(imageWidth/2) + "px"
+                    }).addClass("sized");
+                }
+            });
+        }
+
+        function init() {
+            datatableClick();
+            resizeImageModal();
+        }
+
+        return {
+            init:init
+        }
+    })();
+
+    return {
+        initAdminUi : adminUi.init
+    }
+
+})();

Modified: 
rave/branches/0.21.1/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js
URL: 
http://svn.apache.org/viewvc/rave/branches/0.21.1/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js?rev=1465087&r1=1465086&r2=1465087&view=diff
==============================================================================
--- 
rave/branches/0.21.1/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js
 (original)
+++ 
rave/branches/0.21.1/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js
 Fri Apr  5 18:34:53 2013
@@ -569,23 +569,24 @@ _.extend(rave.ui, (function () {
         var HomeView = function (widget) {
             this.widget = widget;
 
-            var widgetId = widget.regionWidgetId;
+            var regionWidgetId = widget.regionWidgetId;
 
-            this.$chrome = $('#widget-' + widgetId + '-wrapper');
-            this.$minimizeIcon = $("#widget-" + widgetId + "-min");
-            this.$toggleCollapseIcon = $("#widget-" + widgetId + "-collapse");
-            this.$menuItemMove = $("#widget-" + widgetId + "-menu-move-item");
-            this.$menuItemDelete = $("#widget-" + widgetId + 
"-menu-delete-item");
-            this.$menuItemMaximize = $("#widget-" + widgetId + 
"-menu-maximize-item");
-            this.$menuItemAbout = $("#widget-" + widgetId + 
"-menu-about-item");
-            this.$menuItemComment = $("#widget-" + widgetId + 
"-menu-comment-item");
-            this.$menuItemRate = $("#widget-" + widgetId + "-menu-rate-item");
-            this.$menuItemEditPrefs = $("#widget-" + widgetId + 
"-menu-editprefs-item");
-            this.$widgetSite = $("#widget-" + widgetId + "-body");
+            this.$chrome = $('#widget-' + regionWidgetId + '-wrapper');
+            this.$minimizeIcon = $("#widget-" + regionWidgetId + "-min");
+            this.$toggleCollapseIcon = $("#widget-" + regionWidgetId + 
"-collapse");
+            this.$menuItemMove = $("#widget-" + regionWidgetId + 
"-menu-move-item");
+            this.$menuItemDelete = $("#widget-" + regionWidgetId + 
"-menu-delete-item");
+            this.$menuItemMaximize = $("#widget-" + regionWidgetId + 
"-menu-maximize-item");
+            this.$menuItemAbout = $("#widget-" + regionWidgetId + 
"-menu-about-item");
+            this.$menuItemComment = $("#widget-" + regionWidgetId + 
"-menu-comment-item");
+            this.$menuItemRate = $("#widget-" + regionWidgetId + 
"-menu-rate-item");
+            this.$menuItemEditPrefs = $("#widget-" + regionWidgetId + 
"-menu-editprefs-item");
+            this.$widgetSite = $("#widget-" + regionWidgetId + "-body");
         }
 
         HomeView.prototype.render = function (widget) {
-            var widgetId = this.widget.regionWidgetId;
+            var regionWidgetId = this.widget.regionWidgetId;
+            var widgetId = this.widget.widgetId;
             var self = this;
 
             doCollapseExpand();
@@ -595,13 +596,13 @@ _.extend(rave.ui, (function () {
                 $(".dnd-overlay, .canvas-overlay").remove();
                 getNonLockedRegions().sortable("option", "disabled", false);
                 // display the widget in normal view
-                $("#widget-" + widgetId + 
"-wrapper").removeClass("widget-wrapper-canvas").addClass("widget-wrapper");
+                $("#widget-" + regionWidgetId + 
"-wrapper").removeClass("widget-wrapper-canvas").addClass("widget-wrapper");
                 // hide the widget minimize button
-                $("#widget-" + widgetId + "-min").hide();
+                $("#widget-" + regionWidgetId + "-min").hide();
                 // show the widget menu
-                $("#widget-" + widgetId + "-widget-menu-wrapper").show();
+                $("#widget-" + regionWidgetId + "-widget-menu-wrapper").show();
                 // show the collapse/restore toggle icon
-                $("#widget-" + widgetId + "-collapse").show();
+                $("#widget-" + regionWidgetId + "-collapse").show();
                 // if the widget is collapsed execute the collapse function
                 // otherwise execute the minimize function
                 return false;
@@ -638,7 +639,7 @@ _.extend(rave.ui, (function () {
                 // Clear the dropdown box; needing to do self may be a bug?
                 $('.dropdown').removeClass('open');
                 // Open the modal
-                $("#moveWidgetModal").data('regionWidgetId', widgetId);
+                $("#moveWidgetModal").data('regionWidgetId', regionWidgetId);
                 $("#moveWidgetModal").modal('show');
 
                 return false;
@@ -669,7 +670,7 @@ _.extend(rave.ui, (function () {
                 return false;
             }
 
-            $('#widget-' + widgetId + '-toolbar').mousedown(function (event) {
+            $('#widget-' + regionWidgetId + '-toolbar').mousedown(function 
(event) {
                 // don't allow drag and drop when self item is clicked
                 event.stopPropagation();
             });
@@ -710,6 +711,12 @@ _.extend(rave.ui, (function () {
                 displayEmptyPageMessage();
             }
         }
+        HomeView.prototype.expand = function(){
+            this.$chrome.show();
+        }
+        HomeView.prototype.collapse = function(){
+            this.$chrome.hide();
+        }
 
         rave.registerView('home', HomeView);
     }


Reply via email to