From 1b958c6abab2d6d582c5f4641cba97fc99123db8 Mon Sep 17 00:00:00 2001 From: r888888888 Date: Fri, 28 Feb 2014 17:10:59 -0800 Subject: [PATCH] usability improvements for #1237 --- app/assets/javascripts/post_mode_menu.js | 7 ++++++- app/views/posts/partials/index/_mode_menu.html.erb | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/post_mode_menu.js b/app/assets/javascripts/post_mode_menu.js index 9efd7c45b..fd391421c 100644 --- a/app/assets/javascripts/post_mode_menu.js +++ b/app/assets/javascripts/post_mode_menu.js @@ -15,6 +15,10 @@ Danbooru.PostModeMenu.initialize_shortcuts = function() { $(document).bind("keypress", "1 2 3 4 5 6 7 8 9 0", Danbooru.PostModeMenu.change_tag_script); } + + Danbooru.PostModeMenu.show_notice = function(i) { + Danbooru.notice("Switched to tag script #" + i + ". To switch tag scripts, use the number keys."); + } Danbooru.PostModeMenu.change_tag_script = function(e) { if ($("#mode-box select").val() === "tag-script") { @@ -27,7 +31,7 @@ $("#tag-script-field").val(new_tag_script); Danbooru.Cookie.put("current_tag_script_id", new_tag_script_id); if (old_tag_script_id != new_tag_script_id) { - Danbooru.notice("Switched to tag script #" + new_tag_script_id + ". To switch tag scripts, use the number keys."); + Danbooru.PostModeMenu.show_notice(new_tag_script_id); } e.preventDefault(); @@ -121,6 +125,7 @@ var script = Danbooru.Cookie.get("tag-script-" + current_script_id); $("#tag-script-field").val(script).show(); + Danbooru.PostModeMenu.show_notice(1); } else { $("#tag-script-field").hide(); } diff --git a/app/views/posts/partials/index/_mode_menu.html.erb b/app/views/posts/partials/index/_mode_menu.html.erb index a16e63c21..a2edbc453 100644 --- a/app/views/posts/partials/index/_mode_menu.html.erb +++ b/app/views/posts/partials/index/_mode_menu.html.erb @@ -22,6 +22,6 @@ <% end %> + - <% end %>