add global handlers for Danbooru.notice and Danbooru.error

This commit is contained in:
Albert Yi
2018-08-02 16:18:29 -07:00
parent 7099065c3f
commit 75faa5cc31

View File

@@ -71,6 +71,19 @@
}
</script>
<script defer src="https://use.fontawesome.com/releases/v5.0.10/js/all.js" integrity="sha384-slN8GvtUJGnv6ca26v8EzVaR9DC58QEwsIk9q1QXdCU8Yu8ck/tL/5szYlBbqmS+" crossorigin="anonymous"></script>
<script>
window.Danbooru = {
notice: function(msg) {
console.warn("Danbooru.notice will be deprecated. Use $(window).trigger('danbooru:notice', msg) instead.")
$(window).trigger("danbooru:notice", msg);
},
error: function(msg) {
console.warn("Danbooru.error will be deprecated. Use $(window).trigger('danbooru:error', msg) instead.")
$(window).trigger("danbooru:error", msg);
}
}
</script>
</head>
<body lang="en" <%= body_attributes(CurrentUser.user) %>>
<header id="top">