diff --git a/src/mibew/js/source/widget.js b/src/mibew/js/source/widget.js index a1de965f..2755a6f8 100644 --- a/src/mibew/js/source/widget.js +++ b/src/mibew/js/source/widget.js @@ -90,6 +90,12 @@ var Mibew = Mibew || {}; */ this.inviteStyle = options.inviteStyle; + /** + * Flag to disable sound notification on invitations + * @type Boolean + */ + this.silentInvitation = options.silentInvitation; + /** * Locale of the Widget * @type String @@ -134,7 +140,7 @@ var Mibew = Mibew || {}; delete this.dataToSend.user_id; } } - + this.dataToSend.silent = this.silentInvitation ? 1 : 0; Mibew.Utils.loadScript( this.requestURL + '?' + this.getQuery(), @@ -341,10 +347,12 @@ var Mibew = Mibew || {}; * - 'threadUrl': String, URL of the invitation thread which must be * dispaly in invitation iframe. * - 'acceptCaption': String, caption for accept button. + * - 'soundFile': String, pseudo URL (without extension) of the sound file to + * play on invitation event (in case when it's possible) */ Mibew.Invitation.create = function (options) { - // Cookies are blocked, invitation will behave badly + // Cookies are blocked, invitation will behave badly, won't even try if (Mibew.Objects.widget.cookiesBlocked) { return; } @@ -353,6 +361,7 @@ var Mibew = Mibew || {}; var avatarUrl = options.avatarUrl; var threadUrl = options.threadUrl; var acceptCaption = options.acceptCaption; + var soundFile = options.soundFile; var popuptext = '
+