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
|
|
@ -17,16 +17,16 @@ dropdown.addEventListener('click', function(event) {
|
||||||
var btn_copy = document.getElementById('btn-copy');
|
var btn_copy = document.getElementById('btn-copy');
|
||||||
var clipboard = new ClipboardJS(btn_copy);
|
var clipboard = new ClipboardJS(btn_copy);
|
||||||
clipboard.on('success', function(e) {
|
clipboard.on('success', function(e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
$('#btn-copy').addClass('is-success').addClass('is-outlined');
|
$('#btn-copy').addClass('is-success').addClass('is-outlined');
|
||||||
$('#copy-icon').removeClass('icofont-ui-copy').addClass('icofont-check');
|
$('#copy-icon').removeClass('icofont-ui-copy').addClass('icofont-check');
|
||||||
setTimeout(function(){
|
setTimeout(function() {
|
||||||
$('#btn-copy').removeClass('is-success').removeClass('is-outlined');
|
$('#btn-copy').removeClass('is-success').removeClass('is-outlined');
|
||||||
$('#copy-icon').removeClass('icofont-check').addClass('icofont-ui-copy');
|
$('#copy-icon').removeClass('icofont-check').addClass('icofont-ui-copy');
|
||||||
}, 1000)
|
}, 1000)
|
||||||
});
|
});
|
||||||
clipboard.on('error', function(e) {
|
clipboard.on('error', function(e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
function bgpHelpASPath() {
|
function bgpHelpASPath() {
|
||||||
|
|
@ -181,30 +181,20 @@ 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;">
|
${response.responseText}
|
||||||
Authentication Error
|
</div>
|
||||||
</div>
|
|
||||||
<div id="error" style="display: block;" class="message-body">
|
|
||||||
${response.responseText}
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
`);
|
`);
|
||||||
},
|
},
|
||||||
405: function(response, code) {
|
405: function(response, code) {
|
||||||
clearPage();
|
clearPage();
|
||||||
target_error.show()
|
target_error.show()
|
||||||
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;">
|
${response.responseText}
|
||||||
Input Not Allowed
|
</div>
|
||||||
</div>
|
|
||||||
<div id="error" style="display: block;" class="message-body">
|
|
||||||
${response.responseText}
|
|
||||||
</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;">
|
${response.responseText}
|
||||||
Invalid Input
|
</div>
|
||||||
</div>
|
|
||||||
<div id="error" style="display: block;" class="message-body">
|
|
||||||
${response.responseText}
|
|
||||||
</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