mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-22 17:28:41 +00:00
chore: bump bootstrap-dialog
This commit is contained in:
parent
5c3c654281
commit
682f89f838
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
requireLib('bootstrap5');
|
requireLib('bootstrap5');
|
||||||
requireLib('md5');
|
requireLib('md5');
|
||||||
|
requireLib('dialog');
|
||||||
|
|
||||||
use Gregwar\Captcha\PhraseBuilder;
|
use Gregwar\Captcha\PhraseBuilder;
|
||||||
|
|
||||||
@ -86,23 +87,6 @@ if (isset($_POST['register'])) {
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div id="dialog" class="modal fade" tabindex="-1">
|
|
||||||
<div class="modal-dialog">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title" id="modal-title"></h5>
|
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<p id="modal-text"></p>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" aria-label="Close">好的</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function refreshCaptcha() {
|
function refreshCaptcha() {
|
||||||
var timestamp = new Date().getTime();
|
var timestamp = new Date().getTime();
|
||||||
@ -161,23 +145,36 @@ if (isset($_POST['register'])) {
|
|||||||
captcha: $('#input-captcha').val(),
|
captcha: $('#input-captcha').val(),
|
||||||
}, function(msg) {
|
}, function(msg) {
|
||||||
if (/^欢迎你!/.test(msg)) {
|
if (/^欢迎你!/.test(msg)) {
|
||||||
var prevUrl = document.referrer;
|
BootstrapDialog.show({
|
||||||
if (!prevUrl) {
|
title: '注册成功',
|
||||||
prevUrl = '/';
|
message: msg,
|
||||||
};
|
type: BootstrapDialog.TYPE_SUCCESS,
|
||||||
$('#modal-title').html('注册成功');
|
buttons: [{
|
||||||
$('#modal-text').html(msg);
|
label: '好的',
|
||||||
$('#dialog')
|
action: function(dialog) {
|
||||||
.modal('show')
|
dialog.close();
|
||||||
.on('hidden.bs.modal', function() {
|
}
|
||||||
|
}],
|
||||||
|
onhidden: function(dialog) {
|
||||||
|
var prevUrl = document.referrer;
|
||||||
|
if (!prevUrl) {
|
||||||
|
prevUrl = '/';
|
||||||
|
};
|
||||||
window.location.href = prevUrl;
|
window.location.href = prevUrl;
|
||||||
});
|
}
|
||||||
refreshCaptcha();
|
});
|
||||||
} else {
|
} else {
|
||||||
$('#modal-title').html('注册失败');
|
BootstrapDialog.show({
|
||||||
$('#modal-text').html(msg);
|
title: '注册失败',
|
||||||
$('#dialog').modal('show');
|
message: msg,
|
||||||
refreshCaptcha();
|
type: BootstrapDialog.TYPE_DANGER,
|
||||||
|
buttons: [{
|
||||||
|
label: '好的',
|
||||||
|
action: function(dialog) {
|
||||||
|
dialog.close();
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
3
web/css/bootstrap-dialog.min.css
vendored
3
web/css/bootstrap-dialog.min.css
vendored
@ -1 +1,2 @@
|
|||||||
@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}to{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)}to{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(359deg)}}.bootstrap-dialog .modal-header{border-top-left-radius:4px;border-top-right-radius:4px}.bootstrap-dialog .bootstrap-dialog-title{color:#fff;display:inline-block;font-size:16px}.bootstrap-dialog .bootstrap-dialog-message{font-size:14px}.bootstrap-dialog .bootstrap-dialog-button-icon{margin-right:3px}.bootstrap-dialog .bootstrap-dialog-close-button{font-size:20px;float:right;opacity:.9;filter:alpha(opacity=90)}.bootstrap-dialog .bootstrap-dialog-close-button:hover{cursor:pointer;opacity:1;filter:alpha(opacity=100)}@media (min-width:1172px){.bootstrap-dialog .modal-xl{max-width:95%}}.bootstrap-dialog .modal-lg .bootstrap4-dialog-button:first-child{margin-top:8px}.bootstrap-dialog.type-default .modal-header{background-color:#fff}.bootstrap-dialog.type-default .bootstrap-dialog-title{color:#333}.bootstrap-dialog.type-info .modal-header{background-color:#17a2b8}.bootstrap-dialog.type-primary .modal-header{background-color:#007bff}.bootstrap-dialog.type-secondary .modal-header{background-color:#6c757d}.bootstrap-dialog.type-success .modal-header{background-color:#28a745}.bootstrap-dialog.type-warning .modal-header{background-color:#ffc107}.bootstrap-dialog.type-danger .modal-header{background-color:#dc3545}.bootstrap-dialog.type-light .modal-header{background-color:#f8f9fa}.bootstrap-dialog.type-dark .modal-header{background-color:#343a40}.bootstrap-dialog.size-large .bootstrap-dialog-title{font-size:24px}.bootstrap-dialog.size-large .bootstrap-dialog-close-button{font-size:30px}.bootstrap-dialog.size-large .bootstrap-dialog-message{font-size:18px}.bootstrap-dialog .icon-spin{display:inline-block;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear}.bootstrap-dialog-header{display:contents}
|
/*! Bootstrap5 Dialog | https://github.com/GedMarc/bootstrap4-dialog */
|
||||||
|
@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}to{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)}to{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(359deg)}}.bootstrap-dialog .modal-header{border-top-left-radius:4px;border-top-right-radius:4px}.bootstrap-dialog .bootstrap-dialog-title{color:#fff;display:inline-block;font-size:16px}.bootstrap-dialog .bootstrap-dialog-message{font-size:14px}.bootstrap-dialog .bootstrap-dialog-button-icon{margin-right:3px}.bootstrap-dialog .bootstrap-dialog-close-button{float:right;opacity:.9;filter:alpha(opacity=90)}.bootstrap-dialog .bootstrap-dialog-close-button:hover{cursor:pointer;opacity:1;filter:alpha(opacity=100)}@media (min-width:1172px){.bootstrap-dialog .modal-xl{max-width:95%}}.bootstrap-dialog .modal-lg .bootstrap4-dialog-button:first-child{margin-top:8px}.bootstrap-dialog.type-default .modal-header{background-color:#fff}.bootstrap-dialog.type-default .bootstrap-dialog-title{color:#333}.bootstrap-dialog.type-info .modal-header{background-color:#17a2b8}.bootstrap-dialog.type-primary .modal-header{background-color:#007bff}.bootstrap-dialog.type-secondary .modal-header{background-color:#6c757d}.bootstrap-dialog.type-success .modal-header{background-color:#28a745}.bootstrap-dialog.type-warning .modal-header{background-color:#ffc107}.bootstrap-dialog.type-danger .modal-header{background-color:#dc3545}.bootstrap-dialog.type-light .modal-header{background-color:#f8f9fa}.bootstrap-dialog.type-dark .modal-header{background-color:#343a40}.bootstrap-dialog.size-large .bootstrap-dialog-title{font-size:24px}.bootstrap-dialog.size-large .bootstrap-dialog-close-button{font-size:30px}.bootstrap-dialog.size-large .bootstrap-dialog-message{font-size:18px}.bootstrap-dialog .icon-spin{display:inline-block;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear}.bootstrap-dialog-footer-buttons{display:flex}.bootstrap-dialog-header{display:contents}
|
||||||
|
3
web/js/bootstrap-dialog.min.js
vendored
3
web/js/bootstrap-dialog.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user