Bug 1173158 - Fixing imgur upload error. r=jryans

This commit is contained in:
Johan K. Jensen 2015-07-10 10:28:00 +02:00
parent 9966208d30
commit df1410d01e
2 changed files with 13 additions and 6 deletions

View File

@ -133,10 +133,13 @@ exports.items = [
}
// Click handler
if (imageSummary.filename) {
if (imageSummary.href || imageSummary.filename) {
root.style.cursor = "pointer";
root.addEventListener("click", () => {
if (imageSummary.filename) {
if (imageSummary.href) {
const gBrowser = context.environment.chromeWindow.gBrowser;
gBrowser.selectedTab = gBrowser.addTab(imageSummary.href);
} else if (imageSummary.filename) {
const file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
file.initWithPath(imageSummary.filename);
file.reveal();
@ -406,16 +409,15 @@ function uploadToImgur(reply) {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
reply.href = xhr.response.data.link;
reply.destinations.push(l10n.lookupFormat("screenshotImgurError",
reply.destinations.push(l10n.lookupFormat("screenshotImgurUploaded",
[ reply.href ]));
}
else {
} else {
reply.destinations.push(l10n.lookup("screenshotImgurError"));
}
resolve();
}
}
};
});
}

View File

@ -45,6 +45,11 @@ function addParamGroups(command) {
* Get a data block for the help_man.html/help_man.txt templates
*/
function getHelpManData(commandData, context) {
// Filter out hidden parameters
commandData.command.params = commandData.command.params.filter(
param => !param.hidden
);
addParamGroups(commandData.command);
commandData.subcommands.forEach(addParamGroups);