diff options
Diffstat (limited to 'public/assets/js')
| -rw-r--r-- | public/assets/js/lib/views/keywords/keywords.js | 2 | ||||
| -rw-r--r-- | public/assets/js/util/format.js | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/public/assets/js/lib/views/keywords/keywords.js b/public/assets/js/lib/views/keywords/keywords.js index 88acffc..777bebf 100644 --- a/public/assets/js/lib/views/keywords/keywords.js +++ b/public/assets/js/lib/views/keywords/keywords.js @@ -62,6 +62,8 @@ var KeywordsView = View.extend({ .replace(/{{time}}/g, datetime[1]) .replace(/{{date_class}}/g, carbon_date(thread.lastmodified)) .replace(/{{age_opacity}}/g, get_age_opacity(thread.lastmodified)) + .replace(/{{views_opacity}}/g, get_views_opacity(viewed)) + .replace(/{{thread_opacity}}/g, get_size_opacity(threadCountNum)) .replace(/{{views}}/g, views[1]) .replace(/{{threadcount}}/, threadCount[1]) .replace(/{{threadcount_class}}/, threadCount[0]) diff --git a/public/assets/js/util/format.js b/public/assets/js/util/format.js index 422a4c6..41d652a 100644 --- a/public/assets/js/util/format.js +++ b/public/assets/js/util/format.js @@ -286,6 +286,15 @@ const size_scale = [ function get_size_opacity(n) { return get_scale_opacity(n, size_scale); } +const views_scale = [ + [0, 0.5], + [100, 0.8], + [1000, 0.9], + [10000, 1.0], +]; +function get_views_opacity(n) { + return get_scale_opacity(n, views_scale); +} /** * find a value on one axis of an array of points, and return the proportional point * @param {Array} value a value, to be matched on the first column of scale |
