Skip to content

Instantly share code, notes, and snippets.

@dgraversen
Created November 11, 2008 08:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgraversen/23778 to your computer and use it in GitHub Desktop.
Save dgraversen/23778 to your computer and use it in GitHub Desktop.
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