Sun's put a lot of work into what he hopes will eventually be the basis for core support for WYSIWYG editors. Don't know the internal workings, but wanted to make sure you're at least aware of his efforts, so if you haven't already, check them out and get in touch.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Roi Danton’s picture

Thanks for the hint. I've already asked about the abilities of his WYSIWYG API in the Drupal group. Unfortunately without an answer 'til now. See http://groups.drupal.org/wysiwyg

Inline API uses slightly different tags (based on the Image Attach module). I haven't done a discussion with him for unifying (lack of time) but maybe someone could support me/us/the Drupal community by talking to him? I'm using different tags for node/field/term embed/link because the Image Attach tags caused some confusion for some of my customers.

HansBKK’s picture

Posted here for you http://drupal.org/node/80170

and you may want to post to the WYSIWYG group here http://groups.drupal.org/wysiwyg

Roi Danton’s picture

Thanks for referencing at Inline API.

Regarding WYSIWYG API:
I've posted a question about WYSIWYG API in the group, sun answered yesterday: http://groups.drupal.org/node/16535#comments. The WYSIWYG API is currently more interesting for Linodef than Inline API though we have to see where WYSIWYG API goes (the module is still in heavy development) and how many changes are required in the Linodef structure to use it. The usefulness of WYSIWYG for Linodef could be the fact that all editors are useable with Linodef by default without having to have a support module for each editor.

Regarding Inline API:
I still have to exermine what advantages Linodef could have from Inline API. Help (e.g. testing the Inline API and write proposals) is appreciated. :)

HansBKK’s picture

Sorry I can't help much, not being much of a programmer (yet), but thanks for taking this into consideration, the more different modules with similar functions can get integrated the better off we all are.

zmove’s picture

Subscribing. WYSIWYG API is an excellent module based on the excellent idea to standardize WYSIWYG on drupal. I hope to see freelinking implementation soon.

pkej’s picture

Any support comming for any other editor? I'm not that fond of BU editor.

Roi Danton’s picture

Currently there is no ongoing development for other editors. I'm thinking about providing an independent button like image assist does it so people with unsupported editors can use a Linodef tag list (as long as Linodef doesn't use WYSIWYG API). Btw, the Linodef filter doesn't depend on an editor, just the parts for creating a button.

pkej’s picture

I'll have to learn some ajax and look into the button interface of my favourite editor(s) then.

Roi Danton’s picture

If your editor is supported by WYSIWYG API I recommend to look into its code. Especially the patch for img_assist located in #319363: Rewrite editor plugin API could be helpful. The best WYSIWYG API release for testing purposes is 6.x-2.x-dev.

Since the Linodef Button API likely uses WYSIWYG API in future it could benefit from your researches and therefore a better version could be released sooner. It will be a plugin for WYSIWYG API hence img_assist could be good start to learn how to write plugins for WYSIWYG API.

pkej’s picture

Yeah, I started there, thanks for all the links. I kind of hit a wall, for now. I am working on other projects for paying clients first ;)

GuillaumeDuveau’s picture

Subscribe

Roi Danton’s picture

Status message: I'm working on the UI for button creation by using Chaos tools suite and its multistep form wizard as well as its ajax functionality*. Buttons will be stored in the database. Also users of BUEditor will benefit since the buttons content can be cached now and inserting the buttons into BUEditor will be easier for newcomers.

When this is finished I can retrieve the buttons from the database with a WYSIWYG API plugin. This plugin is already written, I just have to add a themeable popup. This differs from the common Linodef popup because all Linodef buttons have to be part of the popup (by design of WYSIWYG API). I thought about an AJAX interface or two frames: top with list of buttons and below the content of the selected button.

*Which will partly go into D7 core, see #399982: Simplify and standardize returning an AHAH response.

entrigan’s picture

Thanks for the work Roi, is a patch coming soon? I will jump at the chance to test it.

Roi Danton’s picture

I hope I get it ready at the end of the week - before I can finalize the button interface the filter needs some rework. Otherwise the patch/commit will come end of August because I'll be off for a week.

GuillaumeDuveau’s picture

Sounds great Roi, I totally look forward from seeing that !

Roi Danton’s picture

Title: Consider support for WYSIWYG and Inline APIs » WYSIWYG API support
FileSize
5.52 KB

The taglists database tables aren't developed yet therefore I haven't committed a Linodef WYSIWYG plugin module. However the admin interface for button creation is included already so you might want to have a look at it at admin/settings/linodef/taglists. See changelog for all changes since rc3 release. The dev release gets updated with the newest commitments within a few hours.

