Added the reply type option. related to #14
This commit is contained in:
parent
fcabeae80e
commit
5caa6a6d89
5 changed files with 49 additions and 4 deletions
|
|
@ -104,6 +104,21 @@
|
|||
"description": ""
|
||||
},
|
||||
|
||||
"prefs_OptionText_reply_all": {
|
||||
"message": "Reply to All",
|
||||
"description": ""
|
||||
},
|
||||
|
||||
"prefs_OptionText_reply_sender": {
|
||||
"message": "Reply to Sender",
|
||||
"description": ""
|
||||
},
|
||||
|
||||
"prefs_OptionText_reply_type": {
|
||||
"message": "Reply type",
|
||||
"description": ""
|
||||
},
|
||||
|
||||
"prefsInfoTitle": {
|
||||
"message": "Important Information",
|
||||
"description": ""
|
||||
|
|
|
|||
|
|
@ -104,6 +104,21 @@
|
|||
"description": ""
|
||||
},
|
||||
|
||||
"prefs_OptionText_reply_all": {
|
||||
"message": "Rispondi a tutti",
|
||||
"description": ""
|
||||
},
|
||||
|
||||
"prefs_OptionText_reply_sender": {
|
||||
"message": "Rispondi al mittente",
|
||||
"description": ""
|
||||
},
|
||||
|
||||
"prefs_OptionText_reply_type": {
|
||||
"message": "Modalità di riposta",
|
||||
"description": ""
|
||||
},
|
||||
|
||||
"prefsInfoTitle": {
|
||||
"message": "Informazioni Importanti",
|
||||
"description": ""
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ for (let messageTab of messageTabs) {
|
|||
}
|
||||
|
||||
|
||||
messenger.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
||||
messenger.runtime.onMessage.addListener(async (message, sender, sendResponse) => {
|
||||
// Check what type of message we have received and invoke the appropriate
|
||||
// handler function.
|
||||
if (message && message.hasOwnProperty("command")){
|
||||
|
|
@ -55,8 +55,15 @@ messenger.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
|||
});
|
||||
const paragraphsHtmlString = paragraphs.map(p => p.outerHTML).join("");
|
||||
//console.log('paragraphsHtmlString: ' + paragraphsHtmlString);
|
||||
let prefs = await browser.storage.sync.get({reply_type: 'reply_all'});
|
||||
console.log('reply_type: ' + prefs.reply_type);
|
||||
let replyType = 'replyToAll';
|
||||
if(prefs.reply_type === 'reply_sender'){
|
||||
replyType = 'replyToSender';
|
||||
}
|
||||
console.log('replyType: ' + replyType);
|
||||
browser.messageDisplay.getDisplayedMessage(message.tabId).then((mailMessage) => {
|
||||
browser.compose.beginReply(mailMessage.id, "replyToAll", {
|
||||
browser.compose.beginReply(mailMessage.id, replyType, {
|
||||
type: "reply",
|
||||
body: paragraphsHtmlString,
|
||||
isPlainText: false,
|
||||
|
|
|
|||
|
|
@ -12,7 +12,13 @@
|
|||
<input type="number" id="chatgpt_win_width" name="chatgpt_win_width" class="option-input" /> __MSG_prefs_OptionText_chatgpt_win_width__</label><br/>
|
||||
<br/>
|
||||
<label><input type="text" id="default_sign_name" name="default_sign_name" class="option-input" /> __MSG_prefs_OptionText_default_sign_name__</label><br/>
|
||||
<label><input type="text" id="default_chatgpt_lang" name="default_chatgpt_lang" class="option-input" /> __MSG_prefs_OptionText_default_chatgpt_lang__</label>
|
||||
<label><input type="text" id="default_chatgpt_lang" name="default_chatgpt_lang" class="option-input" /> __MSG_prefs_OptionText_default_chatgpt_lang__</label><br/>
|
||||
<label>
|
||||
<select id="reply_type" name="reply_type" class="option-input">
|
||||
<option value="reply_all">__MSG_prefs_OptionText_reply_all__</option>
|
||||
<option value="reply_sender">__MSG_prefs_OptionText_reply_sender__</option>
|
||||
</select> __MSG_prefs_OptionText_reply_type__
|
||||
</label><br/>
|
||||
</div>
|
||||
<div id="miczDescription">
|
||||
<h1>__MSG_prefsInfoTitle__</h1>
|
||||
|
|
|
|||
|
|
@ -47,7 +47,9 @@ function restoreOptions() {
|
|||
break;
|
||||
default:
|
||||
if (element.tagName === 'SELECT') {
|
||||
element.value = result[element.id] || '';
|
||||
let default_select_value = '';
|
||||
if(element.id == 'reply_type') default_select_value = 'reply_all';
|
||||
element.value = result[element.id] || default_select_value;
|
||||
if (element.value === '') {
|
||||
element.selectedIndex = -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue