WYMeditor (What You Mean is What You Get) Poised for World Dominance
Back at ON Networks, we just finished upgrading from tinyMCE* to WYMeditor to power the textareas on the backend.
WYMeditor's main concept is to leave details of the document's visual layout, and to concentrate on its structure and meaning, while trying to give the user as much comfort as possible (at least as WYSIWYG editors).
...The end-user defines content meaning, which will determine its aspect by the use of style sheets. The result is easy and quick maintenance of information.
The editor is liscensed under GPL, and will not work without jQuery (getting interested yet?).
Now the editor has a few bugs, and a few poor design decisions in its default interface. But unlike TinyMCE, its source code is comprehensible. Uncompressed, it comes out to 2000 lines of Javascript. That sounds like a lot to some... but remember the the actual size of other WYSIWYG editors uncompressed. (TinyMCE clocks in where? Is it 2 times, or 3 times larger than Drupal core?)
I also forgot to mention that the first 550 lines of code are javascript constants that have been conveniently placed to allow you to alter the application dramatically to fit whatever needs you have.
The only bad news is that the WYMeditor module at Drupal.org hasn't been updated in 9 months, (which when dealing with young projects like WYMeditor, means that the module is probably more trouble than its worth...) But no worries, here's the jquery that is required to make it active on any textarea: <?php
function add_wymeditor($selector = 'textarea') {
drupal_add_js(SOME_MODULE_PATH.'/wymeditor/jquery.wymeditor.js', 'module');
drupal_add_css(SOME_MODULE_PATH.'/wymeditor/skins/default/screen.css');
drupal_add_js('
$(document).ready( function() {
$("'.$selector.'").wymeditor({
updateSelector: ".form-submit"
});
});
','inline');
}
?>
Obviously, you'll want to define the module your putting into, instead of "SOME_MODULE_PATH". Strangely, I wasn't able to find a reference to that update selector anywhere besides the code... so I'm guessing that's why this editor hasn't taken drupal by storm yet... Anyhow, that one line is the secret to making the editor work after hitting the submit button...
****
Someof you might be asking: "but can it really replace tinyMce?" The truth is, I don't think so. TinyMCE in the end, is like Communism: full of lies, murder, schizophrenia, and suffering.
TinyMCE is also impractical. Like the fact that users with "unneat" styles of typing will find the editor as more of hiderence than a help. In practice, I've found that a user needs an understanding of HTML before they can use tinyMCE. That's irony if I've ever heard it....
In the end, WYMeditor is imperfect, but promising. Sadly, that makes it hands down the winner among the competitors which are "imperfect, impossible to debug, utterly hopeless, and in the end, based off of non-jquery javascript... so require way more time than their worth" I mean seriously, who bothers with non-jquery javascript?
Oh.. right: people who contribute to projects/work with pre-existing software that isn't built with jquery... I always forget...
Anyways, if there was ever a canidate for a drupal core alternative to stock textareas, its the only WYMIWYG editor to date
Notes:
1. by upgrading, I mean, burning tinyMCE at the stake for its sins. Afterwords, we got got drunk, and feasted on its charred body. (javascript tastes like metal, as it turns out...)