Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2008-05-03 22:57:42

NBrepresent
New member
Registered: 2008-01-20
Posts: 6

Suggestions on where to start for creating a new plugin?

Hi, I'd like to know which plugin would be the closest to work from, to basically create a plugin that will wrap highlighted text with a bit of code, like

<span class="foo"> highlighted </span>

when a toolbar button is clicked.

It seems like this is just similar to what clicking italic or bold on the toolbar does... On the same topic, is there already a plugin for wrapping highlighted text in custom strings?

Offline

#2 2008-05-04 18:41:23

NBrepresent
New member
Registered: 2008-01-20
Posts: 6

Re: Suggestions on where to start for creating a new plugin?

I found this function that looks like it would do what I am saying, but it's commented as being buggy:

/**
 *  Call this function to surround the existing HTML code in the selection with
 *  your tags.  FIXME: buggy! Don't use this 
 * @todo: when will it be deprecated ? Can it be removed already ?
 * @private (tagged private to not further promote use of this function)
 * @deprecated
 */
Xinha.prototype.surroundHTML = function(startTag, endTag)
{
  var html = this.getSelectedHTML();
  // the following also deletes the selection
  this.insertHTML(startTag + html + endTag);
};

So how do I accomplish the same without using this deprecated function?

Offline

Board footer

Powered by FluxBB