2018-05-08 00:15:40 +02:00
|
|
|
<!-- Alert -->
|
|
|
|
<script>
|
|
|
|
function showAlert(text) {
|
2018-06-24 13:37:45 +02:00
|
|
|
console.log("[INFO] Function showAlert() called.");
|
2018-05-08 00:15:40 +02:00
|
|
|
$("#alert").html(text);
|
2018-06-24 13:37:45 +02:00
|
|
|
$("#alert").slideDown().delay(<?php echo $GLOBALS['ALERT_DISSAPEAR_IN']*1000 ?>).slideUp();
|
2018-05-08 00:15:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
<?php if (Alert::defined()): ?>
|
|
|
|
setTimeout(function(){ showAlert("<?php echo Alert::get() ?>") }, 500);
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
$(window).click(function() {
|
|
|
|
$("#alert").hide();
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2018-06-24 13:37:45 +02:00
|
|
|
<div id="alert" class="alert <?php echo (Alert::status()==ALERT_STATUS_FAIL)?'alert-danger':'alert-success' ?>"></div>
|