From 84cd3bc4368afdfe41320b1388fd9a14bf90fce9 Mon Sep 17 00:00:00 2001 From: r Date: Thu, 30 Jan 2020 13:56:29 +0000 Subject: Remove icons --- static/fluoride.js | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) (limited to 'static/fluoride.js') diff --git a/static/fluoride.js b/static/fluoride.js index 44af7c9..b3e90b8 100644 --- a/static/fluoride.js +++ b/static/fluoride.js @@ -1,16 +1,5 @@ // @license magnet:?xt=urn:btih:90dc5c0be029de84e523b9b3922520e79e0e6f08&dn=cc0.txt CC0 -var actionIcons = { - "like": "/static/icons/star-o.png", - "dark-like": "/static/icons/dark-star-o.png", - "unlike": "/static/icons/liked.png", - "dark-unlike": "/static/icons/liked.png", - "retweet": "/static/icons/retweet.png", - "dark-retweet": "/static/icons/dark-retweet.png", - "unretweet": "/static/icons/retweeted.png", - "dark-unretweet": "/static/icons/retweeted.png" -}; - var reverseActions = { "like": "unlike", "unlike": "like", @@ -45,11 +34,7 @@ function http(method, url, body, type, success, error) { } function updateActionForm(id, f, action) { - if (Array.from(document.body.classList).indexOf("dark") > -1) { - f.querySelector(".icon").src = actionIcons["dark-" + action]; - } else { - f.querySelector(".icon").src = actionIcons[action]; - } + f.querySelector('[type="submit"]').value = action; f.action = "/" + action + "/" + id; f.dataset.action = action; } @@ -74,7 +59,11 @@ function handleLikeForm(id, f) { } var counts = document.querySelectorAll(".status-"+id+" .status-like-count"); counts.forEach(function(c) { - c.innerHTML = count; + if (count > 0) { + c.innerHTML = "(" + count + ")"; + } else { + c.innerHTML = ""; + } }); }, function(err) { forms.forEach(function(f) { @@ -104,7 +93,11 @@ function handleRetweetForm(id, f) { } var counts = document.querySelectorAll(".status-"+id+" .status-retweet-count"); counts.forEach(function(c) { - c.innerHTML = count; + if (count > 0) { + c.innerHTML = "(" + count + ")"; + } else { + c.innerHTML = ""; + } }); }, function(err) { forms.forEach(function(f) { -- cgit v1.2.3