Changeset 8f20eb
- Timestamp:
- Sep 29, 2007, 7:23:57 PM (13 years ago)
- Branches:
- master
- Children:
- 11aa72
- Parents:
- c34db9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chrome/content/v_identity/vI_smtpSelector.js
rc34db9 r8f20eb 20 20 the Initial Developer. All Rights Reserved. 21 21 22 Contributor(s): chuonthis22 Contributor(s): 23 23 * ***** END LICENSE BLOCK ***** */ 24 25 /**26 * some code copied and adapted from 'Show SMTP Username'27 * thanks to chuonthis28 */29 24 30 25 vI_smtpSelector = { … … 121 116 } 122 117 } 123 vI_smtpSelector.elements.Obj_SMTPServerList.setAttribute("label", vI_smtpSelector.getNewHostnamex(idserver));118 vI_smtpSelector.elements.Obj_SMTPServerList.setAttribute("label", (server.description?server.description:server.hostname)); 124 119 }, 125 120 … … 127 122 var listitem = document.createElement("menuitem"); 128 123 129 var hostname = vI_smtpSelector.getNewHostnamex(server); 130 131 listitem.setAttribute("label", hostname); 124 listitem.setAttribute("label", (server.description?server.description:server.hostname)); 132 125 listitem.setAttribute("key", server.key); 133 126 // give it some unique id … … 135 128 136 129 return listitem; 137 },138 139 getNewHostnamex : function (server)140 {141 var showAlias = true;142 var showUsername = true;143 var hideUsername = true;144 145 146 // reuse Preferences from ssun147 try { showAlias = vI.preferences.getBoolPref("ssun.showalias"); } catch (ex) {}148 try { showUsername = vI.preferences.getBoolPref("ssun.showusername"); } catch (ex) {}149 try { hideUsername = vI.preferences.getBoolPref("ssun.hideusername"); } catch (ex) {}150 151 var hostname = server.hostname;152 var port = "";153 154 if (server.port)155 port = ":" + server.port;156 157 // SSUN: Get server alias158 var alias = "";159 if (showAlias) {160 try { alias = vI.preferences.getCharPref("ssun." + server.key + ".alias"); } catch (ex) {}161 if (alias) {162 hostname = alias;163 } else {164 hostname += port;165 }166 } else {167 hostname += port;168 }169 170 // SSUN: Add username171 if (showUsername && (!showAlias || (showAlias && (!alias || !hideUsername))) && server.authMethod && server.username)172 hostname += " (" + server.username + ")";173 174 return hostname175 130 } 176 131 }
Note: See TracChangeset
for help on using the changeset viewer.