Skip to content

Commit c728499

Browse files
committed
Merge pull request #18 from qcode-software/sounds
Sounds
2 parents de3e5af + a7c6d89 commit c728499

File tree

2 files changed

+12
-20
lines changed

2 files changed

+12
-20
lines changed

js/qcode.alert.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,8 @@
1717
var qcode = qcode || {};
1818

1919
(function($, undefined) {
20-
var ding;
2120
var alertQueue = [];
2221
var timeoutID;
23-
$(function() {
24-
if ( qcode.Sound.supported ) {
25-
ding = new qcode.Sound('/Sounds/Windows%20Ding.wav');
26-
}
27-
});
2822

2923
function showNextMessage() {
3024
if ( alertQueue.length > 0 && timeoutID === undefined ) {
@@ -69,12 +63,13 @@ var qcode = qcode || {};
6963
showNextMessage();
7064
}
7165
});
72-
if ( qcode.Sound && qcode.Sound.supported ) {
73-
ding.play();
66+
if ( qcode.Sound && qcode.Sound.supported && qcode.alert.config.sound ) {
67+
qcode.alert.config.sound.play();
7468
}
7569
});
7670
showNextMessage();
7771
}
72+
qcode.alert.config = {};
7873

7974
qcode.confirm = function(message, onConfirm) {
8075
alertQueue.push(function() {
@@ -125,10 +120,11 @@ var qcode = qcode || {};
125120
showNextMessage();
126121
}
127122
});
128-
if ( qcode.Sound && qcode.Sound.supported ) {
129-
ding.play();
123+
if ( qcode.Sound && qcode.Sound.supported && qcode.confirm.config.sound ) {
124+
qcode.confirm.config.sound.play();
130125
}
131126
});
132127
showNextMessage();
133128
}
129+
qcode.confirm.config = {};
134130
})(jQuery);

qcode-ui-3.12.5.js renamed to qcode-ui-3.13.0.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8651,14 +8651,8 @@ function preloadImages() {
86518651
var qcode = qcode || {};
86528652

86538653
(function($, undefined) {
8654-
var ding;
86558654
var alertQueue = [];
86568655
var timeoutID;
8657-
$(function() {
8658-
if ( qcode.Sound.supported ) {
8659-
ding = new qcode.Sound('/Sounds/Windows%20Ding.wav');
8660-
}
8661-
});
86628656

86638657
function showNextMessage() {
86648658
if ( alertQueue.length > 0 && timeoutID === undefined ) {
@@ -8703,12 +8697,13 @@ var qcode = qcode || {};
87038697
showNextMessage();
87048698
}
87058699
});
8706-
if ( qcode.Sound && qcode.Sound.supported ) {
8707-
ding.play();
8700+
if ( qcode.Sound && qcode.Sound.supported && qcode.alert.config.sound ) {
8701+
qcode.alert.config.sound.play();
87088702
}
87098703
});
87108704
showNextMessage();
87118705
}
8706+
qcode.alert.config = {};
87128707

87138708
qcode.confirm = function(message, onConfirm) {
87148709
alertQueue.push(function() {
@@ -8759,12 +8754,13 @@ var qcode = qcode || {};
87598754
showNextMessage();
87608755
}
87618756
});
8762-
if ( qcode.Sound && qcode.Sound.supported ) {
8763-
ding.play();
8757+
if ( qcode.Sound && qcode.Sound.supported && qcode.confirm.config.sound ) {
8758+
qcode.confirm.config.sound.play();
87648759
}
87658760
});
87668761
showNextMessage();
87678762
}
8763+
qcode.confirm.config = {};
87688764
})(jQuery);
87698765

87708766
/* ==== qcode.sound.js ==== */

0 commit comments

Comments
 (0)