Also you might want to have a look at the attached wysiwyg plugin (WIP - quick and dirty for tests, doesn't do anything but showing a button in wysiwyg).

I'm off for a week until 23.08.09

that0n3guy’s picture

Subscribing

HnLn’s picture

subscribe and any news on this ?

Roi Danton’s picture

I was unintentionally busy with university and work. Unfortunately I can't say a certain date when I'll be able to check the new Linodef module for bugs (taglists with user interface - on what the Linodef WYSIWYG module relies) and upload it to the dev branch.

Roulion’s picture

subscribing too

brant’s picture

Subscribe. Any news on where you are and what's left? We're setting up a new site and would love to have users storing links in useful format from the beginning. Wonder if Pathologic could be taught to convert to Linodef format so we could fix things up after-the-fact...

Roi Danton’s picture

I've done little work on the Admin interface for the taglists* (bulk delete like on admin/content/node). Still the taglist editing page, some tweaks to the DB scheme as well as modifications to the BUEditor Linodef module have to be done before the code can be committed to the dev branch.

Pathologic works quite different. It requires no tags but also can't embed content. It transforms existing links but can't reallocate them (e.g. if you change the url alias of a node). Therefore it isn't possible to transform an alias link (e.g. path/nodetitle) to a Linodef tag which includes the node id.

*a taglist is a list of content (nodes, fields, views etc) with Linodef tags attached. These lists can be used to create buttons for editors or used as blocks etc.

Roi Danton’s picture

Taglist admin interface and add/edit/delete processes are finished (see attachments). ToDo:

  • load function for taglists
  • rewrite BUEditor module to use this load function
  • alter the linodef wysiwyg plugin to use that function
  • perhaps provide a patch for the wysiwyg plugin system so it supports several buttons per plugin (depends on my time)

In the current status I can't commit the WIP code since BUEditor doesn't work with the taglists yet which would likely cause avoidable support requests.

scottrigby’s picture

Hi Roi. Short of the TODO above, does the WIP code work with other editors? If so, would you be willing to share (not commit) as an attached zip? It'd be great to begin working/playing with in the meantime, for users who want to try other editors besides BUEditor (like CKEditor).

Roi Danton’s picture

FileSize
34.99 KB

The WIP code doesn't work with WYSIWYG (which incorporates CKEditor) and also not with BUEditor correctly since the popup and list retrieve functions in linodef taglists are not altered yet. However you can test the attached module on a development installation (don't use them on production sites since it is not guaranteed that the current taglist db scheme won't change until commit). Maybe you already detect flaws in the taglist creation UI.

Steps 2 & 4 of #23 are done (WYSIWYG supports several buttons per plugin). In step 3 the javascript is not finished. Step 1 of #23 is just finished partly (30%) since it also includes optimization of caching routines and storage changes (variables of rc3 => linodef table in rc4).

Edit: minor bug in attachment. Add a comma in line 37 of linodef_wysiwyg/plugins/linodef.inc.

Roi Danton’s picture

Category: task » feature
Status: Active » Needs work

I've committed the taglists and wysiwyg module. linodef_wysiwyg still lacks proper javascript wysiwyg support. Currently the scripts aren't loaded by e.g. FCKeditor/TinyMCE. Help is appreciated.

GuillaumeDuveau’s picture

Wow ! I'll try to have a look at this next week.

Roi Danton’s picture

I've identified (one) of the problems with Javascript: The JS objects have to be Drupal.wysiwyg.plugins.linodef_taglist_id where id is the taglist ID. There should be a way to send the available taglist IDs from within the wysiwyg plugins include file (linodef_taglists.inc) to a javascript function and then create the object.

Roi Danton’s picture

Component: Miscellaneous » WYSIWYG
Status: Needs work » Needs review

With the latest commitment Linodef works with WYSIWYG as with BUEditor. I've tested it with FCK and TinyMCE and am very happy about the progress.

HowTo:

  • Get the latest dev release (wait for automatic update today/tomorrow by drupal.org) and install it at a development installation
  • Create a taglist (admin/build/taglists)
  • Edit your WYSIWYG profile (admin/settings/wysiwyg/profile/#/edit) -> Buttons and Plugins -> select those taglists that should be in the editor

Possible improvements:

  • Support a drop down list like in BUEditor - WYSIWYG doesn't provide a general drop down list for all its editors yet.
  • User defined icon - this should be a job of WYSIWYG and not of Linodef, too.
  • Substitute tags for their actual content when using rich-text - this task is as complex as #372167: How about intellisense? and both will be likely done together.
Peter Törnstrand’s picture

I added the following code to the linodef_wysiwyg plugin (linodef_taglist.js) to be able to replace the tags with something prettier for admins. The patch that fixes the path problem for the linodef_taglist.css file is also needed. Sorry I didn't create a patch for this.

/**
   * Replace all linodef tags with images.
   */
  this.attach = function(content, settings, instanceId) {
    content = content.replace(/\[#[^\]]+\]/g, function(orig, match) {
      var node = {}
      return '<img class="linodef" alt="'+orig+'" />';
    });
    return content;
  },

  /**
   * Replace linodef images with tags.
   */
  this.detach = function(content, settings, instanceId) {
    var $content = $('<div>' + content + '</div>'); // No .outerHTML() in jQuery :(
    $('img.linodef', $content).each(function(node) {
      var $self = $(this);
      var inlineTag = $self.attr("alt");
      $(this).replaceWith(inlineTag);
    });
    return $content.html();
  }