Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
momogs.helper.js
// Based on original code by bryan w clark
// all awesomeness by bryan, all hacks by roland :-)
// Licensed under the Mozilla Public License, http://www.mozilla.org/MPL/MPL-1.1.html
// This code is a prototype and proof of concept only. It requires Firefox 3.6 + the JetPack Add-On
// See spec at https://wiki.mozilla.org/Thunderbird/Support/GetSatisfaction/Accelerator
const POSSIBLE_REPLIES = [
{ shortText: "Unable to authenticate to SMTP Server",
replyText: "The community needs more troubleshooting details to help you further (<b>in "+
"particular exact error messages if any, your exact Thunderbird "+
"settings for sending and receiving email - screenshots preferred; your "+
"OS and the other details in the README mentioned below</b>), but to "+
"save time here are some GUESSES:\n\n"+
"1. you upgraded from TB2 where email sending and receiving worked\n"+
"but in TB sending and receiving email doesn't work.\n"+
"2. Perhaps you have the \"Uncheck Use username and password problem\"? If so then follow the instructions here: "+
"http://support.mozillamessaging.com/en-US/kb/Unable+to+authenticate+to+SMTP+server\n"+
"If the above doesn't help, <b>the community needs more detailed troubleshooting information to help you</b>\n"+
"Please reply with <a href=\"https://wiki.mozilla.org/Thunderbird/Support/GetSatisfaction/README\">complete "+
"details as "+
"requested in our README:"+
"firewall and anti-virus software versions if any, Thunderbird version (3.0.3?, 2.0.0.23?), "+
"Operating System (Windows XP?), ISP, mail service provider, POP or IMAP settings including username suitably "+
"altered to protect your privacy i.e change jane@domain.com to jne@domain.com, outgoing SMTP mail server setting "+
"including username altered so we can't guess your username, what add-ons you have installed if any, "+
"exact error message, what you did, what you expected, what happened, etc</a>"
},
{ shortText: "Troubleshooting details missing",
replyText: "The community needs more troubleshooting details to help you further (<b>in "+
"particular exact error messages if any, your exact Thunderbird "+
"settings for sending and receiving email - screenshots preferred; your "+
"OS and the other details in the README mentioned below</b>), but to "+
"save time here are some GUESSES:\n\n"+
"1. you upgraded from TB2 where email sending and receiving worked\n"+
"but in TB sending and receiving email doesn't work.\n"+
"2. Perhaps you have the \"Uncheck Use username and password problem\"? If so then follow the instructions here: "+
"http://support.mozillamessaging.com/en-US/kb/Unable+to+authenticate+to+SMTP+server\n"+
"3. Perhaps your passwords for some reason aren't being recognized? If "+
"so try deleting your SMTP password and your incoming (POP or IMAP password) "+
"http://getsatisfaction.com/mozilla_messaging/topics/fix_smtp_cannot_send_email_problems_by_deleting_passwords \n\n"+
"If the above doesn't help, <b>the community needs more detailed troubleshooting information to help you</b>\n"+
"Please reply with <a href=\"https://wiki.mozilla.org/Thunderbird/Support/GetSatisfaction/README\">complete "+
"details as "+
"requested in our README:"+
"firewall and anti-virus software versions if any, Thunderbird version (3.0.3?, 2.0.0.23?), "+
"Operating System (Windows XP?), ISP, mail service provider, POP or IMAP settings including username suitably "+
"altered to protect your privacy i.e change jane@domain.com to jne@domain.com, outgoing SMTP mail server setting "+
"including username altered so we can't guess your username, what add-ons you have installed if any, "+
"exact error message, what you did, what you expected, what happened, etc</a>"
},
{ shortText: "Create a new topic",
replyText: "If you are still having problems, <a"+
"href=\"http://getsatisfaction.com/mozilla_messaging/topics/new\">please"+
"create a new community support topic</a> with the <a"+
"href=\"https://wiki.mozilla.org/Thunderbird/Support/GetSatisfaction/README\">troubleshooting "+
"info requested in our README</a>" },
{ shortText: "New Topic",
replyText: "Perhaps this will help:\n\n\n"+
"If that doesn't help, the community will no longer reply on this topic to your question "+
"because it belongs in a new topic.\n\n"+
"In order for the community to help you, please create a new community "+
"support topic at:\n\n"+
"http://getsatisfaction.com/mozilla_messaging/topics/new"+
"with the info requested in our README at:\n"+
"https://wiki.mozilla.org/Thunderbird/Support/GetSatisfaction/README" },
{ shortText: "No Phone or Email Support",
replyText: "A gentle reminder:\n"+
"<b>the Thunderbird community doesn't provide email or fax or phone support.</b>\n\n"+
"Thunderbird is an open source project and support like writing and documenting "+
"the code is done by a mostly volunteer community with a few paid staffers and "+
"I am the community support lead/facilitator/coordinator. The number of users "+
"is large but the actual number of contributors i.e. those who help document, "+
"support, design and test Thunderbird is much smaller than the number of "+
"users. Therefore all community contributors are overloaded. This means "+
"that sometimes bugs, support requests and documentation requests are missed. "+
"Please help out the community in the future by giving as much detail in your "+
"support requests as possible and please consider \"giving back\"/\"paying forward\" "+
"by helping support the Thunderbird community in any way you can including supporting "+
"other users, modifying and writing documentation, testing beta builds, etc." },
{ shortText: "Firefox",
replyText: "This is the Thunderbird support forum, not the Firefox one."+
" The Firefox support community focuses their support effort on SUMO.\n"+
"Please try SUMO at:"+
"http://support.mozilla.com/en-US/kb/Support+Website+Forums" },
{ shortText: "Safe Mode",
replyText: "Please try running in Thunderbird Safe Mode and see if that solves the problem:\n\n"+ "http://support.mozillamessaging.com/en-US/kb/Safe+Mode\n\n"+
"If Safe Mode solves the problem, then there is a problem with one of your add-ons or themes."+
"Please contact the add-on or theme developer and report a bug with them."
},
{ shortText: "Thunderbird Profile",
replyText: "Please check out our article about Thunderbird Profiles at:\n"+
"http://support.mozillamessaging.com/en-US/kb/Profiles\n\n"+
"This article includes information about where to find your profile, backing up a profile, and moving a profile."
}
];
jetpack.tabs.onFocus(function() {
if (isMoMoGSFN(this.url)) {
appendReplyAction(this.contentDocument);
}
});
jetpack.tabs.onReady(function() {
if (isMoMoGSFN(this.url)) {
appendReplyAction(this.contentDocument);
}
});
function isMoMoGSFN(url) {
return url.match(/http[s]?:\/\/[www\.]*getsatisfaction\.com\/mozilla_messaging\//);
}
function appendReplyAction(doc) {
if ($("#make_reply_action", doc).length <= 0) {
var suggested_replies = $("<div id='make_reply_action'/>", doc);
suggested_replies.css('background-color', '#aaa');
suggested_replies.css('padding', '3px');
suggested_replies.css('margin', '3px 0');
suggested_replies.css('-moz-border-radius','3px');
$("<label style='font-weight:bold;color:#efefef;' for='reply_select'>Possible Replies: </label>", doc).appendTo(suggested_replies);
var select = $("<select id='reply_select'/>", doc).appendTo(suggested_replies);
$("<option value=''>-- Select Replies from List --</option>", doc).appendTo(select);
for(var i = 0; i < POSSIBLE_REPLIES.length; i++ ) {
select.append($("<option value="+i+">"+POSSIBLE_REPLIES[i].shortText+"</option>", doc));
}
select.change(function() {
var content = $("#reply_content",doc);
var changeData = POSSIBLE_REPLIES[$(this, doc).attr('value')]
content.val(content.val() + '\n' + changeData.replyText);
});
$(".reply_tools", doc).prepend(suggested_replies);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment