You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by pg...@apache.org on 2016/02/03 20:18:36 UTC

svn commit: r1728351 - in /ofbiz/trunk/framework: common/config/CommonUiLabels.xml common/webcommon/includes/messages.ftl images/webapp/images/selectall.js widget/config/widget.properties

Author: pgil
Date: Wed Feb  3 19:18:35 2016
New Revision: 1728351

URL: http://svn.apache.org/viewvc?rev=1728351&view=rev
Log:


OFBIZ-6869 : Add properties in widget.properties, for easy customization of JGrowl alert. Thanks Jacques for the idea

Modified:
    ofbiz/trunk/framework/common/config/CommonUiLabels.xml
    ofbiz/trunk/framework/common/webcommon/includes/messages.ftl
    ofbiz/trunk/framework/images/webapp/images/selectall.js
    ofbiz/trunk/framework/widget/config/widget.properties

Modified: ofbiz/trunk/framework/common/config/CommonUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/CommonUiLabels.xml?rev=1728351&r1=1728350&r2=1728351&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/config/CommonUiLabels.xml (original)
+++ ofbiz/trunk/framework/common/config/CommonUiLabels.xml Wed Feb  3 19:18:35 2016
@@ -5181,6 +5181,14 @@
         <value xml:lang="zh">没有找到帮助文件或网址</value>
         <value xml:lang="zh-TW">沒有找到說明檔或網址</value>
     </property>
+    <property key="CommonHideAllNotifications">
+        <value xml:lang="de">Alle Bekanntgaben ausblenden</value>
+        <value xml:lang="en">Hide all the notifications</value>
+        <value xml:lang="es">Ocultar todas las notificaciones</value>
+        <value xml:lang="fr">Cacher toutes les notifications</value>
+        <value xml:lang="it">Nascondere tutte le notificazioni</value>
+        <value xml:lang="nl">Verbergen alle kennisgevingen</value>
+    </property>
     <property key="CommonHideFields">
         <value xml:lang="ar">اخفاء الحقول</value>
         <value xml:lang="cs">Skrýt pole</value>

Modified: ofbiz/trunk/framework/common/webcommon/includes/messages.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/messages.ftl?rev=1728351&r1=1728350&r2=1728351&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/messages.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/includes/messages.ftl Wed Feb  3 19:18:35 2016
@@ -49,7 +49,12 @@ under the License.
       </#if>
     </div>
   </#if>
-  <script>showjGrowl("${uiLabelMap.CommonShowAll}","${uiLabelMap.CommonCollapse}");</script>
+  <#assign jGrowlPosition = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.position")>
+  <#assign jGrowlWidth = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.width")>
+  <#assign jGrowlHeight = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.height")>
+  <#assign jGrowlSpeed = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.speed")>
+  
+  <script>showjGrowl("${uiLabelMap.CommonShowAll}","${uiLabelMap.CommonCollapse}", "${uiLabelMap.CommonHideAllNotifications}", "${jGrowlPosition}", "${jGrowlWidth}", "${jGrowlHeight}", "${jGrowlSpeed}");</script>
   <#-- display the event messages -->
   <#if (eventMessage?has_content || eventMessageList?has_content)>
     <div id="content-messages" class="content-messages eventMessage" onclick="document.getElementById('content-messages').parentNode.removeChild(this)">
@@ -63,6 +68,10 @@ under the License.
         </#list>
       </#if>
     </div>
-  <script>showjGrowl("${uiLabelMap.CommonShowAll}","${uiLabelMap.CommonCollapse}");</script>
+    <#assign jGrowlPosition = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.position")>
+    <#assign jGrowlWidth = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.width")>
+    <#assign jGrowlHeight = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.height")>
+    <#assign jGrowlSpeed = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.speed")>
+    <script>showjGrowl("${uiLabelMap.CommonShowAll}","${uiLabelMap.CommonCollapse}", "${uiLabelMap.CommonHideAllNotifications}", "${jGrowlPosition}", "${jGrowlWidth}", "${jGrowlHeight}", "${jGrowlSpeed}");</script>
   </#if>
 </#escape>

Modified: ofbiz/trunk/framework/images/webapp/images/selectall.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/selectall.js?rev=1728351&r1=1728350&r2=1728351&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/selectall.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/selectall.js Wed Feb  3 19:18:35 2016
@@ -732,8 +732,8 @@ function submitFormDisableSubmits(form)
     }
 }
 
+function showjGrowl(showAllLabel, collapseLabel, hideAllLabel, jGrowlPosition, jGrowlWidth, jGrowlHeight, jGrowlSpeed) {
 
-function showjGrowl(showAllLabel, collapseLabel) {
     var contentMessages = jQuery("#content-messages");
     if (contentMessages.length) {
         jQuery("#content-messages").hide();
@@ -755,11 +755,12 @@ function showjGrowl(showAllLabel, collap
             // No Error Message Information is set, Error Msg Box can't be created
             return;
         }
-        $.jGrowl.defaults.closerTemplate = '<div class="closeAllJGrowl">Hide All Notifications</div>';
-        $.jGrowl.defaults.position = 'center';
+        $.jGrowl.defaults.closerTemplate = '<div class="closeAllJGrowl">'+hideAllLabel+'</div>';
+        if (jGrowlPosition !== null && jGrowlPosition !== undefined) $.jGrowl.defaults.position = jGrowlPosition;
         $.jGrowl(errMessage, { theme: classEvent, sticky: stickyValue,
             beforeOpen: function(e,m,o){
-                $(e).width( "600px" );
+                if (jGrowlWidth !== null && jGrowlWidth !== undefined) $(e).width( jGrowlWidth+'px' );
+                if (jGrowlHeight !== null  && jGrowlHeight !== undefined) $(e).height( jGrowlHeight+'px' );
             },
             afterOpen: function(e,m) {
                 jQuery(".jGrowl-message").readmore({
@@ -769,7 +770,7 @@ function showjGrowl(showAllLabel, collap
                     maxHeight: 75
                 });
             },
-            speed:100
+            speed:jGrowlSpeed
         });
         contentMessages.remove();
     }

Modified: ofbiz/trunk/framework/widget/config/widget.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/config/widget.properties?rev=1728351&r1=1728350&r2=1728351&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/config/widget.properties (original)
+++ ofbiz/trunk/framework/widget/config/widget.properties Wed Feb  3 19:18:35 2016
@@ -50,6 +50,13 @@ widget.lookup.position=topleft
 widget.lookup.width=620
 widget.lookup.height=500
 
+# Default position and size for Jgrowl error messages
+# accept : top-left, top-right, bottom-left, bottom-right, center
+widget.jgrowl.position=center
+widget.jgrowl.width=600
+widget.jgrowl.height=
+widget.jgrowl.speed=100
+
 # Default text find field's option
 widget.form.defaultTextFindOption=contains