Version 4.1.19
This commit is contained in:
1 parent
28bd025b35
commit
2bd5025018
2674 files changed
+233518
-77766
No files matched your search
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<javascript app="chat">
|
||||
<file javascript_app="chat" javascript_location="front" javascript_path="controllers/chat" javascript_name="ips.chat.main.js" javascript_type="controller" javascript_version="101012" javascript_position="1000050"><![CDATA[/**
|
||||
* IPS Social Suite 4
|
||||
<file javascript_app="chat" javascript_location="front" javascript_path="controllers/chat" javascript_name="ips.chat.main.js" javascript_type="controller" javascript_version="101093" javascript_position="1000050"><![CDATA[/**
|
||||
* IPS Community Suite 4
|
||||
* (c) 2013 Invision Power Services - http://www.invisionpower.com
|
||||
*
|
||||
* ips.chat.main.js - Main chat controller
|
||||
@@ -33,7 +33,7 @@
|
||||
_iframe: null,
|
||||
_iframeWindow: null,
|
||||
_secure: true,
|
||||
_urlRegex: /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;\(\)]*[-A-Z0-9+&@#\/%=~_|])/ig,
|
||||
_urlRegex: /\b(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:localhost)|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[/?#]\S*)?\b/ig,
|
||||
_imgRegex: /^(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;\(\)]*[-A-Z0-9+&@#\/%=~_|])(\.jpg|\.png|\.gif)$/ig,
|
||||
|
||||
initialize: function () {
|
||||
@@ -48,7 +48,7 @@
|
||||
this.on( window, 'focus', this.windowFocus );
|
||||
this.on( window, 'blur', this.windowBlur );
|
||||
this.on( document, 'insertEmoticon', this.insertEmoticon );
|
||||
this.setup();
|
||||
this.setup();
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -921,6 +921,7 @@
|
||||
}
|
||||
|
||||
var sound = new buzz.sound( ips.getSetting('baseURL') + 'applications/chat/interface/sounds/' + ips.getSetting('sounds')[ soundName ], {
|
||||
webAudioApi: true,
|
||||
formats: [ "mp3" ]
|
||||
});
|
||||
|
||||
@@ -1013,7 +1014,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
if( !state.previousLastMsgID && this._noBuffer ){
|
||||
if( !state.previousLastMsgID && ips.getSetting('noBuffer') ){
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1059,6 +1060,8 @@
|
||||
|
||||
thisRoomID = 'private_' + user;
|
||||
}
|
||||
|
||||
msgDetails[4] = msgDetails[4].replace( '~~#~~', "," );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1069,8 +1072,7 @@
|
||||
var itemDate = this._getChatTime( msgDetails[0] );
|
||||
|
||||
msgDetails[2] = msgDetails[2].replace( '~~#~~', "," );
|
||||
msgDetails[2] = this._unCleanMessage( msgDetails[2] );
|
||||
msgDetails[4] = msgDetails[4].replace( '~~#~~', "," );
|
||||
msgDetails[2] = this._unCleanMessage( msgDetails[2] );
|
||||
msgDetails[3] = msgDetails[3].replace( '~~#~~', "," );
|
||||
msgDetails[3] = this._unCleanMessage( msgDetails[3] );
|
||||
msgDetails[3] = this._parseEmoticonsAndBbcode( msgDetails[3], msgDetails[5] );
|
||||
@@ -1366,7 +1368,8 @@
|
||||
.replace( /=/g, "__E__" )
|
||||
.replace( /\+/g, "__PS__" )
|
||||
.replace( /&/g, "__A__" )
|
||||
.replace( /%/g, "__P__" );
|
||||
.replace( /%/g, "__P__" )
|
||||
.replace( /~~\|\|~~/, "~~###~~" );
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -1382,7 +1385,8 @@
|
||||
.replace( /__P__/g, "%" )
|
||||
.replace( /__A__/g, "&" )
|
||||
.replace( /__C__/g, "," )
|
||||
.replace( /__N__/g, "<br />" );
|
||||
.replace( /__N__/g, "<br />" )
|
||||
.replace( /~~###~~/, "~~||~~" );
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -1395,44 +1399,37 @@
|
||||
_parseEmoticonsAndBbcode: function (message, chatUserID) {
|
||||
var self = this;
|
||||
|
||||
// Basics
|
||||
message = message.replace( /\[b\](.+?)\[\/b\]/gi, "<strong class='ipsStyle'>$1</strong>" );
|
||||
message = message.replace( /\[i\](.+?)\[\/i\]/gi, "<em class='ipsStyle'>$1</em>" );
|
||||
message = message.replace( /\[u\](.+?)\[\/u\]/gi, "<u class='ipsStyle'>$1</u>" );
|
||||
|
||||
// Emoticons
|
||||
// @todo this line still needed?
|
||||
message = message.replace( '!', '!' );
|
||||
|
||||
_.each( ips.getSetting('chatEmoticons'), function (url, emoticon) {
|
||||
_.each( ips.getSetting('chatEmoticons'), function (url, emoticon) {
|
||||
var img = $('<img/>').attr({ 'src': url['image'], 'data-emoticon': 'true' });
|
||||
if ( url['width'] ) {
|
||||
img.attr( 'width', url['width'] );
|
||||
}
|
||||
if ( url['height'] ) {
|
||||
img.attr( 'height', url['width'] );
|
||||
img.attr( 'height', url['height'] );
|
||||
}
|
||||
if ( url['image_2x'] ) {
|
||||
img.attr( 'srcset', url['image_2x'] );
|
||||
}
|
||||
img = "$1" + $('<div/>').append( img ).html() + "$2";
|
||||
|
||||
var regexp = new RegExp( "(^|\\s)" + self._escapeRegex( emoticon ) + "(\\s|$)", "gi" );
|
||||
|
||||
var regexp = new RegExp( "(^|\\s)" + self._escapeRegex( emoticon.replace( /</g, "<" ).replace( />/g, ">" ) ) + "(\\s|$)", "gi" );
|
||||
|
||||
while( message.match( regexp ) ){
|
||||
message = message.replace( regexp, img );
|
||||
}
|
||||
});
|
||||
|
||||
// Bad words
|
||||
var groupID = 0;
|
||||
var canBypassBadwords = false;
|
||||
var canBypassBadwords = false;
|
||||
|
||||
if( chatUserID ){
|
||||
var forumUser = ips.getSetting('forumIDMap')[ chatUserID ];
|
||||
|
||||
if( !_.isUndefined( forumUser ) ){
|
||||
groupID = forumUser.groupID
|
||||
canBypassBadwords = forumUser.canBypassBadwords;
|
||||
}
|
||||
}
|
||||
@@ -1451,56 +1448,26 @@
|
||||
info.swop = '#####';
|
||||
}
|
||||
|
||||
// Apparently we have to treat 'ass' differently because of the HTML class attribute
|
||||
if( badword == 'ass' ){
|
||||
var reversed = esrever.reverse( message );
|
||||
|
||||
if( info.m_exact ){
|
||||
// Loose
|
||||
regex = new RegExp( '(\\b|!|\\?|\\.|,|$)' + self._escapeRegex( reversed ) + '(?!lc)(^|\\b|\\s)', "gi" );
|
||||
} else {
|
||||
// Exact
|
||||
regex = new RegExp( self._escapeRegex( reversed ) + '(?!lc)', "gi" );
|
||||
}
|
||||
|
||||
while( matches = regex.exec( message ) ){
|
||||
if( matches !== null ){
|
||||
if( info.m_exact ){
|
||||
replaceMap[ "__BW" + iteration + "__" ] = esrever.reverse( matches[2] ) + info.swop + esrever.reverse( matches[1] );
|
||||
} else {
|
||||
replaceMap[ "__BW" + iteration + "__" ] = info.swop;
|
||||
}
|
||||
|
||||
reversed = reversed.replace( matches[0], "__" + iteration + "WB__" );
|
||||
iteration++;
|
||||
}
|
||||
}
|
||||
|
||||
message = esrever.reverse( reversed );
|
||||
return;
|
||||
// Is this a loose replacement or exact match?
|
||||
if( info.m_exact ){
|
||||
// Loose
|
||||
regex = new RegExp( '(^|\\b|\\s)' + self._escapeRegex( badword ) + '(\\b|!|\\?|\\.|,|$)', "gi" );
|
||||
} else {
|
||||
// Exact
|
||||
regex = new RegExp( self._escapeRegex( badword ), "gi" );
|
||||
}
|
||||
|
||||
// Is this a loose replacement or exact match?
|
||||
if( info.m_exact ){
|
||||
// Loose
|
||||
regex = new RegExp( '(^|\\b|\\s)' + self._escapeRegex( badword ) + '(\\b|!|\\?|\\.|,|$)', "gi" );
|
||||
} else {
|
||||
// Exact
|
||||
regex = new RegExp( self._escapeRegex( badword ), "gi" );
|
||||
}
|
||||
|
||||
// Iterate through the matches
|
||||
while( matches = regex.exec( message ) ){
|
||||
if( matches !== null ){
|
||||
if( info.m_exact ){
|
||||
replaceMap[ "__BW" + iteration + "__" ] = matches[1] + info.swop + matches[2];
|
||||
} else {
|
||||
replaceMap[ "__BW" + iteration + "__" ] = info.swop;
|
||||
}
|
||||
|
||||
message = message.replace( matches[0], "__BW" + iteration + "__" );
|
||||
iteration++;
|
||||
// Iterate through the matches
|
||||
while( matches = regex.exec( message ) ){
|
||||
if( matches !== null ){
|
||||
if( info.m_exact ){
|
||||
replaceMap[ "__BW" + iteration + "__" ] = matches[1] + info.swop + matches[2];
|
||||
} else {
|
||||
replaceMap[ "__BW" + iteration + "__" ] = info.swop;
|
||||
}
|
||||
|
||||
message = message.replace( matches[0], "__BW" + iteration + "__" );
|
||||
iteration++;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1511,6 +1478,11 @@
|
||||
});
|
||||
}
|
||||
|
||||
// Basics
|
||||
message = message.replace( /\[b\](.+?)\[\/b\]/gi, "<strong class='ipsStyle'>$1</strong>" );
|
||||
message = message.replace( /\[i\](.+?)\[\/i\]/gi, "<em class='ipsStyle'>$1</em>" );
|
||||
message = message.replace( /\[u\](.+?)\[\/u\]/gi, "<u class='ipsStyle'>$1</u>" );
|
||||
|
||||
return message;
|
||||
},
|
||||
|
||||
@@ -1521,6 +1493,9 @@
|
||||
* @returns {string}
|
||||
*/
|
||||
_parseMessage: function (message) {
|
||||
// Because we insert as text, we need to make sure & is converted to &, otherwise entities will display incorrectly
|
||||
message = message.replace( /&/gi, '&' );
|
||||
|
||||
message = message.replace( /%20/gi, ' ' );
|
||||
message = message.replace( /%23/gi, '#' );
|
||||
message = message.replace( /%22/gi, '"' );
|
||||
@@ -1698,7 +1673,7 @@
|
||||
var returnURL = url;
|
||||
|
||||
if( text.substring( indexOfURL, indexOfURL - 5) !== 'src="' && text.substring( indexOfURL, indexOfURL - 8) !== 'srcset="' ){
|
||||
returnURL = '<a href="' + url + '" target="_blank">' + url + '</a>';
|
||||
returnURL = '<a href="' + url + '" target="_blank" rel="noopener noreferrer">' + url + '</a>';
|
||||
}
|
||||
|
||||
lastPos = indexOfURL + url.length;
|
||||
@@ -1879,7 +1854,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="chat" javascript_location="front" javascript_path="templates" javascript_name="ips.templates.chat.js" javascript_type="template" javascript_version="101012" javascript_position="1000100"><![CDATA[ips.templates.set('chat.tabs.tab', " \
|
||||
<file javascript_app="chat" javascript_location="front" javascript_path="templates" javascript_name="ips.templates.chat.js" javascript_type="template" javascript_version="101093" javascript_position="1000100"><![CDATA[ips.templates.set('chat.tabs.tab', " \
|
||||
<li role='presentation' data-roomID='{{roomID}}'>\
|
||||
<a href='#' role='tab' id='{{roomID}}' class='ipsFaded_withHover ipsTabs_item ipsType_blendLinks {{#active}}ipsTabs_activeItem{{/active}}' aria-selected='false'>\
|
||||
{{roomTitle}} {{#close}} <span class='ipsFaded ipsFaded_more' data-action='closeTab' data-ipsTooltip title='{{#lang}}closeThisTab{{/lang}}'><i class='fa fa-times'></i></span>{{/close}}\
|
||||
@@ -1996,9 +1971,10 @@ ips.templates.set('chat.chatDate', " \
|
||||
");
|
||||
|
||||
ips.templates.set('chat.parsedImage', " \
|
||||
<div class='cChatParsedImage ipsFaded_withHover'><a href='{{url}}' target='_blank' data-ipsLightbox><img src='{{url}}'></a> <span class='ipsType_light ipsHide' data-role='imageHidden'>{{#lang}}imageHidden{{/lang}}</span> <a href='#' class='ipsFaded ipsFaded_more ipsButton ipsButton_narrow ipsButton_verySmall ipsButton_primary' title='{{#lang}}hideImage{{/lang}}' data-ipsTooltip data-action='toggleImage'><i class='fa fa-caret-up'></i></a></div>\
|
||||
<div class='cChatParsedImage ipsFaded_withHover'><a href='{{url}}' target='_blank' rel='noopener noreferrer' data-ipsLightbox><img src='{{url}}'></a> <span class='ipsType_light ipsHide' data-role='imageHidden'>{{#lang}}imageHidden{{/lang}}</span> <a href='#' class='ipsFaded ipsFaded_more ipsButton ipsButton_narrow ipsButton_verySmall ipsButton_primary' title='{{#lang}}hideImage{{/lang}}' data-ipsTooltip data-action='toggleImage'><i class='fa fa-caret-up'></i></a></div>\
|
||||
");]]></file>
|
||||
<order app="global" path="/dev/js//framework/">templates
|
||||
common/ips.loader.js
|
||||
common/ui
|
||||
common/utils
|
||||
common
|
||||
@@ -2012,6 +1988,4 @@ app.js</order>
|
||||
<order app="global" path="/dev/js//library//jquery">jquery.js
|
||||
jquery.history.js
|
||||
jquery.transform.js</order>
|
||||
<order app="global" path="/dev/js//library//xregexp">xregexp-all.js
|
||||
xregexp-lookbehind.js</order>
|
||||
</javascript>
|
||||
Reference in new issue
Block a user