Forum OpenACS Development: Error in tinymce default config parameter parsing

Hi,

If you have a tinymce config parameter such as

{relative_urls false}

It gets converted to javascript

relative_urls:"false"
insted of
relative_urls:false

causing all kinds of unexpected behavior.

true works as a string or boolean due to any string evaluating to true if checked like this:

if (foo) { ... }

return true always for "a string".

I added a check for parameter values of true or false and I add them to the javascript tinymce config without surrounding quotes.

Does this sounds like a good fix?

Thanks
Dave

Collapse
Posted by Jim Lynch on
Heya Dave.

Is there any way to check for boolean type given the parameter name, and do the substitution of (say) true for "true" only when it's boolean?

-Jim

Collapse
Posted by Jim Lynch on
for example...

if you have as a tinymce (or other editor!) parameter that is fed as {foo true}, what would you do to predefine foo? in that predefinition, is the type specified, hopefully all on the tcl side, before the parameters are rendered into javascript initialization?

-Jim