adaptasi toastr dan delete showjs.blade.php
This commit is contained in:
@@ -1,4 +1,45 @@
|
||||
<script>
|
||||
<style>
|
||||
.notification_success {
|
||||
position: fixed;
|
||||
top: 20px;
|
||||
right: 20px;
|
||||
background-color: #51a351;
|
||||
color: white;
|
||||
padding: 15px;
|
||||
border-radius: 5px;
|
||||
z-index: 1000;
|
||||
transition: opacity 0.5s;
|
||||
box-shadow: 0 0 12px #000;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.notification_error {
|
||||
position: fixed;
|
||||
top: 20px;
|
||||
right: 20px;
|
||||
background-color: #AE342C;
|
||||
color: white;
|
||||
padding: 15px;
|
||||
border-radius: 5px;
|
||||
z-index: 1000;
|
||||
transition: opacity 0.5s;
|
||||
box-shadow: 0 0 12px #000;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<div id="notificationSuccess" class="notification_success" style="display: none;">
|
||||
<div style="display: flex; align-items: center;">
|
||||
<img style="margin-right: 10px;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==">
|
||||
<span id="notification-message-success"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="notificationError" class="notification_error" style="display: none;">
|
||||
<div style="display: flex; align-items: center;">
|
||||
<img style="margin-right: 10px;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=">
|
||||
<span id="notification-message-error"></span>
|
||||
</div>
|
||||
</div>
|
||||
<script tipe="module">
|
||||
function removeErrorCssMsg() {
|
||||
$(".inputku").removeClass("border-danger");
|
||||
$("em").text('');
|
||||
@@ -99,4 +140,56 @@ function numbersonly(ini, e){
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function toastrku(flag, message)
|
||||
{
|
||||
$.each(message, function (key, value) {
|
||||
var msg = '';
|
||||
var lengthnya = value.length;
|
||||
for (let i = 0; i < lengthnya; i++)
|
||||
{
|
||||
if(0!=i && (lengthnya-1)==i)
|
||||
msg+=", ";
|
||||
|
||||
msg+=value[i];
|
||||
|
||||
}
|
||||
if('success'==flag)
|
||||
toastrSuccessBuild(msg);
|
||||
else if('error' ==flag)
|
||||
toastrErrorBuild(msg);
|
||||
});
|
||||
}
|
||||
|
||||
function toastrSuccessBuild(message) {
|
||||
const notification = document.getElementById('notificationSuccess');
|
||||
const messageElement = document.getElementById('notification-message-success');
|
||||
|
||||
messageElement.textContent = message;
|
||||
notification.style.display = 'block';
|
||||
notification.style.opacity = '1';
|
||||
|
||||
setTimeout(() => {
|
||||
notification.style.opacity = '0';
|
||||
setTimeout(() => {
|
||||
notification.style.display = 'none';
|
||||
}, 500);
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
function toastrErrorBuild(message) {
|
||||
const notification = document.getElementById('notificationError');
|
||||
const messageElement = document.getElementById('notification-message-error');
|
||||
|
||||
messageElement.textContent = message;
|
||||
notification.style.display = 'block';
|
||||
notification.style.opacity = '1';
|
||||
|
||||
setTimeout(() => {
|
||||
notification.style.opacity = '0';
|
||||
setTimeout(() => {
|
||||
notification.style.display = 'none';
|
||||
}, 500);
|
||||
}, 3000);
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user