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.
CKEDITOR.htmlParser->CKEDITOR.parserhtmlParser.fragment.fromHtml->htmlParser.parse- this method creates fragments, but also elements (depending on arguments).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
contentDomevent. Therefore we can introduceeditor.on2being 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 registercontentDomlistener that adds this event again.
- Firstly, it's name isn't clear and I don't see a chance to make it clear. Therefore I'd rename it to
- 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). Editor#instanceReadyto#ready(#9911).listener#removeListenerto#remove.- ?
