Skip to main content
Participant
September 12, 2010
Question

TLF 2.0 Bullets in editor

  • September 12, 2010
  • 1 reply
  • 1124 views

Hi All,

I am currently developing an editor with the new TLF 2.0. Everything is working fine except the bullet's functionality.

The goal is to use the bullets dynamically with different selected paragraphs.

Could you please tell me if I can implement a simple solution using ListElement and ListItemElement considering all the different cases ? It seems to be quite difficult and tedious.

For instance, the new tlf 2.0 will use 'ul' and 'li' html tags in order to create the bullets.  I would need to check when the 'ul' and 'li' start and end according to the user selection.

One of these cases would be for example :

  • test 1
  • test 2
  • test 3

with : <ul><li>test 1</li><li>test 2</li><li>test 3</li></ul>

Then, the user selects text 2 and undo the bullet :

  • test 1

    test 2

  • test 3

with : <ul><li>test 1</li></ul>test 2<ul><li>test 3</li></ul>

I need to calculate indexes of the first ListElement, the paragraph and the second ListElement in order to recreate a proper list.

Is there a simple way to implement this example and all the other cases ?

Has someone already implemented a similar solution : a dynamic bullet functionality for a rich text editor using ListElement and ListItemElement ?

Thanks a lot for your tips and help.

Regards,

MC

This topic has been closed for replies.

1 reply

Adobe Employee
September 13, 2010

Hi,

If I understand this correctly there is new operation in develoment (not yet available) which should help.  What I think you want to do is simply promote the children of the second ListElement to be a child of the ListItem.  The inprocess operation - tentatively called PromoteChildren should do all that for you.  That way it won't have a bullet.  Another way to do it would be set the content property of the second ListItem's ListMarkerFormat to be "none".

Note that TLF 2.0 doesn't have a <ul> or a <ol> tag.  Instead it has a single <list> tag that maps to ListElement.  Without built-in CSS ul and ol don't make much sense.  They are used as selectors for a list style in the browsers.  ListElement's can have paragraphs, divs, other lists as well as ListItems as their direct children.

Hope that helps,

Richard

Adobe Employee
September 13, 2010

Actually the new operation is "MoveChildrenOperation".

Richard

MC30Author
Participant
September 24, 2010

Hi Richard,

Thanks a lot for your help. I am looking forward these new features.

Thanks again for all your work.

Cheers, MC