Download & Extend

[D7] Prevent to call Toggle rich text link href="javascipt:..." multiple times

Project:CKEditor - WYSIWYG HTML editor
Version:7.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Patch from #1095174: Toggle rich text link href="javascipt:..." could be called multiple times ported to D7.

The link that toggles a textarea from plain to rich text uses an anchor tag with javascript in the href property. In some cases this could cause the browser to execute the javascript twice or more and is generally considered bad form. Instead javascript should be executed in the onclick property and href should point to a valid url (or "javascript:void(0);").

This patch changes the toggle link from
<a href="javascript:Drupal.ckeditorToggle('edit-body','Switch to plain text editor','Switch to rich text editor',1);">Switch to plain text editor</a>

to

<a href="javascript:void(0);" onclick="javascript:Drupal.ckeditorToggle('edit-body','Switch to plain text editor','Switch to rich text editor',1);">Switch to plain text editor</a>

Comments

#1

Status:active» fixed

I commit it to GIT.

Please check the latest dev release and let me know if you notice any poblems with it. Remember to clear Drupal cache and browsers cache before testing.

Greetings

#2

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#3

Title:[D7] Toggle rich text link href="javascipt:..." could be called multiple times» [D7] Prevent to call Toggle rich text link href="javascipt:..." multiple times