Merge pull request #540 from nickel715/patch-446
Implement notifications for all messages
This commit is contained in:
commit
ab2dc3e806
@ -258,6 +258,13 @@
|
||||
<button id="play">Play sound</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12">
|
||||
<label class="opt">
|
||||
<input type="checkbox" name="notifyAllMessages">
|
||||
Enable notification for all messages
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<h2>About Shout</h2>
|
||||
</div>
|
||||
|
@ -373,6 +373,7 @@ $(function() {
|
||||
part: true,
|
||||
thumbnails: true,
|
||||
quit: true,
|
||||
notifyAllMessages: false,
|
||||
}, $.cookie("settings"));
|
||||
|
||||
for (var i in options) {
|
||||
@ -398,6 +399,7 @@ $(function() {
|
||||
"nick",
|
||||
"part",
|
||||
"quit",
|
||||
"notifyAllMessages",
|
||||
].indexOf(name) !== -1) {
|
||||
chat.toggleClass("hide-" + name, !self.prop("checked"));
|
||||
}
|
||||
@ -599,9 +601,10 @@ $(function() {
|
||||
var isQuery = button.hasClass("query");
|
||||
var type = msg.type;
|
||||
var highlight = type.contains("highlight");
|
||||
if (highlight || isQuery) {
|
||||
if (!document.hasFocus() || !$(target).hasClass("active")) {
|
||||
var message = type.contains("message");
|
||||
var settings = $.cookie("settings") || {};
|
||||
if (highlight || isQuery || (settings.notifyAllMessages && message)) {
|
||||
if (!document.hasFocus() || !$(target).hasClass("active")) {
|
||||
if (settings.notification) {
|
||||
pop.play();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user