Hi Tobias,
that's a very intersting topic, although I don't know any existing code to
suggest. My view on how this should work is based on the fact that there
are different way to create lists (for instance, forEachTiddlerPlugin).
That's why I'd expect manual sorting to be somewhat external for the
list-creating engine (it can be "wikitext list" or list macro or any other
macro). So the idea is that it can either a macro to be put before/after
the list:
<<sortList>>
* first item
* second item
<<sortList>>
<<list filter "...">>
etc or an engine that is applied to each list and doesn't require any wiki
markup at all. Second design question is where and how (in what format) to
store the list order. In the case of a <<sortList>> macro that's quite
simple: either as a param: <<sortList someParamDescribingCurrentOrder>> or
in a cookie: <<sortList txtOrderOfThisList>>. But more puzzling question is
how to store the data about the order? Even if that's a wikitext list, the
order can be some sort of hashmap:
<<sortList {{ {
i1: "fir",
i2: "sec"
} }}>>
actually, in this example that's enough to store just "f" and "s" to
distinguish; but what if the list is changed?
* first
* forth
what order to apply? And if the list is auto-aggregated, this becomes even
harder to figure how to store the order..
Although, when the length of the list is fixed, the order can be stored as
a permutation:
<<sortList {{ {
i1: 2,
i2: 1
} }}>>
but things like <<list filter "[tag[myTag]]">> won't work well with this..
Best regards,
Yakov.
четверг, 7 марта 2013 г., 17:02:54 UTC+4 пользователь Tobias Beer написал:
>
> Hi everyone,
>
> Dragging and sorting (nested) lists has been available in jQuery for quite
> some time via plugins.
>
> Following PMario's post here [1]...
> https://groups.google.com/d/msg/tiddlywiki/0x8a2vdUvdE/fWb6T5BpSv0J
>
> ...the topics / questions for this discussion are:
>
> A) Are there existing implementations for persisting the sort order of
> draggable lists TW?
>
> B) What are the methods for persisting the sort order? What seems
> generally required, method-wise?
>
> C) Are these methods generic enough to be reused by the core and plugins?
>
>
> ...and for @PMario...
>
> D) What are these (proposed / implemented / core) methods (of yours) and
> where are they implemented?
>
>
> Cheers, Tobias.
>
>
> [1]
> Am Donnerstag, 7. März 2013 11:55:37 UTC+1 schrieb PMario:
>>
>> Hi Tobias,
>> I'd want to talk with you about this. I did similar things with my
>> XListPlugin [1], but made it compatible to core list macro, so it can
>> handle the sort order. There is no need for someone to use XListPlugin
>> to get the desired result. Which makes it good to use with eg:
>> TiddlySpace.
>>
>> I did also contribute some code to the core, that was accepted, that
>> lets you do drag and drop sorting without any additional <<list>>
>> plugins like XListPlugin. There is enough information in the default
>> rendering now to get it to work.
>>
>> For the @chat project (a year ago), I did introduce a uniqe id for
>> tiddlers, that isn't changed, even if you do change its name.
>>
>> It would be nice, if we could make our stuff compatible, otherwise we
>> will end up having a lot of custom fields that don't play together,
>> and implement redundant functionality.
>>
>> -m
>> [1] http://apm-plugins.tiddlyspot.com/#XListPlugin
>> [2] http://chat.tiddlyspace.com/
>
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.