public function annotate_field_js(PaperList $pl, &$fjs) { $fjs["highlight_tags"] = $pl->search->highlight_tags(); if (TagInfo::has_votish()) { $fjs["votish_tags"] = array_keys(TagInfo::vote_tags() + TagInfo::approval_tags()); } }
public function link($tag) { if (ctype_digit($tag[0])) { $x = strlen($this->_contactId); if (substr($tag, 0, $x) != $this->_contactId || $tag[$x] !== "~") { return false; } $tag = substr($tag, $x); } $base = TagInfo::base($tag); if (TagInfo::has_votish() && (TagInfo::is_votish($base) || $base[0] === "~" && TagInfo::is_vote(substr($base, 1)))) { $q = "#{$base} showsort:-#{$base}"; } else { if ($base === $tag) { $q = "#{$base}"; } else { $q = "order:#{$base}"; } } return hoturl("search", ["q" => $q]); }