From d09e80d2f4a36faaa5e798e7c7452cb0f57e1295 Mon Sep 17 00:00:00 2001 From: albert Date: Thu, 3 Nov 2011 16:30:06 -0400 Subject: [PATCH] style/js fixes --- app/assets/javascripts/favorites.js | 2 +- app/assets/javascripts/notes.js | 2 +- app/assets/javascripts/posts.js | 26 ++++++++++++++----- app/assets/javascripts/utility.js | 4 +-- .../stylesheets/common/000_vars.css.scss | 7 ++--- .../stylesheets/specific/posts.css.scss | 15 ++++++++--- app/views/comment_votes/create.js.erb | 2 +- app/views/post_appeals/create.js.erb | 4 +-- app/views/post_flags/create.js.erb | 4 +-- app/views/post_votes/create.js.erb | 2 +- config/jrails.yml | 19 -------------- 11 files changed, 45 insertions(+), 42 deletions(-) delete mode 100644 config/jrails.yml diff --git a/app/assets/javascripts/favorites.js b/app/assets/javascripts/favorites.js index e0aee0c6d..4e23e7e1a 100644 --- a/app/assets/javascripts/favorites.js +++ b/app/assets/javascripts/favorites.js @@ -36,7 +36,7 @@ Danbooru.Post.notice_update("dec"); }, error: function(data, status, xhr) { - Danbooru.j_alert("Error: " + data.reason); + Danbooru.notice("Error: " + data.reason); } }); } diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index ec6c68849..d054d3b86 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -319,7 +319,7 @@ Danbooru.Note = { }, error_handler: function(xhr, status, exception) { - Danbooru.j_error("There was an error saving the note"); + Danbooru.error("There was an error saving the note"); }, success_handler: function(data, status, xhr) { diff --git a/app/assets/javascripts/posts.js b/app/assets/javascripts/posts.js index ce25e9e22..5980e6dcb 100644 --- a/app/assets/javascripts/posts.js +++ b/app/assets/javascripts/posts.js @@ -5,7 +5,7 @@ Danbooru.Post.initialize_all = function() { this.initialize_titles(); - + if ($("#c-posts").length && $("#a-index").length) { this.initialize_wiki_page_excerpt(); } @@ -120,30 +120,42 @@ $("#show-wiki-page-excerpt").hide(); } - $("#hide-wiki-page-excerpt").click(function() { + $("#hide-wiki-page-excerpt").click(function(e) { $("#hide-wiki-page-excerpt").hide(); $("#wiki-page-excerpt-content").hide(); $("#show-wiki-page-excerpt").show(); Danbooru.Cookie.put("hide-wiki-page-excerpt", "1"); + e.preventDefault(); }); - $("#show-wiki-page-excerpt").click(function() { + $("#show-wiki-page-excerpt").click(function(e) { $("#hide-wiki-page-excerpt").show(); $("#wiki-page-excerpt-content").show(); $("#show-wiki-page-excerpt").hide(); Danbooru.Cookie.put("hide-wiki-page-excerpt", "0"); + e.preventDefault(); }); } Danbooru.Post.initialize_post_sections = function() { $("#post-sections li a").click(function(e) { - $("#comments").hide(); - $("#notes").hide(); - $("#edit").hide(); + if (e.target.hash === "#comments") { + $("#comments").fadeIn("fast"); + $("#notes").hide(); + $("#edit").hide(); + } else if (e.target.hash === "#notes") { + $("#notes").fadeIn("fast"); + $("#comments").hide(); + $("#edit").hide(); + } else { + $("#edit").fadeIn("fast"); + $("#comments").hide(); + $("#notes").hide(); + } + $("#post-sections li").removeClass("active"); $(e.target).parent("li").addClass("active"); var name = e.target.hash; - $(name).show(); e.preventDefault(); }); diff --git a/app/assets/javascripts/utility.js b/app/assets/javascripts/utility.js index 5cc0f0134..003bd148d 100644 --- a/app/assets/javascripts/utility.js +++ b/app/assets/javascripts/utility.js @@ -4,11 +4,11 @@ } Danbooru.notice = function(msg) { - $('#notice').html(msg).addClass("ui-state-highlight").removeClass("ui-state-error").show(); + $('#notice').html(msg).addClass("ui-state-highlight").removeClass("ui-state-error").slideDown("fast"); } Danbooru.error = function(msg) { - $('#notice').html(msg).removeClass("ui-state-highlight").addClass("ui-state-error").show(); + $('#notice').html(msg).removeClass("ui-state-highlight").addClass("ui-state-error").slideDown("fast"); } Danbooru.ajax_start = function(target) { diff --git a/app/assets/stylesheets/common/000_vars.css.scss b/app/assets/stylesheets/common/000_vars.css.scss index 3a8494840..ab13b17a4 100644 --- a/app/assets/stylesheets/common/000_vars.css.scss +++ b/app/assets/stylesheets/common/000_vars.css.scss @@ -1,8 +1,9 @@ -$link_color: #006FFA; -$link_hover_color: #9093FF; +$link_color: hsl(213, 100%, 50%); +$link_hover_color: hsl(213, 100%, 75%); +$link_dark_color: hsl(213, 100%, 25%); $border_color: #CCC; $highlight_color: #F0F0F0; -$reverse_highlight_color: #FFFDF4; +$reverse_highlight_color: hsl(50, 100, 90); $h1_size: 2em; $h2_size: 1.5em; $h3_size: 1.16667em; diff --git a/app/assets/stylesheets/specific/posts.css.scss b/app/assets/stylesheets/specific/posts.css.scss index 5b8aa2777..42453a3ee 100644 --- a/app/assets/stylesheets/specific/posts.css.scss +++ b/app/assets/stylesheets/specific/posts.css.scss @@ -144,12 +144,21 @@ div#c-posts { div#a-show { menu#post-sections { - font-size: $h3_size; + font-size: $h2_size; font-weight: bold; line-height: 1.25em; - li a { - color: $link_color; + li { + padding: 0; + margin: 0 0.5em 0 0; + + a { + color: $link_dark_color; + } + + &.active a { + color: $link_color; + } } } diff --git a/app/views/comment_votes/create.js.erb b/app/views/comment_votes/create.js.erb index 729743de0..ee619d299 100644 --- a/app/views/comment_votes/create.js.erb +++ b/app/views/comment_votes/create.js.erb @@ -1,5 +1,5 @@ <% if @comment_vote.errors.any? %> - Danbooru.j_error("<%= j @comment_vote.errors.full_messages.join('; ') %>"); + Danbooru.error("<%= j @comment_vote.errors.full_messages.join('; ') %>"); <% elsif @comment_vote.is_negative? %> $(".comment[data-comment-id=<%= @comment.id %>]").remove(); <% end %> diff --git a/app/views/post_appeals/create.js.erb b/app/views/post_appeals/create.js.erb index 4b9265490..938c5705a 100644 --- a/app/views/post_appeals/create.js.erb +++ b/app/views/post_appeals/create.js.erb @@ -1,6 +1,6 @@ var errors = "<%= j @post_appeal.errors.full_messages.join("; ") %>"; if (errors.length > 0) { - Danbooru.j_error(errors); + Danbooru.error(errors); } else { - Danbooru.j_alert("Appeal", "Post appealed"); + Danbooru.notice("Post appealed"); } diff --git a/app/views/post_flags/create.js.erb b/app/views/post_flags/create.js.erb index 3aa47bcfe..5e5f9b804 100644 --- a/app/views/post_flags/create.js.erb +++ b/app/views/post_flags/create.js.erb @@ -1,8 +1,8 @@ var errors = <%= @post_flag.errors.full_messages.to_json.html_safe %>; if (errors.length > 0) { - Danbooru.j_error(errors.join("; ")); + Danbooru.error(errors.join("; ")); } else { - Danbooru.j_alert("Flag", "Post flagged"); + Danbooru.notice("Post flagged"); $("a#approve").show(); $("a#disapprove").show(); } diff --git a/app/views/post_votes/create.js.erb b/app/views/post_votes/create.js.erb index 6eda5336d..49f7f9768 100644 --- a/app/views/post_votes/create.js.erb +++ b/app/views/post_votes/create.js.erb @@ -1,5 +1,5 @@ <% if @error %> - Danbooru.j_error("<%= j @error.to_s %>"); + Danbooru.error("<%= j @error.to_s %>"); <% else %> $("#score-for-post-<%= @post.id %>").html(<%= @post.score %>); <% end %> diff --git a/config/jrails.yml b/config/jrails.yml deleted file mode 100644 index c8b6f1813..000000000 --- a/config/jrails.yml +++ /dev/null @@ -1,19 +0,0 @@ -# if google: true, jrails will use 'jquery_version', 'jqueryui_version' feature. -# for version information See Also http://code.google.com/apis/ajaxlibs/ - -# default values in jrails/lib/jrails.rb -#development: -# google: false -# compressed: true -# jquery_version: "1.4.2" -# jqueryui_version: "1.8.4" - -development: - google: false - compressed: false - -production: - google: true - -test: - google: false