diff options
author | Frug <frugen@gmail.com> | 2014-07-01 15:49:26 -0400 |
---|---|---|
committer | Frug <frugen@gmail.com> | 2014-07-01 15:49:26 -0400 |
commit | 05c79baa6489b9225d118212675cad4d0807b4fe (patch) | |
tree | 6cfae97454e1e6f8083af7cb235b96bf83b9c868 | |
parent | 04677819f7377ba083d5fdd530f8c1f4cd413507 (diff) | |
download | AJAX-Chat-05c79baa6489b9225d118212675cad4d0807b4fe.zip AJAX-Chat-05c79baa6489b9225d118212675cad4d0807b4fe.tar.gz AJAX-Chat-05c79baa6489b9225d118212675cad4d0807b4fe.tar.bz2 |
use custom PM sound (sound-7) in config
-rw-r--r-- | chat/js/chat.js | 13 | ||||
-rw-r--r-- | chat/js/config.js | 67 | ||||
-rw-r--r-- | chat/sounds/sound_7.mp3 | bin | 0 -> 24241 bytes | |||
-rw-r--r-- | chat/sounds/sound_8.mp3 | bin | 0 -> 33436 bytes |
4 files changed, 34 insertions, 46 deletions
diff --git a/chat/js/chat.js b/chat/js/chat.js index 0c42c96..1c7c165 100644 --- a/chat/js/chat.js +++ b/chat/js/chat.js @@ -668,6 +668,7 @@ var ajaxChat = { playSoundOnNewMessage: function(dateObject, userID, userName, userRole, messageID, messageText, channelID, ip) { if(this.settings['audio'] && this.sounds && this.lastID && !this.channelSwitch) { + console.log(this.settings['soundPrivate']); switch(userID) { case this.chatBotID: var messageParts = messageText.split(' ', 1); @@ -900,7 +901,7 @@ var ajaxChat = { this.setSelectedChannel(infoData); this.channelName = infoData; this.channelSwitch = true; - break; + break; case 'channelName': this.setSelectedChannel(infoData); this.channelName = infoData; @@ -910,7 +911,7 @@ var ajaxChat = { break; case 'userID': this.userID = infoData; - break; + break; case 'userName': this.userName = infoData; this.encodedUserName = this.scriptLinkEncode(this.userName); @@ -918,7 +919,7 @@ var ajaxChat = { break; case 'userRole': this.userRole = infoData; - break; + break; case 'logout': this.handleLogout(infoData); return; @@ -960,9 +961,9 @@ var ajaxChat = { if(!this.inArray(onlineUsers, this.usersList[i])) { this.removeUserFromOnlineList(this.usersList[i], i); } - } - this.setOnlineListRowClasses(); - } + } + this.setOnlineListRowClasses(); + } }, handleChatMessages: function(messageNodes) { diff --git a/chat/js/config.js b/chat/js/config.js index 40d5c06..2f8c0d7 100644 --- a/chat/js/config.js +++ b/chat/js/config.js @@ -1,9 +1,5 @@ /* - * @package AJAX_Chat - * @author Sebastian Tschan - * @copyright (c) Sebastian Tschan - * @license Modified MIT License - * @link https://blueimp.net/ajax/ + * AJAX Chat client-side configuration */ // Ajax Chat config parameters: @@ -12,11 +8,11 @@ var ajaxChatConfig = { // The channelID of the channel to enter on login (the loginChannelName is used if set to null): loginChannelID: null, // The channelName of the channel to enter on login (the default channel is used if set to null): - loginChannelName: null, - + loginChannelName: null, + // The time in ms between update calls to retrieve new chat messages: timerRate: 2000, - + // The URL to retrieve the XML chat messages (must at least contain one parameter): ajaxURL: './?ajax=true', // The base URL of the chat directory, used to retrieve media files (images, sound files, etc.): @@ -24,10 +20,10 @@ var ajaxChatConfig = { // A regular expression for allowed source URL's for media content (e.g. images displayed inline); regExpMediaUrl: '^((http)|(https)):\\/\\/', - + // If set to false the chat update is delayed until the event defined in ajaxChat.setStartChatHandler(): startChatOnLoad: true, - + // Defines the IDs of DOM nodes accessed by the chat: domIDs: { // The ID of the chat messages list: @@ -64,27 +60,27 @@ var ajaxChatConfig = { lineBreaks: true, // Defines if emoticon codes are replaced with their associated images: emoticons: true, - + // Defines if the focus is automatically set to the input field on chat load or channel switch: autoFocus: true, // Defines if the chat list scrolls automatically to display the latest messages: - autoScroll: true, + autoScroll: true, // The maximum count of messages displayed in the chat list (will be ignored if set to 0): maxMessages: 0, - + // Defines if long words are wrapped to avoid vertical scrolling: wordWrap: true, - // Defines the maximum length before a word gets wrapped: + // Defines the maximum length before a word gets wrapped: maxWordLength: 32, - + // Defines the format of the date and time displayed for each chat message: dateFormat: '(%H:%i:%s)', - + // Defines if font colors persist without the need to assign them to each message: - persistFontColor: false, + persistFontColor: false, // The default font color, uses the page default font color if set to null: fontColor: null, - + // Defines if sounds are played: audio: true, // Defines the sound volume (0.0 = mute, 1.0 = max): @@ -103,8 +99,8 @@ var ajaxChatConfig = { // Defines the sound that is played on error messages: soundError: 'sound_6', // Defines the sound that is played when private messages are received: - soundPrivate: 'sound_7', - + soundPrivate: 'sound_7', + // Defines if the document title blinks on new messages: blink: true, // Defines the blink interval in ms: @@ -112,7 +108,7 @@ var ajaxChatConfig = { // Defines the number of blink intervals: blinkIntervalNumber: 10 }, - + // Defines a list of settings which are not to be stored in a session cookie: nonPersistentSettings: [], @@ -127,12 +123,12 @@ var ajaxChatConfig = { 'url', 'img' ], - + // Defines the list of allowed color codes: colorCodes: [ 'gray', 'silver', - 'white', + 'white', 'yellow', 'orange', 'red', @@ -148,7 +144,7 @@ var ajaxChatConfig = { 'maroon', 'black' ], - + // Defines the list of allowed emoticon codes: emoticonCodes: [ ':)', @@ -173,9 +169,9 @@ var ajaxChatConfig = { ':help:', ':error:', ':warning:', - ':favorite:' + ':favorite:' ], - + // Defines the list of emoticon files associated with the emoticon codes: emoticonFiles: [ 'smile.png', @@ -211,16 +207,15 @@ var ajaxChatConfig = { sound_4: 'sound_4.mp3', sound_5: 'sound_5.mp3', sound_6: 'sound_6.mp3', - sound_7: 'sound_1.mp3' + sound_7: 'sound_7.mp3' }, - - + + // Once users have been logged in, the following values are overridden by those in config.php. // You should set these to be the same as the ones in config.php to avoid confusion. - + // Session identification, used for style and setting cookies: sessionName: 'ajax_chat', - // The time in days until the style and setting cookies expire: cookieExpiration: 365, // The path of the cookies, '/' allows to read the cookies from all directories: @@ -229,29 +224,22 @@ var ajaxChatConfig = { cookieDomain: null, // If enabled, cookies must be sent over secure (SSL/TLS encrypted) connections: cookieSecure: null, - // The name of the chat bot: chatBotName: 'ChatBot', // The userID of the chat bot: chatBotID: 2147483647, - // Allow/Disallow registered users to delete their own messages: allowUserMessageDelete: true, - // Minutes until a user is declared inactive (last status update) - the minimum is 2 minutes: inactiveTimeout: 2, - // UserID plus this value are private channels (this is also the max userID and max channelID): privateChannelDiff: 500000000, // UserID plus this value are used for private messages: privateMessageDiff: 1000000000, - // Defines if login/logout and channel enter/leave are displayed: showChannelMessages: true, - // Max messageText length: messageTextMaxLength: 1040, - // Defines if the socket server is enabled: socketServerEnabled: false, // Defines the hostname of the socket server used to connect from client side: @@ -260,5 +248,4 @@ var ajaxChatConfig = { socketServerPort: 1935, // This ID can be used to distinguish between different chat installations using the same socket server: socketServerChatID: 0 - -} +};
\ No newline at end of file diff --git a/chat/sounds/sound_7.mp3 b/chat/sounds/sound_7.mp3 Binary files differnew file mode 100644 index 0000000..7ee9273 --- /dev/null +++ b/chat/sounds/sound_7.mp3 diff --git a/chat/sounds/sound_8.mp3 b/chat/sounds/sound_8.mp3 Binary files differnew file mode 100644 index 0000000..010e8a6 --- /dev/null +++ b/chat/sounds/sound_8.mp3 |