Chat box: problems with HTML!
4 posters
Page 1 of 1
Chat box: problems with HTML!
Hello everybody!
I posted the following message in the chat:
Tag code test: [ code]if (_userdata.session_logged_in) { console.log('Ok!') };[/ code]
And the result is in the picture below:

Note that the HTML of BBCode is outside of the block <span style = "color: #222222"> </ span>
I noticed this problem on various forums, not only on my forum, this also happens with a test forum that I have without any JavaScript added!
The correct way should look like this:

For reference, here's the JSON returned in the message:

JS
I posted the following message in the chat:
Tag code test: [ code]if (_userdata.session_logged_in) { console.log('Ok!') };[/ code]
And the result is in the picture below:

Note that the HTML of BBCode is outside of the block <span style = "color: #222222"> </ span>
I noticed this problem on various forums, not only on my forum, this also happens with a test forum that I have without any JavaScript added!
The correct way should look like this:

For reference, here's the JSON returned in the message:
- Code:
<span style="color: #222222">Tag code test:
<dl class="codebox contcode">
<dt>Code:</dt>
<dd>
<code>if (_userdata.session_logged_in) { console.log('Ok!') }</code>
</dd>
</dl>
</span>

JS
Re: Chat box: problems with HTML!
@Black-Shadow"
What? I think you misunderstand the topic! This problem is in chatbox8.js code, not mine!
@Buttercup and/or @The Godfather
The reason of the problem lies in the use of tag <p> that only defines paragraphs!
Not accepting certain tags within it, only the <div> tag that represents a container is that behave any other tag in it!
In this case, the following code snippet in chatbox8.js:
It should look like this:
Result:

JS
What? I think you misunderstand the topic! This problem is in chatbox8.js code, not mine!
@Buttercup and/or @The Godfather
The reason of the problem lies in the use of tag <p> that only defines paragraphs!
Not accepting certain tags within it, only the <div> tag that represents a container is that behave any other tag in it!
In this case, the following code snippet in chatbox8.js:
- Code:
for (var j = 0; j < this.messages.length; j++) {
var message = this.messages[j];
var html = '<p class=\'chatbox_row_' + (j % 2 == 1 ? 2 : 1) + ' clearfix\'>' + '<span class=\'date-and-time\' title=\'' + message.date + '\'>[' + message.datetime + ']</span>';
if (message.userId == -10) {
html += '<span class=\'msg\'>' + '<span style=\'color:' + message.msgColor + '\'>' + '<strong> ' + message.msg + '</strong>' + '</span>' + '</span>'
} else {
html += '<span class=\'user-msg\'>';
if (this.avatar) {
html += '\t<span class=\'cb-avatar\'><img src=\'' + message.user.avatar + '\' /></span>'
}
html += '\t<span class=\'user\' style=\'color:' + message.user.color + '\'>' + '<strong> ' + (message.user.admin ? '@ ' : '') + '<span class=\'chatbox-username chatbox-message-username\' data-user=\'' + message.userId + '\' >' + message.username + '</span> : ' + '</strong>' + '</span>' + '<span class=\'msg\'>' + message.msg + '</span>' + '</span>'
}
html += '</p>';
content += html
}
It should look like this:
- Code:
for (var j = 0; j < this.messages.length; j++) {
var message = this.messages[j];
var html = '<div class=\'chatbox_row_' + (j % 2 == 1 ? 2 : 1) + ' clearfix\'>' + '<span class=\'date-and-time\' title=\'' + message.date + '\'>[' + message.datetime + ']</span>';
if (message.userId == -10) {
html += '<span class=\'msg\'>' + '<span style=\'color:' + message.msgColor + '\'>' + '<strong> ' + message.msg + '</strong>' + '</span>' + '</span>'
} else {
html += '<span class=\'user-msg\'>';
if (this.avatar) {
html += '\t<span class=\'cb-avatar\'><img src=\'' + message.user.avatar + '\' /></span>'
}
html += '\t<span class=\'user\' style=\'color:' + message.user.color + '\'>' + '<strong> ' + (message.user.admin ? '@ ' : '') + '<span class=\'chatbox-username chatbox-message-username\' data-user=\'' + message.userId + '\' >' + message.username + '</span> : ' + '</strong>' + '</span>' + '<span class=\'msg\'>' + message.msg + '</span>' + '</span>'
}
html += '</div>';
content += html
}
Result:

