You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by ad...@apache.org on 2019/10/13 11:04:50 UTC

[roller] branch roller-6.0.x updated: Improve alert messages (ROL-2154) 1. Add close button 2. Remove bulleted text 3. Autoclose messages after 10 seconds

This is an automated email from the ASF dual-hosted git repository.

adityasharma pushed a commit to branch roller-6.0.x
in repository https://gitbox.apache.org/repos/asf/roller.git


The following commit(s) were added to refs/heads/roller-6.0.x by this push:
     new 038acff  Improve alert messages (ROL-2154) 1. Add close button 2. Remove bulleted text 3. Autoclose messages after 10 seconds
     new 10a8432  Merge pull request #41 from adityasharma7/ROL-2150-roller-6.0.x
038acff is described below

commit 038acff21968ca360c26e10aaa3bb39479a5ee1e
Author: Aditya Sharma <ia...@gmail.com>
AuthorDate: Sat Oct 12 15:00:14 2019 +0530

    Improve alert messages (ROL-2154)
    1. Add close button
    2. Remove bulleted text
    3. Autoclose messages after 10 seconds
---
 .../main/webapp/WEB-INF/jsps/tiles/messages.jsp    | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/app/src/main/webapp/WEB-INF/jsps/tiles/messages.jsp b/app/src/main/webapp/WEB-INF/jsps/tiles/messages.jsp
index bb8c58b..5f2bed2 100644
--- a/app/src/main/webapp/WEB-INF/jsps/tiles/messages.jsp
+++ b/app/src/main/webapp/WEB-INF/jsps/tiles/messages.jsp
@@ -17,9 +17,31 @@
 --%>
 <%@ include file="/WEB-INF/jsps/taglibs-struts2.jsp" %>
 
+<script>
+    $(document).ready(function () {
+        // Remove the alert box after 10 seconds
+        $(".alert").delay(10000).slideUp(200, function() {
+            $(this).alert('close');
+        });
+    });
+</script>
+<style>
+    <%-- Alert message should not be bulleted  --%>
+    .alert ul {
+        list-style-type: none;
+        margin: 0;
+        padding: 0;
+    }
+
+</style>
+
+
 <%-- Success Messages --%>
 <s:if test="!actionMessages.isEmpty">
     <div id="messages" class="alert alert-success">
+        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
+            <span aria-hidden="true">&times;</span>
+        </button>
         <s:actionmessage />
     </div>
 </s:if>
@@ -27,6 +49,9 @@
 <%-- Error Messages --%>
 <s:if test="!actionErrors.isEmpty || !fieldErrors.isEmpty">
     <div id="errors" class="alert alert-danger">
+        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
+            <span aria-hidden="true">&times;</span>
+        </button>
         <ul>
 
             <s:iterator var="actionError" value="actionErrors">