Changeset 509348 for content/vI_smartReplyDialog.js
- Timestamp:
- Nov 3, 2014, 12:35:40 PM (8 years ago)
- Branches:
- ng_0.9
- Children:
- 7204cb
- Parents:
- 3c9c29
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
content/vI_smartReplyDialog.js
r3c9c29 r509348 24 24 25 25 Components.utils.import("resource://v_identity/vI_nameSpaceWrapper.js"); 26 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 27 var smartReply_dialog = { 28 Obj_radioGroup : null, 29 all_addresses : null, 26 virtualIdentityExtension.ns(function () { 27 with(virtualIdentityExtension.LIB) { 28 var smartReply_dialog = { 29 Obj_radioGroup: null, 30 all_addresses: null, 30 31 31 init : function() { 32 33 34 35 32 init: function () { 33 smartReply_dialog.Obj_radioGroup = document.getElementById("replySelector.radiogroup"); 34 smartReply_dialog.all_addresses = window.arguments[0]; 35 for (var index = 0; index < smartReply_dialog.all_addresses.number; index++) { 36 var menuentry = smartReply_dialog.all_addresses.identityDataCollection[index].combinedName; 36 37 37 var id = null; var smtp = null; 38 var id = null; 39 var smtp = null; 38 40 39 if (smartReply_dialog.all_addresses.identityDataCollection[index].id) 40 id = smartReply_dialog.all_addresses.identityDataCollection[index].id.value; 41 if (smartReply_dialog.all_addresses.identityDataCollection[index].smtp) 42 smtp = smartReply_dialog.all_addresses.identityDataCollection[index].smtp.value; 43 44 let defaultServerTag = Components.classes["@mozilla.org/intl/stringbundle;1"] 45 .getService(Components.interfaces.nsIStringBundleService) 46 .createBundle("chrome://messenger/locale/messenger.properties") 47 .GetStringFromName("defaultServerTag") 48 49 menuentry += (id?" (" + id + "," + (smtp?smtp:defaultServerTag) + ")":"") 50 smartReply_dialog.add_row(menuentry); 51 } 52 }, 41 if (smartReply_dialog.all_addresses.identityDataCollection[index].id) 42 id = smartReply_dialog.all_addresses.identityDataCollection[index].id.value; 43 if (smartReply_dialog.all_addresses.identityDataCollection[index].smtp) 44 smtp = smartReply_dialog.all_addresses.identityDataCollection[index].smtp.value; 53 45 54 add_row : function(combinedName) { 55 var radio = document.createElement("radio"); 56 radio.setAttribute("label",combinedName); 57 smartReply_dialog.Obj_radioGroup.appendChild(radio); 58 }, 46 let defaultServerTag = Components.classes["@mozilla.org/intl/stringbundle;1"] 47 .getService(Components.interfaces.nsIStringBundleService) 48 .createBundle("chrome://messenger/locale/messenger.properties") 49 .GetStringFromName("defaultServerTag") 59 50 60 accept : function() { 61 /* window.argument[1] stores callback function */ 62 window.arguments[1](smartReply_dialog.all_addresses, smartReply_dialog.Obj_radioGroup.selectedIndex); 63 document.documentElement.acceptDialog(); 64 } 65 } 66 window.addEventListener("load", smartReply_dialog.init, false); 67 vI.smartReply_dialog = smartReply_dialog; 68 }}); 51 menuentry += (id ? " (" + id + "," + (smtp ? smtp : defaultServerTag) + ")" : "") 52 smartReply_dialog.add_row(menuentry); 53 } 54 }, 55 56 add_row: function (combinedName) { 57 var radio = document.createElement("radio"); 58 radio.setAttribute("label", combinedName); 59 smartReply_dialog.Obj_radioGroup.appendChild(radio); 60 }, 61 62 accept: function () { 63 /* window.argument[1] stores callback function */ 64 window.arguments[1](smartReply_dialog.all_addresses, smartReply_dialog.Obj_radioGroup.selectedIndex); 65 document.documentElement.acceptDialog(); 66 } 67 } 68 window.addEventListener("load", smartReply_dialog.init, false); 69 vI.smartReply_dialog = smartReply_dialog; 70 } 71 });
Note: See TracChangeset
for help on using the changeset viewer.