Skip to content

Commit cfd0e95

Browse files
committed
Ajout de la lecture d'un son sur reception d'un message
1 parent 08af442 commit cfd0e95

File tree

7 files changed

+20
-0
lines changed

7 files changed

+20
-0
lines changed

Diff for: css/style.css

+5
Original file line numberDiff line numberDiff line change
@@ -240,3 +240,8 @@ footer
240240
cursor: pointer;
241241
}
242242

243+
/* AUDIO RECEPTION MESSAGE */
244+
#reception-sound
245+
{
246+
display: none;
247+
}

Diff for: js/custom.js

+9
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ function verifReceived()
2929
jQuery.getJSON(HTTP_PWD + "/receiveds/popup", function( data ) {
3030
$.each(data, function(key, val) {
3131
showMessage('SMS reçu du ' + val.send_by.replace(/</g, "&lt;").replace(/>/g, "&gt;") + ' : ' + val.content.replace(/</g, "&lt;").replace(/>/g, "&gt;"), 1);
32+
playReceptionSound();
3233
});
3334
});
3435
}
@@ -50,6 +51,14 @@ function scrollDownDiscussion()
5051
}
5152
}
5253

54+
/**
55+
* Cette fonction jou le son de reception d'un SMS
56+
*/
57+
function playReceptionSound ()
58+
{
59+
jQuery('body').find('#reception-sound').play();
60+
}
61+
5362
jQuery(document).ready(function()
5463
{
5564
var verifReceivedInterval = setInterval(verifReceived, 10000);

Diff for: sounds/receptionSound.mp3

11.4 KB
Binary file not shown.

Diff for: sounds/receptionSound.ogg

12.5 KB
Binary file not shown.

Diff for: sounds/receptionSound.wav

11.8 KB
Binary file not shown.

Diff for: templates/discussions/show.php

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ function getmessages ()
8080
'<div class="discussion-message-date">' + message.date + '</div>' +
8181
'</div>' +
8282
'</div>';
83+
playReceptionSound();
8384
break;
8485
case 'sended' :
8586
var texte = '' +

Diff for: templates/internalIncs/footer.php

+5
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,10 @@
22
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/>
33
Copyright 2014. RaspiSMS est un programme sous <a href="https://www.gnu.org/licenses/gpl.txt" rel="nofollow">licence GNU GPL</a>.<br/>
44
</footer>
5+
<audio id="reception-sound">
6+
<source src="<?php echo HTTP_PWD; ?>sounds/receptionSound.ogg" type="audio/ogg">
7+
<source src="<?php echo HTTP_PWD; ?>sounds/receptionSound.mp3" type="audio/mpeg">
8+
<source src="<?php echo HTTP_PWD; ?>sounds/receptionSound.wav" type="audio/wav">
9+
</audio>
510
</body>
611
</html>

0 commit comments

Comments
 (0)