$core_v2_editor.GetContentScript now returns a semicolon at the end

I am working on an upgrade from v9.0 to v11.1.  I'm running into many javascript syntax errors in some customized widgets that use Rich Text Editors.  It appears that $core_v2_editor.GetContnetScript now returns a semicolon at the end of the string returned and in prior versions it did not.

Thus when I include the script in a jQuery post as part of the post parameters I'm getting syntax errors and nothing works.

Was this intentional?  Below you'll see the .Replace() hack I had to put on a custom widget in order to remove the semicolon and get it to work properly...

 jQuery.telligent.evolution.post({
                
                
                
                url:"$core_v2_widget.GetExecutedFileUrl('save.vm')",
                data:{
                    "name":jQuery("#lesson-name").val(),
                    "description": desc,
                    "seek": $core_v2_editor.GetContentScript('lesson-seek').Replace(";",""),
                    "share": $core_v2_editor.GetContentScript('lesson-share').Replace(";",""),
                    "digdeeper": $core_v2_editor.GetContentScript('dig-deeper').Replace(";",""),
                    "shortdesc":jQuery("#short-description").val(),
                    "duration":jQuery("#duration").val(),
                    "activedate":jQuery("#active-date").val(),
                    "sort":jQuery("#sort-order").val(),
                },
                success:function(response){
                    alert(response);
                    window.location.href = response;
                }
            });

Parents Reply
  • I'd recommend replacing even your adjustment with something like:

    var data = {
        "seek": (function() { return $core_v2_editor.GetContentScript('lesson-seek') })()
    };

    and for 11+, consider transitioning to using evolutionHtmlEditor directly which is going to make more sense directly in javascript. You can then create editors on the client side and interact with them completely without passing those APIs to client script through Velocity/Server-side JavaScript.

Children