<https://lh5.googleusercontent.com/-VRzHCDkGS9g/UTMosZhg06I/AAAAAAAAAAM/PJSoddsiLKQ/s1600/screenshot.tif>
A couple more things:

Here is the version that I adapted it for TW. For this test, I actually 
used jQuery.sortable() instead of the DragSort library, but it works fine. 
The only problem is that TW doesn't recognize the $.cookie function...

*<html>
<style>
#sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
#sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; 
font-size: 1.4em; height: 18px; }
#sortable li span { position: absolute; margin-left: -1.3em; }
</style>
<ul id="sortable">
<li class="ui-state-default"><span class="ui-icon 
ui-icon-arrowthick-2-n-s"></span>Item 1</li>
<li class="ui-state-default"><span class="ui-icon 
ui-icon-arrowthick-2-n-s"></span>Item 2</li>
<li class="ui-state-default"><span class="ui-icon 
ui-icon-arrowthick-2-n-s"></span>Item 3</li>
<li class="ui-state-default"><span class="ui-icon 
ui-icon-arrowthick-2-n-s"></span>Item 4</li>
<li class="ui-state-default"><span class="ui-icon 
ui-icon-arrowthick-2-n-s"></span>Item 5</li>
<li class="ui-state-default"><span class="ui-icon 
ui-icon-arrowthick-2-n-s"></span>Item 6</li>
<li class="ui-state-default"><span class="ui-icon 
ui-icon-arrowthick-2-n-s"></span>Item 7</li>
</ul>
</html>
<script>
jQuery(function() {
     jQuery( "#sortable" ).sortable({
          stop: saveOrder,
          create: retrieveOrder
     });
     jQuery( "#sortable" ).disableSelection();
});

/*-- save sort order to cookie --*/
function saveOrder() {
    var data = $("#list li").map(function() { return $(this).html(); 
}).get();
    var serialStr = data.join("|");
    $.cookie("listSort", serialStr, {expires: 10000});
};
        
/*-- retrieve order from cookie --*/
function retrieveOrder() {
        var order = $.cookie('listSort').split("|");
    var el = $('#list');
    var map = {};

    $('#list li').each(function() { 
                var el = $(this);
                map[el.html()] = el;
    });

    for (var i = 0, l = order.length; i < l; i ++) {
                if (map[order[i]]) {
                    el.append(map[order[i]]);
           }
    }
};
</script>*

And here is a screenshot of what it looks like it TW.

Still haven't figured out how to post my TW online (but I'll get there :)

Thanks!

On Saturday, March 2, 2013 6:51:31 PM UTC-8, Tobias Beer wrote:
>
> I guess the trouble is not so much one of cookies or persistence in 
> general... it really is: to come to a decision on where to store the 
> ordering information of the list and to eventually implement it.
>
> To me it sounds like two things are required:
> 1) an unchangeable hash identifying a tiddler even after name changes
> 2) a "kanban board" tiddler that serves as the store for order as well as 
> state information with respect to the hashes in 1)
>
> 1) is simply done by adding a "hash" field that is populated when first 
> needed and reused throughout whichever use case requires a reliable 
> identifier which the tiddler title is not... I guess a 'hash' should really 
> become a(n potentially optional yet universal) property of the thing called 
> a tiddler.
> 2) states and ordered lists could be stored into a single (custom) 
> "kanban" field using json, whereas (references to the hashes of ) task 
> items would be grouped into states along with the ordering information.
>
> Cheers, Tobias.
>

-- 
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 http://groups.google.com/group/tiddlywiki?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to