Skip to content

Instantly share code, notes, and snippets.

@amau96
Created February 11, 2009 03:55
Show Gist options
  • Save amau96/61813 to your computer and use it in GitHub Desktop.
Save amau96/61813 to your computer and use it in GitHub Desktop.
CmdUtils.CreateCommand({
name: "bugzillathis",
icon:"http://www.geckozone.org/favicon.ico",
takes: {"input": noun_arb_text},
homepage: "http://gist.github.com/61813",
author: { name: "A.BLANC", email: "amau96@gmail.com"},
license: "MPL",
description: "quick link to bugzilla",
preview: function(previewBlock,input) {
previewBlock.innerHTML ="Welcome to the bugzilla quicklink, please enter bug's number";
url="https://bugzilla.mozilla.org/show_bug.cgi?id="+input.text;
if(input.text!=""){
previewBlock.innerHTML ="";
Utils.parseRemoteDocument(
url, // URL
null, // post data
function(doc) { // success callback
previewBlock.innerHTML = "Bug : "+input.text +"<br />Description : "+ jQuery("#summary_alias_container", doc).html();
},
function() { // error callback
previewBlock.innerHTML = "Error!";
}
);
}
},
execute: function(input) {
url="https://bugzilla.mozilla.org/show_bug.cgi?id="+input.text;
Utils.openUrlInBrowser(url);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment