Create a gist now

Instantly share code, notes, and snippets.

@dgraversen /x
Created Nov 11, 2008

What would you like to do?
SCN Search
/**
* SCN Search
*/
CmdUtils.CreateCommand({
name: ['scn-search'],
description: "Direct access to SCN search",
homepage: "http://figaf.com/",
author: { name: "Daniel Graversen"},
license: "GPL",
help: "Type a query String ",
arguments: [{role: 'query', nountype: noun_arb_text, label: 'query'} ],
preview: function( pblock, args) {
pblock.innerHTML = "Search SCN for : " + args.query.text ;
if (arg.searchtype.text != '') {
pblock.innerHTML += " in "+ arg.searchtype.text;
}
},
execute: function( args) {
var url = "https://www.sdn.sap.com/irj/scn/advancedsearch?query={QUERY}&adv=false";
var urlString = url.replace("{QUERY}", args.query.text.replace(/ /g,"+" ));
while ( urlString.match(" ")!=null ) { urlString = urlString.replace(" ","+"); }
Utils.openUrlInBrowser(urlString);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment