This commit is contained in:
albert
2013-03-08 15:31:11 -05:00
parent 35a51c0351
commit c3ac9832f9
2 changed files with 18 additions and 4 deletions

View File

@@ -88,6 +88,9 @@
var $dest = $("#related-tags");
$dest.empty();
if (Danbooru.Cookie.get("recent_tags")) {
$dest.append(Danbooru.RelatedTag.build_html("recent", Danbooru.RelatedTag.recent_tags()));
}
if (Danbooru.RelatedTag.favorite_tags().length) {
$dest.append(Danbooru.RelatedTag.build_html("favorite", Danbooru.RelatedTag.favorite_tags()));
}
@@ -108,6 +111,17 @@
}
}
Danbooru.RelatedTag.recent_tags = function() {
var string = Danbooru.Cookie.get("recent_tags");
if (string && string.length) {
return $.map(string.match(/\S+/g), function(x, i) {
return [[x, 0]];
});
} else {
return [];
}
}
Danbooru.RelatedTag.build_html = function(query, related_tags) {
if (query === null || query === "") {
return "";