forked from mirrors/thatmattlove-hyperglass
Convert error messages to bulma notification class
This commit is contained in:
parent
27195c4a64
commit
d8b0ca92cb
1 changed files with 28 additions and 33 deletions
|
|
@ -181,14 +181,9 @@ function submitForm() {
|
||||||
target_input.addClass('is-danger');
|
target_input.addClass('is-danger');
|
||||||
target_error.html(`
|
target_error.html(`
|
||||||
<br>
|
<br>
|
||||||
<article class="message is-danger is-small" style="display: block;">
|
<div class="notification is-danger">
|
||||||
<div class="message-header" style="display: block;">
|
|
||||||
Authentication Error
|
|
||||||
</div>
|
|
||||||
<div id="error" style="display: block;" class="message-body">
|
|
||||||
${response.responseText}
|
${response.responseText}
|
||||||
</div>
|
</div>
|
||||||
</article>
|
|
||||||
`);
|
`);
|
||||||
},
|
},
|
||||||
405: function(response, code) {
|
405: function(response, code) {
|
||||||
|
|
@ -197,14 +192,9 @@ function submitForm() {
|
||||||
target_input.addClass('is-warning');
|
target_input.addClass('is-warning');
|
||||||
target_error.html(`
|
target_error.html(`
|
||||||
<br>
|
<br>
|
||||||
<article class="message is-warning is-small" style="display: block;">
|
<div class="notification is-warning">
|
||||||
<div class="message-header" style="display: block;">
|
|
||||||
Input Not Allowed
|
|
||||||
</div>
|
|
||||||
<div id="error" style="display: block;" class="message-body">
|
|
||||||
${response.responseText}
|
${response.responseText}
|
||||||
</div>
|
</div>
|
||||||
</article>
|
|
||||||
`);
|
`);
|
||||||
},
|
},
|
||||||
415: function(response, code) {
|
415: function(response, code) {
|
||||||
|
|
@ -213,19 +203,24 @@ function submitForm() {
|
||||||
target_input.addClass('is-danger');
|
target_input.addClass('is-danger');
|
||||||
target_error.html(`
|
target_error.html(`
|
||||||
<br>
|
<br>
|
||||||
<article class="message is-danger is-small" style="display: block;">
|
<div class="notification is-danger">
|
||||||
<div class="message-header" style="display: block;">
|
|
||||||
Invalid Input
|
|
||||||
</div>
|
|
||||||
<div id="error" style="display: block;" class="message-body">
|
|
||||||
${response.responseText}
|
${response.responseText}
|
||||||
</div>
|
</div>
|
||||||
</article>
|
|
||||||
`);
|
`);
|
||||||
},
|
},
|
||||||
429: function(response, code) {
|
429: function(response, code) {
|
||||||
clearPage();
|
clearPage();
|
||||||
$("#ratelimit").addClass("is-active");
|
$("#ratelimit").addClass("is-active");
|
||||||
|
},
|
||||||
|
504: function(response, code) {
|
||||||
|
clearPage();
|
||||||
|
target_error.show()
|
||||||
|
target_error.html(`
|
||||||
|
<br>
|
||||||
|
<div class="notification is-danger">
|
||||||
|
${response.responseText}
|
||||||
|
</div>
|
||||||
|
`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue