Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Yahoo User Interface Library is really good. They're about to release a v3 soon.
http://developer.yahoo.com/yui/editor/
I'm going to add this to WYSIWYG API (or at least try my best). If you have done any work on this or are interested in helping out join me in IRC channel #drupal-wysiwyg.
Comment | File | Size | Author |
---|---|---|---|
#35 | wysiwyg-HEAD.yui_.patch | 7.81 KB | sun |
#13 | yui-wysiwyg_grouping4.diff | 6.5 KB | davidburns |
#11 | wysiwyg-yui_grouping2.diff | 5.77 KB | davidburns |
#12 | yui-wysiwyg_grouping3.diff | 6.15 KB | davidburns |
#14 | yui-wysiwyg_grouping5.diff | 8.44 KB | davidburns |
Comments
Comment #1
davidburnsHere's the basic yui.inc file
-- It's only loading one of the library files, which is yahoo-dom-event.js not sure why
-- Unsure how to add more complex items to yui toolbar, this would include select list, spell check etc... I need to take a closer look at tinyMCE
-- Same goes with creating the yui.js which is able to load and unload the editor when selecting input formats
Comment #2
davidburnsCouple editing errors in the last file, nothing that would stop it from working though. Just cruft left over from my copy and paste.
Comment #3
sunThere you go. Attaching/detaching as well as switching to a different editor works fine for me.
Please note that you might have to remove your wysiwyg profile in front of getting this to work (to reset the editor configuration).
Lastly, support for externally hosted scripts should be dealt with in a separate issue. Let's get this sucker in first ;)
Comment #4
davidburnsHere's the new yui.inc that builds the js based upon which settings you have enabled.
And I added some code to yui.js that will take these settings into account, but still getting some errors. So I commented them out but still may be useful and save some time.
Comment #5
sunSimplified.
Comment #6
sunCommitted patch in #5, so it is easier for you to create a patch.
Comment #7
davidburnsHere's a patch that does grouping. I based it off of how you did button settings. Still doesn't seem as streamlined as it should be, too much hardcoded. But It is outputting the buttons in expected array structure.
Comment #8
davidburnspatch needs work
Comment #9
davidburnsIn reference to the non-working patch above. It leads me to believe we're missing an extra wrapper to YAHOO.widget.Editor.
Here's code that is working for our site in Drupal 5 using a modified version of YUI Editor module
Comment #10
sunComment #11
davidburnsREFER TO COMMENT #14
Here's another patch. Some of the Checkboxes on configuration page were improperly named (parastyle instead of formatselect), couple other changes.
Comment #12
davidburnsREFER TO COMMENT #14
Here's a patch that has been ran the proper way
diff -urp oldfile newfile > patch_name.diff
Grouping still doesn't work
Comment #13
davidburnsREFER TO COMMENT #14
This is patched against HEAD.
You can see the grouping is working fine. It's how we are listing 'buttons' within the group array that seems to be borked.
It's getting close. Any suggestions would be appreciated.
Comment #14
davidburnsSIMPLIFIED
Here's a more streamlined way to do grouping. I believe we'll be able to do grouping with external plugins if we go this route.
This is a patch against HEAD.
Ignore patches from comments #11, #12, & #13
Comment #15
davidburnsI just noticed something else that might help figure this out...
If you apply my last patch and uncomment line 191, you'll see the grouping titles appear like they are supposed to. Here's a screenshot
EXAMPLE 1
now if you slightly modify this code to be the following
EXAMPLE 2
You'll see an undefined button appear, Here's a screen shot.
So lets look at the differences in output to see what's allowing this button to appear.
EXAMPLE 1
EXAMPLE 2
I guess the only real thing that jumps out at me is the first occurrence of 'buttons' in both instances.
Example 1 has "buttons": [{ /// no buttons
Example 2 has "buttons": { /// undefined button
I'm not a JS expert but I believe this may be the reason why we are getting NULL values for this._buttonList in editor.js
How can we get EXAMPLE 1 to output more like EXAMPLE 2???
Comment #16
sunWhat I would really like to know and suggest to test next is whether the example configuration snippet on http://developer.yahoo.com/yui/editor/#toolbar, when copied 1:1 into the attach function (instead of passing the settings variable) actually works. If it really does, there has to be a subtle difference between that code and the settings we are passing.
Comment #17
greg.harveySubscribing - will try to test as well... =)
Comment #18
deshilachado CreditAttribution: deshilachado commentedsubscribing...
Comment #19
hass CreditAttribution: hass commented#390246: YUI Editor not loaded (this._buttonList is null error) has been marked as a duplicate, but have an interim workaround.
Comment #20
sunComment #21
sunOne interesting thing in hass' patch (of the other issue) is that he's additionally defining
_defaultToolbar.buttonType = basic
- I have no idea what this setting is for, but maybe it helps this issue.Comment #22
hass CreditAttribution: hass commentedIf I remember correctly this is a newer (?) option to say
'buttonType' => 'simple'
, but does the same. It loads a small and simple editor http://developer.yahoo.com/yui/examples/editor/simple_adv_editor.html (less KB, basic functionality). The "advanced" editor may be better for this issue. But I'm not sure... never worked with YUI.Comment #23
a_c_m CreditAttribution: a_c_m commentedI've just installed 2.7.0 on HEAD and the buttons show and seem to work, but they are all aligned down the left hand side, one per line.
Very willing to test any new patches.
Comment #24
8w_gremlin CreditAttribution: 8w_gremlin commentedI'm having the same issue. I have a clean install of Drupal and I've just installed 2.7.0, all buttons on the same side in a vertical line.
Comment #25
hass CreditAttribution: hass commentedComment #26
sunIs the malfunction perhaps caused by Drupal.wysiwyg.clone() ? #470928: Drupal.wysiwyg.clone turns arrays into objects seems, from a technical perspective, like nonsense to me - but - if YUI is actually testing the passed in settings to be explicitly an array, maybe?
Comment #27
elgreg CreditAttribution: elgreg commented+1 Same issue re: stacked on top of each other. I'd say this renders YUI useless for WYSIWYG api. Wondering why more aren't having this problem. It looks like the css display setting of inline-block on .yui-button is being overridden in editor.css for YUI.
Comment #28
andydev CreditAttribution: andydev commentedSubscribed.
Same happens with me. Default drupal 6.12 installation, default theme, default Yui.
All buttons show in one vertical row.
Comment #29
MatWho CreditAttribution: MatWho commentedYes same problem, all icons stacked on left side
Comment #30
jozzhart CreditAttribution: jozzhart commentedSame issue here (vertical stacking of icons and not displaying correctly) on clean install.
Comment #31
sunIf you would read the issue, then you'd notice that this still is a feature request.
Comment #32
sunMeh.
Comment #33
bejam CreditAttribution: bejam commentedsubscribing
Comment #34
sun#470928: Drupal.wysiwyg.clone turns arrays into objects has been committed for WYMeditor support. Now let's see whether this helps here, too! :)
Comment #35
sunYeah. That fixed it.
Thanks for reporting, reviewing, and testing! Committed attached patch to all 2.x branches.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.