mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
Ajout du système de popup sur reception d'un SMS
This commit is contained in:
parent
0b2fe3c989
commit
90e761e152
9 changed files with 91 additions and 3 deletions
21
js/custom.js
21
js/custom.js
|
@ -17,5 +17,24 @@ function showMessage(message, type)
|
|||
}
|
||||
|
||||
var alerthtml = '<div class="col-xs-10 col-xs-offset-1 col-md-6 col-md-offset-3 popup-alert alert ' + type + '"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>' + message + '</div>';
|
||||
jQuery('body').prepend(alerthtml);
|
||||
jQuery('body .popup-alerts-container').prepend(alerthtml);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cette fonction vérifie si un message a été reçu
|
||||
*/
|
||||
function verifReceived()
|
||||
{
|
||||
jQuery('.popup-alert').fadeOut('slow');
|
||||
jQuery.getJSON(HTTP_PWD + "/receiveds/popup", function( data ) {
|
||||
$.each(data, function(key, val) {
|
||||
showMessage('SMS reçu du ' + val.send_by.replace(/</g, "<").replace(/>/g, ">") + ' : ' + val.content.replace(/</g, "<").replace(/>/g, ">"), 1);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
jQuery(document).ready(function()
|
||||
{
|
||||
var verifReceivedInterval = setInterval(verifReceived, 10000);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue