usability improvements for #1237

This commit is contained in:
r888888888
2014-02-28 17:10:59 -08:00
parent 1f10f39d1e
commit 1b958c6aba
2 changed files with 7 additions and 2 deletions

View File

@@ -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();
}

View File

@@ -22,6 +22,6 @@
<% end %>
</select>
</form>
<input id="tag-script-field" placeholder="Enter tag script" style="display: none; margin-top: 0.5em;"></input>
</section>
<input id="tag-script-field" placeholder="Enter tag script" style="display: none;"></input>
<% end %>