usability improvements for #1237
This commit is contained in:
@@ -15,6 +15,10 @@
|
|||||||
Danbooru.PostModeMenu.initialize_shortcuts = function() {
|
Danbooru.PostModeMenu.initialize_shortcuts = function() {
|
||||||
$(document).bind("keypress", "1 2 3 4 5 6 7 8 9 0", Danbooru.PostModeMenu.change_tag_script);
|
$(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) {
|
Danbooru.PostModeMenu.change_tag_script = function(e) {
|
||||||
if ($("#mode-box select").val() === "tag-script") {
|
if ($("#mode-box select").val() === "tag-script") {
|
||||||
@@ -27,7 +31,7 @@
|
|||||||
$("#tag-script-field").val(new_tag_script);
|
$("#tag-script-field").val(new_tag_script);
|
||||||
Danbooru.Cookie.put("current_tag_script_id", new_tag_script_id);
|
Danbooru.Cookie.put("current_tag_script_id", new_tag_script_id);
|
||||||
if (old_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();
|
e.preventDefault();
|
||||||
@@ -121,6 +125,7 @@
|
|||||||
var script = Danbooru.Cookie.get("tag-script-" + current_script_id);
|
var script = Danbooru.Cookie.get("tag-script-" + current_script_id);
|
||||||
|
|
||||||
$("#tag-script-field").val(script).show();
|
$("#tag-script-field").val(script).show();
|
||||||
|
Danbooru.PostModeMenu.show_notice(1);
|
||||||
} else {
|
} else {
|
||||||
$("#tag-script-field").hide();
|
$("#tag-script-field").hide();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,6 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</select>
|
</select>
|
||||||
</form>
|
</form>
|
||||||
|
<input id="tag-script-field" placeholder="Enter tag script" style="display: none; margin-top: 0.5em;"></input>
|
||||||
</section>
|
</section>
|
||||||
<input id="tag-script-field" placeholder="Enter tag script" style="display: none;"></input>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Reference in New Issue
Block a user