[Rt-commit] rt branch, master, updated. rt-4.4.4-532-g36724a0a7b
? sunnavy
sunnavy at bestpractical.com
Fri Nov 15 15:05:12 EST 2019
The branch, master has been updated
via 36724a0a7bc84261dbb5df95adfab7c16cba2727 (commit)
via 473c639183ad7622bee3e888cfe93ef2d316d6a0 (commit)
via 04cd07fbea2b6884b6ef1b2faac2394e02ec3fe6 (commit)
from 73f20623ec0bfc8ced4f4bf28c18d27a0ea7c9d7 (commit)
Summary of changes:
devel/third-party/fontawesome/index.js | 12 ++++++++--
share/html/Helpers/TicketTimer | 29 ++++++++----------------
share/static/css/elevator-light/ticket-timer.css | 5 ++++
share/static/js/fontawesome.min.js | 2 +-
4 files changed, 26 insertions(+), 22 deletions(-)
- Log -----------------------------------------------------------------
commit 473c639183ad7622bee3e888cfe93ef2d316d6a0
Author: Blaine Motsinger <blaine at bestpractical.com>
Date: Thu Nov 14 19:42:51 2019 -0600
Replace timer icons with fontawesome and tooltips
This commit also refactors the JS in the TicketTimer Helper to
show and hide the link instead of replacing the img and alt text.
diff --git a/share/html/Helpers/TicketTimer b/share/html/Helpers/TicketTimer
index 440797dcd5..6f6ef6a8de 100644
--- a/share/html/Helpers/TicketTimer
+++ b/share/html/Helpers/TicketTimer
@@ -52,9 +52,6 @@ $id
my $Ticket = RT::Ticket->new($session{'CurrentUser'});
$Ticket->Load( $id );
-my $UnpauseImg = RT->Config->Get('WebPath') . '/static/images/unpause.png';
-my $PauseImg = RT->Config->Get('WebPath') . '/static/images/pause.png';
-
my $Now = RT::Date->new($session{'CurrentUser'});
$Now->SetToNow;
@@ -87,11 +84,6 @@ jQuery( function() {
var CommittedSeconds = 0;
var Readout = jQuery('.readout');
- var PlayPause = jQuery('.playpause');
- var PlayPauseImg = PlayPause.find('img');
-
- var PauseAlt = PlayPauseImg.attr('alt');
- var UnpauseAlt = PlayPauseImg.data('toggle-alt');
var ToHHMMSS = function (Total) {
var Hours = Math.floor(Total / 3600);
@@ -119,24 +111,22 @@ jQuery( function() {
Interval = false;
CommittedSeconds += CurrentSeconds();
LastUnpause = false;
- PlayPauseImg.attr('src', <% $UnpauseImg |n,j %>);
- PlayPauseImg.attr('alt', UnpauseAlt);
- PlayPauseImg.attr('title', UnpauseAlt);
+ jQuery('.playpause.play').removeClass('hidden');
+ jQuery('.playpause.pause').addClass('hidden');
}
else {
// unpause
Interval = setInterval(Tick, 1000);
LastUnpause = new Date().getTime() / 1000;
- PlayPauseImg.attr('src', <% $PauseImg |n,j %>);
- PlayPauseImg.attr('alt', PauseAlt);
- PlayPauseImg.attr('title', PauseAlt);
+ jQuery('.playpause.pause').removeClass('hidden');
+ jQuery('.playpause.play').addClass('hidden');
}
return false;
});
jQuery('.submit-time').click(function () {
clearInterval(Interval);
- jQuery('.control-line a').hide();
+ jQuery('.control-line a:not(.close-popup)').addClass('hidden');
CommittedSeconds += CurrentSeconds();
var Payload = {
@@ -165,7 +155,7 @@ jQuery( function() {
if (Response.ok) {
Readout.addClass('response');
Readout.text(Response.msg);
- jQuery('.control-line .close-popup').show().removeClass('hidden');
+ jQuery('.control-line .close-popup').removeClass('hidden');
}
else {
RenderSubmitError(Response.msg);
@@ -201,9 +191,10 @@ jQuery( function() {
<div class="readout"></div>
<div class="control-line">
- <a href="#" class="playpause"><img src="<% $PauseImg %>" alt="<% loc('Pause Timer') %>" data-toggle-alt="<% loc('Resume Timer') %>" title="<% loc('Pause Timer') %>" /></a>
- <a href="#" class="submit-time"><img src="<% RT->Config->Get('WebPath') %>/static/images/submit.png" alt="<% loc('Submit Timer') %>" title="<% loc('Submit Timer') %>" /></a>
- <a href="#" class="close-popup hidden"><img src="<% RT->Config->Get('WebPath') %>/static/images/close.png" alt="<% loc('Close Window') %>" title="<% loc('Close Window') %>" /></a>
+ <a href="#" class="playpause pause"><span class="far fa-pause-circle" alt="<% loc('Pause Timer') %>" data-toggle="tooltip" data-placement="bottom" data-original-title="<% loc('Pause Timer') %>"></span></a>
+ <a href="#" class="playpause play hidden"><span class="far fa-play-circle" alt="<% loc('Resume Timer') %>" data-toggle="tooltip" data-placement="bottom" data-original-title="<% loc('Resume Timer') %>"></span></a>
+ <a href="#" class="submit-time"><span class="far fa-arrow-alt-circle-up" alt="<% loc('Submit Timer') %>" data-toggle="tooltip" data-placement="bottom" data-original-title="<% loc('Submit Timer') %>"></span></a>
+ <a href="#" class="close-popup hidden"><span class="far fa-times-circle" alt="<% loc('Close Window') %>" data-toggle="tooltip" data-placement="bottom" data-original-title="<% loc('Close Window') %>"></span></a>
</div>
<& /Elements/MessageBox,
diff --git a/share/static/css/elevator-light/ticket-timer.css b/share/static/css/elevator-light/ticket-timer.css
index 54ac7734fe..fd34a9a678 100644
--- a/share/static/css/elevator-light/ticket-timer.css
+++ b/share/static/css/elevator-light/ticket-timer.css
@@ -7,6 +7,11 @@
border-style: none;
}
+.ticket-timer svg {
+ width: 1.5em !important;
+ height: 1.5em !important;
+}
+
/* we use background: #547CCC; to help make the ticket timer look more like RT
but unfortunately that makes the stopwatch icon (being black) look bad */
.ticket-timer .ticket-link img {
commit 36724a0a7bc84261dbb5df95adfab7c16cba2727
Merge: 73f20623ec 473c639183
Author: sunnavy <sunnavy at bestpractical.com>
Date: Sat Nov 16 03:57:24 2019 +0800
Merge branch '4.6/timer-icons-fontawesome'
-----------------------------------------------------------------------
More information about the rt-commit
mailing list