Changeset 85fa10 for content/bindings/v_identity.xml
- Timestamp:
- Sep 9, 2018, 2:36:02 AM (4 years ago)
- Branches:
- ng_0.9
- Children:
- c5860f
- Parents:
- bc6c6b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
content/bindings/v_identity.xml
rbc6c6b r85fa10 83 83 "<td class='image'><img src='chrome://v_identity/skin/vi-info.png' /></td>" + 84 84 "<td class='identityTable'>" + 85 "<div class='name'>" + this.elem.identityData.combinedNameHtml + "</div>" + 86 85 "<div class='name'>" + this.elem.identityData.combinedNameHtml + "</div>" + 86 "<table><tbody>" + this.elem.identityData.getMatrix() + "</tbody></table>" + 87 87 "</td>" + 88 88 "</tr></table>" … … 135 135 136 136 this.description = this._identityDataStorage.sideDescription?this._identityDataStorage.sideDescription:""; 137 this.smtp = this._identityDataStorage.smtp.value; 137 this.smtp = this._identityDataStorage.id.smtpServerName; 138 138 139 // virtualIdentityExtension.MyLog.debug("v_identity.xml fromPopupItem_clone constructor smtp='" + this.smtp + "'") 139 140 this.smtpStyle = "width:" + document.getElementById("virtualIdentityExtension_SmtpServerList").clientWidth + "px;"; 140 this._identityDataStorage.smtp.value;141 141 142 142 document.getElementById("virtualIdentityExtension_tooltipPopupset").addTooltip(this, true); … … 164 164 </implementation> 165 165 </binding> 166 167 <binding id="smtpServerList">168 <resources>169 <stylesheet src="chrome://global/skin/menu.css"/>170 </resources>171 <content sizetopopup="pref">172 <xul:hbox id="smtpServerHbox" class="smtpServerHbox">173 <xul:menulist class="smtpServerMenuList" anonid="smtpServerMenuList" allowevents="true" id="virtualIdentityExtension_SmtpServerList">174 <xul:menupopup anonid="virtualIdentityExtension_SmtpServerList_popup" />175 </xul:menulist>176 <xul:checkbox id="virtualIdentityExtension_SaveSmtpSwitch" class="vI_plain" allowevents="true" oncommand="event.stopPropagation();virtualIdentityExtension.vIprefs.set('storage_store_SMTP', this.checked);" >177 <xul:observes element="virtualIdentityExtension_statusMenu_storage_saveSMTP" attribute="checked" />178 <xul:observes element="virtualIdentityExtension_statusMenu_storage_saveSMTP" attribute="disabled" />179 </xul:checkbox>180 <xul:observes element="virtualIdentityExtension_statusMenu_storage_saveSMTP" attribute="checked" />181 <xul:observes element="virtualIdentityExtension_statusMenu_storage_saveSMTP" attribute="disabled" />182 </xul:hbox>183 </content>184 <implementation>185 <method name="addNoneServer">186 <body><![CDATA[187 var listitem = document.createElement("menuitem");188 listitem.setAttribute("class", "menuitem-non-iconic");189 listitem.setAttribute("type", "non-iconic-noaccel");190 listitem.setAttribute("label", " ");191 listitem.setAttribute("key", virtualIdentityExtension.NO_SMTP_TAG);192 this._smtpPopup.insertBefore(listitem, this._smtpPopup.firstChild);193 this._smtpMenu.selectedItem = listitem;194 ]]></body>195 </method>196 <method name="_addDefaultServer">197 <body><![CDATA[198 var listitem = document.createElement("menuitem");199 listitem.setAttribute("class", "menuitem-non-iconic");200 listitem.setAttribute("type", "non-iconic-noaccel");201 listitem.setAttribute("label",202 Components.classes["@mozilla.org/intl/stringbundle;1"]203 .getService(Components.interfaces.nsIStringBundleService)204 .createBundle("chrome://messenger/locale/messenger.properties")205 .GetStringFromName("defaultServerTag"));206 this._smtpPopup.appendChild(listitem);207 this._smtpMenu.selectedItem = listitem;208 ]]></body>209 </method>210 <method name="_addServer">211 <parameter name="server" />212 <body><![CDATA[213 if (server instanceof Components.interfaces.nsISmtpServer && !server.redirectorType) {214 var listitem = document.createElement("menuitem");215 listitem.setAttribute("class", "menuitem-non-iconic");216 listitem.setAttribute("type", "non-iconic-noaccel");217 listitem.setAttribute("label", (server.description?server.description:server.hostname));218 listitem.setAttribute("key", server.key);219 this._smtpPopup.appendChild(listitem);220 }221 ]]></body>222 </method>223 <method name="refresh">224 <body><![CDATA[225 this.unload();226 this.load();227 ]]></body>228 </method>229 <method name="load">230 <body><![CDATA[231 this._addDefaultServer();232 this._smtpPopup.appendChild(document.createElement("menuseparator"));233 234 var servers, smtpService = Components.classes["@mozilla.org/messengercompose/smtp;1"]235 .getService(Components.interfaces.nsISmtpService);236 // check for new https://hg.mozilla.org/comm-central/rev/fab9e5145cd4 smtpService237 if (typeof(smtpService.servers) == "object") servers = smtpService.servers;238 else servers = smtpService.smtpServers;239 240 while (servers && servers.hasMoreElements())241 this._addServer(servers.getNext());242 ]]></body>243 </method>244 <method name="unload">245 <body><![CDATA[246 var MenuItems = this._smtpPopup.childNodes247 while (MenuItems.length > 0) { this._smtpPopup.removeChild(MenuItems[0]) }248 this._smtpMenu.selectedItem = null;249 ]]></body>250 </method>251 <constructor>252 <![CDATA[253 this.load();254 ]]>255 </constructor>256 <property name="smtp" onget="return this._smtpMenu.selectedItem.getAttribute('key');" >257 <setter><![CDATA[258 if (val == virtualIdentityExtension.NO_SMTP_TAG) return; // dont overwrite if not set259 virtualIdentityExtension.MyLog.debug("v_identity.xml smtp set to '" + val + "'")260 var MenuItems = this._smtpPopup.childNodes261 for (var index = 0; index < MenuItems.length; index++) {262 if (MenuItems[index].localName == "menuseparator") continue;263 if (MenuItems[index].getAttribute("key") == val) {264 this._smtpMenu.selectedItem = MenuItems[index];265 break;266 }267 }268 ]]></setter>269 </property>270 <field name="_smtpPopup">document.getAnonymousElementByAttribute(this, "anonid", "virtualIdentityExtension_SmtpServerList_popup")</field>271 <field name="_smtpMenu">document.getAnonymousElementByAttribute(this, "anonid", "smtpServerMenuList")</field>272 <field name="_smtpService"></field>273 274 </implementation>275 </binding>276 277 166 278 167 <binding id="fromMenuList_new" extends="chrome://global/content/bindings/menulist.xml#menulist-editable"> … … 306 195 </xul:hbox> 307 196 </xul:moz-input-box> 308 <!--<xul:hbox oncommand="event.stopPropagation();document.getBindingParent(this).smtp = this.smtp" xbl:inherits="showSmtp" anonid="smtpServerListHbox" class="smtpServerListHbox" />-->309 197 <xul:dropmarker class="menulist-dropmarker" type="menu" xbl:inherits="open,disabled,parentfocused=focused"/> 310 198 <xul:popupset id="virtualIdentityExtension_tooltipPopupset" /> … … 324 212 // it will be done in v_identity.js init 325 213 // document.getElementById("virtualIdentityExtension_tooltipPopupset").addTooltip(this, false); 326 327 virtualIdentityExtension.vIprefs.addObserver("show_smtp", this.observe, this);328 this.observe(this);329 214 ]]> 330 215 </constructor> … … 333 218 var tooltipPopupset = document.getElementById("virtualIdentityExtension_tooltipPopupset") 334 219 if (tooltipPopupset) tooltipPopupset.removeTooltip(this.tooltipElem.getAttribute("tooltip")); 335 virtualIdentityExtension.vIprefs.removeObserver("show_smtp", this.observe);336 220 ]]> 337 221 </destructor> … … 438 322 ]]></body> 439 323 </method> 440 <property name="smtp" onget="return this.identityData.smtp.key;" > // used to detect changes from SMTP-Menu441 <setter><![CDATA[442 this.identityData.smtp.key = val;443 444 document.getElementById("virtualIdentityExtension_tooltipPopupset").addTooltip(this);445 446 var existingIdentity = this.checkForVirtualIdentity();447 if (existingIdentity) this.selectedMenuItem = existingIdentity;448 ]]></setter>449 </property>450 324 <property name="identityData"> 451 325 <getter><![CDATA[ … … 470 344 <field name="tooltipElem">document.getAnonymousElementByAttribute(this, "anonid", "inputBox")</field> 471 345 <field name="textBoxElem">document.getAnonymousElementByAttribute(this, "anonid", "input");</field> 472 <method name="observe">473 <parameter name="self" />474 <parameter name="aSubject" />475 <parameter name="aTopic" />476 <parameter name="aPrefName" />477 <body><![CDATA[478 self.showSmtp =479 virtualIdentityExtension.vIprefs.get("show_smtp");480 var MenuItems = self._popupElem.childNodes;481 for (var j = 0; j < MenuItems.length; j++) {482 if (MenuItems[j].localName == "menuseparator") continue;483 MenuItems[j].smtpStyle = "width:" + document.getElementById("virtualIdentityExtension_SmtpServerList").clientWidth + "px;";484 }485 ]]></body>486 </method>487 346 <property name="email" onset="this.identityData.email = val; this.label = this.identityData.combinedName; this.inputEvent()" /> 488 347 <property name="vid" onget="return (this.getAttribute('vid') == 'true');" onset="this.setAttribute('vid',val); return val;" /> … … 490 349 <property name="extras" onget="return this.identityData.extras;" /> 491 350 <property name="description" onget="return this.getAttribute('description');" onset="this.setAttribute('description', val); return val;" /> 492 <!--<property name="showSmtp" onget="return (this.getAttribute('showSmtp') == 'true');" onset="this.setAttribute('showSmtp',val?'true':'false'); return val;" />-->493 351 </implementation> 494 352 </binding> … … 522 380 this.identityData = new virtualIdentityExtension.identityData(window, identity.email, 523 381 identity.fullName, identity.key, 524 identity.smtpServerKey,null, null, true);382 null, null, true); 525 383 this._identityData.extras.readIdentityValues(identity); 526 384 } … … 550 408 this._setAttributeIfNotEmpty("label", this._identityData.combinedName); 551 409 this._setAttributeIfNotEmpty("value", this._identityData.combinedName); 552 this._setAttributeIfNotEmpty("smtp", this._identityData. smtp.value);410 this._setAttributeIfNotEmpty("smtp", this._identityData.id.smtpServerName); 553 411 this._setAttributeIfNotEmpty("description", ""); 554 412
Note: See TracChangeset
for help on using the changeset viewer.