73
edits
Changes
Made the sample code modern (and actually work).
<pre>
var noun_type_freebase_topic = {
}
}; CmdUtils.CreateCommand( {
names: ["lookup on freebase"],
arguments: [{ role: "object", nountype: noun_type_freebase_topic, label: "topic" }, preview: function preview( pblock, arguments args) { var text = arguments.object.text || _("any topic"); pblock.innerHTML = _(("Go to the Freebase topic page for " + "{if text}${text}{else}any topic{/if}."), {text: text}args.object);
},
execute: function goToFreebase( arguments ) { if ( arguments.object.: {text , data}}) { Utils.openUrlInBrowser( text ? (data ? "http://www.freebase.com/view" + argumentsdata.id : ("http://www.freebase.objectcom/search?query=" + encodeURIComponent(text))) : "http://www.datafreebase.id com/"); }
}
} );
</pre>