continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From batkin...@apache.org
Subject svn commit: r1659875 - in /continuum/trunk/continuum-webapp/src/main/webapp: WEB-INF/jsp/buildResult.jsp css/continuum.css
Date Sun, 15 Feb 2015 03:14:50 GMT
Author: batkinson
Date: Sun Feb 15 03:14:50 2015
New Revision: 1659875

URL: http://svn.apache.org/r1659875
Log:
Changed indicator to show build and loading status.

Modified:
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResult.jsp
    continuum/trunk/continuum-webapp/src/main/webapp/css/continuum.css

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResult.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResult.jsp?rev=1659875&r1=1659874&r2=1659875&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResult.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResult.jsp Sun Feb 15
03:14:50 2015
@@ -51,54 +51,58 @@
             }
             toggleOutput();  // Show appropriate initial controls
 
-            function showTail(show) {
-              var $oa = $('#outputArea'), tailClass = 'tail-output';
-              if (show) {
-                $oa.addClass(tailClass);
-              } else {
-                $oa.removeClass(tailClass);
-              }
-            }
-            showTail(buildInProgress);  // Show tail indicator if in-progress
-
             function scrollToBottom($textArea) {
               var newHeight = $textArea.attr('scrollHeight');
               $textArea.attr('scrollTop', newHeight);
             }
+            scrollToBottom($ta);  // Scroll text area to bottom on intial page load
 
             function isScrolledToBottom($textArea) {
               return $textArea.attr('scrollHeight') - $textArea.attr('clientHeight') == $textArea.attr('scrollTop')
             }
 
-            // Scroll text area to bottom on page load
-            scrollToBottom($ta);
+            function showStatus(building, loading) {
+              if (loading) {
+                $ta.addClass('cmd-loading');
+                $ta.removeClass('cmd-building');
+              } else if (building) {
+                $ta.addClass('cmd-building');
+                $ta.removeClass('cmd-loading');
+              } else {
+                $ta.removeClass('cmd-building');
+                $ta.removeClass('cmd-loading');
+              }
+            }
+            showStatus(buildInProgress);
 
             setInterval(function() {
               if (buildInProgress && !refreshPending) {
                 refreshPending = true;
                 var autoScroll = isScrolledToBottom($ta);
+                showStatus(buildInProgress, true);
                 $.ajax({
                   url: outputUrl,
                   contentType: 'application/json;charset=utf-8',
                   success: function(data) {
                     parsed = JSON.parse(data);
                     var output = parsed.buildOutput;
+                    buildInProgress = parsed.buildInProgress;
                     $ta.html(output);
                     toggleOutput();
                     if (autoScroll) {
                       scrollToBottom($ta);
                     }
-                    showTail(parsed.buildInProgress);
-                    if (!parsed.buildInProgress) {
+                    if (!buildInProgress) {
                       location.reload();  // reload page when complete
                     }
                   },
                   complete: function() {
                     refreshPending = false;
+                    showStatus(buildInProgress, false);
                   }
                 });
               }
-            }, 5000);
+            }, 1000);
           });
         </script>
     </head>

Modified: continuum/trunk/continuum-webapp/src/main/webapp/css/continuum.css
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/css/continuum.css?rev=1659875&r1=1659874&r2=1659875&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/css/continuum.css (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/css/continuum.css Sun Feb 15 03:14:50
2015
@@ -32,8 +32,14 @@ td.tdLabel {
   font-family: monospace;
 }
 
-.tail-output {
-  background: url(/images/building.gif) 5px 479px no-repeat
+.cmd-loading {
+  background: url(/images/wait.gif) 5px 479px no-repeat;
+  background-size: 16px 16px;
+}
+
+.cmd-building {
+  background: url(/images/building.gif) 5px 479px no-repeat;
+  background-size: 16px 16px;
 }
 
 .pre-wrap {



Mime
View raw message