Skip to content

Commit

Permalink
sweet alert in default/components/layout/_js implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Brunin12 committed Dec 3, 2023
1 parent 59d1f12 commit 4aae455
Show file tree
Hide file tree
Showing 17 changed files with 39 additions and 35 deletions.
58 changes: 39 additions & 19 deletions app/Views/default/components/layout/_js.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,35 @@
<script src="<?= base_url('assets/plugins/jquery-ui/jquery-ui.min.js') ?>"></script>
<!-- Bootstrap 4 -->
<script src="<?= base_url('assets/plugins/bootstrap/js/bootstrap.bundle.min.js') ?>"></script>
<!-- ChartJS -->
<script src="<?= base_url('assets/plugins/chart.js/Chart.min.js') ?>"></script>
<!-- Sparkline -->
<script src="<?= base_url('assets/plugins/sparklines/sparkline.js') ?>"></script>
<!-- JQVMap -->
<script src="<?= base_url('assets/plugins/jqvmap/jquery.vmap.min.js') ?>"></script>
<script src="<?= base_url('assets/plugins/jqvmap/maps/jquery.vmap.usa.js') ?>"></script>
<!-- jQuery Knob Chart -->
<script src="<?= base_url('assets/plugins/jquery-knob/jquery.knob.min.js') ?>"></script>
<!-- daterangepicker -->
<script src="<?= base_url('assets/plugins/moment/moment.min.js') ?>"></script>
<script src="<?= base_url('assets/plugins/daterangepicker/daterangepicker.js') ?>"></script>
<!-- Tempusdominus Bootstrap 4 -->
<script src="<?= base_url('assets/plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js') ?>"></script>
<!-- Summernote -->
<script src="<?= base_url('assets/plugins/summernote/summernote-bs4.min.js') ?>"></script>

<!-- overlayScrollbars -->
<script src="<?= base_url('assets/plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?= base_url('assets/dist/js/adminlte.js') ?>"></script>


<script>
$(() => {
$('.navbar').hide().show(750)

if (localStorage.getItem('dark-mode') === 'enabled') {
$('body').addClass('dark-mode');
$('#toogleMode i').removeClass('fa-moon').addClass('fa-sun');
}


$('#toogleMode').on('click', function() {
if ($('body').hasClass('dark-mode')) {
$('body').removeClass('dark-mode');
$('#toogleMode i').removeClass('fa-sun').addClass('fa-moon');
localStorage.setItem('dark-mode', 'disabled');
} else {
$('body').addClass('dark-mode');
$('#toogleMode i').removeClass('fa-moon').addClass('fa-sun');
localStorage.setItem('dark-mode', 'enabled');
}
});

if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('/sw.js')
Expand All @@ -55,4 +45,34 @@
});
}
})
</script>
</script>

<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<!-- Link para o CSS do SweetAlert2 via CDN -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css">


<?php if (session()->has('success')) : ?>
<script>
$(() => {
Swal.fire({
title: 'Sucesso!',
text: '<?= session('success') ?>',
icon: 'success',
showConfirmButton: false,
timer: 1500
});
});
</script>
<?php elseif (session()->has('error')) : ?>
<script>
$(() => {
Swal.fire({
title: 'Erro!',
text: '<?= session('error') ?>',
icon: 'error',
showConfirmButton: true
});
});
</script>
<?php endif; ?>
1 change: 0 additions & 1 deletion writable/debugbar/debugbar_1700595140.465382.json

This file was deleted.

1 change: 0 additions & 1 deletion writable/debugbar/debugbar_1700602304.784780.json

This file was deleted.

1 change: 0 additions & 1 deletion writable/debugbar/debugbar_1700602315.825691.json

This file was deleted.

1 change: 0 additions & 1 deletion writable/debugbar/debugbar_1700602318.654430.json

This file was deleted.

1 change: 0 additions & 1 deletion writable/debugbar/debugbar_1700602367.956709.json

This file was deleted.

1 change: 0 additions & 1 deletion writable/debugbar/debugbar_1700602375.402229.json

This file was deleted.

1 change: 0 additions & 1 deletion writable/debugbar/debugbar_1700602377.637748.json

This file was deleted.

1 change: 0 additions & 1 deletion writable/debugbar/debugbar_1700602380.447369.json

This file was deleted.

1 change: 0 additions & 1 deletion writable/debugbar/debugbar_1700602382.940494.json

This file was deleted.

1 change: 0 additions & 1 deletion writable/debugbar/debugbar_1700602388.760202.json

This file was deleted.

1 change: 0 additions & 1 deletion writable/debugbar/debugbar_1700602391.021330.json

This file was deleted.

1 change: 0 additions & 1 deletion writable/debugbar/debugbar_1700602392.515472.json

This file was deleted.

1 change: 0 additions & 1 deletion writable/debugbar/debugbar_1700602393.785650.json

This file was deleted.

1 change: 0 additions & 1 deletion writable/debugbar/debugbar_1700602396.035626.json

This file was deleted.

1 change: 0 additions & 1 deletion writable/debugbar/debugbar_1700602501.622794.json

This file was deleted.

1 change: 0 additions & 1 deletion writable/debugbar/debugbar_1700602503.601001.json

This file was deleted.

0 comments on commit 4aae455

Please sign in to comment.