Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Option to show seconds.
Browse files Browse the repository at this point in the history
  • Loading branch information
bews committed Jun 1, 2016
1 parent 90a62c5 commit 8b9442f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ <h2>Messages</h2>
Show quits
</label>
</div>
<div class="col-sm-6">
<label class="opt">
<input type="checkbox" name="seconds">
Show seconds
</label>
</div>
<div class="col-sm-12">
<h2>Visual Aids</h2>
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/js/libs.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/js/libs/handlebars/tz.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Handlebars.registerHelper(
"tz", function(time) {
if (time) {
var utc = moment.utc(time, "HH:mm:ss").toDate();
return moment(utc).format("HH:mm");
return moment(utc).format("HH:mm:ss");
} else {
return "";
}
Expand Down
8 changes: 8 additions & 0 deletions client/js/shout.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,14 @@ $(function() {
msg = $(render("msg", data.msg));
}

if (!options.seconds) {
var time = msg.find(".time");
if (time.html().trim()) {
var time_parts = time.html().split(":");
time.html(time_parts[0] + ":" + time_parts[1]);
}
}

var text = msg.find(".text");
if (text.find("i").size() === 1) {
text = text.find("i");
Expand Down

0 comments on commit 8b9442f

Please sign in to comment.