Task description:

Short: Create the lightweight WYSIWYG that will ship with Drupal 7 core.

Long: As per Dries' "Suggestions for Drupal core" (cfr Resources), create a lightweight WYSIWYG solution to provide basic html entities and to drag-and-drop (position) images into posts More advanced WYSIWYG editors should be able to overwrite the one in core, and more advanced document management solutions should be able to overwrite or extend the basic asset management solution in core. The task is done when the Drupal issue is marked as "ready to be committed".

  • HTML elements to support: a, em, strong, strike, img, blockquote, ul, ol, li, as well as horizontal alignments (left, center, right).
  • When adding an image, allow the option to select an image uploaded with the core upload module or an external url. Use drag-and-drop to position the image.
  • Easy to configure: set the pages where it should (not) appear, just like with block configuration. Allow to enter which classes it should be attached to. Default to the node add/edit pages and the body textarea.
  • Don't use 3rd party libraries like TinyMCE or FCKEditor. Although they have GPL-like licences, Drupal discourages shipping with them.
  • Write the module in the latest Drupal 6 dev version.
  • The icons will be delivered by another GHOP task.

Resources:

Estimated time: 3 weeks

Comments

wmostrey’s picture

Also needs to be included:
- option to switch live between wysiwyg and code view
- option to set default state (wysiwyg / code) for all users
- set a permission which allows users to select their own default sate

catch’s picture

Great, great idea. I think it should mention jQuery, and potentially allow some small jQuery component that's not already in core if it saves reinventing the wheel?

xmacinfo’s picture

Very good task.

Shouldn't the status be set to "active"?

wmostrey’s picture

I will split it in 3 tasks of one week instead one huge task of 3 weeks and I'll include more detailed information. So I'll start of with task one and we'll see from there how things go.

I'm going to mentor this project. With a fast response time and active coding help, I really think we can make this work.

Nick Lewis’s picture

Great idea, but a couple of worries:
1. This is not a small task as is. Making a quality wysiwyg editor AND building reliable image/upload handling into it is probably asking too much of the student.
2. We should be less worried about the features offered by the editor than the editor's extensibility. I could live with only href, lists, bold, italic, and blockquotes if it meant the student could build an easily extensible API.
3. I think the editor should be based on hook_elements which adds the correct javascript when the element is present (as opposed to tinymce which just pops up on every text area if you select a certain page. This allows the editor to be altered directly through hook_form_alter. It also gives module developers direct control over the wysiwyg's defaults.
4. The editor should never add attributes to anything. Only classes...
5. I think WYSIWYM is superior to WYSIWYG, there are some good arguments for it:
http://www.456bereastreet.com/archive/200612/forget_wysiwyg_editors_use_...

Additional resources:
TinyEdit is a good place to start to wrap one's head around how to build the thing.
http://www.reindel.com/tiny_edit/#examples

cwgordon7’s picture

Hmm... a better idea might be:

Create a contributed light weight contributed Drupal 6 wysiwyg editor as a candidate for Drupal 7 core.

The advantages of this are:

1) It doesn't have to be core-quality at the start: a reasonably good job would be good enough. (Makes this task easier).

2) It allows time for feedback from the community as they begin to use Drupal 6: "I don't like this part..." or "It doesn't show up on x pages..."

3) A very interesting task, the only problem is that there are many wysiwyg editors that already exist, and some of them may serve as a platform to build on, which would be bad, as nearly all of them have severe limitations that would make them unsuitable for Drupal core.

-cwgordon7

webchick’s picture

Hm. I'm wondering if we at the very least should mark this to "postponed" until after the wysiwyg research task is done? It would seem a shame to have duplicated code for this.

I can also picture this being one of those nightmarish tasks that spirals out of control in scope creep and bikeshed arguments. Remember that these are supposed to take a week, at the outside. Building a basically functional WYetc. editor would probably take me at least two weeks, let alone working out browser quirks, etc. etc. I'm pretty -1 this, I dunno...

Who here actually has the jQuery chops to mentor this task, potentially?

webchick’s picture

Status: Needs review » Postponed (maintainer needs more info)

...for lack of a better status. :P

cwgordon7’s picture

Ok, first of all, I agree, we should postpone until the wysiwyg task is done. Second of all, I disagree... I don't see how this could take a GHOP student more than a week to finish (not to get to core-quality, just contributed-module-quality). And also, if it was done initially as a contributed module, there is less of a chance it will spiral out of control in in-depth arguments about WYSIWYG in core.

So I give a +1 to counter webchick's -1.

webchick’s picture

Status: Postponed (maintainer needs more info) » Postponed

LOL :) That leaves us at 0. :D

Ok, moving to postponed then, since we do both agree on that. :) It might turn out that there's already the perfect WYSIWYG module to drop into core and we won't need someone to do this one.

wmostrey’s picture

Status: Postponed » Postponed (maintainer needs more info)

cwgordon7, I agree with webchick that this will most likely take about 2 weeks after a lot of testing and corrections. I do feel it's a great task. So I'm postponing this until the research task is finished, and then I'm giving it a shot.

webchick, i'll be mentoring this. I'm not a jQuery expert but with the asset TinyMCE plug-in I've had my share of how this works, so I'm very willing to do this, and to learn myself in the experience as well.

webchick’s picture

Status: Postponed (maintainer needs more info) » Postponed

Marking back to postponed, as I think the status switch was accidental from reading your reply.

And if you're offering to mentor this one, then that makes me feel a lot better. Let's see how it goes. :)

wmostrey’s picture

Title: GHOP: Write the WYSIWYG that will ship with Drupal 7 » Write the WYSIWYG that will ship with Drupal 7

(I didn't actually put it from postponed to active, we posted around the same time and my form still had the orignial state, being active. Just to let you know I'm not hitting your fence ;)

wmostrey’s picture

Title: Write the WYSIWYG that will ship with Drupal 7 » GHOP: Write the WYSIWYG that will ship with Drupal 7
Assigned: Unassigned » wmostrey
Nick Lewis’s picture

Well, who's for badminton?

kourge’s picture

Status: Postponed » Closed (won't fix)

To put this bluntly, this task is insanely hard. Writing a WYSIWYG editor from scratch? There are better ways to torture yourself.

It still wouldn't be worth it even if this is split up into 9 GHOP tasks. I'm imagining a T-shirt that says "I spent my life writing a WYSIWYG editor and all I got was $300 and this silly T-shirt."

A more feasible approach is to look into developments of existing editors such as WYMeditor. It's based on jQuery, and if it's mature enough, it can be dropped right into core with some minimal gluing code.

tjholowaychuk’s picture

Blah! I always miss these GHOP tasks! I have already begun writing this WYSIWYG

http://drupal.org/project/editor