Changes between Initial Version and Version 1 of Ticket #11341, comment 6


Ignore:
Timestamp:
Jan 19, 2014, 4:07:23 PM (6 years ago)
Author:
Piotrek Koszuliński
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11341, comment 6

    initial v1  
    551. Link plugin cannot handle link inside <figure>, because it's image2's territory.
    662. Linked captioned image has to stay linked when caption is removed and vice versa. This has to be handled by image2.
    7 3. We should not duplicate link feature inside image2 dialog. This will require code duplication or reusing link tabs from link dialog, but the latter is very hard, because non-widget dialogs are not reusable, because they don't implement model interface (like widget's data).
    8 4. In the old image dialog, link tab is very basic because it duplicates links code instead of reuse it.
     73. We should not duplicate link feature inside image2 dialog. This would require code duplication or reusing link tabs from link dialog, but the latter is very hard, because non-widget dialogs are not reusable. Additionally, link button would have to work in any case, so it's just simpler to open link dialog.
     84. In the old image dialog, link tab is very basic because it duplicates links code instead of reusing it.
    99
    1010Therefore:
     
    12121. Link dialog should be reused to link captioned image2.
    13132. Image2 does not have to create link - it has to update image2's data with link's properties. Link should be created only when downcasting image2 or removing caption.
    14 3. By default link command opens link dialog in the old way. If data object has not been passed to the dialog, the dialog looks for <a href> element as it does now, scans it and transforms it to data object which is passed to every field on setup and commit. (FYI: Link plugin does this already!) The only difference will be that we will be able to pass custom data object to link dialog.
     143. By default link command will open link dialog in the old way. If data object has not been passed to the dialog, the dialog looks for `<a href>` element in current selection as it does now, scans it and transforms it to data object which is passed to every field on setup and commit. (FYI: Link plugin does this already! The only difference will be that we will be able to pass custom data object to link dialog.)
    15154. Now, image2 has to pass link data object to link dialog when opening it on captioned image2 (empty object has to be passed if image is not yet linked). This can be achieved e.g. by listening on link's command exec and altering the default action.
    16165. On commit, widget's data has to be updated.
     
    1818What cannot be solved:
    1919
    20 1. Applying link to selection containing more than a widget. In this case link will be applied the old way, only to nested editables.
     201. Applying link to selection containing more than a widget. In this case link will be applied the old way, only to nested editables. For me it's acceptable and even expected.
    2121
    2222What has to be checked:
    2323
    24 1. How data object can be passed to dialog.
     241. How data object can be passed to dialog. Especially that passing data object to dialog fields may become a standard, so a clean way of doing that would be reused in the future in other dialogs.
     252. What worries me though, is that widgets pass widget instance to the dialog fields, so there will be already two ways to setup a dialog. Therefore, we may use the same idea as implemented in widgets for links. Instead of passing data object, link object (instance of link feature class) would be passed. A model interface would be mixed in link class (the same way as CKEDITOR.event is) adding #setData method and #data property and event. Additionally I would implement transactions (start, end methods), because currently in widgets to avoid too much #data events, we cancel them during committing dialog and fire one at the end. If this idea is implemented we'll have one, standardised way of setting up and committing dialogs.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy