<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>0xDECAFBAD - Tag: javascript</title>
    <link href="http://decafbad.com/blog/atom.xml" rel="self"/>
    <link href="http://decafbad.com/blog"/>
    <updated>2011-11-16T16:29:50+00:00</updated>
    <id></id>
    <author>
        <name></name>
        <email>l.m.orchard@pobox.com</email>
    </author>
    

    <entry>
        <title>HTML5 drag and drop in Firefox 3.5</title>
        <link href="http://decafbad.com/blog/2009/07/15/html5-drag-and-drop"/>
        <updated>2009-07-15T15:26:40+00:00</updated>
        <id>http://decafbad.com/blog/2009/07/15/html5-drag-and-drop</id>
        <content type="html">&lt;p&gt;&lt;i&gt;
Oh hey, look! It's another blog post—and this one
&lt;a href=&quot;http://hacks.mozilla.org/2009/07/html5-drag-and-drop/&quot;&gt;is cross-posted on hacks.mozilla.com&lt;/a&gt;.
I won't say this is the start of a renewed blogging habit, but let's see what happens.
&lt;/i&gt;&lt;/p&gt;






&lt;div id=&quot;introduction&quot;&gt;
    &lt;p&gt;
        Drag and drop is one of the most fundamental interactions
        afforded by graphical user interfaces.  In one gesture, it
        allows users to pair the selection of an object with the
        execution of an action, often including a second object in the
        operation.  It's a simple yet powerful UI concept used to
        support copying, list reordering, deletion (ala the Trash / Recycle Bin),
        and even the creation of link relationships.
    &lt;/p&gt;&lt;p&gt;
        Since it's so fundamental, offering drag and drop in web
        applications has been a no-brainer ever since browsers first
        offered mouse events in DHTML.  But, although
        &lt;code&gt;mousedown&lt;/code&gt;, &lt;code&gt;mousemove&lt;/code&gt;, and
        &lt;code&gt;mouseup&lt;/code&gt; made it possible, the implementation has been
        limited to the bounds of the browser window.  Additionally,
        since these events refer only to the object being dragged,
        there's a challenge to find the subject of the drop when
        the interaction is completed.
    &lt;/p&gt;&lt;p&gt;

        Of course, that doesn't prevent most modern JavaScript
        frameworks from abstracting away most of the problems and
        throwing in some flourishes while they're at it.  But, wouldn't
        it be nice if browsers offered first-class support for drag and
        drop, and maybe even extended it beyond the window sandbox?
    &lt;/p&gt;&lt;p&gt;
        As it turns out, this very wish is answered by the HTML 5 specification 
        &lt;a target=&quot;_new&quot; href=&quot;http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#dnd&quot;&gt;section on new drag-and-drop events&lt;/a&gt;, and 
        &lt;a target=&quot;_new&quot; href=&quot;https://developer.mozilla.org/En/DragDrop/Drag_and_Drop&quot;&gt;Firefox 3.5 includes an implementation&lt;/a&gt; of those events.
    &lt;/p&gt;&lt;p&gt;
        If you want to jump straight to the code, I've put together 
        &lt;a target=&quot;_new&quot; target=&quot;_new&quot; target=&quot;_new&quot; href=&quot;http://decafbad.com/2009/07/drag-and-drop/api-demos.html&quot;&gt;some simple demos&lt;/a&gt; 
        of the new events.  
    &lt;/p&gt;&lt;p&gt;

        I've even scratched an itch of my own and
        built &lt;a target=&quot;_new&quot; target=&quot;_new&quot; target=&quot;_new&quot; href=&quot;http://decafbad.com/2009/07/drag-and-drop/outline.html&quot;&gt;the beginnings of an outline editor&lt;/a&gt;,
        where every draggable element is also a drop target—of which
        there could be dozens to hundreds in a complex document, something
        that gave me some minor hair-tearing moments in the past
        while trying to make do with plain old mouse events.
    &lt;/p&gt;&lt;p&gt;
        And, all the above can be downloaded or cloned from 
        &lt;a href=&quot;http://github.com/lmorchard/fx35-drag-and-drop&quot;&gt;a GitHub repository&lt;/a&gt;
        I've created especially for this article—which continues after the jump.
    &lt;/p&gt;
&lt;/div&gt;




&lt;!--more--&gt;




&lt;div id=&quot;events&quot;&gt;

    &lt;h2&gt;The New Drag and Drop Events&lt;/h2&gt;
    &lt;p&gt;
        So, with no further ado, here are the new drag and drop events,
        in roughly the order you might expect to see them fired:
    &lt;/p&gt;
    &lt;dl&gt;
        &lt;dt&gt;&lt;code&gt;dragstart&lt;/code&gt;&lt;/dt&gt;
        &lt;dd&gt;
            A drag has been initiated, with the dragged element as the
            event target.
        &lt;/dd&gt;

        &lt;dt&gt;&lt;code&gt;drag&lt;/code&gt;&lt;/dt&gt;
        &lt;dd&gt;
            The mouse has moved, with the dragged element as the event target.
        &lt;/dd&gt;
        &lt;dt&gt;&lt;code&gt;dragenter&lt;/code&gt;&lt;/dt&gt;
        &lt;dd&gt;
            The dragged element has been moved into a drop listener,
            with the drop listener element as the event target.
        &lt;/dd&gt;
        &lt;dt&gt;&lt;code&gt;dragover&lt;/code&gt;&lt;/dt&gt;

        &lt;dd&gt;
            The dragged element has been moved over a drop listener,
            with the drop listener element as the event target.  Since
            the default behavior is to cancel drops, returning
            &lt;code&gt;false&lt;/code&gt; or calling &lt;code&gt;preventDefault()&lt;/code&gt; in
            the event handler indicates that a drop is allowed here.
        &lt;/dd&gt;
        &lt;dt&gt;&lt;code&gt;dragleave&lt;/code&gt;&lt;/dt&gt;
        &lt;dd&gt;
            The dragged element has been moved out of a drop listener,
            with the drop listener element as the event target.
        &lt;/dd&gt;

        &lt;dt&gt;&lt;code&gt;drop&lt;/code&gt;&lt;/dt&gt;
        &lt;dd&gt;
            The dragged element has been successfully dropped on a drop
            listener, with the drop listener element as the event
            target.
        &lt;/dd&gt;
        &lt;dt&gt;&lt;code&gt;dragend&lt;/code&gt;&lt;/dt&gt;
        &lt;dd&gt;
            A drag has been ended, successfully or not, with the
            dragged element as the event target.
        &lt;/dd&gt;
    &lt;/dl&gt;

    &lt;p&gt;
        Like the mouse events of yore, listeners can be attached to
        elements using &lt;code&gt;addEventListener()&lt;/code&gt; 
        directly or by way of your favorite JS library.  
    &lt;/p&gt;&lt;p&gt;
        Consider the following example using jQuery, 
        &lt;a target=&quot;_new&quot; target=&quot;_new&quot; target=&quot;_new&quot; href=&quot;http://decafbad.com/2009/07/drag-and-drop/api-demos.html#newschool&quot;&gt;also available as a live demo&lt;/a&gt;:
    &lt;/p&gt;
    &lt;pre lang=&quot;javascript&quot; line=&quot;1&quot;&gt;
&lt;div id=&quot;newschool&quot;&gt;
    &lt;div class=&quot;dragme&quot;&gt;Drag me!&lt;/div&gt;
    &lt;div class=&quot;drophere&quot;&gt;Drop here!&lt;/div&gt;
&lt;/div&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
    $(document).ready(function() {
        $('#newschool .dragme')
            .attr('draggable', 'true')
            .bind('dragstart', function(ev) {
                var dt = ev.originalEvent.dataTransfer;
                dt.setData(&quot;Text&quot;, &quot;Dropped in zone!&quot;);
                return true;
            })
            .bind('dragend', function(ev) {
                return false;
            });
        $('#newschool .drophere')
            .bind('dragenter', function(ev) {
                $(ev.target).addClass('dragover');
                return false;
            })
            .bind('dragleave', function(ev) {
                $(ev.target).removeClass('dragover');
                return false;
            })
            .bind('dragover', function(ev) {
                return false;
            })
            .bind('drop', function(ev) {
                var dt = ev.originalEvent.dataTransfer;
                alert(dt.getData('Text'));
                return false;
            });
    });
&lt;/script&gt;
    &lt;/pre&gt;
    &lt;p&gt;
        Thanks to the new events and jQuery, this example is both short
        and simple—but it packs in a lot of functionality, as the rest
        of this article will explain.  
    &lt;/p&gt;&lt;p&gt;
        Before moving on, there are at least three things about the above
        code that are worth mentioning:
    &lt;/p&gt;
    &lt;ul&gt;
        &lt;li&gt;

            &lt;p&gt;
                Drop targets are enabled by virtue of having
                listeners for drop events.  But, 
                &lt;a target=&quot;_new&quot; href=&quot;http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#drag-and-drop-processing-model&quot;&gt;per the HTML 5 spec&lt;/a&gt;,
                draggable elements need an
                attribute of &lt;code&gt;draggable=&quot;true&quot;&lt;/code&gt;, set either in
                markup or in JavaScript.  
            &lt;/p&gt;
            &lt;p&gt;
                Thus, &lt;code&gt;$('#newschool&amp;nbsp;.dragme').attr('draggable', 'true')&lt;/code&gt;.
            &lt;/p&gt;

        &lt;/li&gt;
        &lt;li&gt;
            &lt;p&gt;
                The original DOM event (as opposed to jQuery's event
                wrapper) offers a property called &lt;code&gt;dataTransfer&lt;/code&gt;.
                Beyond just manipulating elements, the new drag and drop
                events accomodate the transmission of user-definable data
                during the course of the interaction.  
            &lt;/p&gt;
        &lt;/li&gt;
        &lt;li&gt;
            &lt;p&gt;

                Since these are first-class events, you can apply 
                &lt;a target=&quot;_new&quot; href=&quot;http://icant.co.uk/sandbox/eventdelegation/&quot;&gt;the technique of Event Delegation&lt;/a&gt;.
            &lt;/p&gt;&lt;p&gt;
                What's that?  Well, imagine you have a list of 1000
                list items—as part of a deeply-nested outline document,
                for instance.  Rather than needing to attach listeners
                or otherwise fiddle with all 1000 items, simply attach
                a listener to the parent node (eg. the
                &lt;code&gt;&lt;ul&gt;&lt;/code&gt; element) and all events from
                the children will propagate up to the single parent listener.
                As a bonus, all new child elements added after page
                load will enjoy the same benefits.
            &lt;/p&gt;&lt;p&gt;
                &lt;a target=&quot;_new&quot; target=&quot;_new&quot; target=&quot;_new&quot; href=&quot;http://decafbad.com/2009/07/drag-and-drop/api-demos.html#delegated&quot;&gt;Check out this demo&lt;/a&gt;, 
                and 
                &lt;a target=&quot;_new&quot; target=&quot;_new&quot; href=&quot;http://decafbad.com/2009/07/drag-and-drop/js/drag-delegated.js&quot;&gt;the associated JS code&lt;/a&gt; 
                to see more about these events and Event Delegation.
            &lt;/p&gt;

        &lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;




&lt;div id=&quot;datatransfer&quot;&gt;
    &lt;h2&gt;Using dataTransfer&lt;/h2&gt;
    &lt;p&gt;
        As mentioned in the last section, the new drag and drop events
        let you send data along with a dragged element.  But, it's even
        better than that:  Your drop targets can receive data
        transferred by content objects dragged into the window from 
        other browser windows, and even &lt;i&gt;other applications&lt;/i&gt;.
    &lt;/p&gt;&lt;p&gt;

        Since the example is a bit longer,  
        &lt;a target=&quot;_new&quot; target=&quot;_new&quot; href=&quot;http://decafbad.com/2009/07/drag-and-drop/api-demos.html#data_transfer&quot;&gt;check out the live demo&lt;/a&gt;
        and 
        &lt;a target=&quot;_new&quot; href=&quot;http://decafbad.com/2009/07/drag-and-drop/js/drag-datatransfer.js&quot;&gt;associated code&lt;/a&gt;
        to get an idea of what's possible with &lt;code&gt;dataTransfer&lt;/code&gt;.
    &lt;/p&gt;&lt;p&gt;
        In a nutshell, the stars of this show are the
        &lt;code&gt;setData()&lt;/code&gt; and &lt;code&gt;getData()&lt;/code&gt; methods of
        the &lt;code&gt;dataTransfer&lt;/code&gt; property exposed by the Event object.
    &lt;/p&gt;

    &lt;p&gt;
        The &lt;code&gt;setData()&lt;/code&gt; method is typically called in the 
        &lt;code&gt;dragstart&lt;/code&gt; listener, loading &lt;code&gt;dataTransfer&lt;/code&gt;
        up with one or more strings of content with associated
        &lt;a href=&quot;https://developer.mozilla.org/En/DragDrop/Recommended_Drag_Types#link&quot;&gt;recommended content types&lt;/a&gt;.
    &lt;/p&gt;

    &lt;p&gt;
        For illustration, here's a quick snippet from the example code:
    &lt;/p&gt;
    &lt;pre lang=&quot;javascript&quot; line=&quot;1&quot;&gt;
var dt = ev.originalEvent.dataTransfer;    
dt.setData('text/plain', $('#logo').parent().text());
dt.setData('text/html', $('#logo').parent().html());
dt.setData('text/uri-list', $('#logo')[0].src);
    &lt;/pre&gt;
    &lt;/p&gt;&lt;p&gt;
        On the other end, &lt;code&gt;getData()&lt;/code&gt; allows you to query
        for content by type (eg. &lt;code&gt;text/html&lt;/code&gt; followed by
        &lt;code&gt;text/plain&lt;/code&gt;).  This, in turn, allows you to decide
        on acceptable content types at the time of the
        &lt;code&gt;drop&lt;/code&gt; event or even during &lt;code&gt;dragover&lt;/code&gt;

        to offer feedback for unacceptable types during the drag.
    &lt;/p&gt;&lt;p&gt;
        Here's another example from the receiving end of the example code:
    &lt;/p&gt;
    &lt;pre lang=&quot;javascript&quot; line=&quot;1&quot;&gt;
var dt = ev.originalEvent.dataTransfer;    
$('.content_url .content').text(dt.getData('text/uri-list'));
$('.content_text .content').text(dt.getData('text/plain'));
$('.content_html .content').html(dt.getData('text/html'));
    &lt;/pre&gt;
    &lt;p&gt;
        Where &lt;code&gt;dataTransfer&lt;/code&gt; really shines, though, is that
        it allows your drop targets to receive content from 
        sources outside your defined draggable elements and even from
        outside the browser altogether.  Firefox accepts such drags, 
        and attempts to populate &lt;code&gt;dataTransfer&lt;/code&gt; with
        appropriate content types extracted from the external object.
    &lt;/p&gt;&lt;p&gt;

        Thus, you could select some text in a word processor window and
        drop it into one of your elements, and at least expect to find
        it available as &lt;code&gt;text/plain&lt;/code&gt; content.  
    &lt;/p&gt;&lt;p&gt;
        You can also select content in 
        another browser window, and expect to see &lt;code&gt;text/html&lt;/code&gt;
        appear in your events.  Check out the 
        &lt;a target=&quot;_new&quot; href=&quot;http://decafbad.com/2009/07/drag-and-drop/outline.html&quot;&gt;outline editing demo&lt;/a&gt;
        and see what happens when you try dragging various elements 
        (eg. images, tables, and lists) and highlighted content from
        other windows onto the items there.
    &lt;/p&gt;

&lt;/div&gt;




&lt;div id=&quot;dragfeedback&quot;&gt;
    &lt;h2&gt;Using Drag Feedback Images&lt;/h2&gt;
    &lt;p&gt;
       An important aspect of the drag and drop interaction is a
       representation of the thing being dragged.  By default in
       Firefox, this is a &quot;ghost&quot; image of the dragged element itself.  But,
       the &lt;code&gt;dataTransfer&lt;/code&gt; property of the original Event
       object exposes the method &lt;code&gt;setDragImage()&lt;/code&gt; for use
       in customizing this representation.
    &lt;/p&gt;&lt;p&gt;

        There's
        &lt;a target=&quot;_new&quot; href=&quot;http://decafbad.com/2009/07/drag-and-drop/api-demos.html#feedback_image&quot;&gt;a live demo&lt;/a&gt; of this feature, as well as
        &lt;a target=&quot;_new&quot; href=&quot;http://decafbad.com/2009/07/drag-and-drop/js/drag-feedback-images.js&quot;&gt;associated JS code&lt;/a&gt; 
        available.  The gist, however, is sketched out in these code snippets:
    &lt;/p&gt;
    &lt;pre lang=&quot;javascript&quot; line=&quot;1&quot;&gt;
var dt = ev.originalEvent.dataTransfer;    

dt.setDragImage( $('#feedback_image h2')[0], 0, 0);

dt.setDragImage( $('#logo')[0], 32, 32); 

var canvas = document.createElement(&quot;canvas&quot;);
canvas.width = canvas.height = 50;

var ctx = canvas.getContext(&quot;2d&quot;);
ctx.lineWidth = 8;
ctx.moveTo(25,0);
ctx.lineTo(50, 50);
ctx.lineTo(0, 50);
ctx.lineTo(25, 0);
ctx.stroke();

dt.setDragImage(canvas, 25, 25);
    &lt;/pre&gt;
    &lt;p&gt;
        You can supply a DOM node as the first parameter to 
        &lt;code&gt;setDragImage()&lt;/code&gt;, which includes everything from
        text to images to &lt;code&gt;canvas&lt;/code&gt; elements.  The
        second two parameters indicate at what left and top offset
        the mouse should appear in the image while dragging.
    &lt;/p&gt;&lt;p&gt;

        For example, since the &lt;code&gt;#logo&lt;/code&gt; image is 64x64,
        the parameters in the second &lt;code&gt;setDragImage()&lt;/code&gt;
        method places the mouse right in the center of the image.
        On the other hand, the first call positions the feedback
        image such that the mouse rests in the upper left corner.
    &lt;/p&gt;&lt;p&gt;
    &lt;/p&gt;
&lt;/div&gt;




&lt;div id=&quot;dragfeedback&quot;&gt;

    &lt;h2&gt;Using Drop Effects&lt;/h2&gt;
    &lt;p&gt;
        As mentioned at the start of this article, the drag and drop
        interaction has been used to support actions such as copying,
        moving, and linking.  Accordingly, the HTML 5 specification 
        accomodates these operations in the form of the 
        &lt;code&gt;effectAllowed&lt;/code&gt; and &lt;code&gt;dropEffect&lt;/code&gt;
        properties exposed by the Event object.
    &lt;/p&gt;
    &lt;p&gt;

        For a quick fix, check out the
        &lt;a target=&quot;_new&quot; href=&quot;http://decafbad.com/2009/07/drag-and-drop/api-demos.html#drag_effects&quot;&gt;a live demo&lt;/a&gt; 
        of this feature, as well as the
        &lt;a target=&quot;_new&quot; href=&quot;http://decafbad.com/2009/07/drag-and-drop/js/drag-effects.js&quot;&gt;associated JS code&lt;/a&gt;.
    &lt;/p&gt;&lt;p&gt;
        The basic idea is that the &lt;code&gt;dragstart&lt;/code&gt; event
        listener can set a value for &lt;code&gt;effectAllowed&lt;/code&gt; like so:
    &lt;/p&gt;

    &lt;pre lang=&quot;javascript&quot; line=&quot;1&quot;&gt;
var dt = ev.originalEvent.dataTransfer;
switch (ev.target.id) {
    case 'effectdrag0': dt.effectAllowed = 'copy'; break;
    case 'effectdrag1': dt.effectAllowed = 'move'; break;
    case 'effectdrag2': dt.effectAllowed = 'link'; break;
    case 'effectdrag3': dt.effectAllowed = 'all'; break;
    case 'effectdrag4': dt.effectAllowed = 'none'; break;
}
    &lt;/pre&gt;
    &lt;p&gt;The choices available for this property include the following:&lt;/p&gt;
    &lt;dl&gt; 
        &lt;dt&gt;&lt;code&gt;none&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;no operation is permitted &lt;/dd&gt;
        &lt;dt&gt;&lt;code&gt;copy&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;copy only &lt;/dd&gt;

        &lt;dt&gt;&lt;code&gt;move&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;move only &lt;/dd&gt;
        &lt;dt&gt;&lt;code&gt;link&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;link only &lt;/dd&gt;
        &lt;dt&gt;&lt;code&gt;copyMove&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;copy or move only &lt;/dd&gt;
        &lt;dt&gt;&lt;code&gt;copyLink&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;copy or link only &lt;/dd&gt;
        &lt;dt&gt;&lt;code&gt;linkMove&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;link or move only &lt;/dd&gt;

        &lt;dt&gt;&lt;code&gt;all&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;copy, move, or link &lt;/dd&gt;
    &lt;/dl&gt;
    &lt;p&gt;
        On the other end, the &lt;code&gt;dragover&lt;/code&gt; event listener 
        can set the value of the
        &lt;code&gt;dropEffect&lt;/code&gt; property to indicate the expected effect
        invoked on a successful drop.  If the value does
        not match up with &lt;code&gt;effectAllowed&lt;/code&gt;, the drop will
        be considered cancelled on completion.
    &lt;/p&gt;&lt;p&gt;

        In the 
        &lt;a target=&quot;_new&quot; href=&quot;http://decafbad.com/2009/07/drag-and-drop/api-demos.html#drag_effects&quot;&gt;a live demo&lt;/a&gt;,
        you should be able to see that only elements with matching
        effects can be dropped into the appropriate drop zones.  This
        is accomplished with code like the following:
    &lt;/p&gt;
    &lt;pre lang=&quot;javascript&quot; line=&quot;1&quot;&gt;
var dt = ev.originalEvent.dataTransfer;
switch (ev.target.id) {
    case 'effectdrop0': dt.dropEffect = 'copy'; break;
    case 'effectdrop1': dt.dropEffect = 'move'; break;
    case 'effectdrop2': dt.dropEffect = 'link'; break;
    case 'effectdrop3': dt.dropEffect = 'all'; break;
    case 'effectdrop4': dt.dropEffect = 'none'; break;
}
    &lt;/pre&gt;
    &lt;p&gt;
        Although the OS itself can provide some feedback, you 
        can also use these properties to update your own visible 
        feedback, both on the dragged element and on the drop zone
        itself.
    &lt;/p&gt;

&lt;/div&gt;




&lt;div id=&quot;conclusion&quot;&gt;
    &lt;h2&gt;Conclusion&lt;/h2&gt;
    &lt;p&gt;
        The new first-class drag and drop events in HTML5 and Firefox
        make supporting this form of UI interaction simple, concise,
        and powerful in the browser.  But beyond the new simplicity of
        these events, the ability to transfer content between
        applications opens brand new avenues for web-based applications
        and collaboration with desktop software in general.
    &lt;/p&gt;&lt;p&gt;
    &lt;/p&gt;&lt;p&gt;
    &lt;/p&gt;
&lt;/div&gt;




&lt;div id=&quot;comments&quot; class=&quot;comments archived-comments&quot;&gt;
            &lt;h3&gt;Archived Comments&lt;/h3&gt;
            
        &lt;ul class=&quot;comments&quot;&gt;
            
        &lt;li class=&quot;comment&quot; id=&quot;comment-221090962&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://lmframework.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=03dc722b1852367f02b0b21f02b10675&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://lmframework.com&quot;&gt;David Semeria&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221090962&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2009-07-16T17:56:52&quot;&gt;2009-07-16T17:56:52&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Wow - thanks for a great introduction to D+D in HTML 5, I'm really looking forward to giving it a thorough road test. &lt;/p&gt;

&lt;p&gt;The key part of the implementation are the target listeners, because, as I'm sure you're aware, onmouseover would historically never fire over the target element because the dragged item would always 'cover it up'. BTW, my proposed solution was to add an 'event transparency' property, which would have made the dragged item invisible from the point of view of selected events, eg onmouseover.&lt;/p&gt;

&lt;p&gt;This implementation is going to take a lot of pain away. You have no idea how many hoops I had to jump through to get a fully generic D+D implementation working without these new calls.&lt;/p&gt;

&lt;p&gt;If you're interested, you can see it working here: http://lmframework.com/page.php?id=vd_twig_short_2&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221090964&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=cee7ac3f63d7e8c1367e170bec302c14&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;Alex&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221090964&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2009-07-17T00:13:23&quot;&gt;2009-07-17T00:13:23&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Hey,&lt;/p&gt;

&lt;p&gt;Looks great and useful article.  For dragging from external applications (such as the Desktop) is a normal webpage able to get the data from the drop?  I was just playing with it and seem to always get what seems to be a security error with getData or mozGetDataAt.  However, the documentation seems to state that on drop that data should be made available to the page.  Likewise, in the same way an image can be dragged off the page onto the desktop, can an arbitrary element be dragged onto the desktop with whatever file content to be saved?  Thanks for the help.&lt;/p&gt;

&lt;p&gt;Alex&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221090966&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://paulisageek.com/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=b3bb70a4bace7f9bd49f48b149ab95f9&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://paulisageek.com/&quot;&gt;Paul Tarjan&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221090966&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2009-07-17T04:52:54&quot;&gt;2009-07-17T04:52:54&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Very nice, I didn't know that FF 3.5 actually had this implemented. Time to start playing :)&lt;/p&gt;

&lt;p&gt;Also, how did you do your code posts? Was it just pasting in HTML or do you have a better setup?&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221090967&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=066d1e75c9b938053ee6b3d48b1c0f6a&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;Animal&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221090967&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2009-07-17T14:35:21&quot;&gt;2009-07-17T14:35:21&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Seems pretty pointless pressing ahead with this when you just can't write a web app to use it. There's no support. All a bunch of whizzy fun I'm sure, but sod-all use.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221090969&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=2377f34a68801b861c3e54e1301f0dce&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;l.m.orchard&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221090969&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2009-07-17T16:23:10&quot;&gt;2009-07-17T16:23:10&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;@Animal: Why can't you write a web app to use it?  It's in the HTML5 spec, works in Fx3.5 and Safari 4 / WebKit.  It doesn't have universal support yet, or course, but new standards never do.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221090970&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.crearedesign.co.uk&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=87bf21798e390d9043dda7240c1b60f7&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.crearedesign.co.uk&quot;&gt;paul&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221090970&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2009-07-21T08:08:26&quot;&gt;2009-07-21T08:08:26&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;very nice indeed! i like this, it has definitely opened up new avenues for interaction without using flash. but it will take time before people upgrade to the new browser. a lot of people who browse the web wont realise what the technology will bring and will use their current browser because it does the job!&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221090971&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=04de859cfd6ef0b75e4ea3cbea143190&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;Joel&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221090971&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2009-07-21T14:36:04&quot;&gt;2009-07-21T14:36:04&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Excellent demos of the new features.&lt;/p&gt;

&lt;p&gt;When using a feedback image on a zoomed in page, should the image not also be scaled up automatically?&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221090973&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=41708&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=6d3bf986abdbb431991c3b02eb6e2335&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=41708&quot;&gt;RenegadeX&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221090973&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2009-07-22T04:13:46&quot;&gt;2009-07-22T04:13:46&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Dragging &amp;amp; dropping &lt;em&gt;is&lt;/em&gt; as you say, a &quot;one of the most fundamental interations&quot; that users of computer graphical interfaces have come to know, and expect.&lt;/p&gt;

&lt;p&gt;It therefore completes dumbfounds me how it is that we &lt;em&gt;still&lt;/em&gt; can not natively drag &amp;amp; scroll (&amp;amp; then drop) in Firefox. We can only drag &amp;amp; drop an item within the currently visible portion of a Firefox webpage or tab, no further up, no further down.&lt;/p&gt;

&lt;p&gt;That is should be limited makes absolutely no sense. Microsoft built the function into their Windows 3.x (file) Explorer, and then when visual browsers came along, naturally carried it through into Internet Explorer. &lt;/p&gt;

&lt;p&gt;Firefox Bug 41708, &quot;Should be able to scroll in the viewport while dragging&quot; was opened in June, 2000 (yes, 9 years ago!) and remains open, and is disregarded by Firefox developers as little more than a trivial little annoyance, and therefore is and should be treated as a low-importance 'enhancement' rather than as the 'standard feature' it should really be.&lt;/p&gt;

&lt;p&gt;If it weren't for the extension 'DragToScroll', which has been around for 3-1/2 years now (not updated in a long time but still works if you override version compatibility), I would have dumped Firefox and switched to a different browser (Maxthon 3, most likely).&lt;/p&gt;

&lt;p&gt;So, I'm wondering (and hoping) -- does the new HTML5 drag and drop specification include anything that if implemented properly would make it possible to scroll &amp;amp; drag?&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221090974&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=2377f34a68801b861c3e54e1301f0dce&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;l.m.orchard&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221090974&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2009-07-22T13:57:42&quot;&gt;2009-07-22T13:57:42&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;@RenegadeX: Ugh.  I don't work on the browser itself, but I noticed that unexpected behavior on drag &amp;amp; drop.  The window really should scroll when you get toward the top or bottom while dragging - and, in fact, most pre-HTML5 JS frameworks do that in their own drag &amp;amp; drop abstractions.  &lt;/p&gt;

&lt;p&gt;Until / unless Firefox gets this fixed, the same sort of auto-scrolling could be hacked in to HTML5 drag and drop.  Not perfect, but it's doable.  That is, in the drag event, you can check if the mouse is near the upper or lower edge of the viewport - and if so, start scrolling appropriately. That's pretty much how the JS frameworks do it with old-school D&amp;D&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221090975&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.copperbot.net&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=df48b2c2a3a2be51b1e15f10c5fb05da&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.copperbot.net&quot;&gt;CopperBot&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221090975&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2009-07-23T21:41:07&quot;&gt;2009-07-23T21:41:07&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Very cool article! Thanks for sharing. HTML5 really is going to change everything about how we use and develop for the web. Pretty awesome!&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221090976&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.AmnesiaGames.cl&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=14ad888c23e28c85c222a73b6c633570&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.AmnesiaGames.cl&quot;&gt;Alexos&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221090976&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2009-07-26T05:05:44&quot;&gt;2009-07-26T05:05:44&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Hi, would DD work for uploading files? How can I display a progress bar?
Thanks! 
I've been looking for that several days, and found only applets which I can't use in my proyect :-)&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221090977&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.sjlwebdesign.co.uk&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=185cd965e0e8ccd15df2f90977cbeaf3&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.sjlwebdesign.co.uk&quot;&gt;Sam&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221090977&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2009-07-28T13:54:26&quot;&gt;2009-07-28T13:54:26&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Looks fantastic, going to try it out now (once I have upgraded my FF)&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221090978&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.dankantor.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=60fc8331f617fc905fd682bc4f41ce8d&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.dankantor.com&quot;&gt;Dan Kantor&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221090978&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2009-07-30T03:10:25&quot;&gt;2009-07-30T03:10:25&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Looks like effectAllowed and dropEffect are not working for FF 3.5 on the Mac. I see effects on Windows and Safari 4 on Mac. I've been playing around with adding borders to the drop target, but the + icon for copy really helps a lot. Hopefully Mozilla will fix this next update.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221090979&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.thecssninja.com/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=8677c9f7c0f6d947bf318c1430d00bfd&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.thecssninja.com/&quot;&gt;Ryan&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221090979&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2009-09-01T02:33:06&quot;&gt;2009-09-01T02:33:06&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Great article it's good to see developments in this area. I wrote an article on the further extensions Firefox 3.6 has done with the dataTransfer method by adding the file attribute so you can access local files and upload them without the need for file inputs. http://www.thecssninja.com/javascript/drag-and-drop-upload&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221090982&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=1ed4bbef573bfc014d32356d53103ca2&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;phil swenson&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221090982&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2009-09-03T22:58:36&quot;&gt;2009-09-03T22:58:36&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Why not a first class WYSIWYG rich text editor with copy from clipboard image support?  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;NO ONE&lt;/em&gt; has built a decent text editor in JavaScript - At least not that I've seen.  And browsers don't allow image paste for reasons I don't understand.  &lt;/p&gt;

&lt;p&gt;And by decent I mean just like you'd get in textmate or another editor.  Have the standard text editor features everyone expects:  tab, select indent/select unindent, resize image, home, end, duplicate line, delete line, styling, etc.&lt;/p&gt;

&lt;p&gt;would push the browser to the next level in killing the desktop.  non-techies hate wikis.  They want a real editor.  I do too actually.... would be great for forums, bug tracking system (imagine pasting screen shots in line with your bug desc), email, etc.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221090983&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=deed51cddc830e162557b8f01383a057&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;Jean-Denis&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221090983&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2009-09-04T00:23:39&quot;&gt;2009-09-04T00:23:39&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Francisco Tomalski wrote up a nice piece on HTML 5 drag'n drop at http://www.alertdebugging.com/2009/08/16/on-html-5-drag-and-drop/&lt;/p&gt;

&lt;p&gt;where he uncovers that the proposed standard is partially broken. Any comment on his piece?&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221090984&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://html5tutorial.net/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=3876e030a3fc69a8b59a8c55829fb510&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://html5tutorial.net/&quot;&gt;Lisa&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221090984&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2009-09-09T07:33:08&quot;&gt;2009-09-09T07:33:08&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;This is a great move forward no more relying on 3rd party apps and extensions to play video or audio, i have been reading up on HTML 5 at the &lt;a href=&quot;http://html5tutorial.net/&quot; title=&quot;HTML tutorials&quot; rel=&quot;nofollow&quot;&gt;HTML 5 Tutorials&lt;/a&gt; website, i am now playing around with one of the free templates and was wondering how to embed audio, so thanks a lot, great information, lets hope more people lean towards HTML 5 and SOON!!!&lt;/p&gt;

&lt;p&gt;The drag and drop feature i did not notice was already working in FF 3.5, i was told to get Safari to see HTML 5 in action. Thanks for a great post&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221090985&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.useragentman.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=9a579fa051b35266678735c8a3751771&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.useragentman.com&quot;&gt;Zoltan Hawryluk&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221090985&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2010-01-11T15:14:48&quot;&gt;2010-01-11T15:14:48&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;A million thank yous!  This article was great introduction to HTML5 D+D.  With it, I was able to extend it to other browsers.  It was a little painful at first because the browser implementations diverge in significant, but manageable ways.&lt;/p&gt;

&lt;p&gt;If you are interested, check out my article at http://www.useragentman.com/blog/2010/01/10/cross-browser-html5-drag-and-drop/ if you are interested in my results.&lt;/p&gt;

&lt;p&gt;I noticed you haven't blogged in a while - I hope you haven't stopped totally and continue to share with the webdev community.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221090986&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.lingua-franka.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=e65f416e42c12571ba1c86ae2dadd99f&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.lingua-franka.com&quot;&gt;Raul&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221090986&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2011-04-26T23:56:02&quot;&gt;2011-04-26T23:56:02&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Hi, Leslie. I've just come across a problem that's driving me nuts. I'm not fully comfortable with D&amp;amp;D, but managed to move a crosshairs image over a map to very precisely controlled positions. It worked great on FF 3.6 and FF 4. After a couple of days of successful testing, the image suddenly refused to de dropped after being dragged (it rather flew back to its previous position). Do you know if there is a bug in FF that might cause this? &lt;/p&gt;

&lt;p&gt;BTW, during the programming process I updated Firebug, which also is getting a little cranky.&lt;/p&gt;

&lt;p&gt;Thanks for your prompt answer, Raul&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-324410737&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;&lt;img src=&quot;http://disqus.com/api/users/avatars/google-4014af7ac4ea5d00df95bef4503b78dd.jpg&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;Alexander Plutov&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-324410737&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2011-10-01T11:51:12&quot;&gt;2011-10-01T11:51:12&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;Good post about Drag &amp; Drop http://plutov.by/post/html5_drag_and_drop&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;/ul&gt;
    
        &lt;/div&gt;



</content>
    </entry>
    
    

    <entry>
        <title>An unnecessary Template Attribute Language</title>
        <link href="http://decafbad.com/blog/2008/11/01/an-unnecessary-template-attribute-language"/>
        <updated>2008-11-01T19:23:23+00:00</updated>
        <id>http://decafbad.com/blog/2008/11/01/an-unnecessary-template-attribute-language</id>
        <content type="html">&lt;p&gt;A funny thing happened on the way to building &lt;a href=&quot;http://svn.mozilla.org/projects/lizardfeeder/trunk/&quot;&gt;a delayed real-time feed display&lt;/a&gt;:  I got temporarily obsessed with implementing &lt;a href=&quot;http://github.com/lmorchard/jquery-tal-template/tree/master&quot;&gt;a template language in JavaScript&lt;/a&gt; that, as it turned out later, I didn't need.  About &lt;a href=&quot;http://svn.mozilla.org/projects/lizardfeeder/trunk/&quot;&gt;the feed project itself&lt;/a&gt;, I hope to write more soon—but for now I want to get this extra template language thing out of my system and see if anyone else might have a use for it.&lt;/p&gt;

&lt;p&gt;See, I had a notion it would be keen if I had access to the same template language on the client as on the server.  I needed to render a number of list items statically on the server with feed entries, then update that list with new entries on the client as they became available through JSON feed polling.  It'd be a pain in the butt to maintain two separate list item templates for client and server, so I reached for a shared template language.&lt;/p&gt;

&lt;p&gt;Never mind that I'd just gotten done writing &lt;a href=&quot;http://www.amazon.com/gp/product/0470452021?ie=UTF8&amp;amp;tag=0xdecafbad01-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;c%0D%0Areative=9325&amp;amp;creativeASIN=0470452021&quot;&gt;a small book on Dojo&lt;/a&gt;, and was already aware of the existence of the &lt;a href=&quot;http://svn.dojotoolkit.org/src/dojox/trunk/dtl/README&quot;&gt;DojoX Django Template Language&lt;/a&gt;.  This might've worked, since the server end of things was written in Python (though not with Django).  That the JavaScript side already used &lt;a href=&quot;http://jquery.com/&quot;&gt;jQuery&lt;/a&gt; wasn't &lt;em&gt;too&lt;/em&gt; tall a hurdle.  Also, I'm sure there are a handful of other JavaScript/Python template language match-ups to be found.&lt;/p&gt;

&lt;p&gt;But, let's be honest here:  I've always been a fan of Zope's &lt;a href=&quot;http://wiki.zope.org/ZPT/TALSpecification14&quot;&gt;Template Attribute Language&lt;/a&gt; for their &lt;a href=&quot;http://wiki.zope.org/ZPT/FrontPage&quot;&gt;Page Templates&lt;/a&gt;, and have long wondered how hard it would be to implement.  The concept seems so much cleaner to me than most string-formatting template languages, and the workflow from mockup-to-template and back again has always been appealing to me when it works.  So, when my first few experimental steps in trying my hand at it actually started working, I couldn't stop coding.&lt;/p&gt;

&lt;p&gt;And now, &lt;a href=&quot;http://github.com/lmorchard/jquery-tal-template/tree/master/jquery.taltemplate.js&quot;&gt;the thing&lt;/a&gt; is mostly done.  It has no tests, has features left undone, and probably yields plenty of bugs—but I finished it enough to use it practically, and that was long enough to convince me it wasn't the right tool for the job.&lt;/p&gt;

&lt;p&gt;Still, though, I can't help thinking it might be the right tool for &lt;em&gt;some&lt;/em&gt; job.  That could be because I spent a lot of time on it, or that I'm unreasonably fond of &lt;a href=&quot;http://wiki.zope.org/ZPT/TALSpecification14&quot;&gt;TAL&lt;/a&gt;, but it still feels like a decent little plugin to have on hand.  Maybe someone reading this will have a similar conclusion.&lt;/p&gt;

&lt;p&gt;Oh and by the way, plain &lt;a href=&quot;http://jquery.com/&quot;&gt;jQuery&lt;/a&gt; turned out to be a better tool for &lt;a href=&quot;http://svn.mozilla.org/projects/lizardfeeder/trunk/&quot;&gt;the job in question&lt;/a&gt;.  This seems to nicely balance the duplicate effort between server and client, demanding only that I stick with semantically significant CSS class names in the server template—something I should be doing anyway:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;        // Clone and populate a new entry.
        var new_item = $('#feed-items .entry:last')
            .clone()
            .attr('class', entry_classes.join(' ')) 
            .find('.group span')
                .text(tags['group'])
            .end()
            .find('.title')
                .find('.favicon')
                    .attr('src', favicon)
                .end()
                .find('.link')
                    .attr('href', entry.link)
                    .text(entry.title)
                .end()
            .end()
            .find('.updated')
                .find('.timeago')
                    .attr('title', entry.updated)
                    .text(entry_updated.strftime('%+'))
                    .timeago()
                .end()
                .find('.time')
                    .text(entry_updated.strftime('%I:%M %p'))
                .end()
            .end()
            .find('.author')
                .text(entry.author || 'n/a')
            .end()
            .prependTo('#feed-items')
            .hide();
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Of course, &lt;em&gt;plain&lt;/em&gt; is a relative term here.&lt;/p&gt;

&lt;div id=&quot;comments&quot; class=&quot;comments archived-comments&quot;&gt;
            &lt;h3&gt;Archived Comments&lt;/h3&gt;
            
        &lt;ul class=&quot;comments&quot;&gt;
            
        &lt;li class=&quot;comment&quot; id=&quot;comment-221083366&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=3f398029eea744ce9ba9147aab627557&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;brad clements&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221083366&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2008-11-03T21:26:42&quot;&gt;2008-11-03T21:26:42&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Groan,&lt;/p&gt;

&lt;p&gt;Too bad I haven't had a chance to finish documenting (and tweaking) the ATALi project.&lt;/p&gt;

&lt;p&gt;It's a collection of Alternative TAL Implementations.&lt;/p&gt;

&lt;p&gt;It currently has TAL for xslt (server side using libxslt directly or via lxml with metal support)&lt;/p&gt;

&lt;p&gt;and TAL for javascript (no libraries needed, though it does recognize mochikit iterators, no metal)&lt;/p&gt;

&lt;p&gt;https://launchpad.net/atali&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221083367&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.jm3.net/&quot;&gt;&lt;img src=&quot;http://disqus.com/api/users/avatars/jm3.jpg&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.jm3.net/&quot;&gt;John Manoogian III (jm3)&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221083367&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2008-11-24T18:51:17&quot;&gt;2008-11-24T18:51:17&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Have you seen &quot;trimpath&quot;?&lt;/p&gt;

&lt;p&gt;http://code.google.com/p/trimpath/wiki/JavaScriptTemplates&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;/ul&gt;
    
        &lt;/div&gt;



</content>
    </entry>
    
    

    <entry>
        <title>Writing a Delicious command for Ubiquity</title>
        <link href="http://decafbad.com/blog/2008/09/01/writing-a-delicious-command-for-ubiquity"/>
        <updated>2008-09-01T04:37:03+00:00</updated>
        <id>http://decafbad.com/blog/2008/09/01/writing-a-delicious-command-for-ubiquity</id>
        <content type="html">&lt;p&gt;In my &lt;a href=&quot;http://decafbad.com/blog/2008/08/31/ubiquity-cracks-open-personal-mashup-tinkering&quot; title=&quot;Ubiquity cracks open personal mashup tinkering&quot;&gt;last post&lt;/a&gt;, I got all fluffy about how cool &lt;a href=&quot;http://labs.mozilla.com/2008/08/introducing-ubiquity/&quot;&gt;Ubiquity&lt;/a&gt; is but didn't share any code to prove the point.  As it happens, I have come up with at least one useful command that I'm starting to use habitually in posting bookmarks to Delicious.  You can &lt;a href=&quot;http://decafbad.com/UbiquityCommands/&quot;&gt;subscribe to my command&lt;/a&gt; or &lt;a href=&quot;http://decafbad.com/hg/UbiquityCommands/file/tip/delicious.ubiq.js&quot;&gt;check out the full source&lt;/a&gt;—this post will serve as a dissection of the thing.  Since this will be fairly lengthy, follow along after the jump.&lt;/p&gt;

&lt;p&gt;Oh, and it's been awhile since I posted something this in-depth around here, so feel free to let me know how this first draft works.  And, bug reports and patches are of course welcome.&lt;/p&gt;

&lt;!--more--&gt;


&lt;p&gt;To begin, consider the following code starting off the command source code:&lt;/p&gt;

&lt;pre lang=&quot;javascript&quot; line=&quot;1&quot;&gt;
/**
 * share-on-delicious - an Ubiquity command for sharing bookmarks on
 * delicious.com
 *
 * l.m.orchard@pobox.com
 * http://decafbad.com/
 * Share and Enjoy!
 */
var uext = Application.extensions.get('ubiquity@labs.mozilla.com');

var cookie_mgr = Components.classes[&quot;@mozilla.org/cookiemanager;1&quot;]
    .getService(Components.interfaces.nsICookieManager);
&lt;/pre&gt;


&lt;p&gt;The first thing to note here is that a short header comment introduces the command.  This isn't required, but it's a good idea.  It's also something you can't really do with bookmarklets.  On the other hand, Greasemonkey user scripts expect metadata about the script to be provided here, but Ubiquity doesn't use this convention.&lt;/p&gt;

&lt;p&gt;Second, notice that the code accesses some chrome-level resources.  Again, this is something unavailable to bookmarklets and Greasemonkey user scripts.  Just take a look at the &lt;a href=&quot;http://developer.mozilla.org/en/FUEL&quot;&gt;FUEL library documentation&lt;/a&gt; to get a quick sense of what's available using that simplified API, not to mention what's available using the lower-level browser APIs.&lt;/p&gt;

&lt;p&gt;Now, check out this next chunk of code, which begins the construction of an Ubiquity command:&lt;/p&gt;

&lt;pre lang=&quot;javascript&quot; line=&quot;13&quot;&gt;
CmdUtils.CreateCommand({
    
    name:        
        'share-on-delicious',
    icon:
        'http://delicious.com/favicon.ico',
    description: 
        'Share the current page as a bookmark on delicious.com',
    help:        
        'Select text on the page to use as notes, or enter your own ' + 
        'text after the command word.  You can also assign tags to the '+ 
        'bookmark with the &quot;tagged&quot; modifier, and alter the bookmark ' + 
        'default page title with the &quot;entitled&quot; modifier.  Note that ' + 
        'you must also already be logged in at delicious.com to use ' +
        'this command.',

    homepage:   
        'http://decafbad.com',
    author: { 
        name: 'Leslie Michael Orchard', 
        email: 'l.m.orchard@pobox.com' 
    },
    license:
        'MPL/GPL/LGPL',
&lt;/pre&gt;


&lt;p&gt;Whereas Greasemonkey scripts support metadata in the header comment, the Ubiquity command script API works a little differently.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;http://hg.toolness.com/ubiquity-firefox/file/tip/ubiquity/chrome/content/cmdutils.js&quot;&gt;&lt;code&gt;CmdUtils&lt;/code&gt; module&lt;/a&gt; provided by Ubiquity offers a &lt;code&gt;CreateCommand&lt;/code&gt; function, which expects an object as a parameter.  The object literal whose construction is begun in the code above serves as a self-contained package for the command, bearing metadata describing the command as well as containing all the code necessary to implement it.&lt;/p&gt;

&lt;p&gt;So, in the above code block, you can see the machine-readable description of the command—including a command name, display icon, home page URL, author information, and license.  The command name (&lt;code&gt;share-on-delicious&lt;/code&gt;) will be used by the Ubiquity command parser, but the rest of the description will also be used in the list of commands available to the user, invoked by the &lt;code&gt;command-list&lt;/code&gt; command, like so:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/2008/ubiq-share-on-delicious-list.jpg&quot; style=&quot;border: 1px solid #333; margin: 0.25em; padding: 0.25em&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Moving along, this next chunk of code introduces the first functional bits of the command:&lt;/p&gt;

&lt;pre lang=&quot;javascript&quot; line=&quot;37&quot;&gt;
    takes: { notes: noun_arb_text },
    modifiers: { 
        tagged:  noun_arb_text,
        entitled: noun_arb_text
    },
&lt;/pre&gt;


&lt;p&gt;Like smart keyword shortcut bookmarks, Ubiquity commands accept user-supplied input.  But, what's unique to Ubiquity is that it employs a parser whose goal is to support something approximating natural language.  At present, this results in commands that support a single primary argument—declared above with the &lt;code&gt;takes&lt;/code&gt; property—and any number of additional keyword modifiers—declared above by the &lt;code&gt;modifiers&lt;/code&gt; property.&lt;/p&gt;

&lt;p&gt;For the command under construction here, this establishes a pattern something like the following:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;share-on-delicious {notes} [tagged {tags} entitled {title}]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Content for the &lt;code&gt;{notes}&lt;/code&gt; argument can either be typed directly by hand, or it can be supplied by text highlighted on the page.  To use highlighted text, you can either issue the command alone, or use the word &lt;code&gt;this&lt;/code&gt; for the &lt;code&gt;{notes}&lt;/code&gt; argument before including further modifiers.&lt;/p&gt;

&lt;p&gt;The modifiers &lt;code&gt;tagged&lt;/code&gt; and &lt;code&gt;entitled&lt;/code&gt; are optional, and can be used in any order.  Each of these keywords signifies the start of a different argument—which unfortunately can collide with the literal data supplied for notes, which will hopefully be a rare occurrence.&lt;/p&gt;

&lt;p&gt;All of this adds up command invocations including the following:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;share-on-delicious
share-on-delicious I really like this page tagged nifty amusing
share-on-delicious this entitled This bookmark has no tags
sh this tagged osx software apple entitled This is good OS X software
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That last example is important—since I have no other commands starting with &quot;&lt;code&gt;sh&lt;/code&gt;&quot;, I can abbreviate the full command.  Ubiquity only requires enough of a command name to disambiguate it within your collection of commands.&lt;/p&gt;

&lt;p&gt;Another thing to note is the use of the constant value &lt;code&gt;noun_arb_text&lt;/code&gt;, which declares that these arguments should expect any arbitrary text as input.&lt;/p&gt;

&lt;p&gt;This facility is not exploited for the present command, but Ubiquity defines &lt;a href=&quot;http://hg.toolness.com/ubiquity-firefox/file/tip/ubiquity/chrome/content/nlparser/en/nountypes.js&quot;&gt;noun types&lt;/a&gt;.  These include concepts such as plain text, dates, address book contacts, browser tabs, bookmark tags, and more.  You can define your own noun types, as well as implement suggestion schemes that help guide the user toward constructing useful input values in the command interface.  You can &lt;a href=&quot;https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.1_Author_Tutorial#Introduction_to_Noun_Types&quot;&gt;read more about this&lt;/a&gt; in the official author tutorial.&lt;/p&gt;

&lt;p&gt;Next up is a quick bit of command-specific configuration:&lt;/p&gt;

&lt;pre lang=&quot;javascript&quot; line=&quot;42&quot;&gt;
    /**
     * Command configuration settings.
     */
    _config: {
        // Base URL for the delicious v1 API
        api_base:      'https://api.del.icio.us',

        // Domain and name of the delicious login session cookie.
        cookie_domain: '.delicious.com',
        cookie_name:   '_user'
    },
&lt;/pre&gt;


&lt;p&gt;Since this command will be posting to Delicious via the V1 API, it's handy to declare the base URL for the API in an easily changed spot.  That way, you could change this value later on to point the command at another implementation of the API.&lt;/p&gt;

&lt;p&gt;Additionally, this command will employ a little-known authentication trick supported by the Delicious API that accepts the user's login cookie set by the Delicious website—this &quot;cookie god&quot; auth is used by the official Delicious addon for Firefox.  It's handy for piggybacking on the website login and removing the need to ask the user for their username and password again and possibly storing it in an insecure manner.&lt;/p&gt;

&lt;p&gt;In fact, this next chunk of code defines a utility method to rummage through the cookie jar:&lt;/p&gt;

&lt;pre lang=&quot;javascript&quot; line=&quot;53&quot;&gt;
    /**
     * Dig up the Delicious login session cookie.
     */
    _getUserCookie: function() {
        var iter = cookie_mgr.enumerator;
        while (iter.hasMoreElements()) {
            var cookie = iter.getNext();
            if( cookie instanceof Components.interfaces.nsICookie &amp;&amp; 
                cookie.host.indexOf(this._config.cookie_domain) != -1 &amp;&amp; 
                cookie.name == this._config.cookie_name) {
                return decodeURIComponent(cookie.value);
            }
        }
    },
&lt;/pre&gt;


&lt;p&gt;The method defined above, &lt;code&gt;._getUserCookie()&lt;/code&gt;, uses the browser's cookie manager and the values defined in the previous configuration section to find the login session cookie set for Delicious.  Take note that this is far beyond the allowed capabilities of bookmarklets and Greasemoney user scripts—this is digging straight into the browser itself, skipping past the usual content-space security restrictions.&lt;/p&gt;

&lt;p&gt;In other words: In Ubiquity, &lt;em&gt;the gun is loaded&lt;/em&gt; and you should be careful.&lt;/p&gt;

&lt;p&gt;Moving along, consider this next utility method:&lt;/p&gt;

&lt;pre lang=&quot;javascript&quot; line=&quot;67&quot;&gt;
    /**
     * Given input data and modifiers, attempt to assemble data necessary to
     * post a bookmark.
     */
    _extractBookmarkData: function(input_obj, mods) {
        return {
            _user:
                this._getUserCookie(),
            url:
                context.focusedWindow.location,
            description:
                mods.entitled.text || context.focusedWindow.document.title,
            extended: 
                input_obj.text,
            tags:
                mods.tagged.text
        };
    },
&lt;/pre&gt;


&lt;p&gt;Named &lt;code&gt;._extractBookmarkData()&lt;/code&gt;, this utility method accepts the results of Ubiquity's parser interpreting the primary argument and modifier arguments supplied by the user.  Using these data structures, it attempts to build a structure representing the fields of a Delicious bookmark.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;_user&lt;/code&gt; field is used for authentication via the site login cookie.  The &lt;code&gt;url&lt;/code&gt; is set from the location bar of the current page.  The &lt;code&gt;description&lt;/code&gt;, or title, field of the bookmark is taken from either the &lt;code&gt;entitled&lt;/code&gt; modifier or the title of the current page.  The &lt;code&gt;tags&lt;/code&gt;, if any, come from the &lt;code&gt;tagged&lt;/code&gt; modifier.  And, finally, the &lt;code&gt;extended&lt;/code&gt; notes for the bookmark are taken from the primary input argument of the command.&lt;/p&gt;

&lt;p&gt;As you'll see shortly, this utility method will be used in both the preview and the execution of the command.&lt;/p&gt;

&lt;p&gt;Next, there's one more utility method to cover:&lt;/p&gt;

&lt;pre lang=&quot;javascript&quot; line=&quot;85&quot;&gt;
    /**
     * Given an object, build a URL query string
     */
    _buildQueryString: function(data) {
        var qs = [];
        for (k in data) if (data[k]) 
            qs.push( encodeURIComponent(k) + '=' + 
                encodeURIComponent(data[k]) );
        return qs.join('&amp;');
    },
&lt;/pre&gt;


&lt;p&gt;In anticipation of using the Delicious V1 API, the &lt;code&gt;._buildQueryString()&lt;/code&gt; method accepts an object and constructs a URL query string from the encoded properties of the object.  This will be paired with the &lt;code&gt;._extractBookmarkData()&lt;/code&gt; method to supply data for API calls.&lt;/p&gt;

&lt;p&gt;Moving along, it's time to start digging into the meat of this Ubiquity command:&lt;/p&gt;

&lt;pre lang=&quot;javascript&quot; line=&quot;95&quot;&gt;
    /**
     * Present a preview of the bookmark under construction during the course
     * of composing the command.
     */
    preview: function(pblock, input_obj, mods) {

        var bm          = this._extractBookmarkData(input_obj, mods);
        var user_cookie = this._getUserCookie();
        var user_name   = (user_cookie) ? user_cookie.split(' ')[0] : '';

        var ns = { user_name: user_name, bm: bm };
        var tmpl;
&lt;/pre&gt;


&lt;p&gt;With this code, the implementation of command method &lt;code&gt;.preview()&lt;/code&gt; has begun.  This method is used by Ubiquity to generate a live preview of the command.  Called with a DOM node (&lt;code&gt;pblock&lt;/code&gt;) and partially completed command input (&lt;code&gt;input_obj&lt;/code&gt; and &lt;code&gt;mods&lt;/code&gt;), this method is expected to build a representation of the command's results in the DOM node.  As the user types, this method will be called over and over again, ideally offering feedback as the user composes a command.&lt;/p&gt;

&lt;p&gt;Continuing on, consider this next chunk of code checking the validity of command input:&lt;/p&gt;

&lt;pre lang=&quot;javascript&quot; line=&quot;107&quot;&gt;
        if (!user_name) {

            // If there's no user name, there's no login, so this command won't work. 
            tmpl = [ 
                '&lt;p style=&quot;color: #d44&quot;&gt;No active user found - log in at ', 
                '&lt;img src=&quot;http://delicious.com/favicon.ico&quot;&gt; ',
                '&lt;b&gt;&lt;a style=&quot;color: #3774D0&quot; href=&quot;http://delicious.com&quot;&gt;delicious.com&lt;/a&gt;&lt;/b&gt; ', 
                'to use this command.&lt;/p&gt;'
            ].join('');

        } else if (!bm.description) {

            // If there's no title, then this is an error too.
            tmpl = [ 
                '&lt;p style=&quot;color: #d44&quot;&gt;A title is required for bookmarks on ', 
                '&lt;img src=&quot;http://delicious.com/favicon.ico&quot;&gt; ',
                '&lt;b&gt;&lt;a style=&quot;color: #3774D0&quot; href=&quot;http://delicious.com&quot;&gt;delicious.com&lt;/a&gt;&lt;/b&gt; ', 
                '&lt;/p&gt;'
            ].join('');
&lt;/pre&gt;


&lt;p&gt;This chunk of code first checks for a user name, which can be extracted from a valid Delicious login cookie, if one was found.  If not found, the command will fail—so the preview built here will instruct the user to login at Delicious before going further.&lt;/p&gt;

&lt;p&gt;The second precondition for using the command is that the bookmark has been given a title.  By default, this is the title of the current page—but, some pages don't offer titles.  So, an error needs to be flagged if the user hasn't manually supplied a title in this case.&lt;/p&gt;

&lt;p&gt;Finally, notice in both of these error cases, a string of HTML is composed in the variable &lt;code&gt;tmpl&lt;/code&gt;.  This will be used at the end of the method to populate the DOM node passed in as &lt;code&gt;pblock&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now, assuming that all the command's prerequisites have been met, it's time to try constructing a proper preview for the results of this command:&lt;/p&gt;

&lt;pre lang=&quot;javascript&quot; line=&quot;126&quot;&gt;
        } else {

            // Attempt to construct a vaguely delicious-esque preview of a bookmark.
            tmpl = [ 
                '&lt;style type=&quot;text/css&quot;&gt;',
                    '.preview a { color: #3774D0 }',
                    '.del-bookmark { font: 12px arial; color: #ddd; background: #eee; line-height: 1.25em }',
                    '.del-bookmark a.title { color: #1259C7 }',
                    '.del-bookmark .full-url { color: #396C9B; font-size: 12px; display: block; padding: 0.25em 0 }',
                    '.del-bookmark .notes { color: #4D4D4D }',
                    '.del-bookmark .tags { color: #787878; padding-top: 0.25em; text-align: right }',
                '&lt;/style&gt;',
                '&lt;div class=&quot;preview&quot;&gt;',
                    '&lt;p&gt;Share a bookmark at &lt;img src=&quot;http://delicious.com/favicon.ico&quot;&gt; ',
                        '&lt;b&gt;&lt;a href=&quot;http://delicious.com/${user_name}&quot;&gt;delicious.com/${user_name}&lt;/a&gt;&lt;/b&gt;:&lt;/p&gt;',
                    '&lt;div class=&quot;del-bookmark&quot;&gt;',
                        '&lt;div style=&quot;padding: 1em;&quot;&gt;',
                        '&lt;a class=&quot;title&quot; href=&quot;${bm.url}&quot;&gt;${bm.description}&lt;/a&gt;',
                        '&lt;a class=&quot;full-url&quot; href=&quot;${bm.url}&quot;&gt;${bm.url}&lt;/a&gt;',
                        bm.extended ? 
                            '&lt;div class=&quot;notes&quot;&gt;${bm.extended}&lt;/div&gt;' : '',
                        bm.tags ?
                            '&lt;div class=&quot;tags&quot;&gt;&lt;span&gt;tags:&lt;/span&gt; ${bm.tags}&lt;/div&gt;' : '',
                    '&lt;/div&gt;',
                '&lt;/div&gt;'
            ].join(&quot;\n&quot;);

        }

        pblock.innerHTML = CmdUtils.renderTemplate(tmpl, ns);
    },
&lt;/pre&gt;


&lt;p&gt;Building on the notion that previews are built in a DOM node, the code above uses both CSS and HTML to assemble a quick-and-dirty facsimile of a Delicious bookmark—which will be rendered like this:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/2008/ubiq-share-on-delicious-preview.jpg&quot; style=&quot;border: 1px solid #333; margin: 0.25em; padding: 0.25em&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Also note that Ubiquity provides a template engine for use in generating content—namely the &lt;a href=&quot;http://code.google.com/p/trimpath/wiki/JavaScriptTemplates&quot;&gt;JavaScript Templates&lt;/a&gt; engine from the &lt;a href=&quot;http://code.google.com/p/trimpath/wiki/TrimPath&quot;&gt;TrimPath&lt;/a&gt; project.  This engine may eventually be replaced with another, but the notion is that Ubiquity will provide tools to more easily generate previews and more.&lt;/p&gt;

&lt;p&gt;The conclusion of the &lt;code&gt;.preview()&lt;/code&gt; method uses the template engine with a call to &lt;code&gt;CmdUtils.renderTemplate()&lt;/code&gt; to inject content into the preview element by way of the &lt;code&gt;.innerHTML&lt;/code&gt; property.&lt;/p&gt;

&lt;p&gt;Now that the preview is out of the way, it's time to get down to implementing the execution of the command:&lt;/p&gt;

&lt;pre lang=&quot;javascript&quot; line=&quot;157&quot;&gt;    
    /**
     * Attempt to use the delicious v1 API to post a bookmark using the 
     * command input
     */
    execute: function(input_obj, mods) {
        var bm          = this._extractBookmarkData(input_obj, mods);
        var user_cookie = this._getUserCookie();
        var user_name   = (user_cookie) ? user_cookie.split(' ')[0] : '';

        if (!user_name) {
            // If there's no user name, there's no login, so this command won't work. 
            displayMessage('No active user found - log in at delicious.com ' +
                'to use this command.');
            return false;
        }

        if (!bm.description) {
            // If there's no title, somehow, then this is an error too.
            displayMessage(&quot;A title is required for bookmarks at delicious.com&quot;);
            return false;
        }
&lt;/pre&gt;


&lt;p&gt;Mirroring the &lt;code&gt;.preview()&lt;/code&gt; method, the &lt;code&gt;.execute()&lt;/code&gt; method first checks for validity of the arguments given by the user.  A missing user name or title result in a notification that the command has failed.&lt;/p&gt;

&lt;p&gt;But, if the arguments are all valid, it's time to actually issue a request to the Delicious V1 API:&lt;/p&gt;

&lt;pre lang=&quot;javascript&quot; line=&quot;178&quot;&gt;
        var path = '/v1/posts/add';
        var url  = this._config.api_base + path;

        var req = Components.classes[&quot;@mozilla.org/xmlextras/xmlhttprequest;1&quot;].
            createInstance();

        req.open('POST', url, true);

        req.onload = function(ev) { 
            displayMessage('Bookmark &quot;' + bm.description + '&quot; ' + 
                'shared at delicious.com/' + user_name);
        }

        req.onerror = function(ev) { 
            displayMessage('ERROR: Bookmark &quot;' + bm.description + '&quot; ' + 
                ' NOT shared on delicious.com/' + user_name);
        }
&lt;/pre&gt;


&lt;p&gt;Using the base URL for the Delicious API declared earlier in the configuration section, the &lt;code&gt;.execute()&lt;/code&gt; method constructs an API URL for the &lt;code&gt;/v1/posts/add&lt;/code&gt; method.  Then, it creates an instance of &lt;code&gt;XMLHttpRequest&lt;/code&gt; from the browser to be used in sending the API request.  Event handlers are registered with the object to present notifications to the user indicating whether or not the API request was successful.&lt;/p&gt;

&lt;p&gt;At long last, it's time to wrap up this method and make the API request:&lt;/p&gt;

&lt;pre lang=&quot;javascript&quot; line=&quot;195&quot;&gt;
        req.setRequestHeader('Authorization', 'Basic Y29va2llOmNvb2tpZQ=='); // btoa('cookie:cookie')

        var mediator = Components.classes[&quot;@mozilla.org/appshell/window-mediator;1&quot;].
            getService(Components.interfaces.nsIWindowMediator);
        var win = mediator.getMostRecentWindow(null);
        var user_agent = win.navigator.userAgent + &quot;;Ubiquity-share-on-delicious&quot;;

        req.setRequestHeader(&quot;User-Agent&quot;, user_agent);      

        req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        req.send(this._buildQueryString(bm));
    },

    EOF:null // I hate trailing commas
});
&lt;/pre&gt;


&lt;p&gt;The login cookie authentication supported by the Delicious V1 API is triggered by supplying a user name / password pair of &lt;code&gt;cookie&lt;/code&gt;, which is done by setting the &lt;code&gt;Authorization&lt;/code&gt; request header.  The login cookie is then expected to be passed in as the POST variable &lt;code&gt;_user&lt;/code&gt;, which is done in the &lt;code&gt;._extractBookmarkData()&lt;/code&gt; utility method.&lt;/p&gt;

&lt;p&gt;Another bit here that shows more access of browser resources is the construction of a unique User-Agent header for this API call based on the browser's own User-Agent string, something that's suggested in the guidelines for using the Delicious API.&lt;/p&gt;

&lt;p&gt;Finally, the &lt;code&gt;.execute()&lt;/code&gt; method—and the command itself—is wrapped up with by sending off the bookmark data encoded as POST form variables with the &lt;code&gt;._buildQueryString()&lt;/code&gt; utility method.&lt;/p&gt;

&lt;p&gt;And, that's it—a command-driven Delicious browser extension in a little over 200 lines of code.  There's still more to be done to really make this thing full-featured, but I think this shows off the basic features of Ubiquity.  I'm hoping to dig in deeper and explore further, taking a look at running Greasemonkey-style code at &lt;a href=&quot;https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.1_Author_Tutorial#Running_on_page_load_and_startup&quot;&gt;browser startup and page load&lt;/a&gt;, as well as playing with some more browser chrome features.&lt;/p&gt;

&lt;div id=&quot;comments&quot; class=&quot;comments archived-comments&quot;&gt;
            &lt;h3&gt;Archived Comments&lt;/h3&gt;
            
        &lt;ul class=&quot;comments&quot;&gt;
            
        &lt;li class=&quot;comment&quot; id=&quot;comment-221085986&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://jclark.org/weblog/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=d0a9ab4b71ce193e98b7284ca257e327&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://jclark.org/weblog/&quot;&gt;Jason Clark&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221085986&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2008-09-01T14:47:35&quot;&gt;2008-09-01T14:47:35&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;First off-  fantastic post.  Great to see a lengthy post here again, although I'm one to talk.  This is an excellent introduction to Ubiquity command development, and tres useful to boot.&lt;/p&gt;

&lt;p&gt;I'm wondering why you chose to construct and post the XMLHttpRequest manually instead of using jQuery, which is included with Ubiquity.  I don't know that there's any benefit other than some simplicity, but I took a crack at converting your code to use jQuery, which works nicely.  In the 'execute' function, replace everything after &quot;var url  = this._config.api_base + path;&quot; with this (hope code blocks work in comments):&lt;/p&gt;

&lt;p&gt;&lt;code&gt;
        var win = context.focusedWindow;
        var user_agent = win.navigator.userAgent + &quot;;Ubiquity-share-on-delicious&quot;;&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    jQuery.ajax({
      type: &quot;POST&quot;,
      url: url,
      data: this._buildQueryString(bm),
      username: &quot;cookie&quot;,
      password: &quot;cookie&quot;,
      beforeSend: function( req ) {
        req.setRequestHeader(&quot;User-Agent&quot;, user_agent); 
      },
      error: function() {
        displayMessage('ERROR: Bookmark &quot;' + bm.description + '&quot; ' + 
            ' NOT shared on delicious.com/' + user_name);
      },
      success: function() {
        displayMessage('Bookmark &quot;' + bm.description + '&quot; ' + 
            'shared at delicious.com/' + user_name);
      },
    });
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Also, with both versions of the code, I'm seeing some unexpected behavior around authentication.  Assume I'm logged in to delicious, with &quot;stay logged in&quot; checked, and I restart my browser.  Trying to post with the command fails with a 401 unauthorized, even though I can see the cookie was sent (via Live HTTP Headers extension).  Going to delicious.com shows me logged in, and once I've viewed the site, the command works.  Except that now I can't reproduce; but I know it happened because I've got the headers.  At any rate, it is working nicely, but the previous failure is bugging me... feel like I'm overlooking something.  &lt;/p&gt;

&lt;p&gt;Thanks again for an awesome post.  Hope to see more of the same.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221085988&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=e799a79441c7543be48562403411cd13&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;Ryan Scott Scheel&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221085988&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2008-09-01T15:07:01&quot;&gt;2008-09-01T15:07:01&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;You should be helping with the documentation, if you aren't already.  Very nice job with this article;&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221085991&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://azarask.in&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=e4307f205d017ba76647806951e14bb0&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://azarask.in&quot;&gt;Aza Raskin&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221085991&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2008-09-02T01:44:13&quot;&gt;2008-09-02T01:44:13&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Hi Leslie,&lt;/p&gt;

&lt;p&gt;This is a beautiful tutorial on writing a Ubiquity command. We'd love your help in making Ubiquity's documentation better (especially dev facing). You should totally link to this from the Ubiquity Wiki -- or even add the content in someway.&lt;/p&gt;

&lt;p&gt;Anyway, just wanted to say thanks.&lt;/p&gt;

&lt;p&gt;-- Aza&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221085993&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.slackorama.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=15b474c86cd73c2d12c1d77af11c1d8a&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.slackorama.com&quot;&gt;seth&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221085993&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2008-09-08T17:30:16&quot;&gt;2008-09-08T17:30:16&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Am I doing something wrong?  &lt;/p&gt;

&lt;p&gt;When I enter in &quot;sh this tagged tag1 tag2 entitled This is a title&quot; everything after the tagged is added as a tag. It's not seeing the entitled part.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221085994&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://spyced.blogspot.com/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=849810634810c960e5e7c27fa54a0f5b&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://spyced.blogspot.com/&quot;&gt;http://spyced.blogspot.com/&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221085994&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2008-09-15T19:12:58&quot;&gt;2008-09-15T19:12:58&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Did something break?  I'm getting a 404 accessing http://decafbad.com/hg/UbiquityCommands/file/tip/delicious.ubiq.js&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221085995&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=2377f34a68801b861c3e54e1301f0dce&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;l.m.orchard&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221085995&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2008-09-15T23:07:42&quot;&gt;2008-09-15T23:07:42&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Yeah, looks like I had a small snafu with switching back from Lighttpd to Apache.  Left out a rewrite rule - doh!&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221085996&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=357a20e8c56e69d6f9734d23ef9517e8&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;Tony&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221085996&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2008-10-22T04:56:03&quot;&gt;2008-10-22T04:56:03&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Great article. This is replacing my delicious bookmarklet. Thanks!&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221085997&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=31461076fcbce091ff822fc9ac31315d&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;dgtlchlk&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221085997&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2009-04-14T01:06:57&quot;&gt;2009-04-14T01:06:57&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Great article and command.
Wish it worked correctly with the latest 0.1.8 release though. No matter what text you put in it adds everything as the notes. The tagged and entitled modifiers don't work.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221085999&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.nolanhergert.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=957e24509baf770ba57ad306e20f201c&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.nolanhergert.com&quot;&gt;Nolan&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221085999&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2009-04-16T03:10:07&quot;&gt;2009-04-16T03:10:07&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;I second that comment. Delicious is actually saying the link given was &quot;chrome://browser/content/browser.xul&quot; and marking it as harmful inside delicious!&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221086002&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=3d056a5b07c384647fe0806b0dfc429e&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;Justin&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221086002&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2009-07-06T12:39:39&quot;&gt;2009-07-06T12:39:39&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Hi Leslie,&lt;/p&gt;

&lt;p&gt;Thanks for the delicious ubiquity command. Unfortunately, as one of the commenters above mentions, the tagged modifier doesn't seem to work. I'm using Ubiquity 0.5 pre and typing the phrase:&lt;/p&gt;

&lt;p&gt;share tagged foo&lt;/p&gt;

&lt;p&gt;Adds the bookmark to Delicious with the note text &quot;tagged foo&quot;&lt;/p&gt;

&lt;p&gt;Cheers, Justin&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221086004&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://ericscalf.com/stream&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=0775f9beff626496b86d7cb602e5f46f&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://ericscalf.com/stream&quot;&gt;Eric&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221086004&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2009-07-20T22:43:17&quot;&gt;2009-07-20T22:43:17&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Echoing others.. I'm using the latest ubiquity (err, next to latest.. 0.1.8?), and doing &quot;share-on-delicious this is a note tagged testing&quot; saves the link with notes &quot;this is a note tagged testing&quot; and no tags. :(  Then again, the other delicious command I've found (by someone else) is having the same issue.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;/ul&gt;
    
        &lt;/div&gt;



</content>
    </entry>
    
    

    <entry>
        <title>Ubiquity cracks open personal mashup tinkering</title>
        <link href="http://decafbad.com/blog/2008/08/31/ubiquity-cracks-open-personal-mashup-tinkering"/>
        <updated>2008-08-31T04:07:22+00:00</updated>
        <id>http://decafbad.com/blog/2008/08/31/ubiquity-cracks-open-personal-mashup-tinkering</id>
        <content type="html">&lt;p&gt;When I was a wee hacker, I lived my digital life though a &lt;a href=&quot;http://www.virtualsky.net/iadoremyc64/&quot;&gt;Commodore 64&lt;/a&gt;.  I played games on it, did homework, talked to people far away—you know, all the stuff they showed in the pictures on the box.  I also took things apart—both the machine itself and software running on it.  I grew up learning that my digital environment was ultimately understandable, &lt;a href=&quot;http://cbm.csbruce.com/~csbruce/cbm/transactor/&quot;&gt;susceptible to tinkering&lt;/a&gt;, and open to being bent to my own purposes.&lt;/p&gt;

&lt;p&gt;From the Commodore 64, I graduated eventually to terminals and text editors, opening portals mostly onto computers elsewhere via powerful UNIX command shells.  And, of course, over the past decade, this has largely given way to life in a browser.&lt;/p&gt;

&lt;p&gt;Yet, for a little while, particularly in the first few years of browsers, freedom to tinker seemed cramped.  JavaScript had yet to arrive, and was a little messy when it did.  There was no relatively easy addon development.  And, though the portals opened by a browser were richer than those provided by terminals, the paths of navigation defined by links controlled by site owners offered less freedom of movement than UNIX commands.  I could create my own pages, but I couldn't do much to others' pages.&lt;/p&gt;

&lt;p&gt;But then, javascript: URLs came around, dots were connected, and &lt;a href=&quot;http://en.wikipedia.org/wiki/Bookmarklet&quot;&gt;bookmarklets&lt;/a&gt; were born.  Suddenly, it was possible to customize &lt;em&gt;my&lt;/em&gt; browsing environment with arbitrary JavaScript code having access to the current page—no matter &lt;em&gt;whose&lt;/em&gt; page it was.  And, through the various tricks of the AJAX trade, bookmarklets have only gotten more capable throughout the years.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.mozilla.org/docs/end-user/keywords.html&quot;&gt;Smart keyword shortcuts&lt;/a&gt; came around a little later, allowing quick access to bookmarks via simple keywords typed into the location bar.  The smart part, though, came in the form of bookmarked URLs with placeholders and keywords given arguments to fill the placeholders—allowing not only quick access to bookmarked pages but also search engine forms bookmarked with late-bound fields.&lt;/p&gt;

&lt;p&gt;Bookmarklets inherited the benefits of smart keyword shortcuts.  The same placeholder in http: URLs can be inserted into the code of a javascript: URL, thus parameterizing the JavaScript code and incidentally turning the location bar into a kind of primitive command line.  For example, one of my most heavily used &quot;&lt;a href=&quot;http://naeblis.cx/weblog/2004/08/09/DeliciousAddresslets&quot;&gt;addresslets&lt;/a&gt;&quot; is based on &lt;a href=&quot;http://ejohn.org/blog/super-fast-delicious-bookmarklet/&quot;&gt;John Resig's original &quot;Super-Fast Delicious Bookmarklet&quot;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Another leap in prying open the browser tinkering space came in the form of &lt;a href=&quot;http://www.greasespot.net/&quot;&gt;Greasemonkey&lt;/a&gt;—an addon-powered environment created explicitly for the purpose of end-user scripting applied to others' pages.  &lt;a href=&quot;http://www.greasespot.net/&quot;&gt;Greasemonkey&lt;/a&gt; user scripts can do more than bookmarklets, and with a much better development environment to boot.  And, though a user script can't do quite as much as a proper browser addon, they're much easier to hack on and distribute.&lt;/p&gt;

&lt;p&gt;Now, consider one of &lt;a href=&quot;http://labs.mozilla.com/&quot;&gt;Mozilla Labs&lt;/a&gt;' &lt;a href=&quot;http://labs.mozilla.com/2008/08/introducing-ubiquity/&quot;&gt;newest projects&lt;/a&gt;, named &lt;a href=&quot;http://labs.mozilla.com/2008/08/introducing-ubiquity/&quot;&gt;Ubiquity&lt;/a&gt;.  This rough and experimental addon for Firefox combines and improves upon everything I've described so far:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://labs.mozilla.com/2008/08/introducing-ubiquity/&quot;&gt;Ubiquity&lt;/a&gt; is a hackable command line environment, better than &lt;a href=&quot;http://en.wikipedia.org/wiki/Bookmarklet&quot;&gt;bookmarklets&lt;/a&gt; and smart &lt;a href=&quot;http://www.mozilla.org/docs/end-user/keywords.html&quot;&gt;keyword shortcuts&lt;/a&gt;;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://labs.mozilla.com/2008/08/introducing-ubiquity/&quot;&gt;Ubiquity&lt;/a&gt; enables persistent customization of others' pages, not unlike &lt;a href=&quot;http://www.greasespot.net/&quot;&gt;Greasemonkey&lt;/a&gt;;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://labs.mozilla.com/2008/08/introducing-ubiquity/&quot;&gt;Ubiquity&lt;/a&gt; facilitates live in-browser creation and web-based subscription to user commands and scripts;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://labs.mozilla.com/2008/08/introducing-ubiquity/&quot;&gt;Ubiquity&lt;/a&gt; gives access to browser chrome resources without a need for frequent restarts;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So far, most of the &lt;a href=&quot;https://labs.toolness.com/ubiquity-herd/&quot;&gt;commands&lt;/a&gt; I see popping up since the 0.1 release have not accomplished much more than &lt;a href=&quot;http://www.mozilla.org/docs/end-user/keywords.html&quot;&gt;smart keyword shortcuts&lt;/a&gt; in the location bar could.  But, it's early yet, and &lt;a href=&quot;http://labs.mozilla.com/2008/08/introducing-ubiquity/&quot;&gt;Ubiquity&lt;/a&gt; is far from limited to these commands.&lt;/p&gt;

&lt;p&gt;Once the basics have been well-explored, I expect to see more people taking a crack at the broader capabilities offered by &lt;a href=&quot;http://labs.mozilla.com/2008/08/introducing-ubiquity/&quot;&gt;Ubiquity&lt;/a&gt;.  &lt;a href=&quot;http://en.wikipedia.org/wiki/Bookmarklet&quot;&gt;Bookmarklets&lt;/a&gt; and &lt;a href=&quot;http://www.greasespot.net/&quot;&gt;Greasemonkey&lt;/a&gt; can't access browser chrome—but &lt;a href=&quot;http://labs.mozilla.com/2008/08/introducing-ubiquity/&quot;&gt;Ubiquity&lt;/a&gt; can.  &lt;a href=&quot;http://labs.mozilla.com/2008/08/introducing-ubiquity/&quot;&gt;Ubiquity&lt;/a&gt; also offers a user interface that's so much more promising than keyword shortcuts, including command previews and typed parameters with suggestions.&lt;/p&gt;

&lt;p&gt;Ubiquity promises web-wide mashups directed by a conversational command interface.  All in all, the potential of this makes me feel like my digital environment—browser and web as a whole—is getting even more intimately, personally hackable.&lt;/p&gt;

&lt;p&gt;It'll be very interesting to see where this project goes.&lt;/p&gt;

&lt;div id=&quot;comments&quot; class=&quot;comments archived-comments&quot;&gt;
            &lt;h3&gt;Archived Comments&lt;/h3&gt;
            
        &lt;ul class=&quot;comments&quot;&gt;
            
        &lt;li class=&quot;comment&quot; id=&quot;comment-221089574&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=22b4e824255828f5aedd0e6e2558dc52&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;Raul&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221089574&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2008-08-31T10:20:58&quot;&gt;2008-08-31T10:20:58&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Hi, was using the original delicious command linked from the Ubiquity wiki, just tried yours and its definitely more polished and functional. Great job with the preview and the extra functionality. Only thing is 'share-to-delicious' is too much to type so I unsubscribed the previous command and changed the namespace in yours. This is clearly going to become a problems as the commands proliferate.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221089575&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=2377f34a68801b861c3e54e1301f0dce&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;l.m.orchard&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221089575&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2008-08-31T14:43:39&quot;&gt;2008-08-31T14:43:39&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;@Raul: &quot;share-to-delicious&quot; is long, but keep in mind is that you only need to type enough of the command to disambiguate it.  That is, all I type is &quot;sh this tagged osx software apple&quot; because I have no other commands starting with &quot;sh&quot;.  Watch the list of commands in the preview as you type.  Those tell you what the parser thinks of what you're typing as you type.  It's like automatic tab-completion.&lt;/p&gt;

&lt;p&gt;Also, I think there's work planned to put some usage based sorting into the command parser, preferring the commands you use most in order of disambiguation.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221089576&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://abcdefu.wordpress.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=af8b180d6d4092fb42fe6b5e0b21536c&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://abcdefu.wordpress.com&quot;&gt;Abi&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221089576&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2008-08-31T15:33:24&quot;&gt;2008-08-31T15:33:24&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Nice post. I share your sentiment with regards to Ubiquity commands. A lot of commands that I see are just plain simple searches. I hope developers will work on more interesting things. For example, even things like auto-form filling for this comment (possibly even on page load without having to type a command) could be done by Ubiquity. There's still a lot more room for experimentation.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221089578&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://abcdefu.wordpress.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=af8b180d6d4092fb42fe6b5e0b21536c&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://abcdefu.wordpress.com&quot;&gt;Abi&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221089578&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2008-08-31T15:45:59&quot;&gt;2008-08-31T15:45:59&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;&lt;/p&gt;

&lt;p&gt;But otherwise, I &lt;em&gt;really&lt;/em&gt; like your command especially the preivew. We should include it as a builtin command, if you don't mind. :)&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221089580&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://abcdefu.wordpress.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=af8b180d6d4092fb42fe6b5e0b21536c&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://abcdefu.wordpress.com&quot;&gt;Abi&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221089580&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2008-08-31T15:51:20&quot;&gt;2008-08-31T15:51:20&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;I noticed a bug in your command. If I select some text in the awesomebar, the bookmark url is chrome. You should use something the command utils to get the url, instead.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221089582&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=2377f34a68801b861c3e54e1301f0dce&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;l.m.orchard&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221089582&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2008-09-01T06:17:37&quot;&gt;2008-09-01T06:17:37&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;@Abi: Making this a built-in command is totally fine by me!  It can use more work, though, for sure.&lt;/p&gt;

&lt;p&gt;Also, I can reproduce that bug.  Ugh.  I can't find any methods in the CmdUtils to get the current page URL, though.  I'll keep poking a bit though.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221089584&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://abcdefu.wordpress.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=af8b180d6d4092fb42fe6b5e0b21536c&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://abcdefu.wordpress.com&quot;&gt;Abi&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221089584&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2008-09-01T06:50:23&quot;&gt;2008-09-01T06:50:23&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Your blog seems to be rejecting code (that's why I had so many posts in the first place). You can get the current page url using (with dots):&lt;/p&gt;

&lt;p&gt;CmdUtils  getDocumentInsecure() location href&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221089586&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://theunfocused.net/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=738af918f39d544f8b0d765850c986f8&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://theunfocused.net/&quot;&gt;Blair McBride&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221089586&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2008-09-02T02:50:12&quot;&gt;2008-09-02T02:50:12&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;I recommend against using getDocumentInsecure() - its got &quot;Insecure&quot; in its name for a reason! Instead, you should use:&lt;/p&gt;

&lt;p&gt;Application.activeWindow.activeTab.uri.spec&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;/ul&gt;
    
        &lt;/div&gt;



</content>
    </entry>
    
    

    <entry>
        <title>do not taunt happy fun JSON</title>
        <link href="http://decafbad.com/blog/2006/12/21/do-not-taunt-happy-fun-json"/>
        <updated>2006-12-21T02:55:45+00:00</updated>
        <id>http://decafbad.com/blog/2006/12/21/do-not-taunt-happy-fun-json</id>
        <content type="html">&lt;p&gt;Allow me to repeat myself somewhat and clarify my general opinion of JSON and its use in cross-domain browser scripting:&lt;/p&gt;

&lt;p&gt;Happy Fun JSON is not really an API. Happy Fun JSON is not a bold declaration of side-taking in the grand war of web service specifications. Do not base business models on Happy Fun JSON. Caution: Happy Fun JSON may suddenly accelerate to dangerous speeds or stop altogether. Happy Fun JSON contains a liquid core, which, if exposed due to rupture, should not be touched, inhaled, or looked at. Ingredients of Happy Fun JSON include an unknown glowing substance which fell to Earth, presumably from outer space. If Happy Fun JSON begins to smoke, get away immediately. Seek shelter and cover head.&lt;/p&gt;

&lt;p&gt;Do not taunt Happy Fun JSON.&lt;/p&gt;

&lt;p&gt;Having said all that?  Happy Fun JSON is pretty fun to throw around.&lt;/p&gt;

&lt;div id=&quot;comments&quot; class=&quot;comments archived-comments&quot;&gt;
            &lt;h3&gt;Archived Comments&lt;/h3&gt;
            
        &lt;ul class=&quot;comments&quot;&gt;
            
        &lt;li class=&quot;comment&quot; id=&quot;comment-221087880&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://gfmorris.net/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=505e3b39dcea29b3ded74a5494c493eb&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://gfmorris.net/&quot;&gt;Geof F. Morris&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221087880&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-12-21T03:34:19&quot;&gt;2006-12-21T03:34:19&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Did it hurt when Happy Fun JSON fell from Heaven?  ;)&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221087884&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://franklinmint.fm&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=b9ed774661a22ff8797a1e0e24f0baf3&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://franklinmint.fm&quot;&gt;Robert Sayre&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221087884&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-12-21T03:55:47&quot;&gt;2006-12-21T03:55:47&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Obviously, the new del.icio.us JSON url feed is crushing blow against XML Web Enterprise Services Declarative Net Neutrality.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221087886&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=c82c72ca4f9eab33a80a7bd839c1ae0b&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;jamesv&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221087886&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-12-21T15:14:24&quot;&gt;2006-12-21T15:14:24&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;I only wish you could pass Happy Fun JSON into Flash via FlashVars in IE. FF and Safari seem to have no problems with it.&lt;/p&gt;

&lt;p&gt;It would make authoring a richer content version of sIFR much, much easier.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221087889&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.litfuel.net/plush&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=048d90bde20830d1e4fdec860321a5a6&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.litfuel.net/plush&quot;&gt;Jim Plush&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221087889&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-12-22T19:22:48&quot;&gt;2006-12-22T19:22:48&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;You should be banned from talking about JSON if you think you have to choose one or the other. A place for everything and everything in it's place.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221087893&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://dannyayers.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=7028f422ca6da0180de6c9d922a3228f&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://dannyayers.com&quot;&gt;Danny&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221087893&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-12-31T18:11:19&quot;&gt;2006-12-31T18:11:19&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;All this lynch talk - I just got throttled! &lt;/p&gt;

&lt;p&gt;Running the script &lt;a href=&quot;http://dannyayers.com/2006/12/29/del&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; on a series of URIs got me the 999 error (no sure how many had run). There's a 2 second pause between calls, I thought that would be polite enough. Still throttled now, maybe 10 mins later. Any suggestions for what would prevent throttling? How long it needs to recover?&lt;/p&gt;

&lt;p&gt;btw, I think Happy Fun JSON is great, and not unreasonable for interop. But what isn't so good for interop is inventing a new HTTP code when there's &lt;a href=&quot;http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4&quot; rel=&quot;nofollow&quot;&gt;503 Service Unavailable&lt;/a&gt; (and a Retry-After header would be handy).&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221087896&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.alleged.org.uk/pdc/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=5b7d6aea7a0ef515700985bb17cdc5a0&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.alleged.org.uk/pdc/&quot;&gt;Damian Cugley&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221087896&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2007-01-22T14:16:27&quot;&gt;2007-01-22T14:16:27&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;@jamesv: The first thing I did with JSON at work was pass it in to a Flash movie via FlashVars. This used a JSON decode written in ActionScript grabbed from JSON.org, plus a JSON encoder written in C# (it did not take long to write because I  did not attempt to serialize arbitrary objects).  Some gratuitous URL-encoding was also involved. Compared with passing the same data structure via URL-encoded XML to be picked apart by ActionScript's DOM support, it was easy and much more like fun.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;/ul&gt;
    
        &lt;/div&gt;



</content>
    </entry>
    
    

    <entry>
        <title>drag and drop and the missing mouseup</title>
        <link href="http://decafbad.com/blog/2006/12/19/drag-and-drop-and-the-missing-mouseup"/>
        <updated>2006-12-19T16:21:40+00:00</updated>
        <id>http://decafbad.com/blog/2006/12/19/drag-and-drop-and-the-missing-mouseup</id>
        <content type="html">&lt;blockquote cite=&quot;http://www.thinkvitamin.com/features/design/create-cross-browser-vector-graphics#comment-34453&quot;&gt;With the draggable circles - click, drag, move the mouse outside the rectangle, release the mouse button. Now move the mouse back inside the rectangle, and it still thinks your dragging, even though you’ve mouse-up’d.&lt;br /&gt;&lt;br /&gt;I guess this is because it’s not catching the onmouseup when you’re outside it’s “domain”. Perhaps make it automatically trigger the mouseup when the pointer leaves the area?&lt;/blockquote&gt;


&lt;div class=&quot;quotesource&quot;&gt;Source: &lt;a href=&quot;http://www.thinkvitamin.com/features/design/create-cross-browser-vector-graphics#comment-34453&quot;&gt;Vitamin Features » Create cross browser vector graphics - Comment by Steve&lt;/a&gt;&lt;/div&gt;


&lt;p&gt;So, that &lt;code&gt;dojo.gfx&lt;/code&gt; thing is cool - but what caught my eye in the above-linked article is the above-quoted comment.  Drag and drop and missed mouseups seem to be an issue everywhere.  I can't seem to get around them in my &lt;a href=&quot;http://decafbad.com/trac/wiki/XoxoOutliner&quot;&gt;XoxoOutliner&lt;/a&gt; drag code, &lt;a href=&quot;http://developer.yahoo.com/yui/examples/dragdrop/drag.html?mode=dist&quot;&gt;YUI DnD examples&lt;/a&gt; seem to suffer from it, and hell - even Firefox itself doesn't seem immune:  Try drag-selecting some text, wander off-window with the mouse, release the mouse button.  For me at least, on my Mac, the drag-selection keeps doing its thing when I wander back on-window.   No me gusta.&lt;/p&gt;
</content>
    </entry>
    
    

    <entry>
        <title>XoxoOutliner shows some signs of life</title>
        <link href="http://decafbad.com/blog/2006/11/12/xoxooutliner-shows-some-signs-of-life"/>
        <updated>2006-11-12T05:25:40+00:00</updated>
        <id>http://decafbad.com/blog/2006/11/12/xoxooutliner-shows-some-signs-of-life</id>
        <content type="html">&lt;p&gt;Remember when I &lt;a href=&quot;http://decafbad.com/blog/2006/03/25/about-xoxooutliner&quot;&gt;started writing about&lt;/a&gt; &lt;a href=&quot;http://decafbad.com/trac/wiki/XoxoOutliner&quot;&gt;XoxoOutliner&lt;/a&gt; around 8 months ago?  Yeah, lots has happened with life in general between then and now - but lately I've been &lt;a href=&quot;http://decafbad.com/blog/2006/11/06/xoxooutliner-rewrite-coming-now-with-event-delegation&quot;&gt;working on code&lt;/a&gt; for it again.  As you might see from &lt;a href=&quot;http://decafbad.com/trac/timeline&quot;&gt;my Trac timeline&lt;/a&gt;, I've got lots of new code checked in.  And I mean &lt;a href=&quot;http://decafbad.com/trac/changeset/765&quot;&gt;lots&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If I can keep up this bout of &lt;a href=&quot;http://decafbad.com/blog/2006/05/26/confessions-of-a-serial-enthusiast&quot;&gt;serial enthusiasm&lt;/a&gt; for the project, you'll be hearing lots more about it soon.&lt;/p&gt;

&lt;p&gt;For now, check out the new static &lt;a href=&quot;http://decafbad.com/2006/11/XoxoOutliner/README.html&quot;&gt;README.html&lt;/a&gt; and the &lt;a href=&quot;http://decafbad.com/2006/11/XoxoOutliner/&quot;&gt;live demo&lt;/a&gt;.  It's extremely bugful, but it might do interesting things for Firefox and Safari users.&lt;/p&gt;

&lt;div id=&quot;comments&quot; class=&quot;comments archived-comments&quot;&gt;
            &lt;h3&gt;Archived Comments&lt;/h3&gt;
            
        &lt;ul class=&quot;comments&quot;&gt;
            
        &lt;li class=&quot;comment&quot; id=&quot;comment-221087237&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://vdm.cc/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=a4dae25fe0faeec4f9ff1ad769a52b36&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://vdm.cc/&quot;&gt;Vincent D Murphy&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221087237&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-11-12T09:14:26&quot;&gt;2006-11-12T09:14:26&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Wow!&lt;/p&gt;

&lt;p&gt;This thing is such an improvement. I love that the README is an outline.&lt;/p&gt;

&lt;p&gt;I think this is really powerful. I think an outliner should eliminate the need for a lot of rich text browser editors. Outlines inherently break text into small little chunks, which are stylable (and potentially URL addressable, for block-level comments). I think this thing would rock in a wiki.&lt;/p&gt;

&lt;p&gt;Keep up the good work!&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221087241&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://db79.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=db8059b0ce0b3cf393f4de0ad7af758f&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://db79.com&quot;&gt;Shawn Medero&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221087241&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-11-13T12:59:18&quot;&gt;2006-11-13T12:59:18&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Bravo! This is a great set of updates and works well in Safari (haven't had the time yet to test in Firefox.)&lt;/p&gt;

&lt;p&gt;I've been thinking about using some portion of these tools in my wiki software to dress up outlines. I'm not sure yet... sometimes I feel like editing an outline  (well a simple one I'd use on a wiki at least) is quicker manually with something like Markdown.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221087243&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.gibberish.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=d78a376f93e23dd093abe8d280198ebd&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.gibberish.com&quot;&gt;misuba&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221087243&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-11-14T00:15:01&quot;&gt;2006-11-14T00:15:01&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Rad!&lt;/p&gt;

&lt;p&gt;Keep this up and I won't have to finish mine. :-)&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;/ul&gt;
    
        &lt;/div&gt;



</content>
    </entry>
    
    

    <entry>
        <title>XoxoOutliner rewrite coming, now with event delegation</title>
        <link href="http://decafbad.com/blog/2006/11/06/xoxooutliner-rewrite-coming-now-with-event-delegation"/>
        <updated>2006-11-06T18:14:26+00:00</updated>
        <id>http://decafbad.com/blog/2006/11/06/xoxooutliner-rewrite-coming-now-with-event-delegation</id>
        <content type="html">&lt;p&gt;For what it's worth: I've answered my own &lt;a href=&quot;http://decafbad.com/blog/2006/10/31/event-delegation-based-dhtml-drag-and-drop&quot;&gt;question about event delegation based drag and drop&lt;/a&gt;.  It seems to work quite well on my machine, which is quite a bit beefier than my old machine.  I should try it out on there soon.  But, I'll hopefully be releasing it soon in the form of a mostly-rewritten &lt;a href=&quot;http://decafbad.com/trac/wiki/XoxoOutliner&quot;&gt;XoxoOutliner&lt;/a&gt; that will feature drag and drop outline items as well as keyboard navigation/control and in-place editing.  And, it should actually start to become useful, since I plan to also whip up a PHP-based server side bit that will handle loading and saving outlines, as well as possibly a client-side bit that can save outlines using local browser storage.  I have the technology - we'll see how far my ambitious plans take me during this hobbling sprint of development.&lt;/p&gt;

&lt;div id=&quot;comments&quot; class=&quot;comments archived-comments&quot;&gt;
            &lt;h3&gt;Archived Comments&lt;/h3&gt;
            
        &lt;ul class=&quot;comments&quot;&gt;
            
        &lt;li class=&quot;comment&quot; id=&quot;comment-221087316&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://db79.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=db8059b0ce0b3cf393f4de0ad7af758f&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://db79.com&quot;&gt;Shawn Medero&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221087316&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-11-07T11:01:11&quot;&gt;2006-11-07T11:01:11&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Great news Les! I had checked out the souce of XoxoOutliner and was thinking about playing around myself. Let me know if you'd like an additional tester. :)&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221087318&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://overstimulate.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=50d10a8864accf0b2522c326381a4702&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://overstimulate.com&quot;&gt;Jesse Andrews&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221087318&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-11-08T18:18:11&quot;&gt;2006-11-08T18:18:11&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Is there a demo of the event delegation framework you are building posted?&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221087319&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=2377f34a68801b861c3e54e1301f0dce&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;l.m.orchard&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221087319&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-11-08T18:23:29&quot;&gt;2006-11-08T18:23:29&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Nope, nothing available or posted yet.  Soon, though - hoping to check the works in before the end of the week.  It's a bit in pieces right now&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221087320&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://codinginparadise.org&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=96da1b3d8858bfa0306b7c55d3e48270&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://codinginparadise.org&quot;&gt;Brad Neuberg&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221087320&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-11-29T09:57:04&quot;&gt;2006-11-29T09:57:04&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Les, very exciting that you're jumping back into the XoXoOutliner code! I can't wait to try to hook it up to HyperScope and play with it some more. It's the best open source DHTMLly outliner out there.&lt;/p&gt;

&lt;p&gt;Two things that might help you; for local storage, I just checked in a new storage provider for Dojo Storage that will use the native storage abilities in Firefox 2 if they are available, in an automagic way; if they aren't there, then it will revert to hidden Flash like it's worked in the past. This might be useful for you; don't know what you were thinking about for local storage. There's a page up with better docs on Dojo Storage now at http://manual.dojotoolkit.org/WikiHome/DojoDotBook/Book50&lt;/p&gt;

&lt;p&gt;The second thing is I just finished an HTML to OPML outline transformer; right now it adds in the line for the HyperScope XSLT stylesheet, but it can be used by any OPML hackers who want to play with bringing HTML into the OPML world, including for things like experimenting with the kind of OPath, deep linking, and inclusion work you've hinted about in other blog entries. A blog post on it is here: http://codinginparadise.org/weblog/2006/11/html-transformer-for-hyperscope-apply.html . Might be fun for you to use in your hacking.&lt;/p&gt;

&lt;p&gt;We still need to grab drinks some time! How is your leg healing up? Hope you had a great thanksgiving.&lt;/p&gt;

&lt;p&gt;Best,
  Brad&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;/ul&gt;
    
        &lt;/div&gt;



</content>
    </entry>
    
    

    <entry>
        <title>Event Delegation based DHTML Drag and Drop?</title>
        <link href="http://decafbad.com/blog/2006/10/31/event-delegation-based-dhtml-drag-and-drop"/>
        <updated>2006-10-31T21:46:40+00:00</updated>
        <id>http://decafbad.com/blog/2006/10/31/event-delegation-based-dhtml-drag-and-drop</id>
        <content type="html">&lt;p&gt;So, as the urge to tinker rises again, I've started playing with &lt;a href=&quot;http://developer.yahoo.com/yui/&quot;&gt;YUI&lt;/a&gt; and cracked open some &lt;a href=&quot;http://decafbad.com/trac/wiki/XoxoOutliner&quot;&gt;XoxoOutliner&lt;/a&gt; code again.  One of the things that struck me like a bolt from the blue recently is the notion of &lt;a href=&quot;http://icant.co.uk/sandbox/eventdelegation/&quot;&gt;event delegation&lt;/a&gt;.  For the most part, I've treated event bubbling as a nuisance, except for where it came in handy in keyboard input handling.  But avoiding the need to individually track events on every list element on the page via instantiated objects and methods is &lt;em&gt;hot&lt;/em&gt; and &lt;em&gt;forehead-slappingly obvious&lt;/em&gt; once you've seen it working.  Just implement one set of event handlers on the outline root element (ie. UL or OL), and do the right thing as events come in from the list child elements.&lt;/p&gt;

&lt;p&gt;Thus, while I can do outline node expand/collapse with ease, my goal is to implement an &lt;a href=&quot;http://icant.co.uk/sandbox/eventdelegation/&quot;&gt;event delegation&lt;/a&gt; based approach to dragging outline nodes around.  Apropos of that, I've been poking at &lt;a href=&quot;http://yuiblog.com/sandbox/yui/v0114/examples/event/delegation.php&quot;&gt;how event delegation it works in YUI&lt;/a&gt;.  While there's nothing much special about it in general, I've run into a bit of a snag when it comes to drag-and-drop.&lt;/p&gt;

&lt;p&gt;See, YUI comes with a &lt;a href=&quot;http://developer.yahoo.com/yui/dragdrop/&quot;&gt;rather nice drag-and-drop abstraction&lt;/a&gt; that I'd like to use.  That abstraction, however, requires the instantiation of lots of little objects - one per outline node.  Definitely not delegation-based: The problem is that I'll be adding and removing outline nodes at whim throughout the lifetime of the page, which would require lots of care to ensure that I'm maintaining drag-and-drop wrapper objects.  I've done that a bit in &lt;a href=&quot;http://decafbad.com/trac/wiki/XoxoOutliner&quot;&gt;XoxoOutliner&lt;/a&gt;; it sucks.&lt;/p&gt;

&lt;p&gt;So, I was able to build part of a delegation-based drag tracker from scratch.  I'm sad to lose the other niceties that the YUI DnD offers, but it works.  The problem now, though, is the &lt;em&gt;drop&lt;/em&gt; part of the equation.  I can drag elements around the page until my heart's content, but I can never quite tell in what context I've dropped it.&lt;/p&gt;

&lt;p&gt;I poured through the source code for the YUI DnD implementation, as well as the implementation of a few other JS frameworks' DnD offerings.  The general solution seems to be calculating and caching the page coordinate regions for each element relevant in the drop operation.  In my case, that usually includes every outline node on the page.  That's easy when you have lots of little objects instantiated - you just iterate through them and match up regions with the coordinates where the drag stopped.  But, part of my win with event delegation was that I don't have to maintain a pile of objects.&lt;/p&gt;

&lt;p&gt;Oh yeah, and did I mention that I don't assign IDs to all the little list items making up my outline?  And that I don't particularly feel like doing so?  That also throws a monkey wrench in the YUI DnD paradigm.&lt;/p&gt;

&lt;p&gt;The only idea I have so far is that I need to at least build a cache mapping regions to outline nodes, and keep it fairly well maintained.  That should be lighterweight than a fleet of DOM event wrappers, but still annoying.  I could trigger a cache refresh when a drag first starts, but that will probably drag down UI response.  I could trigger it whenever the outline changes, but that's just moving the burden.  And then, who knows how I'll map ID-less elements to their respective regions, while ensuring I stay clear of memory leaks.  That's still semi-voodoo to me, and I feel ashamed of that.&lt;/p&gt;

&lt;p&gt;Eh, maybe it won't be as bad as I think.  But, to anyone who understands what I just spewed:  Any ideas?&lt;/p&gt;

&lt;div id=&quot;comments&quot; class=&quot;comments archived-comments&quot;&gt;
            &lt;h3&gt;Archived Comments&lt;/h3&gt;
            
        &lt;ul class=&quot;comments&quot;&gt;
            
        &lt;li class=&quot;comment&quot; id=&quot;comment-221083066&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=2d870e8df3af0d62fa636b336b17cd60&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;Nick&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221083066&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-11-01T00:19:27&quot;&gt;2006-11-01T00:19:27&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;You know, Marty and I were talking tonight about how some of your posts make NO sense to us.  She even said &quot;it's like he's talking another fucking language&quot;.&lt;/p&gt;

&lt;p&gt;Damn Programmers!!&lt;/p&gt;

&lt;p&gt;--nick&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221083067&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://gandrew.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=de0d80e531fef9095048375a247d1149&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://gandrew.com&quot;&gt;Gareth Andrew&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221083067&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-11-01T18:57:21&quot;&gt;2006-11-01T18:57:21&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;I'm sure I've missed something obvious - why can't you simply use the same event delegation approach on the mouseUp event?  getTarget should return the node you've dropped on, what else do you need?&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221083074&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=2377f34a68801b861c3e54e1301f0dce&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;l.m.orchard&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221083074&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-11-01T19:18:52&quot;&gt;2006-11-01T19:18:52&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Gareth: Yup, the issue I have with the mouseUp is that getTarget gives me what was under the mouse when I let go of the button - namely, the element I've been dragging around, not the element under the thing being dragged.  In addition, for user feedback &lt;em&gt;during&lt;/em&gt; the drag (ie. at mouseMove time), I want to know what's under the dragged element - so I can highlight the potential landing spot, etc.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221083075&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.fluffy.co.uk/stediting/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=a660afb8f1f22ce1b03ad3b532aa05b5&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.fluffy.co.uk/stediting/&quot;&gt;Ben&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221083075&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-11-02T13:10:53&quot;&gt;2006-11-02T13:10:53&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;I presume the problem is that, given a point on the screen, you want to find exactly what DOM element is beneath it.&lt;/p&gt;

&lt;p&gt;I found a solution for this in my proof-of-concept structured editor http://www.fluffy.co.uk/stediting/ -- you need to know where the mouse was clicked to insert the caret.&lt;/p&gt;

&lt;p&gt;It might be a start anyway.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221083078&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.gibberish.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=d78a376f93e23dd093abe8d280198ebd&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.gibberish.com&quot;&gt;misuba&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221083078&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-11-06T02:40:19&quot;&gt;2006-11-06T02:40:19&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;I think the dragdrop stuff in scriptaculous would get you most of this... at least, it is good about draggable elements having handles you can specify (e.g. child elements of the thing you want to drag), and flexible about what sorts of targets you can land on.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221083084&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=2377f34a68801b861c3e54e1301f0dce&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;l.m.orchard&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221083084&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-11-06T19:06:03&quot;&gt;2006-11-06T19:06:03&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;misuba: Nope, the Scriptaculous approach gives me problems too.  The first is that I don't like Prototype, unless they've stopped messing with Object.prototype since I last checked.  The second is that DnD in Scriptaculous involves juggling lots of little objects ilke most other DnD implementations I've found.  When I have an outline of 100's to 1000's of items, that really blows.  I think I've got an approach working now that's significantly lighter weight.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221083085&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.gibberish.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=d78a376f93e23dd093abe8d280198ebd&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.gibberish.com&quot;&gt;misuba&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221083085&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-11-06T22:26:55&quot;&gt;2006-11-06T22:26:55&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;I'm interested to see your approach. (FWIW, Proto hasn't touched Object.prototype for a couple of versions now.)&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221083086&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://javascriptmvc.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=10b3282aac613831755e42ac74acbc41&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://javascriptmvc.com&quot;&gt;Justin Meyer&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221083086&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2008-05-31T07:43:52&quot;&gt;2008-05-31T07:43:52&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;I am working on the exact same issue for JavaScriptMVC.  If you haven't seen JavaScriptMVC, check out its trunk.  In the controller2 plugin, you'll find a really nice event delegation library.&lt;/p&gt;

&lt;p&gt;I've only thought of 1 way to do event delegation drops.  It's crazy, but it might work.&lt;/p&gt;

&lt;p&gt;First, style Drags so their z-Index is LOWER than the Drops.  You want your mouse to hit the droppable areas.&lt;/p&gt;

&lt;p&gt;Once a droppable is moused over by dragging a drag to it, it creates a transparent element in the exact same position as the Droppable.  It also lowers the droppable z-Index.  This gives the appearance that the draggable is over the droppable.&lt;/p&gt;

&lt;p&gt;To simulate movement, the transparent droppable's mouseovers are sent to the draggable.&lt;/p&gt;

&lt;p&gt;On mousing out of the transparent Droppable, it sets everything back to normal.&lt;/p&gt;

&lt;p&gt;I haven't tried this yet.  The biggest issue I see is that when you grab a draggable in the middle, half of it will be behind the droppable until the mouseover happens.  This isn't ideal, but maybe there is something that can be done about that.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221083088&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=8f18d2579d5c8f2fb2a79c09a9234e6e&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;Batiste&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221083088&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2009-01-20T10:06:54&quot;&gt;2009-01-20T10:06:54&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;A jQuery solution for Drag and Drop with event delegation :&lt;/p&gt;

&lt;p&gt;http://batiste.dosimple.ch/blog/posts/2008-05-18-1/jquery-drag-and-drop-and-resize-event-delegation.html&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;/ul&gt;
    
        &lt;/div&gt;



</content>
    </entry>
    
    

    <entry>
        <title>JS versus PHP?</title>
        <link href="http://decafbad.com/blog/2005/12/19/js-versus-php"/>
        <updated>2005-12-19T03:59:31+00:00</updated>
        <id>http://decafbad.com/blog/2005/12/19/js-versus-php</id>
        <content type="html">&lt;p&gt;...on the other hand:  With all these people getting reacquainted with JavaScript by way of AJAX, wouldn't it be cool if we had something as easy to deploy as PHP but based on JavaScript?&lt;/p&gt;

&lt;!-- tags: javascript webdev php --&gt;




&lt;div id=&quot;comments&quot; class=&quot;comments archived-comments&quot;&gt;
            &lt;h3&gt;Archived Comments&lt;/h3&gt;
            
        &lt;ul class=&quot;comments&quot;&gt;
            
        &lt;li class=&quot;comment&quot; id=&quot;comment-221090997&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.snook.ca/jonathan/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=ce0f8df84e1e4edb3d9999740472261a&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.snook.ca/jonathan/&quot;&gt;Jonathan Snook&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221090997&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2005-12-19T04:26:31&quot;&gt;2005-12-19T04:26:31&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Isn't that ASP?&lt;/p&gt;

&lt;p&gt;I know I've liked the idea of doing JavaScript on the server and client. Less confusing.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221090999&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://admin.support.journurl.com/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=5f89d3df08b8dedac1a0fde900a586db&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://admin.support.journurl.com/&quot;&gt;Roger Benningfield&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221090999&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2005-12-19T15:10:28&quot;&gt;2005-12-19T15:10:28&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;As of CFMX, the CFScript sub-branch of the language is similar to Javascript... the handling of curly brackets is the same, and Coldfusion Components are basically a server-side implementation of Javascript's approach to objects.&lt;/p&gt;

&lt;p&gt;The big difference is in operators. For some reason, they stuck with CF's standard, text-based operators, so you end up with stuff like this:&lt;/p&gt;

&lt;p&gt;if (i=1;i LT 10;i = i + 1) {
// do something
}&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221091000&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=2377f34a68801b861c3e54e1301f0dce&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.decafbad.com&quot;&gt;l.m.orchard&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221091000&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2005-12-19T18:23:36&quot;&gt;2005-12-19T18:23:36&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Jonathan: Well, yeah, JScript is one of the languages available in ASP...  but ASP isn't a quick configure-and-make module for Apache.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221091001&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=47a5b72b5be083e6dd744f59ab6143c5&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;&quot;&gt;Stephen De Gabrielle&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221091001&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2005-12-21T07:31:52&quot;&gt;2005-12-21T07:31:52&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Isn't Rhino the obvious solution? I'm sure there is an opensource jvm/compiler that it will run on too?&lt;/p&gt;

&lt;p&gt;http://www.mozilla.org/rhino/&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221091002&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.vivabit.com/bollocks&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=6ab593768880d22b442d964443b4e4c5&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://www.vivabit.com/bollocks&quot;&gt;Dan Webb&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221091002&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2006-04-04T23:18:43&quot;&gt;2006-04-04T23:18:43&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;I'd love to give that a go.  I like RoR for large applications but having an apache mod that interpeted JS along with some APIs to access the system and server environment would be great.&lt;/p&gt;

&lt;p&gt;I've been looking for someone to start that project with because unfortunately I know hardly any C.  If anyone does an is interested then I'd love to give it a shot.  &lt;/p&gt;

&lt;p&gt;I think mod_javascript was started years ago but stalled eventually before it came to anything.  I think spidermonkey would be a better basis that rhino to get in all to run as fast as possible which is a shame because I can code Java..&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;/ul&gt;
    
        &lt;/div&gt;



</content>
    </entry>
    
    

    <entry>
        <title>FeedMagick gains an RSS-to-JSON filter</title>
        <link href="http://decafbad.com/blog/2005/12/19/feedmagick-gains-an-rss-to-json-filter"/>
        <updated>2005-12-19T03:01:51+00:00</updated>
        <id>http://decafbad.com/blog/2005/12/19/feedmagick-gains-an-rss-to-json-filter</id>
        <content type="html">&lt;p&gt;So, I put &lt;a href=&quot;http://decafbad.com/2005/12/FeedMagick/&quot;&gt;some more infrastructure&lt;/a&gt; behind &lt;a href=&quot;http://decafbad.com/trac/wiki/FeedMagick&quot;&gt;FeedMagick&lt;/a&gt; and lifted &lt;a href=&quot;http://ejohn.org/projects/rss2json/&quot;&gt;a RSS-to-JSON idea from John Resig&lt;/a&gt; to transform from &lt;a href=&quot;http://magpierss.sourceforge.net/&quot;&gt;MagpieRSS&lt;/a&gt; parsing to JSON output.&lt;/p&gt;

&lt;p&gt;Here's &lt;a href=&quot;http://decafbad.com/2005/12/FeedMagick/docs/json-demo.html&quot;&gt;a spiffy JSON-enriched demo&lt;/a&gt;.  It was surprisingly easy, all told.&lt;/p&gt;

&lt;p&gt;I'm not sure how much time I'll have to really put into this project, but this is the first decent effort I've put into a URL-line suite in a long time.  I'm trying to throw in some bits to make it easy to build, document, and use these feed processing commands.&lt;/p&gt;

&lt;!-- tags: rss json php syndication atom javascript webdev ajax web20 --&gt;



</content>
    </entry>
    
    

    <entry>
        <title>DOM Scripting sounds like a fine book</title>
        <link href="http://decafbad.com/blog/2005/10/08/dom-scripting-sounds-like-a-fine-book"/>
        <updated>2005-10-08T17:21:30+00:00</updated>
        <id>http://decafbad.com/blog/2005/10/08/dom-scripting-sounds-like-a-fine-book</id>
        <content type="html">&lt;blockquote cite=&quot;http://domscripting.com/blog/display.php/21&quot;&gt;Flicking through the book, it does give the impression of being full of code. I hope that doesn’t scare off any potential buyers.&lt;/blockquote&gt;


&lt;p&gt;&lt;small style=&quot;text-align:right; display:block&quot;&gt;Source: &lt;a href=&quot;http://domscripting.com/blog/display.php/21&quot;&gt;DOM Scripting: The book has landed&lt;/a&gt;&lt;/small&gt;&lt;br /&gt;
This is one thing I'd worried about with &lt;a href=&quot;http://www.amazon.com/exec/obidos/ASIN/0764597582/0xdecafbad01-20?creative=327641&amp;amp;camp=14573&amp;amp;link_code=as1&quot;&gt;my book&lt;/a&gt;, but on the other hand &lt;a href=&quot;http://decafbad.com/blog/2004/05/25/i-was-a-pre-teen-transactor-author-wannabe-and-still-am&quot;&gt;I always wanted to write for The Transactor&lt;/a&gt;.  And what I wanted to write was a book &lt;i&gt;I&lt;/i&gt; would've wanted to buy, if I hadn't written it.&lt;/p&gt;

&lt;p&gt;By the sounds of it, &lt;a href=&quot;http://domscripting.com/book/&quot;&gt;DOM Scripting&lt;/a&gt; has turned out brilliantly.  I'm looking forward to checking it out!  It's described as a book targeted at designers versus coders—but a lot of times, it's easier to show-don't-tell with code than with prose.&lt;/p&gt;

&lt;blockquote cite=&quot;http://domscripting.com/blog/display.php/21&quot;&gt;Apart from those minor quibbles, I’m pleased as punch. I still can’t quite believe that I wrote an honest-to-goodness book. Some form of celebration is called for.&lt;/blockquote&gt;


&lt;p&gt;This is exactly how I felt, too.  Congratulations, Jeremy!  I'm going to have to pick up &lt;a href=&quot;http://domscripting.com/book/&quot;&gt;a copy of this book&lt;/a&gt; for myself!&lt;/p&gt;

&lt;!-- tags: books writing javascript webdev --&gt;




&lt;div id=&quot;comments&quot; class=&quot;comments archived-comments&quot;&gt;
            &lt;h3&gt;Archived Comments&lt;/h3&gt;
            
        &lt;ul class=&quot;comments&quot;&gt;
            
        &lt;li class=&quot;comment&quot; id=&quot;comment-221087064&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://domscripting.com/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=b92a329df428bcda0822b25a110ab5ac&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://domscripting.com/&quot;&gt;Jeremy Keith&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221087064&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2005-10-09T00:42:48&quot;&gt;2005-10-09T00:42:48&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;Thanks, Leslie. I think you can relate to how I'm feeling right now.&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;li class=&quot;comment&quot; id=&quot;comment-221087066&quot;&gt;
            &lt;div class=&quot;meta&quot;&gt;
                &lt;div class=&quot;author&quot;&gt;
                    &lt;a class=&quot;avatar image&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://bt2net.org/&quot;&gt;&lt;img src=&quot;http://www.gravatar.com/avatar.php?gravatar_id=61087c5f5f3f410280fb5c9dd4786582&amp;amp;size=32&amp;amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png&quot;/&gt;&lt;/a&gt;
                    &lt;a class=&quot;avatar name&quot; rel=&quot;nofollow&quot; 
                       href=&quot;http://bt2net.org/&quot;&gt;Warren Fischer&lt;/a&gt;
                &lt;/div&gt;
                &lt;a href=&quot;#comment-221087066&quot; class=&quot;permalink&quot;&gt;&lt;time datetime=&quot;2005-10-09T10:51:38&quot;&gt;2005-10-09T10:51:38&lt;/time&gt;&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;p&gt;This book makes sense in a clear, and consice way that most tech books don't. His examples are great, and his writing style is very readable. Thanks!&lt;/p&gt;&lt;/div&gt;
            
        &lt;/li&gt;
    
        &lt;/ul&gt;
    
        &lt;/div&gt;



</content>
    </entry>
    
    
</feed>

