Hello again Eric,
Based on your recent reply, I made some change to *toc-item-drop* macro the 
and it seems it work now!
Please have a look and let me know if you confirm it.

--Mohammad


\define toc-item-drop()
<$reveal default=<<actionTiddler>> type="nomatch" text=<<item>>> <!-- DON'T 
DROP ON SELF -->
   <!-- get OLDTAG and NEWTAG, exclude special TiddlyBook tags -->
   <$vars sourcetags={{{ [<actionTiddler>get[tags]] }}}
          targettags={{{ [<item>get[tags]] }}}>
   <$vars oldtag={{{ [enlist<sourcetags>!enlist<toc-ignore-tags>] }}}
          newtag={{{ [enlist<targettags>!enlist<toc-ignore-tags>] }}}>
<!-- Save the current ordering of the tiddlers with this tag -->
<$set name="order" filter="[<newtag>tagging[]]">
<!-- Remove any list-after or list-before fields from the tiddlers with 
this tag -->
<$list filter="[<newtag>tagging[]]">
<$action-deletefield $field="list-before"/>
<$action-deletefield $field="list-after"/>
</$list> 
   <$reveal default=<<modifier>> type="match" text="normal"> <!-- DROP 
BEFORE SIBLING -->
      <$action-listops $tiddler=<<actionTiddler>> $field="tags" 
$subfilter="-[<oldtag>]" />
      <$action-listops $tiddler=<<actionTiddler>> $field="tags" 
$subfilter="[<newtag>]" />
      <$action-listops $tiddler=<<oldtag>>        $field="list" 
$subfilter="-[<actionTiddler>]" />
      <$action-listops $tiddler=<<newtag>>        $field="list" 
$subfilter="+[enlist<order>] +[append<actionTiddler>putbefore<item>]" />
   </$reveal>
   <$reveal default=<<modifier>> type="match" text="shift"> <!-- DROP AFTER 
SIBLING -->
      <$action-listops $tiddler=<<actionTiddler>> $field="tags" 
$subfilter="-[<oldtag>]" />
      <$action-listops $tiddler=<<actionTiddler>> $field="tags" 
$subfilter="[<newtag>]" />
      <$action-listops $tiddler=<<oldtag>>        $field="list" 
$subfilter="-[<actionTiddler>]" />
      <$action-listops $tiddler=<<newtag>>        $field="list" 
$subfilter="+[enlist<order>] +[append<actionTiddler>putafter<item>]" />
   </$reveal>
   <$reveal default=<<modifier>> type="match" text="ctrl"> <!-- DROP AS 
CHILD -->
      <$action-listops $tiddler=<<actionTiddler>> $field="tags" 
$subfilter="-[<oldtag>]" />
      <$action-listops $tiddler=<<actionTiddler>> $field="tags" 
$subfilter="[<item>]" />
      <$action-listops $tiddler=<<oldtag>>        $field="list" 
$subfilter="-[<actionTiddler>]" />
      <$action-listops $tiddler=<<item>>          $field="list" 
$subfilter="[<actionTiddler>]" />
   </$reveal>
</$set>
   </$vars>
   </$vars>
</$reveal>
\end



