Hi there:
I am running FCKEditor 2.6.4 and am looking for a solution to insert onClick and onMouseOver external javascript into the anchor tags of my editor instances.
This insertion would be handled via a toolbar button.
What I already know and have tried:
1. Know how to manually do this task in source view.
2. Already created the 2 javascripts I want to use, and proven they work when I insert the script in the editors source mode.
3. Already started making the plugin, but I'm lost on making the actual processing file as I do not want a dialogue window, just have the user click the button in the toolbar.
4. Already have created my fckplugin.js file and toolbar button.
As an example, here is what I have accomplished:
The standard image with its link is:
<a class="fadeit" target="_self" href="anotherpage.php"><img border="0" hspace="1" alt="" width="181" height="43" src="pathto/image.png" /></a>
I already have a style class for the link, the styleclass sets 50% opacity until hovered at 100% opactiy, that was easily accomplished by applying the style to the Insert/Edit Link > advanced tab (after setting it in the editor stylesheet).
Here is what I'm trying to accomplish:
We start out with the same linked and styled image...
<a class="fadeit" target="_self" href="anotherpage.php"><img border="0" hspace="1" alt="" width="181" height="43" src="pathto/image.png" /></a>
The user clicks the plugin toolbar button and the link source code is modified to the following:
<a class="fadeit" onclick="clickit('anotherpage.php', 'targetwin will be _parent'); return false" onmouseover="hoverit('picpath/pic.png', 'targetdiv'); return false"><img border="0" hspace="1" alt="" width="181" height="43" src="pathto/image.png" /></a>
Any help or advice for this FCKEditor plugin would be great.
Best regards,
dennishall