This is just some static backup of the original site, don't expect every link to work!

source: chrome/content/v_identity/v_identity.xml @ 80940ab

multiEditng_0.6ng_0.8ng_0.9
Last change on this file since 80940ab was 80940ab, checked in by rene <rene@…>, 13 years ago

modified comments to get clearer debug info

  • Property mode set to 100644
File size: 25.3 KB
Line 
1<?xml version="1.0"?>
2<!-- ***** BEGIN LICENSE BLOCK *****
3   - This program is free software; you can redistribute it and/or modify
4   - it under the terms of the GNU General Public License as published by
5   - the Free Software Foundation; either version 2 of the License, or
6   - (at your option) any later version.
7
8   - This program is distributed in the hope that it will be useful,
9   - but WITHOUT ANY WARRANTY; without even the implied warranty of
10   - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11   - GNU General Public License for more details.
12
13   - You should have received a copy of the GNU General Public License
14   - along with this program; if not, write to the Free Software
15   - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
16
17   - The Original Code is the Virtual Identity Extension.
18
19   - The Initial Developer of the Original Code is Rene Ejury.
20   - Portions created by the Initial Developer are Copyright (C) 2007
21   - the Initial Developer. All Rights Reserved.
22
23   - Contributor(s):
24   - ***** END LICENSE BLOCK ***** -->
25
26<!DOCTYPE overlay [
27<!ENTITY % vIdentDTD SYSTEM "chrome://v_identity/locale/v_identity.dtd">
28%vIdentDTD;
29]>
30
31
32<bindings id="mailComposeBindings"
33          xmlns="http://www.mozilla.org/xbl"
34          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
35          xmlns:xbl="http://www.mozilla.org/xbl">
36   
37    <binding id="tooltipPopupset">
38    <implementation>
39    <method name="addTooltip">
40    <parameter name="elem" />
41    <parameter name="permanent" />
42            <body><![CDATA[
43        var randID = elem.tooltipElem.getAttribute("tooltip");
44        this.removeTooltip(randID);
45        if (!randID) {
46            randID = "tooltip_" + parseInt((new Date()).getTime());
47            elem.tooltipElem.setAttribute("tooltip", randID);
48        }
49        var toolTip = document.createElement("tooltip");
50        toolTip.setAttribute("class", "identityDataTooltip");
51        toolTip.setAttribute("id", randID);
52        toolTip.elem = elem;
53        toolTip.permanent = permanent;
54        this.appendChild(toolTip);
55        ]]></body>
56    </method>
57    <method name="removeTooltip">
58    <parameter name="randID" />
59            <body><![CDATA[
60        if (randID) this.removeChild(document.getElementById(randID))
61        ]]></body>
62    </method>
63    </implementation>
64    </binding>
65   
66    <binding id="vI_identityDataTooltip" extends="chrome://global/content/bindings/popup.xml#tooltip">
67    <content onpopuphidden="popuphidden();" onpopupshowing="this.popupshowing();this.resize()" onpopupshown="this.resize()" >
68            <xul:browser style="overflow:hidden" anonid="tooltipBrowser" class="vI_htmlTextBox" cssSource="vI_TooltipBrowser.css" flex="1" disablehistory="true" onoverflow="document.getBindingParent(this).resize()"/>
69            <children />
70    </content>
71    <implementation>
72    <method name="popupshowing">
73            <body><![CDATA[
74        if (!this._identityInfo) {
75            this._identityInfo =
76                "<table><tr>" +
77                    "<td class='image'><img src='chrome://v_identity/skin/vi-info.png' /></td>" +
78                    "<td class='identityTable'>" +
79                        "<div class='name'>" + this.elem.identityData.combinedNameHtml + "</div>" +
80                        "<table><tbody>" + this.elem.identityData.getMatrix() + "</tbody></table>" +
81                    "</td>" +
82                "</tr></table>"
83//          vI_notificationBar.dump("** v_identity.xml added tooltip with id='" +  this.elem.identityData.id.key + "'\n")
84            this._tooltipBrowser.outputString = this._identityInfo;
85        }
86        ]]></body>
87    </method>
88    <method name ="popuphidden">
89            <body><![CDATA[
90        if (!this.permanent) this._identityInfo = null;
91        ]]></body>
92    </method>   
93    <method name="resize">
94        <body><![CDATA[
95        if (!this._identityInfo) return;
96        var width = document.getElementById("msgIdentity_clone").boxObject.width * 0.7;
97        var height = this._tooltipBrowser.contentDocument.lastChild.scrollHeight + 5;
98        this.sizeTo(width, height);
99        width = document.getElementById("msgIdentity_clone").boxObject.width * 0.75;
100        this.sizeTo(width, height);
101        ]]></body>
102    </method>
103    <field name="permanent" />
104    <field name="elem" />
105<!--    <field name="identityData">this.elem.identityData</field> -->
106    <field name="_identityInfo">false</field>
107<!--    <field name="_initialized">false</field> -->
108    <field name="_tooltipBrowser">document.getAnonymousElementByAttribute(this, "anonid", "tooltipBrowser")</field>
109    </implementation>
110    </binding> 
111   
112    <binding id="fromPopupItem_clone" extends="chrome://global/content/bindings/menu.xml#menuitem">
113    <content excludes="template,observes,menupopup">
114        <xul:image class="menupopup_clone-icon" xbl:inherits="src"/>
115        <xul:label class="menupopup_clone-text" xbl:inherits="value=label,accesskey,crop" crop="right" flex="1"/>
116        <xul:label value="&vident.accPane.prettyName.prefix;" class="menupopup_clone-vid virtIdLabel" vid="false" xbl:inherits="vid" crop="right"/>
117            <xul:label class="menupopup_clone-description" xbl:inherits="value=description" crop="right"/>
118        <xul:label class="menupopup_clone-smtp" xbl:inherits="value=smtp,style=smtpStyle" crop="right"/>
119    </content>
120    <implementation>
121    <constructor>
122        <![CDATA[
123        this._identityDataStorage = this.identityData;
124       
125        this.label = this._identityDataStorage.combinedName;
126        this.value = this._identityDataStorage.id.key;
127        // vI_notificationBar.dump("** v_identity.xml fromPopupItem_clone constructor id='" + this.value + "'.\n")
128
129        this.description = this._identityDataStorage.sideDescription;
130        this.smtp = this._identityDataStorage.smtp.value;
131        // vI_notificationBar.dump("** v_identity.xml fromPopupItem_clone constructor smtp='" + this.smtp + "'.\n")
132        this.smtpStyle = "width:" + document.getElementById("smtp_server_list").clientWidth + "px;";
133        this._identityDataStorage.smtp.value;
134       
135        document.getElementById("vI_tooltipPopupset").addTooltip(this, true);
136        ]]>
137    </constructor>
138    <method name="clean">
139            <body><![CDATA[
140        document.getElementById("vI_tooltipPopupset")
141            .removeTooltip(this.tooltipElem.getAttribute("tooltip"));
142        ]]></body>
143    </method>
144    <destructor>
145        <![CDATA[
146        this.clean();
147        ]]>
148    </destructor>
149    <property name="_identityData" onget="return this._identityDataStorage;" />
150    <field name="tooltipElem">this</field>
151    <property name="vid" onget="return this.getAttribute('vid');" onset="this.setAttribute('vid', val); return val;" />
152    <property name="label" onget="return this.getAttribute('label');" onset="this.setAttribute('label', val); return val;" />
153    <property name="value" onget="return this.getAttribute('value');" onset="this.setAttribute('value', val); return val;" />
154    <property name="description" onget="return this.getAttribute('description');" onset="this.setAttribute('description', val); return val;" />
155    <property name="smtp" onget="return this.getAttribute('smtp');" onset="this.setAttribute('smtp', val); return val;" />
156    <property name="smtpStyle" onget="return this.getAttribute('smtpStyle');" onset="this.setAttribute('smtpStyle', val); return val;" />
157    </implementation>
158    </binding>
159
160    <binding id="smtpServerList">
161    <resources>
162            <stylesheet src="chrome://global/skin/menu.css"/>
163    </resources>
164    <content sizetopopup="pref">
165        <xul:hbox id="smtpServerHbox" class="smtpServerHbox">
166            <xul:menulist class="smtpServerMenuList" anonid="smtpServerMenuList" allowevents="true" id="smtp_server_list">
167                <xul:menupopup anonid="smtp_server_list_popup" />
168            </xul:menulist>
169            <xul:checkbox  id="saveSMTPSwitch" class="vI_plain" allowevents="true" oncommand="event.stopPropagation();vI_statusmenu.changeSMTPStatus(this);" >
170                <xul:observes element="vI_statusMenu_storage_saveSMTP" attribute="checked" />
171                <xul:observes element="vI_statusMenu_storage_saveSMTP" attribute="disabled" />
172            </xul:checkbox>
173            <xul:observes element="vI_statusMenu_storage_saveSMTP" attribute="checked" />
174            <xul:observes element="vI_statusMenu_storage_saveSMTP" attribute="disabled" />
175        </xul:hbox>
176    </content>
177    <implementation>
178    <method name="addNoneServer">
179        <body><![CDATA[
180        var listitem = document.createElement("menuitem");
181        listitem.setAttribute("class", "menuitem-non-iconic");
182        listitem.setAttribute("type", "non-iconic-noaccel");
183        listitem.setAttribute("label", " ");
184        listitem.setAttribute("key", NO_SMTP_TAG);
185        this._smtpPopup.insertBefore(listitem, this._smtpPopup.firstChild);
186        this._smtpMenu.selectedItem = listitem;
187        ]]></body>
188    </method>
189    <method name="_addDefaultServer">
190            <body><![CDATA[
191        var listitem = document.createElement("menuitem");
192        listitem.setAttribute("class", "menuitem-non-iconic");
193        listitem.setAttribute("type", "non-iconic-noaccel");
194        listitem.setAttribute("label", document.getElementById("bundle_messenger").getString("defaultServerTag"));
195        this._smtpPopup.appendChild(listitem);
196        this._smtpMenu.selectedItem = listitem;
197        ]]></body>
198    </method>
199    <method name="_addServer">
200        <parameter name="server" />
201            <body><![CDATA[
202        if (server instanceof Components.interfaces.nsISmtpServer && !server.redirectorType) {
203            var listitem = document.createElement("menuitem");
204            listitem.setAttribute("class", "menuitem-non-iconic");
205            listitem.setAttribute("type", "non-iconic-noaccel");
206            listitem.setAttribute("label", (server.description?server.description:server.hostname));
207            listitem.setAttribute("key", server.key);
208            this._smtpPopup.appendChild(listitem);
209        }
210        ]]></body>
211    </method>   
212    <constructor>
213        <![CDATA[       
214        this._addDefaultServer();
215        this._smtpPopup.appendChild(document.createElement("menuseparator"));
216
217        var servers = Components.classes["@mozilla.org/messengercompose/smtp;1"]
218            .getService(Components.interfaces.nsISmtpService).smtpServers;
219       
220        if (typeof(servers.Count) == "undefined")       // TB 3.x
221            while (servers && servers.hasMoreElements())
222                this._addServer(servers.getNext());
223        else                            // TB 2.x
224            for (var i=0 ; i<servers.Count(); i++)
225                this._addServer(servers.QueryElementAt(i, Components.interfaces.nsISmtpServer));
226       
227        ]]>
228    </constructor>
229    <property name="smtp" onget="return this._smtpMenu.selectedItem.getAttribute('key');" >
230        <setter><![CDATA[
231        if (val == NO_SMTP_TAG) return; // dont overwrite if not set
232        vI_notificationBar.dump("** v_identity.xml smtp set to '" + val + "'\n")
233        var MenuItems = this._smtpPopup.childNodes
234        for (var index = 0; index < MenuItems.length; index++) {
235            if (MenuItems[index].localName == "menuseparator") continue;
236            if (MenuItems[index].getAttribute("key") == val) {
237                this._smtpMenu.selectedItem = MenuItems[index];
238                break;
239            }
240        }
241        ]]></setter>
242    </property>
243    <field name="_smtpPopup">document.getAnonymousElementByAttribute(this, "anonid", "smtp_server_list_popup")</field>
244    <field name="_smtpMenu">document.getAnonymousElementByAttribute(this, "anonid", "smtpServerMenuList")</field>
245    <field name="_smtpService"></field>
246
247    </implementation>
248    </binding>
249   
250   
251   
252   
253    <binding id="fromMenuList_clone" display="xul:menu" extends="chrome://global/content/bindings/menulist.xml#menulist-description">
254    <resources>
255            <stylesheet src="chrome://global/skin/menu.css"/>
256        <stylesheet src="chrome://global/skin/autocomplete.css"/>
257    </resources>
258    <content sizetopopup="pref">
259        <xul:hbox class="contentHBox" anonid="contentHBox" flex="1"  >
260            <xul:hbox id="identityHbox" class="identityHbox" flex="1">
261                <xul:vbox><xul:spacer flex="1" />
262                    <xul:image class="menulist_clone-icon" id="msgIdentity_clone_image" xbl:inherits="src"/>
263                <xul:spacer flex="1" /></xul:vbox>
264                <xul:vbox flex="1" id="msgIdentity_clone_fromVbox"><xul:spacer flex="1" />
265<!--                    textbox is internally an html:input field which inherits the onblur event.
266                    Thats why we have to search the textbox before calling blurEvent() -->
267                    <xul:textbox anonid="textBox" type="search" id="msgIdentity_clonetextBoxElem" class="plain menulist_clone-textbox" allowevents="true" xbl:inherits="value=label,crop,accesskey,nomatch=vid" oncommand="event.stopPropagation(); document.getBindingParent(this).inputEvent();"
268                    onblur="event.stopPropagation(); var elem = this; while (elem.localName != 'textbox') elem = elem.parentNode; document.getBindingParent(elem).blurEvent();"
269                    crop="right" highlightnonmatches="true"/>
270                <xul:spacer flex="1" /></xul:vbox>
271                <xul:vbox id="saveSwitch"><xul:spacer flex="1" />
272                    <xul:checkbox class="vI_plain" allowevents="true" oncommand="event.stopPropagation();vI_statusmenu.changeSaveStatus(this);" >
273                        <xul:observes element="vI_statusMenu_storage_save" attribute="checked" />
274                    </xul:checkbox>
275                <xul:spacer flex="1" /></xul:vbox>
276                <xul:vbox><xul:spacer flex="1" />
277                    <xul:hbox>
278                        <xul:label id="msgIdentity_base_id_label" class="menu_clone-description" xbl:inherits="value,hidden=base_id_key_hidden" crop="right" hidden="true"/>
279                        <xul:label value="&vident.accPane.prettyName.prefix;" class="menu_clone-vid virtIdLabel" xbl:inherits="vid" crop="right"/>
280                    </xul:hbox>
281                <xul:spacer flex="1" /></xul:vbox>
282                <xul:observes element="vI_statusMenu_storage_save" attribute="checked" />
283            </xul:hbox>
284            <xul:hbox id="baseIDHbox" class="baseIDHbox" >
285                <xul:vbox><xul:spacer flex="1" />
286                    <xul:label id="msgIdentity_clone_label" class="menu_clone-description" xbl:inherits="value=description" crop="right"/>
287                <xul:spacer flex="1" /></xul:vbox>
288                <xul:vbox id="saveBaseIDSwitch"><xul:spacer flex="1" />
289                    <xul:checkbox class="vI_plain" allowevents="true" oncommand="event.stopPropagation();vI_statusmenu.changeBaseIDStatus(this);" >
290                        <xul:observes element="vI_statusMenu_storage_saveBaseID" attribute="checked" />
291                        <xul:observes element="vI_statusMenu_storage_saveBaseID" attribute="disabled" />
292                    </xul:checkbox>
293                <xul:spacer flex="1" /></xul:vbox>
294                <xul:observes element="vI_statusMenu_storage_saveBaseID" attribute="checked" />
295                <xul:observes element="vI_statusMenu_storage_saveBaseID" attribute="disabled" />
296            </xul:hbox>
297            <xul:hbox oncommand="event.stopPropagation();document.getBindingParent(this).smtp = this.smtp" anonid="smtpServerListHbox" class="smtpServerListHbox" />
298        </xul:hbox>
299        <children />
300    </content>
301        <implementation>
302    <constructor>
303        <![CDATA[       
304        var inputTextbox = document.getAnonymousElementByAttribute(this, "class", "plain menulist_clone-textbox");
305       
306        // check if 'search' textboxes are not implemented change to 'timed'
307        if (!inputTextbox.timeout) inputTextbox.setAttribute("type", "timed");
308        inputTextbox.setAttribute("timeout", "300")
309       
310        // to ealy to access vI_tooltipPopupset, this might break the interface
311        // it will be done in v_identity.js init
312        // document.getElementById("vI_tooltipPopupset").addTooltip(this, false);
313       
314        this._prefroot.addObserver("extensions.virtualIdentity.show_smtp", this._observer, false);
315        this._observer.observe();
316        ]]>
317    </constructor>
318    <destructor>
319        <![CDATA[
320        document.getElementById("vI_tooltipPopupset")
321            .removeTooltip(this.tooltipElem.getAttribute("tooltip"));
322        this._prefroot.removeObserver("extensions.virtualIdentity.show_smtp", this._observer);
323        ]]>
324    </destructor>
325
326    <!--
327    double the Identity-Select Dropdown-Menu to be more flexible with modifying it
328    the original Identity Dropdown Menu is hidden and stores the base Identity, on which one
329    the Virtual Identity is build upon
330    -->
331    <method name="command">
332        <body><![CDATA[
333        vI_notificationBar.dump("\n** v_identity.xml msgIdentityCloneElem.doCommand() \n")
334        // copy selected Menu-Value from clone to orig.
335        var MenuItems = this._msgIdentityPopupElem.childNodes
336        for (var index = 0; index < MenuItems.length; index++) {
337            if ( MenuItems[index].getAttribute("value") == this.selectedMenuItem.identityData.id.key ) {
338                this._msgIdentityElem.selectedItem = MenuItems[index];
339                this._msgIdentityElem.value = MenuItems[index].getAttribute("value");
340                break;
341            }
342        }
343        this._msgIdentityPopupElem.doCommand();
344       
345        this.identityData = this.selectedMenuItem.identityData.getDuplicate();
346       
347        // if current SMTP is empty, take the one from current Identity
348        if (this.identityData.smtp.hasNoDefinedSMTP()) {
349            this.identityData.smtp.key = gAccountManager.getIdentity(this.value).smtpServerKey;
350            document.getAnonymousElementByAttribute(this, "anonid", "smtpServerListHbox").smtp = this.identityData.smtp.keyNice;
351            this.checkForVirtualIdentity();
352        }
353    ]]></body>
354    </method>   
355    <method name="init">
356        <body><![CDATA[
357        var MenuItems = this._msgIdentityPopupElem.childNodes
358        for (var index = 0; index < MenuItems.length; index++) {
359            var identity = gAccountManager.getIdentity(MenuItems[index].getAttribute("value"));
360           
361            var newIdentity = new identityData(identity.email, identity.fullName, identity.key,
362                        identity.smtpServerKey, null,
363                        identity.description?"- "+identity.description:identity.accountname)
364            newIdentity.extras.readIdentityValues(identity);
365
366            var menuItem = this.addIdentityToCloneMenu(newIdentity)
367
368            if (this._msgIdentity_selectedItem == MenuItems[index]) {
369                this.selectedItem = menuItem;
370                this.identityData = newIdentity.getDuplicate();
371            }
372        }
373        this._popupMenu_separator = true;
374        ]]></body>
375    </method>
376    <method name="clean">
377        <body><![CDATA[
378        var MenuItems = this._popupElem.childNodes;
379        while (MenuItems.length > 0) {
380            try {MenuItems[0].clean();} catch (e) { };
381            this._popupElem.removeChild(MenuItems[0])
382        }
383        this.selectedItem = null;
384        this.identityData = null;
385       
386        this._menu_separator = null;
387        ]]></body>
388    </method>   
389    <method name="addIdentityToCloneMenu">
390        <parameter name="localIdentityData" />
391        <body><![CDATA[
392        var existingItem = this._isExistingCloneMenuItem(localIdentityData);
393        if (!existingItem) {
394            var MenuItem = document.createElement("menuitem");
395                MenuItem.identityData = localIdentityData;
396            MenuItem.setAttribute("class", "identity_clone-popup-item");
397            MenuItem.setAttribute("type", "vIdentity"); // to prevent overriding with menuitem:not([type])
398            MenuItem.value = localIdentityData.id.key; // might be accessed before item is constructed
399
400            // set vid explicitely
401            if (this._popupMenu_separator) MenuItem.setAttribute("vid", "true");
402            else    MenuItem.setAttribute("vid", "false");
403                       
404            this._popupElem.appendChild(MenuItem);
405            return MenuItem;
406        }
407        else return existingItem;
408        ]]></body>
409    </method>
410    <method name="addIdentitiesToCloneMenu">
411        <parameter name="identityCollection" />
412        <body><![CDATA[
413        for (var index = 0; index < identityCollection.number; index++)
414            identityCollection.menuItems[index] =
415                this.addIdentityToCloneMenu(identityCollection.identityDataCollection[index])
416        ]]></body>
417    </method>
418    <method name="_getMenuItemForIdentity">
419        <parameter name="identitykey" />
420        <body><![CDATA[
421        var MenuItems = this._popupElem.childNodes;
422        for (var index = 0; index < MenuItems.length; index++) {
423            if (MenuItems[index].value == identitykey)
424                return MenuItems[index]
425        }
426        return null;
427        ]]></body>
428    </method>
429    <property name="_popupMenu_separator" >
430        <getter><![CDATA[
431            if (this._menu_separator) this._menu_separator.removeAttribute("hidden");
432            return this._menu_separator;
433        ]]></getter>
434        <setter><![CDATA[
435            if (!val) return;
436            // add hidden separator as indicator that now only virtual identities are added
437            this._menu_separator = document.createElement("menuseparator");
438            this._menu_separator.setAttribute("id", "vid_separator");
439            this._menu_separator.setAttribute("hidden", "true");
440            this._popupElem.appendChild(this._menu_separator)
441        ]]></setter>   
442    </property>
443    <property name="selectedMenuItem" >
444        <getter><![CDATA[
445            return this.selectedItem;
446        ]]></getter>
447        <setter><![CDATA[
448            if (typeof(val) == "object") this.selectedItem = val
449            else if (val == "default")
450                this.selectedItem = this._getMenuItemForIdentity(gAccountManager.defaultAccount.defaultIdentity.key)
451            else this.selectedItem = this._getMenuItemForIdentity(val)
452            this.doCommand();
453        ]]></setter>   
454    </property>
455    <method name="_isExistingCloneMenuItem">
456        <parameter name="localIdentityData" />
457        <body><![CDATA[
458        var MenuItems = this._popupElem.childNodes
459        for (var j = 0; j < MenuItems.length; j++) {
460            if (MenuItems[j].localName == "menuseparator") continue;
461            if (MenuItems[j].identityData.equals(localIdentityData)) return MenuItems[j];
462        }
463        return null;
464        ]]></body>
465    </method>
466    <field name="_msgIdentityElem">document.getElementById("msgIdentity")</field>
467    <field name="_msgIdentityPopupElem">document.getElementById("msgIdentityPopup")</field>
468    <property name="_msgIdentity_selectedItem" >
469        <getter><![CDATA[
470            if (!this._msgIdentityElem.selectedItem) {
471                vI_notificationBar.dump("** v_identity.xml: msgIdentityElem.selectedItem not set, using first Menuitem\n");
472                this._msgIdentityElem.selectedItem = this._msgIdentityPopupElem.firstChild
473                vI_notificationBar.dump("** v_identity.xml: msgIdentityElem.doCommand()\n");
474                this._msgIdentityElem.doCommand();
475            }
476            return this._msgIdentityElem.selectedItem;
477        ]]></getter>
478    </property> 
479    <method name="blurEvent">
480            <body><![CDATA[
481        vI_notificationBar.dump("\n** v_identity.xml blurEvent")
482        this.inputEvent(); // timeout might prevent inputEvent to fire before blurEvent
483       
484        this.label = this.identityData.combinedName; // add "<" and ">" to email if required
485        this.setAttribute("label", this.label);
486        ]]></body>
487    </method>
488    <method name="inputEvent">
489            <body><![CDATA[     
490        vI_notificationBar.dump("\n** v_identity.xml inputEvent\n")
491       
492        this.identityData.combinedName = this.label;
493       
494        var existingIdentity = this.checkForVirtualIdentity();
495        if (existingIdentity) this.selectedMenuItem = existingIdentity;
496        ]]></body>
497    </method>
498    <method name="checkForVirtualIdentity">
499        <body><![CDATA[
500        vI_notificationBar.dump("** v_identity.xml checkForVirtualIdentity: " + this.identityData.id.key + " '" + this.identityData.id.value + "'\n")
501        var existingIdentity = this.identityData.isExistingIdentity(false);
502       
503        this.vid = (!existingIdentity);
504       
505        vI_msgIdentityCloneTools.signatureSwitch(existingIdentity);
506       
507        return existingIdentity;
508        ]]></body>
509    </method>
510    <property name="smtp" onget="return this.identityData.smtp.key;" > // used to detect changes from SMTP-Menu
511        <setter><![CDATA[
512        this.identityData.smtp.key = val;
513       
514        document.getElementById("vI_tooltipPopupset").addTooltip(this);
515
516        var existingIdentity = this.checkForVirtualIdentity();
517        if (existingIdentity) this.selectedMenuItem = existingIdentity;
518        ]]></setter>
519    </property>
520    <property name="identityData">
521        <getter><![CDATA[
522        this._identityDataStorage.extras.readValues(); // update with current data
523        return this._identityDataStorage;
524        ]]></getter>
525        <setter><![CDATA[
526        vI_notificationBar.dump("** v_identity.xml identityData setter\n")
527        if (!val) this._identityDataStorage = null
528        else {
529            var oldIdentityData = this._identityDataStorage;
530            this._identityDataStorage = val;
531           
532            if (oldIdentityData) { // indicates that it's not first time after clean
533                if (!this._identityDataStorage.id.key) {
534                    this._identityDataStorage.id.key = oldIdentityData.id.key;
535                    var idName = this._identityDataStorage.id.value;
536                    this._identityDataStorage.sideDescription = (idName)?" - "+idName:"";
537                    vI_notificationBar.dump("** v_identity.xml set new Id: " + this._identityDataStorage.id.key + " '" + this._identityDataStorage.id.value + "'\n")
538                }
539                this._identityDataStorage.extras.setValues();
540           
541                this.checkForVirtualIdentity();
542            }
543            else    this.vid = false;       // first time after clean it's always a real identity
544           
545            this.label = this._identityDataStorage.combinedName;
546            this.value = this._identityDataStorage.id.key;
547            vI_notificationBar.dump("** v_identity.xml identityData setter value='" + this.value + "'\n")
548            this.description = this._identityDataStorage.sideDescription;
549            vI_notificationBar.dump("** v_identity.xml identityData setter smtp='" + this._identityDataStorage.smtp.keyNice + "'\n")
550            document.getAnonymousElementByAttribute(this, "anonid", "smtpServerListHbox").smtp = this._identityDataStorage.smtp.keyNice;
551           
552        }
553        // vI_notificationBar.dump("** v_identity.xml identityData setter done.'\n")
554        ]]></setter>
555    </property>
556    <field name="_popupElem">document.getElementById("msgIdentityPopup_clone")</field>
557    <field name="tooltipElem">document.getAnonymousElementByAttribute(this, "anonid", "contentHBox")</field>
558    <field name="textBoxElem">document.getAnonymousElementByAttribute(this, "anonid", "textBox");</field>
559    <field name="_prefroot">Components.classes["@mozilla.org/preferences-service;1"]
560        .getService(Components.interfaces.nsIPrefService)
561        .getBranch(null).QueryInterface(Components.interfaces.nsIPrefBranch2)</field>
562    <field name="_observer"><![CDATA[({
563        _self: this,
564            observe: function(aSubject, aTopic, aPrefName) {
565            if (this._self._prefroot)
566                this._self.showSmtp =
567                this._self._prefroot.getBoolPref("extensions.virtualIdentity.show_smtp");
568                var MenuItems = this._self._popupElem.childNodes;
569                for (var j = 0; j < MenuItems.length; j++) {
570                    if (MenuItems[j].localName == "menuseparator") continue;
571                    MenuItems[j].smtpStyle = "width:" + document.getElementById("smtp_server_list").clientWidth + "px;";
572                }
573        }
574        })]]></field>
575    <property name="email" onset="this.identityData.email = val; this.label = this.identityData.combinedName; this.inputEvent()" />
576    <property name="vid" onget="return (this.getAttribute('vid') == 'true');" onset="this.setAttribute('vid',val?'true':'false'); return val;" />
577    <property name="label" onget="return this.textBoxElem.value;" onset="this.textBoxElem.value = val; return val;" />
578    <property name="value" onget="return this.getAttribute('value');" onset="this.setAttribute('value', val); return val;" />
579    <property name="extras" onget="return this.identityData.extras;" />
580    <property name="description" onget="return this.getAttribute('description');" onset="this.setAttribute('description', val); return val;" />
581    <property name="showSmtp" onget="return (this.getAttribute('showSmtp') == 'true');" onset="this.setAttribute('showSmtp',val?'true':'false'); return val;" />
582    </implementation>
583    </binding>
584</bindings>
Note: See TracBrowser for help on using the repository browser.