added notification in kelulusan
This commit is contained in:
@@ -126,6 +126,18 @@
|
|||||||
var audio = new Audio("{{ asset('sound/3.wav') }}");
|
var audio = new Audio("{{ asset('sound/3.wav') }}");
|
||||||
audio.muted = true;
|
audio.muted = true;
|
||||||
|
|
||||||
|
const Toast = Swal.mixin({
|
||||||
|
toast: true,
|
||||||
|
position: 'top-end',
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 5000,
|
||||||
|
timerProgressBar: true,
|
||||||
|
didOpen: (toast) => {
|
||||||
|
toast.addEventListener('mouseenter', Swal.stopTimer)
|
||||||
|
toast.addEventListener('mouseleave', Swal.resumeTimer)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Enable pusher logging - don't include this in production
|
// Enable pusher logging - don't include this in production
|
||||||
Pusher.logToConsole = false;
|
Pusher.logToConsole = false;
|
||||||
|
|
||||||
@@ -134,6 +146,35 @@
|
|||||||
encrypted: true
|
encrypted: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var kelulusanhapus = pusher.subscribe('notice-kelulusan');
|
||||||
|
kelulusanhapus.bind('my-kelulusan', function(data) {
|
||||||
|
if(data.tagoperasi == 1){
|
||||||
|
let message = JSON.stringify(data);
|
||||||
|
|
||||||
|
$('#bell').css("color", "red");
|
||||||
|
$('#linkz').text(data.namateller + " Pohon Kelulusan Dihapuskan");
|
||||||
|
$("#linkz").attr("href", "{{ url('kelulusan') }}");
|
||||||
|
if(window.location.pathname === '/operasi/kelulusan')
|
||||||
|
location.reload();
|
||||||
|
else{
|
||||||
|
audio.play();
|
||||||
|
audio.muted = false;
|
||||||
|
var countlagu = 1;
|
||||||
|
audio.onended = function() {
|
||||||
|
if(countlagu <= 3){
|
||||||
|
countlagu++;
|
||||||
|
this.play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Toast.fire({
|
||||||
|
icon: 'info',
|
||||||
|
title: 'Kelulusan Dipohon Sekarang!'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
var channel = pusher.subscribe('operasi-notify');
|
var channel = pusher.subscribe('operasi-notify');
|
||||||
channel.bind('operasi-event', function(data) {
|
channel.bind('operasi-event', function(data) {
|
||||||
let message = JSON.stringify(data);
|
let message = JSON.stringify(data);
|
||||||
@@ -156,17 +197,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const Toast = Swal.mixin({
|
|
||||||
toast: true,
|
|
||||||
position: 'top-end',
|
|
||||||
showConfirmButton: false,
|
|
||||||
timer: 5000,
|
|
||||||
timerProgressBar: true,
|
|
||||||
didOpen: (toast) => {
|
|
||||||
toast.addEventListener('mouseenter', Swal.stopTimer)
|
|
||||||
toast.addEventListener('mouseleave', Swal.resumeTimer)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
Toast.fire({
|
Toast.fire({
|
||||||
icon: 'error',
|
icon: 'error',
|
||||||
|
|||||||
Reference in New Issue
Block a user