mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-06-28 15:27:43 +00:00
3.5.22 to 3.5.30. I need to commit more. Added basic setting for Stream Uptime, made Uptime seconds configurable. Tooltip for Stream Latency includes resolution. Added Stream Uptime to the directory. Added Reset Settings button. Added customizable in-line moderation icons. Added option to show channel logos in the directory. Added option to swap columns on the dashboard. Split Minimalistic Chat into two configurable sub-options.
This commit is contained in:
parent
4072f3c82a
commit
f62132cc7e
22 changed files with 1067 additions and 306 deletions
35
src/utils.js
35
src/utils.js
|
@ -8,13 +8,15 @@ var sanitize_el = document.createElement('span'),
|
|||
sanitize_el.textContent = msg;
|
||||
return sanitize_el.innerHTML;
|
||||
},
|
||||
|
||||
|
||||
R_QUOTE = /"/g,
|
||||
R_SQUOTE = /'/g,
|
||||
R_AMP = /&/g,
|
||||
R_LT = /</g,
|
||||
R_GT = />/g,
|
||||
|
||||
|
||||
DURATIONS = {},
|
||||
|
||||
quote_attr = function(msg) {
|
||||
return msg.replace(R_AMP, "&").replace(R_QUOTE, """).replace(R_SQUOTE, "'").replace(R_LT, "<").replace(R_GT, ">");
|
||||
},
|
||||
|
@ -256,7 +258,7 @@ module.exports = {
|
|||
return 'less than a second';
|
||||
},
|
||||
|
||||
time_to_string: function(elapsed, separate_days, days_only, no_hours) {
|
||||
time_to_string: function(elapsed, separate_days, days_only, no_hours, no_seconds) {
|
||||
var seconds = elapsed % 60,
|
||||
minutes = Math.floor(elapsed / 60),
|
||||
hours = Math.floor(minutes / 60),
|
||||
|
@ -273,7 +275,32 @@ module.exports = {
|
|||
days = ( days > 0 ) ? days + " days, " : "";
|
||||
}
|
||||
|
||||
return days + ((!no_hours || days || hours) ? ((hours < 10 ? "0" : "") + hours + ':') : '') + (minutes < 10 ? "0" : "") + minutes + ":" + (seconds < 10 ? "0" : "") + seconds;
|
||||
return days + ((!no_hours || days || hours) ? ((days && hours < 10 ? "0" : "") + hours + ':') : '') + (minutes < 10 ? "0" : "") + minutes + (no_seconds ? "" : (":" + (seconds < 10 ? "0" : "") + seconds));
|
||||
},
|
||||
|
||||
duration_string: function(val) {
|
||||
if ( val === 1 )
|
||||
return 'Purge';
|
||||
|
||||
if ( DURATIONS[val] )
|
||||
return DURATIONS[val];
|
||||
|
||||
var weeks, days, hours, minutes, seconds;
|
||||
|
||||
weeks = Math.floor(val / 604800);
|
||||
seconds = val % 604800;
|
||||
|
||||
days = Math.floor(seconds / 86400);
|
||||
seconds %= 86400;
|
||||
|
||||
hours = Math.floor(seconds / 3600);
|
||||
seconds %= 3600;
|
||||
|
||||
minutes = Math.floor(seconds / 60);
|
||||
seconds %= 60;
|
||||
|
||||
var out = DURATIONS[val] = (weeks ? weeks + 'w' : '') + ((days || (weeks && (hours || minutes || seconds))) ? days + 'd' : '') + ((hours || ((weeks || days) && (minutes || seconds))) ? hours + 'h' : '') + ((minutes || ((weeks || days || hours) && seconds)) ? minutes + 'm' : '') + (seconds ? seconds + 's' : '');
|
||||
return out;
|
||||
},
|
||||
|
||||
format_unread: function(count) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue