tweaked styles
This commit is contained in:
@@ -13,7 +13,7 @@ GIT
|
|||||||
revision: afdfa8f7f4129820c573f94f79b99aed715a385d
|
revision: afdfa8f7f4129820c573f94f79b99aed715a385d
|
||||||
specs:
|
specs:
|
||||||
sanitize (2.0.3)
|
sanitize (2.0.3)
|
||||||
nokogiri (< 1.6, >= 1.4.4)
|
nokogiri (>= 1.4.4, < 1.6)
|
||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: http://github.com/EmmanuelOga/ffaker.git
|
remote: http://github.com/EmmanuelOga/ffaker.git
|
||||||
@@ -77,10 +77,10 @@ GEM
|
|||||||
mime-types (~> 1.16)
|
mime-types (~> 1.16)
|
||||||
treetop (~> 1.4.8)
|
treetop (~> 1.4.8)
|
||||||
mechanize (2.0.1)
|
mechanize (2.0.1)
|
||||||
net-http-digest_auth (>= 1.1.1, ~> 1.1)
|
net-http-digest_auth (~> 1.1, >= 1.1.1)
|
||||||
net-http-persistent (~> 1.8)
|
net-http-persistent (~> 1.8)
|
||||||
nokogiri (~> 1.4)
|
nokogiri (~> 1.4)
|
||||||
webrobots (>= 0.0.9, ~> 0.0)
|
webrobots (~> 0.0, >= 0.0.9)
|
||||||
memcache-client (1.8.5)
|
memcache-client (1.8.5)
|
||||||
metaclass (0.0.1)
|
metaclass (0.0.1)
|
||||||
method_source (0.6.5)
|
method_source (0.6.5)
|
||||||
@@ -145,7 +145,7 @@ GEM
|
|||||||
sprockets (2.0.0)
|
sprockets (2.0.0)
|
||||||
hike (~> 1.2)
|
hike (~> 1.2)
|
||||||
rack (~> 1.0)
|
rack (~> 1.0)
|
||||||
tilt (!= 1.3.0, ~> 1.1)
|
tilt (~> 1.1, != 1.3.0)
|
||||||
super_exception_notifier (3.0.13)
|
super_exception_notifier (3.0.13)
|
||||||
actionmailer
|
actionmailer
|
||||||
rake
|
rake
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
this.common_bind("#related-artists-button", "artist");
|
this.common_bind("#related-artists-button", "artist");
|
||||||
this.common_bind("#related-characters-button", "character");
|
this.common_bind("#related-characters-button", "character");
|
||||||
this.common_bind("#related-copyrights-button", "copyright");
|
this.common_bind("#related-copyrights-button", "copyright");
|
||||||
|
$("find-artist-button").click(Danbooru.RelatedTag.find_artist);
|
||||||
}
|
}
|
||||||
|
|
||||||
Danbooru.RelatedTag.common_bind = function(button_name, category) {
|
Danbooru.RelatedTag.common_bind = function(button_name, category) {
|
||||||
@@ -45,10 +46,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
Danbooru.RelatedTag.process_response = function(data) {
|
Danbooru.RelatedTag.process_response = function(data) {
|
||||||
var query = data.query;
|
Danbooru.RelatedTag.recent_search = data;
|
||||||
var related_tags = data.tags;
|
Danbooru.RelatedTag.build_all();
|
||||||
var wiki_page_tags = data.wiki_page_tags;
|
}
|
||||||
|
|
||||||
|
Danbooru.RelatedTag.build_all = function() {
|
||||||
|
var query = Danbooru.RelatedTag.recent_search.query;
|
||||||
|
var related_tags = Danbooru.RelatedTag.recent_search.tags;
|
||||||
|
var wiki_page_tags = Danbooru.RelatedTag.recent_search.wiki_page_tags;
|
||||||
var $dest = $("#related-tags");
|
var $dest = $("#related-tags");
|
||||||
|
$dest.empty();
|
||||||
|
|
||||||
$dest.append(Danbooru.RelatedTag.build_html(query, related_tags));
|
$dest.append(Danbooru.RelatedTag.build_html(query, related_tags));
|
||||||
if (wiki_page_tags.length > 0) {
|
if (wiki_page_tags.length > 0) {
|
||||||
@@ -89,6 +96,45 @@
|
|||||||
$div.append($ul);
|
$div.append($ul);
|
||||||
return $div;
|
return $div;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Danbooru.RelatedTag.toggle = function(e) {
|
||||||
|
var $field = $("#upload_tag_string,#post_tag_string");
|
||||||
|
var tags = $field.val().match(/\S+/g) || [];
|
||||||
|
var tag = $(e.target).html().replace(/ /g, "_");
|
||||||
|
|
||||||
|
if ($.inArray(tag, tags)) {
|
||||||
|
$field.val(Danbooru.without(tags, tag).join(" ") + " ");
|
||||||
|
} else {
|
||||||
|
$field.val(tags.concat([tag]).join(" ") + " ");
|
||||||
|
}
|
||||||
|
|
||||||
|
$field[0].selectionStart = $field.val().length;
|
||||||
|
Danbooru.RelatedTag.build_all();
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
Danbooru.RelatedTag.find_artist = function(e) {
|
||||||
|
var url = $("#upload_source,#post_source");
|
||||||
|
$.get("/artists.json", {"search[url_match]": url.val()}).success(Danbooru.RelatedTag.process_artist);
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
Danbooru.RelatedTag.process_artist = function(data) {
|
||||||
|
var $dest = $("#related-tags");
|
||||||
|
$dest.empty();
|
||||||
|
|
||||||
|
if (data.size() === 0) {
|
||||||
|
$dest.html("No artists found");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$.each(data, function(i, json) {
|
||||||
|
var id = json.id;
|
||||||
|
var name = json.name;
|
||||||
|
var other_names = json.other_names;
|
||||||
|
var urls
|
||||||
|
});
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|||||||
@@ -35,6 +35,16 @@
|
|||||||
return all;
|
return all;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Danbooru.without = function(array, element) {
|
||||||
|
var temp = [];
|
||||||
|
$.each(array, function(i, v) {
|
||||||
|
if (v !== element) {
|
||||||
|
temp.push(v);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
Danbooru.reject = function(array, f) {
|
Danbooru.reject = function(array, f) {
|
||||||
var filtered = [];
|
var filtered = [];
|
||||||
$.each(array, function(i, x) {
|
$.each(array, function(i, x) {
|
||||||
|
|||||||
@@ -261,18 +261,20 @@ header#top {
|
|||||||
}
|
}
|
||||||
|
|
||||||
menu {
|
menu {
|
||||||
|
margin-top: -2px;
|
||||||
background: #F7F7FF;
|
background: #F7F7FF;
|
||||||
padding: 5px 20px;
|
padding: 6px 20px;
|
||||||
|
|
||||||
li {
|
li a {
|
||||||
padding: 5px 10px;
|
padding: 6px 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
menu.main {
|
menu.main {
|
||||||
|
margin-top: 0px;
|
||||||
background: white;
|
background: white;
|
||||||
|
|
||||||
li.current {
|
li.current a {
|
||||||
background: #F7F7FF;
|
background: #F7F7FF;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user