diff --git a/app/assets/javascripts/comments.js b/app/assets/javascripts/comments.js index 3c4cf3aa9..582edecf1 100644 --- a/app/assets/javascripts/comments.js +++ b/app/assets/javascripts/comments.js @@ -35,18 +35,19 @@ Danbooru.Comment.initialize_expand_links = function() { $(".comment-section form").hide(); - $(".comment-section input.expand-comment-response").click(function() { + $(".comment-section input.expand-comment-response").click(function(e) { var post_id = $(this).closest(".comment-section").data("post-id"); - $(".comment-section[data-post-id=" + post_id + "] form").show(); $(this).hide(); + $(".comment-section[data-post-id=" + post_id + "] form").slideDown("fast"); + e.preventDefault(); }); } Danbooru.Comment.initialize_response_link = function() { $("a.expand-comment-response").click(function(e) { - e.preventDefault(); - $(e.target).closest("div.new-comment").find("form").show(); $(e.target).hide(); + $(e.target).closest("div.new-comment").find("form").slideDown("fast"); + e.preventDefault(); }); $("div.new-comment form").hide(); diff --git a/app/assets/javascripts/dtext.js b/app/assets/javascripts/dtext.js index 3b2cf4c09..9f38cd3c1 100644 --- a/app/assets/javascripts/dtext.js +++ b/app/assets/javascripts/dtext.js @@ -16,7 +16,7 @@ success: function(data) { $button.val("Edit"); $input.hide(); - $preview.html(data).show(); + $preview.html(data).fadeIn("fast"); } }); } @@ -24,7 +24,7 @@ Danbooru.Dtext.call_edit = function(e, $button, $input, $preview) { $button.val("Preview"); $preview.hide(); - $input.show(); + $input.slideDown("fast"); } Danbooru.Dtext.click_button = function(e) { diff --git a/app/assets/javascripts/post_mode_menu.js b/app/assets/javascripts/post_mode_menu.js index 0a8818202..d490e6547 100644 --- a/app/assets/javascripts/post_mode_menu.js +++ b/app/assets/javascripts/post_mode_menu.js @@ -17,7 +17,7 @@ $("#mode-box select").val(Danbooru.Cookie.get("mode")); } - $("#mode-box select").click(Danbooru.PostModeMenu.change); + $("#mode-box select").change(Danbooru.PostModeMenu.change); } Danbooru.PostModeMenu.initialize_preview_link = function() { @@ -27,7 +27,7 @@ Danbooru.PostModeMenu.initialize_edit_form = function() { $("#quick-edit-div").hide(); $("#quick-edit-form input[value=Cancel]").click(function(e) { - $("#quick-edit-div").hide(); + $("#quick-edit-div").slideUp("fast"); e.preventDefault(); }); @@ -49,14 +49,14 @@ }); } - Danbooru.PostModeMenu.change = function() { - $("#quick-edit-div").hide(); + Danbooru.PostModeMenu.change = function(e) { + $("#quick-edit-div").slideUp("fast"); var s = $("#mode-box select").val(); var $body = $(document.body); $body.removeClass(); $body.addClass("mode-" + s); - Danbooru.Cookie.put("mode", s, 7); - + Danbooru.Cookie.put("mode", s, 1); + if (s === "edit-tag-script") { var script = Danbooru.Cookie.get("tag-script"); script = prompt("Enter a tag script", script); @@ -68,15 +68,15 @@ $("#mode-box select").val("view"); } - Danbooru.PostModeMenu.change(); + Danbooru.PostModeMenu.change(e); } } Danbooru.PostModeMenu.open_edit = function(post_id) { var $post = $("#post_" + post_id); - $("#quick-edit-div").show(); + $("#quick-edit-div").slideDown("fast"); $("#quick-edit-form").attr("action", "/posts/" + post_id + ".json"); - $("#post_tag_string").val($post.data("tags")); + $("#post_tag_string").val($post.data("tags")).focus(); } Danbooru.PostModeMenu.click = function(e) { diff --git a/app/assets/javascripts/uploads.js b/app/assets/javascripts/uploads.js index 9a893004d..2a4a90885 100644 --- a/app/assets/javascripts/uploads.js +++ b/app/assets/javascripts/uploads.js @@ -2,9 +2,8 @@ Danbooru.Upload = {}; Danbooru.Upload.initialize_all = function() { - this.initialize_image(); - if ($("#c-uploads").length) { + this.initialize_image(); this.initialize_info(); this.initialize_similar(); } diff --git a/app/assets/javascripts/utility.js b/app/assets/javascripts/utility.js index 003bd148d..fe3cb30a9 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").slideDown("fast"); + $('#notice').html(msg).addClass("ui-state-highlight").removeClass("ui-state-error").fadeIn("fast"); } Danbooru.error = function(msg) { - $('#notice').html(msg).removeClass("ui-state-highlight").addClass("ui-state-error").slideDown("fast"); + $('#notice').html(msg).removeClass("ui-state-highlight").addClass("ui-state-error").fadeIn("fast"); } Danbooru.ajax_start = function(target) { diff --git a/app/models/dmail.rb b/app/models/dmail.rb index b0799519a..3cf7879c0 100644 --- a/app/models/dmail.rb +++ b/app/models/dmail.rb @@ -16,6 +16,7 @@ class Dmail < ActiveRecord::Base scope :active, where(["is_deleted = ?", false]) scope :deleted, where(["is_deleted = ?", true]) scope :search_message, lambda {|query| where(["message_index @@ plainto_tsquery(?)", query])} + scope :unread, where("is_read = false and is_deleted = false") module AddressMethods def to_name diff --git a/app/models/post.rb b/app/models/post.rb index 2e636c9d6..1772d6fd8 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -136,7 +136,7 @@ class Post < ActiveRecord::Base def medium_file_url if has_medium? if is_flash? - "/images/480x150-flash.png" + "/images/480x200-flash.png" else "/data/medium/#{file_path_prefix}#{md5}.jpg" end @@ -235,7 +235,7 @@ class Post < ActiveRecord::Base def medium_image_height if is_flash? - return 204 + return 200 end ratio = Danbooru.config.medium_image_width.to_f / image_width.to_f diff --git a/app/models/user.rb b/app/models/user.rb index bb9b3ceb9..6c64240a6 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -37,6 +37,7 @@ class User < ActiveRecord::Base has_one :ban has_many :subscriptions, :class_name => "TagSubscription", :foreign_key => "creator_id" has_many :note_versions, :foreign_key => "updater_id" + has_many :dmails, :foreign_key => "owner_id", :order => "dmails.id desc" belongs_to :inviter, :class_name => "User" scope :named, lambda {|name| where(["lower(name) = ?", name])} scope :admins, where("is_admin = TRUE") diff --git a/app/views/comments/index_for_post.js.erb b/app/views/comments/index_for_post.js.erb index 264fb7bc7..e671acbb8 100644 --- a/app/views/comments/index_for_post.js.erb +++ b/app/views/comments/index_for_post.js.erb @@ -8,4 +8,3 @@ $("div.comments-for-post[data-post-id=<%= @post.id %>] div.list-of-comments").ht <% else %> Danbooru.Comment.hide_threshold_comments(<%= @post.id %>); <% end %> - diff --git a/app/views/dmails/_secondary_links.html.erb b/app/views/dmails/_secondary_links.html.erb index 9ec9543d4..d96471e51 100644 --- a/app/views/dmails/_secondary_links.html.erb +++ b/app/views/dmails/_secondary_links.html.erb @@ -1,7 +1,7 @@ <% content_for(:secondary_links) do %>
diff --git a/app/views/users/_secondary_links.html.erb b/app/views/users/_secondary_links.html.erb index 72b809819..ff7ead9ca 100644 --- a/app/views/users/_secondary_links.html.erb +++ b/app/views/users/_secondary_links.html.erb @@ -6,6 +6,7 @@ <% if @user.id == CurrentUser.id %>