js: clean up notice/error messaging.

This commit is contained in:
evazion
2019-08-14 01:46:44 -05:00
parent e000bdb861
commit 8d07ad7390
22 changed files with 50 additions and 64 deletions

View File

@@ -1,9 +1,9 @@
<% if @api_key.errors.any? %>
$(window).trigger("danbooru:error", "<%= j @api_key.errors.full_messages.join(', ') %>");
Danbooru.error("<%= j @api_key.errors.full_messages.join(', ') %>");
<% else %>
$("#api-key").text("<%= j @api_key.key %>");
$("#api-key-created").html("<%= j compact_time @api_key.created_at %>");
$("#api-key-updated").html("<%= j compact_time @api_key.updated_at %>");
$(window).trigger("danbooru:notice", "API key regenerated.");
Danbooru.notice("API key regenerated.");
<% end %>