community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1864089 - in /comdev/reporter.apache.org/trunk/site/wizard: css/wizard.css index.html js/source/primer.js js/wizard.js
Date Wed, 31 Jul 2019 16:39:21 GMT
Author: humbedooh
Date: Wed Jul 31 16:39:21 2019
New Revision: 1864089

URL: http://svn.apache.org/viewvc?rev=1864089&view=rev
Log:
Add a modal window in HTML to avoid using alert() so much

Modified:
    comdev/reporter.apache.org/trunk/site/wizard/css/wizard.css
    comdev/reporter.apache.org/trunk/site/wizard/index.html
    comdev/reporter.apache.org/trunk/site/wizard/js/source/primer.js
    comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js

Modified: comdev/reporter.apache.org/trunk/site/wizard/css/wizard.css
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/css/wizard.css?rev=1864089&r1=1864088&r2=1864089&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/css/wizard.css (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/css/wizard.css Wed Jul 31 16:39:21 2019
@@ -93,10 +93,6 @@
     font-size: 0.85rem;
 }
 
-#step_text {
-    margin-bottom: 10px !important;
-}
-
 .wizard-tip {
     width: 720px;
     border: 1.5px solid #3339;
@@ -107,6 +103,10 @@
     font-size: 0.85rem;
 }
 
+#step_text {
+    margin-bottom: 10px !important;
+}
+
 
 .loader,
 .loader:before,
@@ -167,3 +167,13 @@
     height: 5em;
   }
 }
+
+
+ .fade {
+   opacity: 1;
+   -webkit-transition: opacity 0.01s linear !important;
+      -moz-transition: opacity 0.01s linear !important;
+       -ms-transition: opacity 0.01s linear !important;
+        -o-transition: opacity 0.01s linear !important;
+           transition: opacity 0.01s linear !important;
+ }
\ No newline at end of file

Modified: comdev/reporter.apache.org/trunk/site/wizard/index.html
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/index.html?rev=1864089&r1=1864088&r2=1864089&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/index.html (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/index.html Wed Jul 31 16:39:21 2019
@@ -20,8 +20,8 @@
  <div id="wizard_spinner" style="margin-top: 80px; height: 300px !important;">
   <h4 style="text-align: center;">Loading base data..</h4>
   <div class="loader"></div>
-  
  </div>
+ 
    <div id="wrapper" style="display: none;">
     <h2 id="pname" style="text-align: center;">Board Report Wizard</h2>
     <div id="steps">
@@ -49,12 +49,33 @@ placeholder="Example activity:
     <div id="tips" class="wizard-tip"></div>
     </div>
    
+   <!-- Modal for notices -->
+  <div class="modal fade" id="alert" role="dialog">
+    <div class="modal-dialog">
+    
+      <!-- Modal content-->
+      <div class="modal-content">
+        <div class="modal-header">
+          <h4 class="modal-title">We hit a snag!</h4>
+        </div>
+        <div class="modal-body">
+          <p id="alert_text" style="font-size: 0.85rem;"></p>
+        </div>
+        <div class="modal-footer">
+          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+        </div>
+      </div>
+      
+    </div>
+  </div>
+   
    <footer style="text-align: center; font-size: 0.8rem;">
     Powered by the <a href='./'>ASF Board Report Wizard</a>. Copyright&copy;
2019 <a href='https://community.apache.org'>Apache Community Development</a>.<br/>
     Queries or other feedback should go to our mailing list: dev@community.apache.org
    </footer>
    
    
+   
 
 <script src="https://kit.fontawesome.com/a250232153.js"></script>
 <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/primer.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/primer.js?rev=1864089&r1=1864088&r2=1864089&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/primer.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/primer.js Wed Jul 31 16:39:21 2019
@@ -3,10 +3,15 @@ let report = [null,null,null,null,null,n
 let current_step = 0;
 let cycles = {};
 
+function modal(txt) {
+    document.getElementById('alert_text').innerText = txt;
+    $("#alert").modal();
+}
+
 function prime_wizard(state, json) {
     // Adjust title(s)
     if (!json.pdata[project]) {
-        alert("Could not find project data for %s!".format(project));
+        modal("Could not find project data for %s!".format(project));
         return;
     }
     pdata = json;
@@ -43,7 +48,7 @@ function build_steps(s, start) {
         report[current_step] = text.value;
     }
     if (!start && text && current_step > 0 && text.value.length
== 0 && s > current_step) {
-        alert("Please complete this report section before continuing to the next step.");
+        modal("Please complete this report section before continuing to the next step.");
         return
     }
     
@@ -52,7 +57,7 @@ function build_steps(s, start) {
         for (var i = 1; i < 5; i++) {
             let step = step_json[i];
             if (report[i] == null || report[i].length == 0) {
-                alert("Please fill out the \"%s\" section before you preview the report!".format(step.description));
+                modal("Please fill out the \"%s\" section before you preview the report!".format(step.description));
                 return
             }
         }

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js?rev=1864089&r1=1864088&r2=1864089&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js Wed Jul 31 16:39:21 2019
@@ -1164,10 +1164,15 @@ let report = [null,null,null,null,null,n
 let current_step = 0;
 let cycles = {};
 
+function modal(txt) {
+    document.getElementById('alert_text').innerText = txt;
+    $("#alert").modal();
+}
+
 function prime_wizard(state, json) {
     // Adjust title(s)
     if (!json.pdata[project]) {
-        alert("Could not find project data for %s!".format(project));
+        modal("Could not find project data for %s!".format(project));
         return;
     }
     pdata = json;
@@ -1204,7 +1209,7 @@ function build_steps(s, start) {
         report[current_step] = text.value;
     }
     if (!start && text && current_step > 0 && text.value.length
== 0 && s > current_step) {
-        alert("Please complete this report section before continuing to the next step.");
+        modal("Please complete this report section before continuing to the next step.");
         return
     }
     
@@ -1213,7 +1218,7 @@ function build_steps(s, start) {
         for (var i = 1; i < 5; i++) {
             let step = step_json[i];
             if (report[i] == null || report[i].length == 0) {
-                alert("Please fill out the \"%s\" section before you preview the report!".format(step.description));
+                modal("Please fill out the \"%s\" section before you preview the report!".format(step.description));
                 return
             }
         }



Mime
View raw message