2.0.9 Toggle WYSIWYG view and insert quote do not work in Chrome based browsers

Started by mcelliot_g, March 22, 2015, 09:58:00 PM

Previous topic - Next topic

mcelliot_g

Hello everyone and thanks in advance for your help!
I have a newly converted forum from phpbb3 to smf. Everything went fine except I have two little problems with posting in Chrome and Chrome based browsers. The toggle button in the editor does not work at all when I click it, nothing happens. I ran the Chrome console and encountered this error:

Uncaught TypeError: undefined is not a function
smc_Editor.onToggleDataReceived
oSendDoc.onreadystatechange


In related files, on editor.js the console seems to find an error on the following undelined part:


smc_Editor.prototype.onToggleDataReceived = function(oXMLDoc)
{
   var sText = '';
for (var i = 0; i < oXMLDoc.getElementsByTagName('message')[0].childNodes.length; i++)
      sText += oXMLDoc.getElementsByTagName('message')[0].childNodes.nodeValue;

I don't know if this error occured from the beginning, before or after conversion, and mod installations, I paid attention to it after all of the above were done.


Also when trying to insert additional quote in a message nothing happens also when I hit the "Insert quote" button! The normal quote button works fine, but no additional quotes can be inserted from there. The console gives no errors which makes it even more strange.
Please note that all of the above problems do not occur at all on Firefox!
What should I do, is there something I should edit myself? Please tell me what you need me to include to help you rectify this problem, I attached list of my installed mods to begin with!

margarett

You have some MODs that can maybe mess with JS.

Anyway, I would suggest to first start with default theme, then uninstall MODs one at a time to see if the culprit can be found ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

mcelliot_g

Quote from: margarett on March 22, 2015, 10:20:50 PM
You have some MODs that can maybe mess with JS.

Anyway, I would suggest to first start with default theme, then uninstall MODs one at a time to see if the culprit can be found ;)
Thank you so much for your reply! I thought about the mods as well, but would messing with JS break the functionality in Firefox as well?
This solution is a good one, but the problem is I have very active users and that would cause them lots of inconvenience unfortunately!  :(
However could anyone explain to me what this error is about and if I could possibly edit something to fix it? I tried looking around but could not find something similar!

margarett

Hi ;)

I cannot try it here (no Chrome) but that piece of code is the same as in the original file.

Can you please give us a link to your forum and a test account (no admin) for us to test?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

mcelliot_g


mcelliot_g

So doesn't anyone else have the same issue, is it only on my forum?
As a reminder:
I have some editor javascript problem that occurs only on Chrome and Chrome based browsers.
1. the toggle button does not work when I click on it. If I have it enabled by default it stays like this constantly (blue background), if not it stays inactive (grey background). When I click on it I get this console error:

XHR finished loading: POST ".....".
sendXMLDocument
smc_Editor.requestParsedMessage
smc_Editor.toggleView
smc_Editor.handleButtonClick
(anonymous function)
smc_BBCButtonBox.handleButtonClick
oCurControl.oImg.onclick


Uncaught TypeError: undefined is not a function
smc_Editor.onToggleDataReceived
oSendDoc.onreadystatechange


In the related files it finds the error on this line on editor.js
smc_Editor.prototype.onToggleDataReceived = function(oXMLDoc)
{
   var sText = '';
   for (var i = 0; i < oXMLDoc.getElementsByTagName('message')[0].childNodes.length; i++)
      sText += oXMLDoc.getElementsByTagName('message')[0].childNodes.nodeValue;

2. When I try to insert new quote on an already quoted message, when I click on Insert quote nothing happens. The console gives me no error. The normal quote button works but no additional quote can be added after that.

In Firefox all of the above does not occur, everything works normally. Any javascript experts that may have some indication to what is happening? I could suspect some mods which I uninstalled and reinstalled but nothing solved the issue, besides if it was from the mods, would the functionality break in Firefox also?

margarett

I checked this issue in place and it is something that Chrome broke in recent versions and affects all of SMF 2.0.9 (it can be reproduced here)

* Set WYSIWYG as your default editor
* Open a new topic or reply
* Click a smiley. Nothing happens and an error is triggered in Chrome's console

Now repeat:
* Open a new topic or reply
* Click inside the post area.
* Click a smiley. It works and no error is triggered.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

mcelliot_g

I see what happens with the smileys indeed! However in your SMF installation both the toggle button and the insert quote work in Chrome whereas an uncaught type error is generated in mine!
And what is with the anonymous functions, is it something normal!
Damn, I wish I knew javascript coding!  :(
For the moment I advise my users to work on Firefox but many don't want to be restrained!

margarett

Actually I have an issue with FF also :P

It seems that recent versions of the browsers created some incompatibilities with our WYSIWYG editor. We are working on it.
Best advice you can give to your members is to disable the advanced editor for now :(
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

mcelliot_g

Thank you for your insight! Do you think the smileys problem is related to mine though? I mean will an update that solves the smileys issue will also fix mine with Chrome based browsers?

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

MancerCorp

I find this issue is happening for me also when attempting to use custom theme 'Astonished'

(in both Chrome & FF)

but when using the default Curve theme there is no issue.

Kindred

In which case, you would need to ask for assistance form the theme author in the thread dedicated to supporting that specific theme
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: