diff --git a/web/v2/js/paste.js b/web/v2/js/paste.js index 07d4394..95dd08e 100644 --- a/web/v2/js/paste.js +++ b/web/v2/js/paste.js @@ -52,15 +52,18 @@ function validate_url(path) { return url.protocol === 'http:' || url.protocol === 'https:'; } -function show_pop_alert(message, alert_type = 'alert-primary') { +function show_pop_alert(message, alert_type = 'alert-primary', add_classes = null) { remove_pop_alert(); $('.navbar').after(jQuery.parseHTML( - ``, )); + if (add_classes) { + $('.alert').addClass(add_classes); + } window.scrollTo(0, 0); } @@ -211,7 +214,8 @@ $(function () { } if (!tos_btn.prop('checked')) { - show_pop_alert('Please read the TOS before upload', 'alert-warning'); + show_pop_alert('Please read the team and conditions before upload', 'alert-warning', 'tos-alert'); + tos_btn.addClass('is-invalid'); return false; } @@ -260,6 +264,11 @@ $(function () { upload_button.text('Upload'); }); + tos_btn.on('click', function () { + tos_btn.removeClass('is-invalid'); + $('.tos-alert').remove(); + }); + show_saved_btn.on('click', function () { if (!!!saved_modal) { show_pop_alert('No saved paste found.', 'alert-warning'); diff --git a/web/v2/paste.html b/web/v2/paste.html index 6cce5b0..6d15dd7 100644 --- a/web/v2/paste.html +++ b/web/v2/paste.html @@ -146,8 +146,8 @@
@@ -156,7 +156,6 @@ -