/** * Ubiquity command to add a task to RTM, using a bookmarklet */ CmdUtils.CreateCommand({ name: "rtm-bookmarklet", author: { name: "Gary Hodgson", homepage : "http://www.garyhodgson.com/ubiquity/rtm-bookmarklet.html", email : "contact@garyhodgson.com" }, contributors: ["Kevin Kubasik", "Matteo"], license: "MPL", releaseinfo: {2:"(01 Sep 2008) Replaced openUrl with Utils.openUrlInBrowser", 1:"(28 Aug 2008) Initial Release." }, description: "Creates a new task in Remember The Milk. (Original by Kevin Kubasik)", help: "Opens the RTM add task bookmarklet with the task and date fields optionally populated.", takes: {task: noun_arb_text}, modifiers: {on: noun_arb_text}, icon: "http://www.rememberthemilk.com/favicon.ico", preview: function( pblock , taskText, mods) { var msg = 'Creates the following Task: ${task} on ${on}'; var subs = {task: taskText.text, on: mods.on.text}; pblock.innerHTML = CmdUtils.renderTemplate( msg, subs ); }, execute: function( taskText, mods ) { h='www.rememberthemilk.com'; p='/services/ext/addtask.rtm'; cp='http://'+h+p+'?d='+encodeURIComponent(mods.on.text || '')+'&t='+encodeURIComponent(taskText.text); Utils.openUrlInBrowser(cp,null); } });