diff --git a/css/style.css b/css/style.css index 6d481e0..3eef7ab 100755 --- a/css/style.css +++ b/css/style.css @@ -240,3 +240,8 @@ footer cursor: pointer; } +/* AUDIO RECEPTION MESSAGE */ +#reception-sound +{ + display: none; +} diff --git a/js/custom.js b/js/custom.js index 802ee30..692fa10 100755 --- a/js/custom.js +++ b/js/custom.js @@ -29,6 +29,7 @@ function verifReceived() 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); + playReceptionSound(); }); }); } @@ -50,6 +51,14 @@ function scrollDownDiscussion() } } +/** + * Cette fonction jou le son de reception d'un SMS + */ +function playReceptionSound () +{ + jQuery('body').find('#reception-sound').play(); +} + jQuery(document).ready(function() { var verifReceivedInterval = setInterval(verifReceived, 10000); diff --git a/sounds/receptionSound.mp3 b/sounds/receptionSound.mp3 new file mode 100644 index 0000000..b437050 Binary files /dev/null and b/sounds/receptionSound.mp3 differ diff --git a/sounds/receptionSound.ogg b/sounds/receptionSound.ogg new file mode 100644 index 0000000..b09833c Binary files /dev/null and b/sounds/receptionSound.ogg differ diff --git a/sounds/receptionSound.wav b/sounds/receptionSound.wav new file mode 100644 index 0000000..7bc81da Binary files /dev/null and b/sounds/receptionSound.wav differ diff --git a/templates/discussions/show.php b/templates/discussions/show.php index f4f0b3f..0e27bca 100755 --- a/templates/discussions/show.php +++ b/templates/discussions/show.php @@ -80,6 +80,7 @@ '<div class="discussion-message-date">' + message.date + '</div>' + '</div>' + '</div>'; + playReceptionSound(); break; case 'sended' : var texte = '' + diff --git a/templates/internalIncs/footer.php b/templates/internalIncs/footer.php index a078685..09a8ae7 100755 --- a/templates/internalIncs/footer.php +++ b/templates/internalIncs/footer.php @@ -2,5 +2,10 @@ RaspiSMS a été créé pour vous par le site <a href="http://raspbian-france.fr">Raspbian-France</a>, site dédié à la Raspberry Pi<br/> Copyright 2014. RaspiSMS est un programme sous <a href="https://www.gnu.org/licenses/gpl.txt" rel="nofollow">licence GNU GPL</a>.<br/> </footer> + <audio id="reception-sound"> + <source src="<?php echo HTTP_PWD; ?>sounds/receptionSound.ogg" type="audio/ogg"> + <source src="<?php echo HTTP_PWD; ?>sounds/receptionSound.mp3" type="audio/mpeg"> + <source src="<?php echo HTTP_PWD; ?>sounds/receptionSound.wav" type="audio/wav"> + </audio> </body> </html>