diff options
author | Andrew Dolgov <[email protected]> | 2017-12-04 10:39:50 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2017-12-04 10:39:50 +0300 |
commit | 8f92a67e6f1831d9cf1e746ddf8a06cc065d94ce (patch) | |
tree | e46ad3f7ae98089779da941318727adb9850a9da | |
parent | 003a7447c3cba9b1108b0a97d1263e7a72261f5b (diff) |
some (very minor) code cleanup in feeds class
-rwxr-xr-x | classes/feeds.php | 36 | ||||
-rwxr-xr-x | js/viewfeed.js | 4 |
2 files changed, 8 insertions, 32 deletions
diff --git a/classes/feeds.php b/classes/feeds.php index 878306730..7b5531464 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -339,6 +339,8 @@ class Feeds extends Handler_Protected { $label_cache = $line["label_cache"]; $labels = false; + $mouseover_attrs = "onmouseover='postMouseIn(event, $id)' onmouseout='postMouseOut($id)'"; + if ($label_cache) { $label_cache = json_decode($label_cache, true); @@ -367,29 +369,13 @@ class Feeds extends Handler_Protected { ++$num_unread; } - if ($line["marked"]) { - $marked_pic = "<img - src=\"images/mark_set.png\" - class=\"markedPic\" alt=\"Unstar article\" - onclick='toggleMark($id)'>"; - $class .= " marked"; - } else { - $marked_pic = "<img - src=\"images/mark_unset.png\" - class=\"markedPic\" alt=\"Star article\" - onclick='toggleMark($id)'>"; - } + $marked_pic_src = $line["marked"] ? "mark_set.png" : "mark_unset.png"; + $class .= $line["marked"] ? " marked" : ""; + $marked_pic = "<img src=\"images/$marked_pic_src\" class=\"markedPic\" onclick='toggleMark($id)'>"; - if ($line["published"]) { - $published_pic = "<img src=\"images/pub_set.png\" - class=\"pubPic\" - alt=\"Unpublish article\" onclick='togglePub($id)'>"; - $class .= " published"; - } else { - $published_pic = "<img src=\"images/pub_unset.png\" - class=\"pubPic\" - alt=\"Publish article\" onclick='togglePub($id)'>"; - } + $published_pic_src = $line["published"] ? "pub_set.png" : "pub_unset.png"; + $class .= $line["published"] ? " published" : ""; + $published_pic = "<img src=\"images/$published_pic_src\" class=\"pubPic\" onclick='togglePub($id)'>"; $updated_fmt = make_local_datetime($line["updated"], false, false, false, true); $date_entered_fmt = T_sprintf("Imported at %s", @@ -456,9 +442,6 @@ class Feeds extends Handler_Protected { } } - $mouseover_attrs = "onmouseover='postMouseIn(event, $id)' - onmouseout='postMouseOut($id)'"; - $reply['content'] .= "<div class='hl hlMenuAttach $class' data-orig-feed-id='$feed_id' data-article-id='$id' id='RROW-$id' $mouseover_attrs>"; $reply['content'] .= "<div class='hlLeft'>"; @@ -551,9 +534,6 @@ class Feeds extends Handler_Protected { } } - $mouseover_attrs = "onmouseover='postMouseIn(event, $id)' - onmouseout='postMouseOut($id)'"; - $expanded_class = $expand_cdm ? "expanded" : "expandable"; $tmp_content = "<div class=\"cdm $hlc_suffix $expanded_class $class\" diff --git a/js/viewfeed.js b/js/viewfeed.js index e0ad2dd32..ffd8fcf46 100755 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -423,11 +423,9 @@ function toggleMark(id, client_only) { if (!row.hasClassName("marked")) { img.src = img.src.replace("mark_unset", "mark_set"); - img.alt = __("Unstar article"); query = query + "&mark=1"; } else { img.src = img.src.replace("mark_set", "mark_unset"); - img.alt = __("Star article"); query = query + "&mark=0"; } } @@ -477,11 +475,9 @@ function togglePub(id, client_only, no_effects, note) { if (!row.hasClassName("published") || note != undefined) { img.src = img.src.replace("pub_unset", "pub_set"); - img.alt = __("Unpublish article"); query = query + "&pub=1"; } else { img.src = img.src.replace("pub_set", "pub_unset"); - img.alt = __("Publish article"); query = query + "&pub=0"; } } |