Hi Mat ,

looking at your evolving TidBitz , I would do this:

modify the $:/core/ui/ViewTemplate like so:

<$set name="storyTiddler" value=<<currentTiddler>>><$set 
name="tiddlerInfoState" value=<<qualify "$:/state/popup/tiddler-info">>><$set 
name="curr" value=<<qualify "$:/tidbitz/scratch">> ><$tiddler tiddler=<
<currentTiddler>>><$droppable actions="""<<TidBit-dropactions>>"""><div 
class=<<frame-classes>>><$list 
filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]!has[draft.of]]" 
variable="listItem"><$transclude tiddler=<<listItem>>/></$list></div>
</$droppable></$tiddler></$set></$set></$set>


Then I'd modify the TidBit-dropactions Macro: 

Note: you need a tiddler (I call it $:/list/numbers) with a list of 
integers from 1 to a big number in its list field. You can get one from 
here: 
http://tiddlytouch.tiddlyspot.com/#%24%3A%2Fplugins%2FBTC%2Ftiddly-touch%2Flists%2Fnumbers


\define setScratchTiddlerField()
<$action-setfield $tiddler="""$(curr)$""" $field=
"tidbit-row-$(nextTidbitCount)$" $value="""your TidBit""/>
\end
\define TidBit-dropactions()
<$set name=TidBit filter="[[$(actionTiddler)$]removeprefix[TidBit/]]">
<$wikify name="id" text=<<TidBit-id>>>
<$wikify name="TidBitid" text=<<TidBitid>>>
<$list filter="[[$(actionTiddler)$/temp]fields[]prefix<TidBitid>!suffix[-id
]]" variable="fld">
  <<TidBit-setfields>>
</$list>
</$wikify>
<$set name="tidbitCount" filter="[[$(curr)$]fields[]prefix[tidbit-row]count
[]]">
<$set name="nextTidbitCount" filter="[<tidbitCount>next[$:/list/numbers]]">

<<setScratchTiddlerField>>

</$set>
</$set>
</$wikify>
</$set>
\end


You then modify the $:/core/ui/ViewTemplate/body
There you can access the <<curr>> :

\define renderTidbit()

$(tidbitContent)$

\end
\define getScratchFieldsContent()
<$list filter="[[$(curr)$]get[tidbit-row-$(tidbitRow)$]]" variable=
"tidbitContent">
<<renderTidbit>>
</$list>
\end
<$set name="tidbitCount" filter="[<curr>fields[]prefix[tidbit-row]count[]]">
<$list filter="[list[$:/list/numbers]limit<tidbitCount>]" 
variable="tidbitRow">

<<getScratchFieldsContent>>

</$list>
</$set>

I haven't tested this code but it's the basic idea

...

Then I'd make the tidbitContent within renderTidbit() draggable and place a 
droppable surrounding it
The droppable actions there have access to the $(curr)$ and to the unique 
field where the tidbit is stored: tidbit-row-$(tidbitRow)$ 

So, the draggable must be: <$draggable tiddler="tidbit-row-$(tidbitRow)$">
and the droppable actions then should do nothing else than exchanging the 
contents of the tidbit-row-fields 


-----------------------------------------------------------------------

If this works, you probably need a solution for preventing the full-tiddler 
droppable not to trigger when re-ordering tidbits within a tiddler
There are solutions that can be done by applying css classes to the 
draggable widgets and preventing things by css in a stylesheet tiddler
That can be figured out in the end

BTC

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/f858e316-ed2f-4083-8ace-08fd2cf33c40%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to