diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-09-06 12:27:47 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-09-06 12:27:47 -0400 |
| commit | fcd65a3f0b23d0c0f0682b3f750fba59e55e4db9 (patch) | |
| tree | 1851524821b2fa4b75bc74f9fd8fdaf5af7bcf53 /public/assets/js | |
| parent | 5e5cdd7e3758412851fffa56a9786ffa5d751e40 (diff) | |
more responsive
Diffstat (limited to 'public/assets/js')
| -rw-r--r-- | public/assets/js/util/format.js | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/public/assets/js/util/format.js b/public/assets/js/util/format.js index 90a19d2..d034c26 100644 --- a/public/assets/js/util/format.js +++ b/public/assets/js/util/format.js @@ -48,10 +48,10 @@ function verbose_date (date) { if (m < 10) m = "0" + m if (h < 10) h = "0" + h - var date = d + '-' + short_months[date.getMonth()] + '-' + date.getFullYear() + var date = d + '‑' + short_months[date.getMonth()] + '‑' + date.getFullYear() var time = h + ':' + m + meridian - return date + " <small>" + time + "</small>" + return date + " <small>" + time + "</small>" } function carbon_date (date, no_bold) { var span = (+new Date() / 1000 - date) @@ -74,13 +74,13 @@ function hush_views (n, bias, no_bold) { var txt = commatize(n) bias = bias || 1 n = n || 0 - if (n < 30) { return["quiet", n + " v."] } - if (n < 200) { return ["quiet", txt + " v."] } - else if (n < 500) { return ["quiet", txt + " v."] } - else if (n < 1000) { return ["old", txt + " v."] } - else if (n < 5000) { return ["med", txt + " kv."] } - else if (nobold || n < 10000) { return ["recent", txt + " kv."] } - else { return ["new", txt + " kv."] } + if (n < 30) { return["quiet", n + " v."] } + if (n < 200) { return ["quiet", txt + " v."] } + else if (n < 500) { return ["quiet", txt + " v."] } + else if (n < 1000) { return ["old", txt + " v."] } + else if (n < 5000) { return ["med", txt + " kv."] } + else if (nobold || n < 10000) { return ["recent", txt + " kv."] } + else { return ["new", txt + " kv."] } } function hush_size (n, bias, nobold) { @@ -88,25 +88,25 @@ function hush_size (n, bias, nobold) { bias = 1 || bias n = n || 0 if (n < 1024) { - return ["quiet", txt + " b."] + return ["quiet", txt + " b."] } if (n < 1024*1024) { - return ["quiet", txt + " kb."] + return ["quiet", txt + " kb."] } else if (n < (20000000/bias)) { - return ["quiet", txt + " mb."] + return ["quiet", txt + " mb."] } else if (n < (50000000/bias)) { - return ["old", txt + " mb."] + return ["old", txt + " mb."] } else if (n < (80000000/bias)) { - return ["med", txt + " mb."] + return ["med", txt + " mb."] } else if (nobold || n < (170000000/bias)) { - return ["recent", txt + " mb."] + return ["recent", txt + " mb."] } else { - return ["new", txt + " mb."] + return ["new", txt + " mb."] } } |