On Saturday, January 25, 2020 at 8:04:46 AM UTC+3:30, Mohammad wrote:
>
> Eric,
>
> Another issue:
>
> In the example of previous post assume you add a new tiddler tagged with A 
> named ad
> If *ad* has a list-after field with value *aa*, whenever you reorder list 
> and darg and drop *aa* to a new position, dd will be moved and appear 
> after *aa*.
> the same is true for child tiddlers with list-before field.
>
>
> --Mohammad
>
>
>
> On Saturday, January 25, 2020 at 7:30:30 AM UTC+3:30, Mohammad wrote:
>>
>> Problem with drag and drop in the author mode:  
>> http://www.TiddlyTools.com/InsideTW <http://www.tiddlytools.com/InsideTW>
>>
>> Hi Eric,
>>
>>  I think I understood what is wrong with toc-tree in author mode!
>> It seems in TiddlyTools/TOC/Macros
>>
>> the line
>>
>> <$action-listops $tiddler=<<newtag>> $field="list" $subfilter="+[append
>> <actionTiddler>putafter<item>]" />
>>
>>
>>
>> does not work on empty list or when the list field is not existed! It may 
>> be related to append.
>>
>> To reproduce the issue goto  http://www.TiddlyTools.com/InsideTW 
>> <http://www.tiddlytools.com/InsideTW>
>> create the below set of tiddlers
>> A, B both tagged with root
>> aa, ab, ac all tagged with A
>> ba, bb, bc all tagged with B
>>
>> then in a new tiddler:
>>
>> <<toc-toggle-all>>
>>
>> <<toc-tree "root">>
>>
>> Now in author mode, try to drag and drop children in the same branch or 
>> other branch.
>> Only drag onto (ctrl+drop) works!
>>
>> Now using the tag pill of A and B reorder tiddlers cause to create list 
>> field with children in A, and B.
>> Repeat drag and drop! It works now!
>>
>> --Mohammad
>>
>>
>>
>>
>>
>> On Wednesday, January 22, 2020 at 4:08:28 PM UTC+3:30, Eric Shulman wrote:
>>>
>>> On Wednesday, January 22, 2020 at 1:32:03 AM UTC-8, Mat wrote:
>>>>
>>>> Mohammad wrote:
>>>>>
>>>>> Drag and drop in tiddlywiki.com and see how amazingly it works!
>>>>>
>>>>
>>>> Thanks, both of you, for sharing. Please note that recursions can cause 
>>>> problems also: For example, go to tiddlywiki.com and tag the 
>>>> HelloThere tiddler with "Examples" (i.e to create a loop because Examples 
>>>> is a subtiddler to HelloThere). This does *not* cause problems. But if 
>>>> you add Mohammads creation you get RSOE. I'm not sure how native TW avoids 
>>>> this but know it was something that was actively dealt with a few years 
>>>> back.
>>>>
>>>
>>> This was one of my earlier TW5 contributions.  The TOC macros use an 
>>> "exclude" paramter that is dynamically updated as the recursion occurs.  
>>> Each level of recursion adds the current Tiddler to a list (using syntax 
>>> -[[tiddlername]]) so that as it dives down into the tree, any tiddler that 
>>> has already been visited in the current 'branch' is excluded from being 
>>> visited again.  This prevents infinite loops that eat up all the browser 
>>> memory and eventually cause a fatal error condition. 
>>>
>>>>
>>>> A wish: One major lacking feature of current ToC's is drag'n 
>>>> drop-ability. I.e to rearrange the branches in the tree. This would be the 
>>>> basis for a super useful outliner: The next step would be a feature to 
>>>> "open all tiddlers" in a tree or a subbranch. It'd be a very powerful tool 
>>>> for authoring longer texts.
>>>>
>>>
>>> My custom TOC macros for InsideTiddlyWiki include drag-and-drop 
>>> handling.  To try it, open http://www.TiddlyTools.com/InsideTW and then 
>>> 'unlock' the document (padlock icon in the upper right toolbar).  Then open 
>>> the TOC "slidebar" (menu icon in the upper left toolbar).  Then just 
>>> drag-n-drop items.  It supports "drop before", "drop after" and "drop into" 
>>> handling based on modifier keys (default=drop before, SHIFT=drop after, 
>>> CTRL=drop into).  The macro code is here: 
>>> http://tiddlytools.com/InsideTW/#TiddlyTools%2FTOC%2FMacros.  See also 
>>> http://tiddlytools.com/InsideTW/#TiddlyTools%2FTOC%2FTemplate and 
>>> http://tiddlytools.com/InsideTW/#TiddlyTools%2FTOC%2FStylesheet
>>>
>>>
>>> -e
>>>
>>>
>>> -e
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/941a6d96-0352-431e-94a0-c355bf5fcb8e%40googlegroups.com.

Reply via email to