Browse Source

fixed sound notifications

master
Hedgehog 11 years ago
parent
commit
370a1be8de
  1. 2
      home.html
  2. 25
      js/options.js
  3. 4
      js/twister_timeline.js

2
home.html

@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
<script src="jquery-emotions/jquery.emotions.js"></script>
<script src="js/sjcl.js"></script>
<script>
$(function(){setInterval("networkUpdate()", 2000); homeIntInit();})
$(function(){setInterval("networkUpdate()", 2000); homeIntInit();});
</script>
<link rel="icon" type="image/png" href="img/twister_mini.png" />

25
js/options.js

@ -57,33 +57,28 @@ var TwisterOptions = function() @@ -57,33 +57,28 @@ var TwisterOptions = function()
this.DMsNotif = function() {
if($.Options.getOption('sndDM', 'false') === "false") return;
var opt = $.Options.getOption('sndDM', 'false');
var player = $('#player');
$('#player').empty();
if (player[0].canPlayType('audio/mpeg;')) {
player.attr('type', 'audio/mpeg');
player.attr('src', 'sound/'+localStorage['sndDM']+'.mp3');
} else {
player.attr('type', 'audio/ogg');
player.attr('src', 'sound/'+localStorage['sndDM']+'.ogg');
}
player.attr('type', 'audio/mpeg');
player.attr('src', 'sound/'+opt+'.mp3');
player[0].volume = $.Options.getOption('playerVol', 1);
player[0].play();
}
this.mensNotif = function() {
if($.Options.getOption('sndMention', 'false' === 'false')) return;
if($.Options.getOption('sndMention', 'false') === 'false') return;
var opt = $.Options.getOption('sndMention', 'false');
var player = $('#player');
$('#playerSec').empty();
if (player[0].canPlayType('audio/mpeg;')) {
player.attr('type', 'audio/mpeg');
player.attr('src', 'sound/'+localStorage['sndMention']+'.mp3');
} else {
player.attr('type', 'audio/ogg');
player.attr('src', 'sound/'+localStorage['sndMention']+'.ogg');
}
player.attr('type', 'audio/mpeg');
player.attr('src', 'sound/'+opt+'.mp3');
player[0].volume = $.Options.getOption('playerVol', 1);
player[0].play();
};

4
js/twister_timeline.js

@ -279,7 +279,7 @@ function processLastHave(userHaves) @@ -279,7 +279,7 @@ function processLastHave(userHaves)
// callback for getposts to update the number of new pending posts not shown in timeline
function processNewPostsConfirmation(expected, posts)
{
_newPostsPending += posts.length -1;
_newPostsPending += posts.length;
//we don't want to produce alert for the posts that won't be displayed
var p2h = 0;
@ -291,7 +291,7 @@ function processNewPostsConfirmation(expected, posts) @@ -291,7 +291,7 @@ function processNewPostsConfirmation(expected, posts)
}
_newPostsPending += posts.length - p2h;
if( _newPostsPending ) {
$.MAL.reportNewPosts(_newPostsPending);
$.MAL.reportNewPosts(_newPostsPending - 1);
}
if( posts.length < expected ) {
// new DMs have probably been produced by users we follow.

Loading…
Cancel
Save