JS
Re: Chat box: problems with HTML!
Last edited by Ace 1 on May 18th 2015, 5:30 pm; edited 2 times in total
Re: Chat box: problems with HTML!
Once again: What?Ace 1 wrote:I don't see a difference in the code...
I regret that you can not see the difference...
Please only respond this topic who really can solve it, okay?
It does not help that did not get answer, or do not see any difference, as this will only slow the progress of the solution.
Possible solution of the problem: https://help.forumotion.com/t140648-chat-box-problems-with-html#956674
JS
Shadow- Manager
-
Posts : 16217
Reputation : 1830
Language : French, English
Re: Chat box: problems with HTML!
Hello
I just sent a new email to our technicians
I'll let you know 
EDIT: Our technicians are currently studying your proposal. They told me you are true but they are not sure they can do it without impacting forums that modify their CSS and templates.
I'll let you know when I have more info
I just sent a new email to our technicians


EDIT: Our technicians are currently studying your proposal. They told me you are true but they are not sure they can do it without impacting forums that modify their CSS and templates.
I'll let you know when I have more info

Shadow- Manager
-
Posts : 16217
Reputation : 1830
Language : French, English
Re: Chat box: problems with HTML!
Okay, I had already noticed this problem with CSS, but if we look at the default values of each version, we can see that the change is minimal:Buttercup wrote:(...)
EDIT: Our technicians are currently studying your proposal. They told me you are true but they are not sure they can do it without impacting forums that modify their CSS and templates.(...)
- Spoiler:
//phpbb2- Code:
#chatbox > p {
border-bottom: 1px solid #d5dde5;
}
#chatbox p {
line-height: 1.2em;
}
//phpbb3- Code:
#chatbox > p {
border-bottom: 1px solid #d5dde5;
}
//punbb- Code:
#chatbox > p {
border-bottom: 1px solid #d5dde5;
}
#chatbox p {
line-height: 1.2em;
}
//invision- Code:
#chatbox > p {
border-bottom: 1px solid #d5dde5;
}
Basically just replace the p by div...
JS
Re: Chat box: problems with HTML!
Hello Script
I got technicians answer. After studying your proposal they told me you are true. But making this change would create additional problems for all forums with CSS and personalize JS and HTML pages.
The chatbox is very touchy, so we won't take the risk of creating some bugs. However, you're true and our technicians are thankful for your remark
Thanks
I got technicians answer. After studying your proposal they told me you are true. But making this change would create additional problems for all forums with CSS and personalize JS and HTML pages.
The chatbox is very touchy, so we won't take the risk of creating some bugs. However, you're true and our technicians are thankful for your remark

Thanks
Shadow- Manager
-
Posts : 16217
Reputation : 1830
Language : French, English
Re: Chat box: problems with HTML!
@Buttercup
Ok, no problem, so I can publish a JavaScript that corrects this problem for those who wish?
My code corrects the CSS to suit div tag!
JS
Ok, no problem, so I can publish a JavaScript that corrects this problem for those who wish?
My code corrects the CSS to suit div tag!
JS
Re: Chat box: problems with HTML!
Yes you can publish it and even create a short tutorial that we cannot display on our tutorial section
(of course if you've enough time
)
Thanks for your help


Thanks for your help

Shadow- Manager
-
Posts : 16217
Reputation : 1830
Language : French, English

» New chat box problems for avacweb chat
» Chat box problems
» Chat box Problems
» problems with the chat box
» Chat Box Problems
» Chat box problems
» Chat box Problems
» problems with the chat box
» Chat Box Problems
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum