Author: erinnp
Date: Mon Jun 24 22:36:53 2013
New Revision: 1496244

URL: http://svn.apache.org/r1496244
Log:
bug fixes, update templates to register handlebars helpers

Modified:
    
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/addwidget.jsp
    
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/addwidget.marketplace.jsp
    
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/addwidget.w3c.jsp
    
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/categories.jsp
    
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/preferences.jsp
    
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/users.jsp
    
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/widgetdetail.jsp
    
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/widgets.jsp
    
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/error.jsp
    
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/mobile_home.jsp
    
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp
    
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/personProfile.jsp
    
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/store.jsp
    
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/widget.jsp
    
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/tags/rave_js.tag
    
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/core/rave_api.js
    
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/main.js
    
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_admin.js
    
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_display.js
    
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_event_bindings.js
    
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_store.js
    
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_templates.js
    
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/addwidget.jsp
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/addwidget.jsp?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/addwidget.jsp
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/addwidget.jsp
 Mon Jun 24 22:36:53 2013
@@ -131,14 +131,14 @@
 
 <portal:register-init-script location="${'AFTER_RAVE'}">
 <script>
-    require(['portal/rave_event_bindings', "jquery"], 
function(raveEventBindings, $){
+    require(['ui', "jquery"], function(ui, $){
         $(function() {
             if ($('#url').val().length === 0) {
                 $('#addWidgetForm').hide();
                 $('#addWidgetFormSubmit').hide();
             }
 
-            raveEventBindings.bindEvents('addWidget.jsp');
+            ui.bindEvents('addWidget.jsp');
     })});
 </script>
 </portal:register-init-script>

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/addwidget.marketplace.jsp
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/addwidget.marketplace.jsp?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/addwidget.marketplace.jsp
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/addwidget.marketplace.jsp
 Mon Jun 24 22:36:53 2013
@@ -243,10 +243,10 @@
 
 <portal:register-init-script location="${'AFTER_RAVE'}">
     <script>
-        require(["portal/rave_store", "portal/rave_event_bindings", "jquery"], 
function(raveStore, raveEventBindings, $){
+        require(["portal/rave_store", "ui", "jquery"], function(raveStore, ui, 
$){
             $(function () {
                 raveStore.init('<c:out value="${referringPageId}"/>');
-                raveEventBindings.bindEvents("addwidget.marketplace.jsp")
+                ui.bindEvents("addwidget.marketplace.jsp")
             });
         })
     </script>

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/addwidget.w3c.jsp
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/addwidget.w3c.jsp?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/addwidget.w3c.jsp
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/addwidget.w3c.jsp
 Mon Jun 24 22:36:53 2013
@@ -137,7 +137,7 @@
 
 <portal:register-init-script location="${'AFTER_RAVE'}">
 <script>
-    require(["core/main"], function(main){
+    require(["rave"], function(rave){
         $(function() {
             if ($('#url').val().length === 0) {
                 $('#addWidgetForm').hide();

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/categories.jsp
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/categories.jsp?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/categories.jsp
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/categories.jsp
 Mon Jun 24 22:36:53 2013
@@ -108,7 +108,7 @@
     <script>
         require(["portal/rave_admin", "jquery"], function(raveAdmin, $){
             $(function() {
-                raveAdmin.initAdminUi();
+                raveAdmin.init();
             });
         })
     </script>

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/preferences.jsp
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/preferences.jsp?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/preferences.jsp
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/preferences.jsp
 Mon Jun 24 22:36:53 2013
@@ -76,10 +76,10 @@
 </div> 
 <portal:register-init-script location="${'AFTER_RAVE'}">
     <script>
-       require(["portal/rave_admin", "jquery"], function(raveAdmin, $){
-           $(function() {
-               raveAdmin.initAdminUi();
-           });
-       })
+        require(["portal/rave_admin", "jquery"], function(raveAdmin, $){
+            $(function() {
+                raveAdmin.init();
+            });
+        })
     </script>
 </portal:register-init-script>

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/users.jsp
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/users.jsp?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/users.jsp
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/users.jsp
 Mon Jun 24 22:36:53 2013
@@ -103,8 +103,7 @@
     <script>
         require(["portal/rave_admin", "jquery"], function(raveAdmin, $){
             $(function() {
-                raveAdmin.initAdminUi();
-
+                raveAdmin.init();
             });
         })
     </script>

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/widgetdetail.jsp
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/widgetdetail.jsp?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/widgetdetail.jsp
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/widgetdetail.jsp
 Mon Jun 24 22:36:53 2013
@@ -266,7 +266,7 @@
     <script>
         require(["portal/rave_admin", "portal/rave_event_bindings", "jquery"], 
function(raveAdmin, raveEventBindings, $){
             $(function() {
-                raveAdmin.initAdminUi();
+                raveAdmin.init();
 
                 raveEventBindings.bindEvents('widgetdetail.jsp');
             });

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/widgets.jsp
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/widgets.jsp?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/widgets.jsp
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/widgets.jsp
 Mon Jun 24 22:36:53 2013
@@ -117,7 +117,7 @@
     <script>
         require(["portal/rave_admin", "jquery"], function(raveAdmin, $){
             $(function() {
-                raveAdmin.initAdminUi();
+                raveAdmin.init();
             });
         })
     </script>

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/error.jsp
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/error.jsp?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/error.jsp
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/error.jsp
 Mon Jun 24 22:36:53 2013
@@ -69,8 +69,8 @@ and use it as the default error page for
 
 
         <script>
-            require(["portal/rave_event_bindings", "jquery"], 
function(raveEventBindings, $){
-                $(function(){raveEventBindings.bindEvents('error.jsp')});
+            require(["ui", "jquery"], function(ui, $){
+                $(function(){ui.bindEvents('error.jsp')});
             })
         </script>
     </tiles:putAttribute>

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/mobile_home.jsp
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/mobile_home.jsp?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/mobile_home.jsp
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/mobile_home.jsp
 Mon Jun 24 22:36:53 2013
@@ -142,11 +142,11 @@
 
 <portal:register-init-script location="${'AFTER_RAVE'}">
     <script>
-        require(["portal/rave_portal", "portal/rave_event_bindings", 
"jquery"], function(ravePortal, raveEventBindings, $){
+        require(["rave", "ui", "jquery"], function(rave, ui, $){
             $(function() {
-                ravePortal.initPageEditorStatus(<c:out 
value="${pageUser.editor}"/>);
+                rave.getViewer().editor =<c:out value="${pageUser.editor}"/>;
 
-                raveEventBindings.bindEvents('mobile_home.jsp');
+                ui.bindEvents('mobile_home.jsp');
             });
         })
     </script>

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp
 Mon Jun 24 22:36:53 2013
@@ -446,8 +446,6 @@
             ui.models.currentPage.addInitData('${member.id}', 
${members.editor})
             </c:forEach>
 
-            rave.init();
-
             $(function () {
                 ui.bindEvents('page.jsp');
                 rave.renderWidgets('home');

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/personProfile.jsp
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/personProfile.jsp?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/personProfile.jsp
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/personProfile.jsp
 Mon Jun 24 22:36:53 2013
@@ -27,7 +27,7 @@
 
 <!-- get the display name of user -->
 <fmt:message key="page.personProfile.title" var="pageTitle">
-       <fmt:param><c:out value="${userProfile.displayName}" /></fmt:param>
+    <fmt:param><c:out value="${userProfile.displayName}"/></fmt:param>
 </fmt:message>
 <tiles:putAttribute name="pageTitleKey" value="${pageTitle}"/>
 <tiles:importAttribute name="pageTitleKey" scope="request"/>
@@ -55,9 +55,10 @@
         <div class="span9">
             <div id="personProfileContent">
                 <c:url var="profileUrl" value="/app/person">
-                    <c:param name="referringPageId" value="${referringPageId}" 
/>
+                    <c:param name="referringPageId" 
value="${referringPageId}"/>
                 </c:url>
-                <form:form id="editAccountForm" commandName="userProfile" 
action="${profileUrl}" method="POST" class="form-horizontal">
+                <form:form id="editAccountForm" commandName="userProfile" 
action="${profileUrl}" method="POST"
+                           class="form-horizontal">
 
                     <fieldset class="row-fluid" id="userProfilePrimaryData">
                         <div class="span2 profile-user-thumb">
@@ -68,11 +69,15 @@
                             <!-- Display user info-->
                             <div class="profile-info-visible">
                                 <h2><c:out 
value="${userProfile.displayName}"/></h2>
-                                <h3><span id="givenName"><c:out 
value="${userProfile.givenName}"/></span>&nbsp;<span id="familyName"><c:out 
value="${userProfile.familyName}"/></span></h3>
+
+                                <h3><span id="givenName"><c:out 
value="${userProfile.givenName}"/></span>&nbsp;<span
+                                        id="familyName"><c:out 
value="${userProfile.familyName}"/></span></h3>
+
                                 <p class="profile-user-status">
                                     <fmt:message key="page.profile.status"/>
                                     &nbsp;<span id="status"><c:out 
value="${userProfile.status}"/></span>
                                 </p>
+
                                 <p class="profile-info-visible">
                                     <fmt:message key="page.profile.about.me"/>
                                     &nbsp;<span id="aboutMe"><c:out value=" 
${userProfile.aboutMe}"/></span>
@@ -81,37 +86,52 @@
                             <!-- Display edit view of user info-->
                             <div class="profile-info-hidden">
                                 <div class="control-group">
-                                    <label for="displayNameField" 
class="control-label"><fmt:message key="page.profile.display.name"/></label>
+                                    <label for="displayNameField" 
class="control-label"><fmt:message
+                                            
key="page.profile.display.name"/></label>
+
                                     <div class="controls">
-                                        <form:input id="displayNameField" 
path="displayName" value="${userProfile.displayName}" class="span6"/>
+                                        <form:input id="displayNameField" 
path="displayName"
+                                                    
value="${userProfile.displayName}" class="span6"/>
                                     </div>
                                 </div>
                                 <div class="control-group">
-                                    <label class="control-label 
pull-left"><fmt:message key="page.profile.first.name"/></label>
-                                        <form:input id="givenNameField" 
path="givenName" class="span3 pull-left" value="${userProfile.givenName}" 
/>&nbsp;
-
-                                    <label class="control-label 
pull-left"><fmt:message key="page.profile.last.name"/></label>
-                                        <form:input id="familyNameField" 
path="familyName" class="span3 pull-left" value="${userProfile.familyName}"/>
+                                    <label class="control-label 
pull-left"><fmt:message
+                                            
key="page.profile.first.name"/></label>
+                                    <form:input id="givenNameField" 
path="givenName" class="span3 pull-left"
+                                                
value="${userProfile.givenName}"/>&nbsp;
+
+                                    <label class="control-label 
pull-left"><fmt:message
+                                            
key="page.profile.last.name"/></label>
+                                    <form:input id="familyNameField" 
path="familyName" class="span3 pull-left"
+                                                
value="${userProfile.familyName}"/>
                                 </div>
                                 <div class="control-group">
-                                    <label for="statusField" 
class="control-label"><fmt:message key="page.profile.status"/></label>
+                                    <label for="statusField" 
class="control-label"><fmt:message
+                                            key="page.profile.status"/></label>
+
                                     <div class="controls">
                                         <form:select path="status" 
class="span3" id="statusField">
                                             <fmt:message 
key="page.general.relation.single" var="singleText"/>
-                                            <form:option value="${singleText}" 
id="single_id">${singleText}</form:option>
+                                            <form:option value="${singleText}"
+                                                         
id="single_id">${singleText}</form:option>
                                             <fmt:message 
key="page.general.relation.committed" var="committedText"/>
-                                            <form:option 
value="${committedText}" id="committed_id">${committedText}</form:option>
+                                            <form:option 
value="${committedText}"
+                                                         
id="committed_id">${committedText}</form:option>
                                             <fmt:message 
key="page.general.relation.married" var="marriedText"/>
-                                            <form:option 
value="${marriedText}" id="married_id">${marriedText}</form:option>
+                                            <form:option value="${marriedText}"
+                                                         
id="married_id">${marriedText}</form:option>
                                             <fmt:message 
key="page.general.relation.other" var="otherText"/>
                                             <form:option value="${otherText}" 
id="other_id">${otherText}</form:option>
                                         </form:select>
                                     </div>
                                 </div>
                                 <div class="control-group">
-                                    <label for="aboutMeField" 
class="control-label"><fmt:message key="page.profile.about.me"/></label>
+                                    <label for="aboutMeField" 
class="control-label"><fmt:message
+                                            
key="page.profile.about.me"/></label>
+
                                     <div class="controls">
-                                        <form:textarea id="aboutMeField" 
path="aboutMe" value="${userProfile.aboutMe}" class="span11" />
+                                        <form:textarea id="aboutMeField" 
path="aboutMe" value="${userProfile.aboutMe}"
+                                                       class="span11"/>
                                     </div>
                                 </div>
                             </div>
@@ -122,15 +142,19 @@
                     <fieldset class="row-fluid">
                         <div class=" span12">
                             <div class="well">
-                                <h4><fmt:message 
key="page.profile.contact.info" /></h4>
+                                <h4><fmt:message 
key="page.profile.contact.info"/></h4>
+
                                 <div class="profile-info-visible">
                                     <p id='email'><c:out value=" 
${userProfile.email}"/></p>
                                 </div>
                                 <div class="profile-info-hidden">
                                     <div class="control-group">
-                                        <label for="emailField" 
class="control-label"><fmt:message key="page.profile.email"/></label>
+                                        <label for="emailField" 
class="control-label"><fmt:message
+                                                
key="page.profile.email"/></label>
+
                                         <div class="controls">
-                                            <form:input id="emailField" 
name="email" required="required" path="email" class="span5" 
value="${userProfile.email}" />
+                                            <form:input id="emailField" 
name="email" required="required" path="email"
+                                                        class="span5" 
value="${userProfile.email}"/>
                                         </div>
                                     </div>
                                 </div>
@@ -139,18 +163,20 @@
                     </fieldset>
 
                     <%-- only display the edit profile button if the current 
logged in user matches the profile being viewed --%>
-                    <c:set var="currentUsername"><sec:authentication 
property="principal.username" htmlEscape="false" /></c:set>
+                    <c:set var="currentUsername"><sec:authentication 
property="principal.username" htmlEscape="false"/></c:set>
                     <c:if test="${currentUsername == userProfile.username}">
                         <fieldset class="row-fluid">
                             <div class="span12">
                                 <p>
-                                    <input type="hidden" id="profileInfo" 
value="profile-info" />
-                                    <button type="button" id="profileEdit" 
class="btn btn-primary profile-info-visible"><fmt:message 
key="page.profile.edit"/></button>
+                                    <input type="hidden" id="profileInfo" 
value="profile-info"/>
+                                    <button type="button" id="profileEdit" 
class="btn btn-primary profile-info-visible">
+                                        <fmt:message 
key="page.profile.edit"/></button>
                                     <fmt:message key="page.profile.save" 
var="save"/>
                                     <input type="submit" class="btn 
btn-primary profile-info-hidden" value="${save}"/>
-                                    <button type="button" class="btn 
profile-info-hidden" id="cancelEdit"><fmt:message 
key="page.profile.cancel"/></button>
+                                    <button type="button" class="btn 
profile-info-hidden" id="cancelEdit"><fmt:message
+                                            
key="page.profile.cancel"/></button>
                                 </p>
-                             </div>
+                            </div>
                         </fieldset>
                     </c:if>
 
@@ -165,63 +191,65 @@
             </div>
         </div>
         <div class="span3">
-            <portal:person id="${page.ownerId}" var="owner" />
-               <button type="button" id="addRemoveFriend" 
value="${owner.username}" class="btn btn-primary 
profile-info-visible"><fmt:message 
key="page.personProfile.addremove.friends"/></button>
+            <portal:person id="${page.ownerId}" var="owner"/>
+            <button type="button" id="addRemoveFriend" 
value="${owner.username}"
+                    class="btn btn-primary profile-info-visible"><fmt:message
+                    key="page.personProfile.addremove.friends"/></button>
         </div>
         <div class="span3">
             <div>
                 <%-- render the person profile parent page region/widgets --%>
                 <c:forEach var="region" items="${page.regions}" 
varStatus="status">
-                    <rave:region region="${region}" 
regionIdx="${status.count}" />
+                    <rave:region region="${region}" 
regionIdx="${status.count}"/>
                 </c:forEach>
             </div>
         </div>
-    <div class="clear-float">&nbsp;</div>
+        <div class="clear-float">&nbsp;</div>
     </div>
 </div>
-    <div id="userDialog" class="modal hide" data-backdrop="static">
-        <div class="modal-header">
-            <a href="#" class="close" data-dismiss="modal">&times;</a>
-            <h3><fmt:message key="page.general.search.title"/></h3>
-        </div>
-        <div class="modal-body">
-            <div id="userDialogContent" >
-                <div id="userContent">
-                    <div id="searchControls"><input id="searchTerm" 
name="searchTerm" type="text"/>
-                        <input id="userSearchButton" value="<fmt:message 
key="page.store.search.button"/>" type="submit"/>
-                        <input id="clearSearchButton" value="<fmt:message 
key="admin.clearsearch"/>" type="submit" class="hide"/>
-                    </div>
-                    <div id="userSearchListHeader"></div>
-                    <div id="userSearchListPaging"></div>
-                    <div id="userSearchResults"></div>
+<div id="userDialog" class="modal hide" data-backdrop="static">
+    <div class="modal-header">
+        <a href="#" class="close" data-dismiss="modal">&times;</a>
+
+        <h3><fmt:message key="page.general.search.title"/></h3>
+    </div>
+    <div class="modal-body">
+        <div id="userDialogContent">
+            <div id="userContent">
+                <div id="searchControls"><input id="searchTerm" 
name="searchTerm" type="text"/>
+                    <input id="userSearchButton" value="<fmt:message 
key="page.store.search.button"/>" type="submit"/>
+                    <input id="clearSearchButton" value="<fmt:message 
key="admin.clearsearch"/>" type="submit"
+                           class="hide"/>
                 </div>
+                <div id="userSearchListHeader"></div>
+                <div id="userSearchListPaging"></div>
+                <div id="userSearchResults"></div>
             </div>
         </div>
-        <div class="modal-footer">
-            <a href="#" class="btn" data-dismiss="modal" 
data-target="#userDialog">Close</a>
-        </div>
     </div>
+    <div class="modal-footer">
+        <a href="#" class="btn" data-dismiss="modal" 
data-target="#userDialog">Close</a>
+    </div>
+</div>
 <div class="clear-float">&nbsp;</div>
 
 <input id="currentPageId" type="hidden" value="${page.id}"/>
 
 <portal:register-init-script location="${'AFTER_RAVE'}">
     <script>
-        require(["core/rave_core", "core/rave_widget", "portal/rave_layout", 
"portal/rave_person_profile", "portal/rave_portal", "portal/rave_forms", 
"jquery"],
-                function(raveCore, raveRegionWidget, raveLayout, 
ravePersonProfile, ravePortal, raveForms, $){
-                    raveCore.init();
-                    raveRegionWidget.defaultView = 'profile';
+        require(["rave", "ui", "portal/rave_person_profile", 
"portal/rave_portal", "portal/rave_forms", "jquery"],
+                function (rave, ui, ravePersonProfile, ravePortal, raveForms, 
$) {
+                    rave.setDefaultView('profile');
+                    rave.setOwner({
+                        username: "<c:out value="${userProfile.username}"/>",
+                        id: "<c:out value="${userProfile.id}"/>"
+                    });
 
                     $(function () {
-                        raveLayout.init();
                         ravePersonProfile.init();
-                        ravePortal.setPageOwner({
-                            username: "<c:out 
value="${userProfile.username}"/>",
-                            id: "<c:out value="${userProfile.id}"/>"
-                        });
                         raveForms.validateEditAccountForm();
-                        raveCore.renderWidgets('home');
+                        rave.renderWidgets('home');
                     });
-        })
+                })
     </script>
 </portal:register-init-script>

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/store.jsp
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/store.jsp?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/store.jsp
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/store.jsp
 Mon Jun 24 22:36:53 2013
@@ -306,7 +306,8 @@
 
 <portal:register-init-script location="${'AFTER_RAVE'}">
     <script>
-        require(["portal/rave_store", "portal/rave_event_bindings", "jquery"], 
function(raveStore, raveEventBindings, $){
+        require(["rave", "portal/rave_store", "portal/rave_event_bindings", 
"jquery"],
+                function(rave, raveStore, raveEventBindings, $){
             $(function () {
                 raveStore.init('<c:out value="${referringPageId}"/>');
 

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/widget.jsp
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/widget.jsp?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/widget.jsp
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/widget.jsp
 Mon Jun 24 22:36:53 2013
@@ -119,7 +119,7 @@
                                    <i class="icon-thumbs-down" 
title="${widgetDislikes}&nbsp;<fmt:message 
key="page.widget.rate.dislikes"/>"></i>
                         </span>
                     </div>
-                    <div id="rating-${widget.id}" class="ratingButtons" 
data-toggle="buttons-radio">
+                    <div id="rating-${widget.id}"  data-toggle="buttons-radio">
                        <button id="like-${widget.id}" class="widgetLikeButton 
btn btn-mini ${widgetsStatistics[widget.id].userRating==10? 'active 
btn-success':''}"
                                 ${widgetsStatistics[widget.id].userRating==10 
? " checked='true'":""} name="rating-${widget.id}">
                             <fmt:message key="page.widget.rate.likebtn"/> 

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/tags/rave_js.tag
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/tags/rave_js.tag?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/tags/rave_js.tag
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/tags/rave_js.tag
 Mon Jun 24 22:36:53 2013
@@ -36,7 +36,7 @@
 </c:choose>
 <script src="<spring:url value="/static/script/app.js"/>"></script>
 <script>
-    require(["rave"], function (rave) {
+    require(["rave", "jquery"], function (rave, $) {
         <%-- set the web application context --%>
         rave.setContext("<spring:url value="/app/" />");
         <%-- set the default widget height so js code has access to it --%>
@@ -48,6 +48,10 @@
         rave.setViewer({username: "${username}", id: "${id}"});
         </sec:authorize>
 
+        $(function(){
+            rave.init();
+        });
+
         <%-- set the javascript debug mode so js code has access to it --%>
         <%--ui.setJavaScriptDebugMode(<c:out value="${jsDebugMode}"/>);--%>
     });

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/core/rave_api.js
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/static/script/core/rave_api.js?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/core/rave_api.js
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/core/rave_api.js
 Mon Jun 24 22:36:53 2013
@@ -267,6 +267,8 @@ define(['underscore', 'jquery', 'core/ra
                             handleRpcError(result);
                         } else {
                             // if a callback is supplied, invoke it with the 
regionwidget id
+                            var addedWidget = result.result != undefined ? 
result.result.widgetId : undefined;
+
                             if (args.successCallback && addedWidget != 
undefined) {
                                 args.successCallback(result.result);
                             }

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/main.js
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/main.js?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/main.js
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/main.js
 Mon Jun 24 22:36:53 2013
@@ -18,7 +18,7 @@
  */
 
 define(['underscore', 'portal/rave_portal', 'portal/rave_event_bindings', 
'portal/rave_models', 'portal/rave_ui',
-    'portal/rave_layout', 'portal/rave_forms', 'portal/rave_store', 
'portal/rave_admin', 'portal/rave_person_profile'],
+    'portal/rave_layout', 'portal/rave_forms'],
     function (_, portal, eventBindings, models) {
 
         _.extend(portal, eventBindings);

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_admin.js
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_admin.js?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_admin.js
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_admin.js
 Mon Jun 24 22:36:53 2013
@@ -18,38 +18,41 @@
  */
 
 define(["jquery"], 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 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
+    }
 })
\ No newline at end of file

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_display.js
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_display.js?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_display.js
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_display.js
 Mon Jun 24 22:36:53 2013
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-define(["rave"], function (rave) {
+define(["rave", "portal/rave_templates", "jqueryUi"], function (rave, 
raveTemplates) {
     function displayUsersOfWidget(widgetId) {
         rave.api.rest.getUsersForWidget({widgetId: widgetId, successCallback: 
function (data) {
 

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_event_bindings.js
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_event_bindings.js?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_event_bindings.js
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_event_bindings.js
 Mon Jun 24 22:36:53 2013
@@ -170,15 +170,14 @@ define(["jquery", 'rave', 'portal/rave_s
          ********************************/
         function addWidgetToPageCallback (result){
             var widgetTitle = ravePortal.getClientMessage("widget.add_prefix");
-            var addedWidget = result != undefined ? result.widgetId : 
undefined;
 
-            if (addedWidget != undefined && addedWidget.title != undefined && 
addedWidget.title.length > 0) {
-                widgetTitle = addedWidget.title;
+            if (result != undefined && result.title != undefined && 
result.title.length > 0) {
+                widgetTitle = result.title;
             }
             ravePortal.showInfoMessage(widgetTitle + ' ' + 
ravePortal.getClientMessage("widget.add_suffix"));
 
             // Update Add Widget button to reflect status
-            var addWidgetButton = "#addWidget_" + args.widgetId;
+            var addWidgetButton = "#addWidget_" + result.widgetId;
             var addedText = '<i class="icon icon-ok icon-white"></i> ' + 
$(addWidgetButton).data('success');
 
             
$(addWidgetButton).removeClass("btn-primary").addClass("btn-success").html(addedText);

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_store.js
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_store.js?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_store.js
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_store.js
 Mon Jun 24 22:36:53 2013
@@ -19,7 +19,6 @@
 
 define(["jquery", "rave", "portal/rave_portal"], function($, rave, ravePortal){
     function initRatings() {
-        $('.ratingButtons').button();
 
         //Adjust width's
         $('.widgetRating').each(function(){
@@ -136,11 +135,9 @@ define(["jquery", "rave", "portal/rave_p
 
             if($(this).attr("data-target")){
                 target = $(this).attr("data-target");
-                console.log($(this).attr("data-target"));
             }
             else{
                 target = $(this).attr("href");
-                console.log("else");
             }
 
             if($(this).attr('data-toggle-text')){

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_templates.js
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_templates.js?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_templates.js
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_templates.js
 Mon Jun 24 22:36:53 2013
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-define(["handlebars", "jquery"], function(Handlebars, $){
+define(["handlebars", "jquery", "clientMessages"], function(Handlebars, $, 
clientMessages){
     var templates = {}
 
     $('[data-template-for]').each(function () {
@@ -27,6 +27,13 @@ define(["handlebars", "jquery"], functio
         templates[key] = Handlebars.compile(source);
     });
 
+    /*
+     Register View Helpers
+     */
+    Handlebars.registerHelper('getClientMessage', function (key) {
+        return clientMessages[key];
+    });
+
     return{
         templates:templates
     }

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js?rev=1496244&r1=1496243&r2=1496244&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js
 Mon Jun 24 22:36:53 2013
@@ -17,20 +17,13 @@
  * under the License.
  */
 
-define(["jquery", "underscore", "handlebars", "rave",
+define(["jquery", "underscore", "rave",
     "portal/rave_portal", "portal/rave_backbone", "portal/rave_models", 
"portal/rave_templates",
     "jqueryUi"],
-    function ($, _, Handlebars, rave, ravePortal, raveBackbone, raveModels, 
raveTemplates) {
+    function ($, _, rave, ravePortal, raveBackbone, raveModels, raveTemplates) 
{
         var exports = {};
 
         /*
-         Register View Helpers
-         */
-        Handlebars.registerHelper('getClientMessage', function (key) {
-            return ravePortal.getClientMessage(key);
-        })
-
-        /*
          Build rave client side views
          */
         var views = exports.views = {};


Reply via email to