WYSISYG editor breaking scripts in footer

Last post 11-23-2009, 10:49 AM by esturrock. 6 replies.
Sort Posts: Previous Next
  •  10-21-2009, 1:54 PM 2339

    WYSISYG editor breaking scripts in footer

    I was called in to help debug another AC client's analytics and noticed something odd:

    In the footer, once you open the wysiwyg editor it automatically comments out the scripts from the html with an RAEditor prefix in the comments. It seems to be caused by the editor in AC; as a work around we created the analytics scripts as files on the server and use an external reference merge to call it in. Works fine now.

    Not sure if anyone else if having this type of problem, and I'm hoping AC has some insight into this. Thanks!

     


    Article on Me & Americommerce
  •  10-21-2009, 3:54 PM 2345 in reply to 2339

    Re: WYSISYG editor breaking scripts in footer

    Yep - we had the same prob and lodged a support request. Your work around is a good one. Our work-around is to not use the 'switch to HTML'/'switch to wysiwyg' button, at the top of the editor, for editing anything contains scripts. Instead, we use the icon the looks like '<>' and the 'pencil' in the bottom left corner of the editor to switch between HTML and WSIWYG which doesn't seem to cause the script-breaking issue.

     Here's our summary of the issue:

     Since the wysiwyg editor has been updated in admin, a bug has crept in where if you make a change to the code in the HMTL screen, it can break all scripts. 

    For example, we added the mcafee secure code to our footer last week. When the changes are saved, the RADEDITOR is adding '-->' to the closing script tag and breaking it.

    I've corrected this a number of times, and it keeps re-appearing. If AC were to open our footer for example, look at the code in HTML mode make a change, and save it, the script tags would be broken.

    FYI I think the following post is relevant to the RADEDITOR issue. I have only experienced this problem since the upgrade to the RADEDITOR (which now allows switching between HTML and WYSIWYG without a page refresh)

    http://www.telerik.com/community/forums/aspnet/editor/adding-custom-javascript.aspx 

  •  10-21-2009, 4:23 PM 2347 in reply to 2345

    Re: WYSISYG editor breaking scripts in footer

    The 3rd party control RadEditor is hacking up the javascript.  We are adding a new snapin (Code Snapin or Javascript Snapin or similar) where you can put in javascript and not worry about it which will help users keep it seperate from their HTML.  Another option is to put it in a .js file and do an include on the page.

    We are not sure what else to do, if we turn on the scripting like that link above suggests it actually runs the script when in WYSIWYG mode which is just as annoying and causes other things to break randomly in the admin...it's a lose lose from what I gather.  Why telerik would 'run' the script is beyond me.  The verse is they 'comment' the code out when in wysiwyg mode...then when we get the HTML from the control...it's commented.

    We are looking into autoswitching to html view before we grab the html so that it is always uncommented...until then it may be best to separate the javascript into its own html snapin so you can edit the area.


    Ed Sturrock
    Co-Founder, VP of Product Management
  •  10-23-2009, 3:48 PM 2360 in reply to 2347

    Re: WYSISYG editor breaking scripts in footer

    Thanks Ed... the external merge is working great now, I recommend it for anyone having script issues due to the WSYWIG.
    Article on Me & Americommerce
  •  10-23-2009, 4:26 PM 2364 in reply to 2360

    Re: WYSISYG editor breaking scripts in footer

    We fixed this interaction today and should be in this release as a hotfix.  No more broken scripts (no thanks to Telerik I must add...we had to maneuver around it).  However, I will still push you to use a seperate HTML area for your code or put it in an external file and bring in, that is just good encapsulation of your code, keep it away from your HTML always.
    Ed Sturrock
    Co-Founder, VP of Product Management
  •  11-22-2009, 3:39 PM 2421 in reply to 2339

    Re: WYSISYG editor breaking scripts in footer

    The WYSIWYG editor will definitely not work on Google Chrome. After you do your work and save it, it adds all the 0$ to what you saved.

    Best Regards,
    Louis
    TackleToyStore.com
  •  11-23-2009, 10:49 AM 2427 in reply to 2421

    Re: WYSISYG editor breaking scripts in footer

    This is fixed in more recent versions of AmeriCommerce.  It is still not recommended to use chrome for AmeriCommerce since some functionality in the 'editable grids' is lost.  This will change soon as well.  I personally use Chrome when using AmeriCommerce just for the diversity and to help ensure it is usable since most others use FireFox or IE.  If Chrome works, Safari on Windows should follow suit for the most part.  It is still an official recommendation to use FF or IE.
    Ed Sturrock
    Co-Founder, VP of Product Management
View as RSS news feed in XML