Skip to content

Commit

Permalink
Issue mozilla#49 - Add bayimg provider
Browse files Browse the repository at this point in the history
  • Loading branch information
xabolcs committed Mar 20, 2013
1 parent 574c60b commit 6ee94aa
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions extension/chrome/content/screenshot/providers.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,40 @@ var PostimageDotOrg = {
}
}

var bayimg = {
genRemovalCode: function (aLength)
{
var len = aLength || 10;
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

for (var i=0; i < len; i++) {
text += possible.charAt(Math.floor(Math.random() * possible.length));
}

return text;
},

addFormFields: function(formdata)
{
formdata.addControl("code", bayimg.genRemovalCode());
},

getFileFormField: function()
{
return "file";
},

getReferer: function()
{
return "http://bayimg.com";
},

getSubmissionURL: function()
{
return "http://upload.bayimg.com/upload";
}
}

Providers.addProvider(PostimageDotOrg);
Providers.addProvider(bayimg);

0 comments on commit 6ee94aa

Please sign in to comment.