Archive | February, 2010

patched tableDND library

13 Feb

jQuer UI sortable lets you drag things to rearrange lists and apparently doesn't work on tables.

So I found this:

http://www.isocra.com/2008/02/table-drag-and-drop-jquery-plugin/

which does let you drag table rows up and down. Works pretty nicely, though it could do with some animation or shadow effects or something as it's *too* slick, the change is instantaneous. Anyway, it's a great library and works fine. I'm using it in Scrumptious to let users rearrange bookmarks in a trail.

The issue though, buried in all those comments somewhere, is that you can't drag things inside table cells. In this case, I have some button-like titles which are the obvious drag handles. In a comment, the author says this is to prevent problems with clicking on links and such-like, but I think it's too big a trade-off.

I modified "makeDraggable" to do this as follows, and it works fine.

?????? // mahemoff – patched this so dragHandle is *child* of a TD, not a TD itself
?????? // also, dragHandle is now a jQuery selector, not a class name
?????? if (table.tableDnDConfig.dragHandle) {
?????????? // We only need to add the event to the specified cells
?????????? jQuery(table.tableDnDConfig.dragHandle, table).each(function() {
?????????????? // The cell is bound to "this"
?????????????????????????????? var cell = this.parentNode;
?????????????????????????????? console.log("cell", cell);
?????????????????????????????? jQuery(cell).mousedown(function(ev) {
?????????????????????????????????????? jQuery.tableDnD.dragObject = this.parentNode;
?????????????????????????????????????? jQuery.tableDnD.currentTable = table;?????????????????????????????????????? jQuery.tableDnD.mouseOffset = jQuery.tableDnD.getMouseOffset(this, ev);
?????????????????????????????????????? if (config.onDragStart) {???????????????????????????????????????????????? // Call the onDrop method if there is one???????????????????????????????????????????????? config.onDragStart(table, this);?????????????????????????????????????? }
?????????????????????????????????????? return false;
?????????????????????????????? });
?????????? })

Advertisements

@tiddlywiki plugin – treating sections and slices as fields

12 Feb

@jermolene's generally encouraged me to use sections and slices instead of fields, being that they are more free-form, hence more tiddlyesque. This isn't always easy, because fields have better editing support. (Although the "edit" macro is sort of buggy, because it prevents you clicking on edit to edit the underlying text.)

One step in this direction is to hijack store.getValue as shown below. It's used by the "view" macro – which appears in view/edit templates – to render tiddler fields. Use the following plugin code (currently in Scrumptious's zzScrumptious.js, I might extract it later) and "view" will let you render slices and sections. So if your ViewTemplate includes:

?? <div class='bookmarkDescription' macro='view Description wikified'></div>

It will show a "Description" section if there is one, and if not, a Description slice, and if not, the Description field, if that exists.

You would normally only use this for a highly-customised tiddler view in which the "text" field (the main stuff of the tiddler) is not actually shown, i.e. you've removed from the standard View template the line ?? <div class='bookmarkDescription' macro='view Description wikified'></div>.

?? _getValue = store.getValue;
?? store.getValue = function(tiddler, field, value) {
?????? var sectionContent, slice, tiddler = store.resolveTiddler(tiddler);
?????? sectionContent = store.getTiddlerText(tiddler.title+"##"+field);
?????? console.log(tiddler.title, field, "nooot", sectionContent);
?????? if (sectionContent) return sectionContent;
?????? if (sliceContent?? = store.getTiddlerText(tiddler.title+"::"+field)) return sliceContent;
?????? return _getValue.apply(this, arguments);
?? }

end of tiddlyspace hackday 2

10 Feb
We're getting close – we now have sample users and spaces, with the ability to create a new space.

What we did today:

* completed build and instancer scripts and better understood system bags (_public and _private) – now build all bags and recipes, set up users, and pull in plugins
* continued implementing clone
* backstage UI for clone and create
* wireframed the overall UI

What we still need to do:

* dev process – streamline the client-side development process (to be discussed on the mailing list –http://groups.google.com/group/tiddlyweb/browse_thread/thread/549745e9ae96ace9)
* finish clone implementation
* membership management – adding and removing users (and ideally other stuff like invites and requests) to space. This will be client-side plugins in the global _private bag, talking to a service exposed by a new server-side plugin. One responsibility for the plugin is to ensure the redundant set of policies across all four bags/recipes is kept consistent…and ideally/eventually with a locking mechanism.
* subdomains – integrated Chris's virtualhost plugin
* improve create/clone UI
* ideally build out other UI aspects, e.g. dashboard

Philip Greenspun’s Computer-equipped treadmill

10 Feb

  1. philg

    February 1, 2010 @ 1:33 pm

    8

    I have a homemade thing that I keep meaning to write about. Maybe in another month or two! I suspect that the latest commercial incarnations are better. I have a 24??? monitor right now mounted on a swing-out wall arm. A 30??? monitor would be better, but I???m waiting until I can get one with a touch screen (the oneworldtouch.com link that Mayson helpfully provided offers a 32??? monitor but it is really a television, not a computer monitor (the resolution is 1366??768)).

    When typing, I walk uphill at 8% and at 0.7 to 1.3 mph. For surfing and reading off the Web, I can bump up to the speed to 1.5-2 mph.

twitter reactions is wonderful, here’s what it needs

9 Feb
Twitter Reactions (http://lifehacker.com/5462474/twitter-reactions-shows-what-the-twitterverse-is-saying-about-that-web-page) is a very nice tool for tracking what the twittersphere is saying about a web page. Just like embedded Scrumptious comments or Google’s sidewikis, it augments the page with comments, but in this case, those comments are tweets.

(One day, Scrumptious might do the same thing…it’s all just tiddlers and we’ll be able to have tiddlers pushed from inbound email, twitter, text messages, and elsewhere.)

Anyway, @RWW asks what features we want?

My inclination is “nothing; KISS”. But one thing I would really want is some kind of filter to avoid showing tweets that are just in the format “http://the/link the title” (with some kind of fuzzy matching). Not that there’s anything wrong with tweets like that, but it’s just not the kind of thing I need to see when I’m looking for reactions.

brave @dalmaer proves #webos is So Just Web with a dash of live coding #o2palm

8 Feb
Photo

Please admire this photo…i risked leaving tweetdeck open in front of @codepo8 to go to the front and snap it.

.@prem visiting the osmoplex, about to demo iframe ninjary

8 Feb
Photo