Serchilo:Ubiquity/Serchilo.js

if (CmdUtils.parserVersion == 2) { CmdUtils.CreateCommand({   names: ["serchilo"],    icon: "http://serchilo.net/favicon.ico",    homepage: "http://serchilo.net/",    author: { name: "Georg Jaehnig", email: "info@serchilo.net"},    license: "MPL / LGPL / GPL",    description: "Calls Serchilo with given command",    arguments: [      {        role: "object",        nountype: noun_arb_text,        label: "command"      }    ],    preview: function ( pblock, args ) {      var query = args.object.text;      if (query == '') {         query = 'g';      }      jQuery.get( "http://de.serchilo.net/?action=suggestions_text", { query: query } , function (data, textStatus) { var text; items = data.split("\n"); text = ' '; pblock.innerHTML = text; },       "text" );   },    execute: function( args ) {      Utils.openUrlInBrowser( "http://serchilo.net/?action=command&source=6&query=" + args.object.text );   }  }); } else { CmdUtils.CreateCommand({  name: "serchilo",   icon: "http://serchilo.net/favicon.ico",   homepage: "http://serchilo.net/",   author: { name: "Georg Jaehnig", email: "info@serchilo.net"},   license: "MPL / LGPL / GPL",   description: "Calls Serchilo with given command",   preview: function ( pblock, command ) {     var query = command.text;     if (query == '') {        query = 'g';     }     jQuery.get( "http://de.serchilo.net/?action=suggestions_text", { query: query } , function (data, textStatus) { var text; items = data.split("\n"); text = ' '; pblock.innerHTML = text; },      "text" );  },   takes: {"command": noun_arb_text  },   execute: function( command ) {     Utils.openUrlInBrowser( "http://serchilo.net/?action=command&source=6&query=" + command.text );   } }); }