Progress with
jwysiwyg has pretty much stalled without any resolution of the bugs others have highlighted.
Last week I came across a new jQuery wysiwyg plugin called
CLEditor.
I've made a Vanilla plugin using it: CLEditor for VanillaIt's functional with the 'stock' .js and .css, it also allows editing of the HTML - unlike jwysiwyg.
On Vanilla 2.0.3 you need to
update the file
applications/dashboard/modules/class.headmodule.php - insert this at line 269:
foreach ($this->_Strings as $String) {
$Head .= $String;
$Head .= "\n";
}
One tweak you can make is to edit line-19 of
jquery.cleditor.min.js to remove extra toolbar buttons, eg. cut/copy/paste might not work on your system.
BUGS: There's a bug where both the HTML and WYSIWYG view are visible in 'Write comment' textarea in a Discussion.
This is 'fixed' by clicking the HTML button a couple of times. Try this fix:
Edit
plugins/cleditor/default.php and change line-43 to:
$Sender->Head->AddString('$("#Form_Body").live("mouseover", function() {$("#Form_Body").cleditor({width:"100%", height:"100%"});});');
There's probably a way of fixing this with a jQuery call, one of these pages might help a jQuery-guru figure it out:
http://premiumsoftware.net/cleditor/docs/GettingStarted.html#internalObjecthttp://groups.google.com/group/cleditor/browse_thread/thread/d0f916101fe16903/Try it out and let us know how it goes!
4 • •
Comments
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •foreach ($this->_Strings as $String) {Save the file and reload to see if you can see the CLEditor toolbar$Head .= $String;
$Head .= "\n";
}
This fix is mentioned here: http://github.com/ShadauxCat/Garden/commit/4ade3f7d65811bc5d7fa013720fb70ee3a21fdc8 & here: http://vanillaforums.org/discussion/12509/vanilla-2.0.3-released
- Spam
- Abuse
- Troll
1 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
1 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •How do I stop both HTML & Wysiwyg displaying as a default? Looked in the forums attached but no luck.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •So far, I'm 0 for 3 on getting any of these Wysiwyg plugins to work without major quirks.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Are you seeing it on 'Start a New Discussion' textareas also?
CLEditor is the closest to a 100% solution for WYSIWYG on Vanilla I've seen - if we can figure out this little quirk!
The previous attempt, jwysiwyg, stalled trying to figure out its quirks.
I've posted a question on the CLEditor Google group, so we hope to have a fix soon - CLEditor's author is on vacation until Aug 30.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •On a side note, any plans to make this addon also work when you edit a post? So far, that seems to be a weakness of all of the wysiwyg plugins.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •If anyone has any insight into calling jQuery (or having CLEditor 'listen' for new textareas) when the author clicks 'Edit', please comment here.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Edit plugins/cleditor/default.php and change line-43 to:
$Sender->Head->AddString('<script type="text/javascript">$("#Form_Body").live("mouseover", function() {$("#Form_Body").cleditor({width:"100%", height:"100%"});});</script>');
(*updated*)A step towards a full solution. Please let us know if this works for you.
- Spam
- Abuse
- Troll
1 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Changed script and works great in both comment and new discussion, if it could work on the edit pages too that would be great but this is the first WYSIWYG editor that I have successfully installed and is working well. 1 out of 3
Could anyone help me put an 'add image' button / browse/ upload it to the site, with up to 9 images displaying under the discussion or comment similar to the images in the vanilla plugins?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •That did it! Thanks a ton.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •(Please post the last part of the URL/path of one of these pages)
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •That fix is perfect. It works on edit and new posts. The only slight downside is that it feels a little weird to have it pop up on mouseover. But that's a small quibble.
With that fix, this wysiwyg plugin is by far the leader of the pack for Vanilla 2.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Having said that, after finding that jQuery live() function, I'm sure there's a way to extend it so that it adds toolbars without the need for a mouseover.
Where are all jQuery ninjas when you need them?!
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Mouseover fix would be good - best wysiwyg editor for Vanilla
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •@tmilovan: I'll take a look at that, there's probably a way to make CLEditor clear the field with jQuery when Vanilla creates the new posting.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •(even the original) cleditor does not allow that
in order to temporarilly enable this I have patched jquery.cleditor.min.js, so that part:
if(f=="url"){if(d=="link"&&I(b)=="")
becomes:
if(f=="url"){if(d=="link"&&I(b)=="" && 0)
while this is not best solution, it might help someone
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •