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

Option to show seconds. #671

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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