Changeset add418


Ignore:
Timestamp:
Jan 1, 2010, 4:19:03 PM (12 years ago)
Author:
rene <rene@…>
Branches:
multiEdit, ng_0.6, ng_0.8, ng_0.9
Children:
80940ab
Parents:
218b2b
Message:

added option to negate the filter-match with regular expressions

Location:
chrome
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • chrome/content/v_identity/vI_identityData.js

    r218b2b radd418  
    184184        for (var index = 0; index < addIdentityCollection.number; index++)
    185185            this.addWithoutDuplicates(addIdentityCollection.identityDataCollection[index])
     186    },
     187
     188    dropIdentity : function(index) {
     189        vI_notificationBar.dump("## identityCollection:   dropping address from inputList: " + this.identityDataCollection[index].combinedName + "\n");
     190        while (index < (this.number - 1)) { this.identityDataCollection[index] = this.identityDataCollection[++index]; };
     191        this.identityDataCollection[--this.number] = null;
    186192    },
    187193
  • chrome/content/v_identity/vI_smartIdentity.js

    r218b2b radd418  
    160160            if (filterList.length <= 1 && filterList[0] == "")
    161161                { vI_notificationBar.dump("## vI_smartIdentity: no filters configured\n"); recentfilterType = filterType.None; }
    162             else if (/^\/(.*)\/$/.exec(filterList[i]))
     162            else if (/^[+-]?\/(.*)\/$/.exec(filterList[i]))
    163163                { vI_notificationBar.dump("## vI_smartIdentity: filter emails with RegExp '"
    164164                    + filterList[i].replace(/\\/g,"\\\\") + "'\n"); recentfilterType = filterType.RegExp; }
     
    173173                    case filterType.RegExp:
    174174                        if (skipRegExp) break;
    175                         try {   /^\/(.*)\/$/.exec(filterList[i]);
    176                             add_addr =  (smartIdentities.identityDataCollection[j].email.match(new RegExp(RegExp.$1,"i")))
     175                        try {   /^[+-]?\/(.*)\/$/.exec(filterList[i]);
     176                            if ( filterList[i][0] == "-" ) {
     177                                if (smartIdentities.identityDataCollection[j].email.match(new RegExp(RegExp.$1,"i")))
     178                                    smartIdentities.dropIdentity(j--);
     179                            } else
     180                                add_addr = (smartIdentities.identityDataCollection[j].email.match(new RegExp(RegExp.$1,"i")));
    177181                        }
    178182                        catch(vErr) {
  • chrome/locale/en-US/v_identity/vI_prefDialog.dtd

    r218b2b radd418  
    3737<!ENTITY vI_prefDialog.smartTab2.caption "2. filter and sort identities">
    3838<!ENTITY vI_prefDialog.smartReplyTab.Tab2.desc "After getting the addresses they have to be filtered. All filters are used after each other, so you can use them to sort the result too. At the end the first-found address might get used instantly as a senders identity. If you don&apos;t use a filter, all addresses are transferred.">
    39 <!ENTITY vI_prefDialog.smartReply.filter.desc "Smart Reply filter  -  one filter per line, usage of regular Expressions possible (for instance &apos;/@mozilla.org$/&apos; is matching every email from domain mozilla.org)">
     39<!ENTITY vI_prefDialog.smartReply.filter.desc "Smart Reply filter  -  one filter per line, usage of regular Expressions possible (for instance &apos;/@mozilla.org$/&apos; is matching every email from domain mozilla.org). Add '-' before regular Expressions to negate match.">
    4040
    4141<!ENTITY vI_prefDialog.smartTab3.header "Smart Reply - Compare">
Note: See TracChangeset for help on using the changeset viewer.