[dev] Imple rewrite issues

Michael M Slusarz slusarz at horde.org
Tue Jun 5 20:04:38 UTC 2012


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 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.

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).

>> 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]



More information about the dev mailing list