Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One can not add any JavaScript events in TinyMCE editor #9268

Closed
konstantin-karetny opened this issue Mar 1, 2016 · 9 comments
Closed

One can not add any JavaScript events in TinyMCE editor #9268

konstantin-karetny opened this issue Mar 1, 2016 · 9 comments

Comments

@konstantin-karetny
Copy link

Even when I log in as Super Administrator with selected 'No Filtering' filter type in System => Global Configuration => Text Filters;
Even when I add 'script' in 'Valid Elements' field in 'Editor - TinyMCE' plugin settings;
I still can not add JavaScript events like onclick for tags in TinyMCE editor.
I think if I am Super Administrator with all rights I must have some opportunity to make some elementary actions like this one. Am I wrong?

@richard67
Copy link
Member

What does the field "Prohibited Elements" in the plugin settings of TinyMCE (is at the very bottom of the 1st tab) contain?

If it contains "script", remove that, and it will work.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9268.

@konstantin-karetny
Copy link
Author

Sure I tried that, and it's allows me only to add a <script></script> tag, but I need to add an attribute onclick="" to an existing tag.
TinyMCE just deletes all event attributes like onclick at any settings, that's the problem.

@richard67
Copy link
Member

Hmm, I see ... sorry for asking.

@konstantin-karetny
Copy link
Author

Kein Problem!
Yes, try to play with this. Judging by deep googling this is the old issue but there is no solution for now.
At least I have not found it yet.

@brianteeman
Copy link
Contributor

Have you looked through the tinymce bug tracker?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9268.

@dgrammatiko
Copy link
Contributor

What is the tag that you are trying to put the onclick? <a> or something else?

@dgrammatiko
Copy link
Contributor

Also from tinymce' documentation:

Also note that all event attributes are excluded by default since it's a bad practice to use inline script handles like "onclick". You can manually add extra elements and attributes using the extended_valid_elements option.

https://www.tinymce.com/docs/configure/content-filtering/#extended_valid_elements

@konstantin-karetny
Copy link
Author

dgt41, I tried to add onclick to different tags.
Many thanks for link!
Now topic can be closed, the problem is solved.
I just set *[*] value for the 'Valid Elements' field, according to to the TinyMCE documentation:

Use *[*] to include all elements and all attributes.

https://www.tinymce.com/docs/configure/content-filtering/#specialvariables

@brianteeman
Copy link
Contributor

Closed as requested - this is a tinymce issue not one we can alter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants