Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
CmdUtils.CreateCommand({ name: "get-dents", //takes: {num_posts: noun}, homepage: "http://theunfocused.net/moz/ubiquity/verbs/", author: {name: "Remy Porter", homepage: "http://identi.ca/t3knomanser"}, license: "MPL", preview: function(previewBlock) { var dent_template = "<tr><td><img src=\"${imageUrl}\" height=\"25px\" width=\"25px\" /></td>" + "<th>${user}:</th><td>${dent}</td></tr>"; //previewBlock.innerHTML = "<table>" + CmdUtils.renderTemplate(dent_template, {user:"Joebob",status:"Testing dent"}) + "</table>"; var numPosts = 10; var updateURL; updateURL = LACONICA_ROOT + "friends_timeline.xml?count=" + numPosts; jQuery.ajax({ type: "GET", url: updateURL, success: function(xml) { var body = ""; jQuery("status", xml).each(function() { body += CmdUtils.renderTemplate(dent_template, {user:jQuery("screen_name", this).text(), dent:jQuery("text", this).text(), imageUrl:jQuery("profile_image_url", this).text()} ); }); previewBlock.innerHTML = "<table border=\"1\">" + body + "</table>"; }, error: function() {displayMessage("Failed getting dents."); } }); } });
This paste will be private.
From the Design Piracy series on my blog: