Page 1 of 1

Javascript in links

Posted: Sat 30. Dec 2017, 12:05
by faujsniufade
Hi everybody.

I'm transferring an old 3.2 website to the most recent version of CMSimple, and run into a problem.

When I select some text, add a link to it, and define the target as javascript:some_code, the javascript code is removed on save. But I need it to obfuscate an email address.

How can I enter javascript as a link URL?

thank you.

Re: Javascript in links

Posted: Sat 30. Dec 2017, 13:23
by faujsniufade
OK, found it by myself.

It's not a CMSimple issue, but a config option of the tinyMCE editor. To fix, go to .../plugins/tinymce/inits and add the line

Code: Select all

    allow_script_urls: true, 
directly behind the line

Code: Select all

    selector: "cmsimple-editor",
in the files
  • init_full.js
    init_medium.js
    init_minimal.js
    init_narrow.js
    init_sidebar.js
so the files look like this:

Code: Select all

var tinyConfig = {
//      convert_urls: false,
    selector: "cmsimple-editor",
    allow_script_urls: true,
    skin: "cmsimple",
    [...]