Opened 12 years ago

Last modified 12 years ago

#10536 confirmed Bug

API imporevements — at Initial Version

Reported by: Piotrek Koszuliński Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

I'd like to gather in this ticket some API improvements we could make. Of course most of them are not obvious, so they can be controversial. Also, in every case backward compatibility should be ensured.

  1. CKEDITOR.htmlParser -> CKEDITOR.parser
  2. htmlParser.fragment.fromHtml -> htmlParser.parse - this method creates fragments, but also elements (depending on arguments).
  3. editable.attachListener
    • Firstly, it's name isn't clear and I don't see a chance to make it clear. Therefore I'd rename it to editable.on2. Similarly to bookmarks and bookmarks2.
    • Secondly, it is always used with contentDom event. Therefore we can introduce editor.on2 being a combination of both. This should simplify our code, but also would make it simpler to explain that to others. This method would executed listener immediately if editor already has initialized editable and would always register contentDom listener that adds this event again.
  4. We can change some get* to their simpler versions (*). E.g.: getParent, getFirst, getLast, getPrevious, getNext, getName, getChild, getSelection, getDocument, getRanges, etc. It's for making code easier to write. It won't save a significant number of kbytes (I've made a static analysis and saved ~1% in gzipped package after making even more changes).
  5. Editor#instanceReady to #ready (#9911).
  6. listener#removeListener to #remove.
  7. ?

Change History (0)

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy