add favorite tags to reltag js
This commit is contained in:
@@ -88,12 +88,19 @@
|
||||
var $dest = $("#related-tags");
|
||||
$dest.empty();
|
||||
|
||||
if (Danbooru.RelatedTag.favorite_tags().length) {
|
||||
$dest.append(Danbooru.RelatedTag.build_html("favorite", Danbooru.RelatedTag.favorite_tags()));
|
||||
}
|
||||
$dest.append(Danbooru.RelatedTag.build_html(query, related_tags));
|
||||
if (wiki_page_tags.length > 0) {
|
||||
if (wiki_page_tags.length) {
|
||||
$dest.append(Danbooru.RelatedTag.build_html("wiki:" + query, wiki_page_tags));
|
||||
}
|
||||
}
|
||||
|
||||
Danbooru.RelatedTag.favorite_tags = function() {
|
||||
return Danbooru.meta("favorite-tags").match(/\S+/g);
|
||||
}
|
||||
|
||||
Danbooru.RelatedTag.build_html = function(query, related_tags) {
|
||||
if (query === null || query === "") {
|
||||
return "";
|
||||
|
||||
@@ -60,6 +60,10 @@ class AnonymousUser
|
||||
[]
|
||||
end
|
||||
|
||||
def favorite_tags
|
||||
nil
|
||||
end
|
||||
|
||||
def upload_limit
|
||||
0
|
||||
end
|
||||
|
||||
@@ -99,6 +99,7 @@
|
||||
<meta name="post-is-flagged" content="<%= @post.is_flagged? %>">
|
||||
<meta name="config-large-width" content="<%= Danbooru.config.large_image_width %>">
|
||||
<meta name="always-resize-images" content="<%= CurrentUser.user.always_resize_images? %>">
|
||||
<meta name="favorite-tags" content="<%= CurrentUser.user.favorite_tags %>">
|
||||
<meta property="og:title" content="<%= h @post.presenter.humanized_essential_tag_string %> - <%= Danbooru.config.app_name %>">
|
||||
<meta property="og:description" content="<%= h @post.presenter.humanized_tag_string %>">
|
||||
<meta property="og:image" content="<%= @post.preview_file_url %>">
|
||||
|
||||
@@ -72,4 +72,8 @@
|
||||
Upload - <%= Danbooru.config.app_name %>
|
||||
<% end %>
|
||||
|
||||
<% content_for(:html_header) do %>
|
||||
<meta name="favorite-tags" content="<%= CurrentUser.user.favorite_tags %>">
|
||||
<% end %>
|
||||
|
||||
<%= render "posts/partials/common/secondary_links" %>
|
||||
|
||||
Reference in New Issue
Block a user