var noun_type_trac_type = new CmdUtils.NounType( "Trac Type", ['defect', 'enhancement', 'task']) CmdUtils.CreateCommand({ name:"tickets", author: {name:"Fernando 'fern' Takai",email:"fernando.takai@gmail.com"}, license:"MPL", icon:"http://labs.toolness.com/trac/chrome/common/trac.ico", takes: {'summary':noun_arb_text}, modifiers: {'keywords':noun_arb_text, 'type':noun_type_trac_type}, description: 'Queries Ubiquity Trac for tickets - w/o parameters, get the last 8 open tickets.', preview: function(pblock ,summary, mods){ pblock.innerHTML = "
Getting the tickets...
" var url = "http://ubiquity.mozilla.com/trac/query?status=%21closed&format=csv&desc=1&order=id&col=id&col=summary"; if(summary && summary.text.length > 0) url += "&summary=~" + summary.text if(mods.type && mods.type.text && mods.type.text.length > 0) url += "&type=" + mods.type.text jQuery.get(url, null, function(data){ pblock.innerHTML = ""; var template = "#${number} ${title}