[Rt-commit] rt branch, 4.4/ticket-timer, created. rt-4.2.11-4-gecf1ee0

Shawn Moore shawn at bestpractical.com
Thu May 14 15:12:43 EDT 2015


The branch, 4.4/ticket-timer has been created
        at  ecf1ee083fd440640b66863794849a3696fc7a12 (commit)

- Log -----------------------------------------------------------------
commit ecf1ee083fd440640b66863794849a3696fc7a12
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu May 14 19:12:11 2015 +0000

    Add a ticking timer to the bottom right of the screen

diff --git a/share/html/Elements/Footer b/share/html/Elements/Footer
index dc1ce6b..9d8b6f7 100644
--- a/share/html/Elements/Footer
+++ b/share/html/Elements/Footer
@@ -49,6 +49,7 @@
   <hr class="clear" />
 </div>
 % $m->callback( %ARGS );
+<& /Elements/TicketTimer &>
 <div id="footer">
 % if ($m->{'rt_base_time'}) {
   <p id="time"><span><&|/l&>Time to display</&>: <%Time::HiRes::tv_interval( $m->{'rt_base_time'} )%></span></p>
diff --git a/share/html/Elements/Footer b/share/html/Elements/TicketTimer
similarity index 65%
copy from share/html/Elements/Footer
copy to share/html/Elements/TicketTimer
index dc1ce6b..c479980 100644
--- a/share/html/Elements/Footer
+++ b/share/html/Elements/TicketTimer
@@ -45,30 +45,6 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
-%# End of div#body from /Elements/PageLayout
-  <hr class="clear" />
+<div id="ticket_timer">
+    <span class="readout">0:00:00</span>
 </div>
-% $m->callback( %ARGS );
-<div id="footer">
-% if ($m->{'rt_base_time'}) {
-  <p id="time"><span><&|/l&>Time to display</&>: <%Time::HiRes::tv_interval( $m->{'rt_base_time'} )%></span></p>
-%}
-  <p id="bpscredits"><span><&|/l_unsafe,     '»|«', $RT::VERSION, '2015', '<a href="http://www.bestpractical.com?rt='.$RT::VERSION.'">Best Practical Solutions, LLC</a>', &>[_1] RT [_2] Copyright 1996-[_3] [_4].</&>
-</span></p>
-% if (!$Menu) {
-  <p id="legal"><&|/l_unsafe, '<a href="http://www.gnu.org/licenses/gpl-2.0.html">', '</a>' &>Distributed under [_1]version 2 of the GNU GPL[_2].</&><br /><&|/l_unsafe, '<a href="mailto:sales at bestpractical.com">sales at bestpractical.com</a>' &>To inquire about support, training, custom development or licensing, please contact [_1].</&><br /></p>
-% }
-</div>
-% if ($Debug >= 2 ) {
-% require Data::Dumper;
-% my $d = Data::Dumper->new([\%ARGS], [qw(%ARGS)]);
-<pre>
-<%$d->Dump() %>
-</pre>
-% }
-  </body>
-</html>
-<%ARGS>
-$Debug => 0
-$Menu => 1
-</%ARGS>
diff --git a/share/static/css/base/misc.css b/share/static/css/base/misc.css
index a76bf00..a6706cf 100644
--- a/share/static/css/base/misc.css
+++ b/share/static/css/base/misc.css
@@ -79,3 +79,19 @@ textarea.messagebox, #cke_Content, #cke_UpdateContent {
 .datepicker {
     width: 17em;
 }
+
+#ticket_timer {
+    position: fixed;
+    bottom: 25px;
+    right: 0px;
+    background-color: rgba(255, 255, 255, 0.85);
+    z-index: 9999;
+    padding: 1em;
+    border-top: 1px solid #600;
+    border-left: 1px solid #600;
+    border-bottom: 1px solid #600;
+}
+
+#ticket_timer .readout {
+    font-size: 1.5em;
+}
diff --git a/share/static/js/util.js b/share/static/js/util.js
index b665c0e..7852d78 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -328,6 +328,30 @@ function escapeCssSelector(str) {
     return str.replace(/([^A-Za-z0-9_-])/g,'\\$1');
 }
 
+function AddTicketTimer() {
+    var container = jQuery('#ticket_timer');
+    var readout = container.find('.readout');
+
+    var seconds = 0;
+    setInterval(function () {
+        seconds++;
+
+        var s = seconds;
+        var h = Math.floor(s / 3600);
+        s -= h * 3600;
+        var m = Math.floor(s / 60);
+        s -= m * 60;
+
+        if (m < 10) {
+            m = "0" + m;
+        }
+        if (s < 10) {
+            s = "0" + s;
+        }
+
+        readout.text(h + ':' + m + ':' + s);
+    }, 1000);
+}
 
 jQuery(function() {
     jQuery(".user-accordion").each(function(){
@@ -342,4 +366,5 @@ jQuery(function() {
         });
     });
     ReplaceAllTextareas();
+    AddTicketTimer();
 });

-----------------------------------------------------------------------


More information about the rt-commit mailing list