[dev] Imple rewrite issues

Michael J Rubinsky mrubinsk at horde.org
Wed Jun 6 14:31:50 UTC 2012


Quoting Michael M Slusarz <slusarz at horde.org>:

> Quoting Michael J Rubinsky <mrubinsk at horde.org>:
>
>> Quoting Michael M Slusarz <slusarz at horde.org>:
>>
>>> Quoting Michael J Rubinsky <mrubinsk at horde.org>:
>>>
>>>> I wasn't planning on looking at any of this now, but it's  
>>>> interfering with my normal workflow now so I've started looking  
>>>> at things enough to fix what I need. I fixed a few issues I was  
>>>> having that was preventing the portal page from loading fully  
>>>> when the Mnemo Notes block or the Weather block are present. I've  
>>>> also fixed a few issues with Kronolith's traditional view sidebar.
>>>>
>>>> The tagging functionality, however, in Kronolith is completely  
>>>> broken. The TagActions Imple was removed, so the code responsible  
>>>> for attaching ajax actions to the "delete tag" icons and for  
>>>> attaching the the ajax action to to the "add" button for each  
>>>> calendar's tagger is now missing. Also, the fallback action for  
>>>> the buttons (to actually submit the page for non-javascript  
>>>> browsers) is missing as well.
>>>
>>> The Kronolith tagging was unintentionally lost.  Much like the  
>>> Ansel imple tag - these were the two imples that were so far off  
>>> from what imples were originally designed to do that it pretty  
>>> much stopped my refactoring in its place.  The eventual correct  
>>> solution *at least as done in Ansel) was to realize that none of  
>>> these tagging actions were appropriate for imples
>>
>> I have to say that I don't see why tagging (as done in the  
>> traditional interface) is out of the scope for imples. We are  
>> attaching ajax actions to UI elements (deleting that tag, adding  
>> the tag). The complicating factor is of course that some of the UI  
>> elements (new tags) are added via ajax calls. Another complicating  
>> factor was the original requirement that the tagging form fail  
>> gracefully in the absence of javascript.
>
> It doesn't fit the imple paradigm, because there is not a 1 -> 1  
> mapping of the DOM element to the imple handle.  These tagging  
> functions are doing different actions depending on when/where in the  
> page they are accessed.  Example: in Ansel, clicking on a DOM  
> element at various times during a page view will either bring up the  
> tag interface, change/add the tag, or delete the tag.

This is not technically true. Each imple was bound to a specific DOM  
element. Nowhere in Ansel could you perform different actions by  
clicking on the _same_ DOM element. I.e, The only way to add a new tag  
(as far as imples are concerned) was to enter it in the text box and  
click the 'Add' button. The Add button was bound to one Imple.  
Likewise, the only way to delete a tag was to click the delete link  
('x') next to said tag. This, too, was bound to a separate imple.  
Clicking the tag, itself, would navigate to the browse view - and was  
not connected to any Imple.


> This is not what imples were designed to do.  Compare to the other  
> imples that have defined behavior (spellchecker, autocompleter,  
> passhprase dialogs) that never changes once bound to a DOM element.

See above. While I agree that tags are not as clear cut as e.g., the  
autocompleter, Ansel still only ever bound a single Imple to a single  
DOM element. The only difference is that a single general  
functionality, "tagging", is utilizing a number of different imples to  
perform various tasks - autocompleting (bound to the text box), adding  
(bound to the "Add" button), and deleting (bound to the "delete" link).

> Imples were never designed to package all related javascript/PHP  
> actions into a single file.  That appears to be what the tag actions  
> were trying to do, which is a fundamentally incorrect usage of  
> imples (again with the caveat that imples may have been used  
> originally since there was no other Horde-level way to do AJAX  
> actions.  But now that this exists, the latter reasoning is no  
> longer valid).

While it may have been using a single Imple class that was capable of  
different actions each DOM element was bound to it's own instance of  
the imple.

I'm fine with moving this to the Ajax framework after I'm finished  
with my other commitments, but I have to say, and I don't mean to  
sound like a jerk about it, but having this completely break so close  
to a release that we are on such a tight schedule for is frustrating.

>>> It would be nice if somehow tagging functionality shared between  
>>> ansel and kronolith could be abstracted into a base Imple, to  
>>> create a unified-API for tagging in future Horde applications
>>
>> We might be able to share some js/imple code for the tagger, but we  
>> would still need to eventually have the application's tagger object  
>> do the actual tagging since we need to enfore some application  
>> specific rules/logic.
>
> Looking at the code, there is really zero code shared.  And the UI  
> is not the same in the two applications.  Which indicates that  
> tagging actions are not a good candidate for imples and are instead  
> core functionality that should directly be built into the  
> application's UI.
>
> michael
>
> ___________________________________
> Michael Slusarz [slusarz at horde.org]
>
> -- 
> dev mailing list
> Frequently Asked Questions: http://wiki.horde.org/FAQ
> To unsubscribe, mail: dev-unsubscribe at lists.horde.org


-- 
mike

The Horde Project (www.horde.org)
mrubinsk at horde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6096 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.horde.org/archives/dev/attachments/20120606/927ec900/attachment.bin>


More information about the dev mailing list