вторник, 20 мая 2014 г., 19:39:54 UTC+4 пользователь Shankar Swamy написал:
>
>
>
> Imagine this: I save the contents of each textarea in an array.  I load 
> them into dynamically created textareas via a javascript function when I 
> load the tiddler.  When I want to save, I write a JSON string and save it 
> as a tiddler.  When I load the tiddler again, I read from the JSON string.  
> You get the idea.  So that part is taken care of.  For my use, the sizes of 
> the textarea content etc are small enough that there will be no performance 
> issues here.  Though I have not done this yet, I think it is doable and I 
> know how to do it - pehaps after a bit of fighting to get the right 
> alignment of text areas inside the table cells etc :-).
>
> Here is what I don't know how to do it (possibly I have not had enough 
> time invested in this to solve it yet, I agree)  say I now I drag one cell 
> over the other (or, one text area over the other), all I need is a callback 
> to a javascript function indicating which cell was dragged over which one.  
> Once I have that, I can swap the two textareas in my javascript array and 
> redraw the table.  I saw a couple of examples on the Internet that use 
> HTML5 and javascript. I tried them with <HTML> and <script> tags inside 
> tiddlers and they did not work. May be I should go back and investigate why 
> they failed. But I am hoping someone might already have an example of a 
> simple drag and drop working in TWC for me to start with rather than go 
> debug this  which is my default option now.
>
> Did I completely miss your point?
>
> Well, my point is two-wise:

first, any control of what part of the markup corresponded to which part of 
(wikified) html seems to be complicated. For instance, because the table 
can be transcluded. And also not each pipe symbol divides cells: 
[[prettyLink|also contains pipe symbols]]; etc. Consistent approach would 
be changing the wikifier or some other complicated thing, even to 
understand how the wikifier [1] works is not as simple as one would desire;

second, the twve plugin set already implements such stuff, and there's 
"move colomn to the left/right" and "move raw up/down" options (buttons), 
so drag&drop "move to an arbitrary position" action shouldn't be difficult 
to implement. Moreover, Vincent has created the "base" plugin "twve.core" 
which should ease the access to the markup that corresponds to the 
generated DOM, and it would be natural to add the "drag&drop sort" 
functionality to twve.table, so I encourage you to discuss this with 
Vincent.

I could even try to review your code and help with "why it doesn't work" (I 
haven't understood you idea well from the description), but it seems 
counter-productive as the functionality you describe sounds natural to add 
to twve and implementing it in another plugin will quite probably cause 
conflicts between the two (as both modify tiddler text from the view mode).

Best regards,
Yakov.

[1] https://github.com/TiddlyWiki/tiddlywiki/blob/master/js/Wikifier.js
 

> Thanks for the response.
>
> Cheers; 'best,
> shankar
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to