Changeset 0f7e1c


Ignore:
Timestamp:
Apr 5, 2017, 3:56:59 PM (4 years ago)
Author:
rene <rene@…>
Branches:
ng_0.9
Children:
3819a1
Parents:
c5112d
Message:

for each is deprecated

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • content/vI_rdfDataEditor.js

    rc5112d r0f7e1c  
    6464        // set type of entry (and populate Menu)
    6565        var typeMenuPopup = document.getElementById("type_menu_popup")
    66         for each(var typeField in Array("email", "maillist", "newsgroup", "filter")) {
     66        for (var typeField of Array("email", "maillist", "newsgroup", "filter")) {
    6767          var menuitem = document.createElement("menuitem");
    6868          var label = Components.classes["@mozilla.org/intl/stringbundle;1"]
  • content/vI_rdfDataTree.js

    rc5112d r0f7e1c  
    246246        rdfDataTreeCollection._rdfDatasource = new vI.rdfDatasource(window, "virtualIdentity.rdf");
    247247
    248         for each(var treeType in rdfDataTreeCollection.treeTypes)
     248        for (var treeType of rdfDataTreeCollection.treeTypes)
    249249        rdfDataTreeCollection.trees[treeType] = new rdfDataTree(treeType, rdfDataTreeCollection._rdfDatasource);
    250250      },
     
    338338      __setFilter: function (text) {
    339339        // loop trough all trees
    340         for each(var treeType in rdfDataTreeCollection.treeTypes) {
     340        for (var treeType of rdfDataTreeCollection.treeTypes) {
    341341          var tree = rdfDataTreeCollection.trees[treeType];
    342342          tree.filterText = text;
     
    415415
    416416        // reload all trees (multiple types might have changed)
    417         for each(var treeType in rdfDataTreeCollection.treeTypes) {
     417        for (var treeType of rdfDataTreeCollection.treeTypes) {
    418418          rdfDataTreeCollection.trees[treeType].idData = null;
    419419          rdfDataTreeCollection.trees[treeType].loadTable()
     
    530530        rdfDataTreeCollection.infoBoxHidden = true;
    531531        document.getElementById("rdfDataTreeCollectionInfoBox").setAttribute("style", "height:0px");
    532         for each(var treeType in rdfDataTreeCollection.treeTypes) {
     532        for (var treeType of rdfDataTreeCollection.treeTypes) {
    533533          try {
    534534            if (rdfDataTreeCollection.trees[treeType])
     
    559559
    560560        // reload all trees (multiple types might have changed)
    561         for each(var treeType in rdfDataTreeCollection.treeTypes) {
     561        for (var treeType of rdfDataTreeCollection.treeTypes) {
    562562          rdfDataTreeCollection.trees[treeType].idData = null;
    563563          rdfDataTreeCollection.trees[treeType].idTable = null;
  • content/vI_upgrade.js

    rc5112d r0f7e1c  
    7373          var all_accounts = vI.prefroot.getCharPref("mail.accountmanager.accounts").split(",");
    7474
    75           for each(let pref in vI.prefroot.getChildList("mail.server")) {
     75          for (let pref of vI.prefroot.getChildList("mail.server")) {
     76             
     77             
    7678            if (pref.indexOf(".hostname") == pref.length - 9 && vI.prefroot.getCharPref(pref) == "smart mailboxes") {
    7779              // ok, smart mailbox server found, check if it still in use
    7880              let server = pref.replace(/^mail\.server\./, "").replace(/\.hostname$/, "");
    7981              let inUse = false;
    80               for each(let account in all_accounts) {
     82              for (let account of all_accounts) {
    8183                if (vI.prefroot.getCharPref("mail.account." + account + ".server") == server)
    8284                  inUse = true;
     
    8486              if (!inUse) {
    8587                Log.debug("cleaning leftover 'smart mailbox' for server " + server);
    86                 for each(let obsoletePref in vI.prefroot.getChildList("mail.server." + server)) {
     88                for (let obsoletePref of vI.prefroot.getChildList("mail.server." + server)) {
    8789                  if (obsoletePref.indexOf(".directory") == obsoletePref.length - 10) {
    8890                    // remove obsolete 'smart mailbox' directory
     
    142144            // remove any obsolete preferences under extensions.virtualIdentity
    143145            Log.debug("transfer changed preferences of pre-" + transferPrefs[i].version + " release...")
    144             for each(let transferPref in transferPrefs[i].prefs) {
     146            for (let transferPref of transferPrefs[i].prefs) {
    145147              try {
    146148                vI.vIprefs.commit(transferPref.targetPref,
     
    181183            // remove any obsolete preferences under extensions.virtualIdentity
    182184            Log.debug("removing obsolete preferences of pre-" + obsoletePrefs[i].version + " release...")
    183             for each(let pref in obsoletePrefs[i].prefs) {
     185            for (let pref of obsoletePrefs[i].prefs) {
    184186              try {
    185187                vI.vIprefs.clearUserPref(pref);
  • modules/vI_identityData.js

    rc5112d r0f7e1c  
    296296    var saveBaseId = vIprefs.get("storage_store_base_id");
    297297    var saveSMTP = vIprefs.get("storage_store_SMTP");
    298     for each(let item in Items) {
     298    for (let item of Items) {
    299299      var classEqual = (this.comp.equals[item]) ? "equal" : "unequal";
    300300      var classIgnore = (((!saveBaseId) && (item == "id")) || ((!saveSMTP) && (item == "smtp"))) ? " ignoreValues" : ""
     
    312312    const Items = Array("smtp", "id");
    313313    var string = "";
    314     for each(var item in Items) if (this[item + "Html"])
     314    for (var item of Items) if (this[item + "Html"])
    315315        string += "<tr><td class='col1'>" + this[item + "Label"] + ":</td>" +
    316316        "<td class='col2'>" + this[item + "Html"] + "</td></tr>"
  • modules/vI_identityDataExtras.js

    rc5112d r0f7e1c  
    5050  this._currentWindow = currentWindow;
    5151  this.extras = [];
    52   for each(let [, identityDataExtrasObject] in Iterator(idExtrasObjects)) {
     52 
     53  this_object = this;
     54  idExtrasObjects.map(function(identityDataExtrasObject) {
    5355    try {
    54       this.extras.push(new identityDataExtrasObject(this._currentWindow));
     56      this_object.extras.push(new identityDataExtrasObject(this_object._currentWindow));
    5557    } catch (e) {
    5658      Log.error("identityDataExtras '" + identityDataExtrasObject + "' returned an error:", e)
    5759      dumpCallStack(e);
    5860    }
    59   }
     61  });
    6062  if (rdfDatasource)
    6163    this.loopThroughExtras(
  • modules/vI_prefs.js

    rc5112d r0f7e1c  
    9595    this._localPrefs[aPrefName] = aPrefValue;
    9696    //       Log.debug("changed pref " + aPrefName + " to " + aPrefValue)
    97     for each(let [, prefObserver] in Iterator(this._localObservers)) {
     97    this._localObservers.map(function(prefObserver) {
    9898      //         Log.debug("check prefobserver " + prefObserver.pref + " against " + aPrefName)
    9999      if (prefObserver.pref == aPrefName) {
    100100        prefObserver.observe(prefObserver.context, aPrefValue, "nsPref:changed", aPrefName);
    101       }
    102     }
     101      };
     102    });
    103103  },
    104104  commit: function (aPrefName, aPrefValue) {
     
    120120  },
    121121  removeObserver: function (aPrefName, aFunction) {
    122     for each(let [i, prefObserver] in Iterator(this._localObservers)) {
     122    var this_object = this;
     123    this._localObservers.forEach(function(prefObserver, i) {
    123124      if (prefObserver.pref == aPrefName && prefObserver.observe == aFunction) {
    124         this._localObservers.splice(i, 1)
    125         break;
     125        this_object._localObservers.splice(i, 1)
    126126      }
    127     }
     127    });
    128128  },
    129129  observe: function (subject, topic, aPrefName) {
    130130    Log.debug("prefChange observed : " + aPrefName)
    131131    this._retrievePref(aPrefName);
    132     for each(let [, prefObserver] in Iterator(this._localObservers)) {
     132    this._localObservers.map(function(prefObserver) {
    133133      if (prefObserver.pref == aPrefName) {
    134134        //           Log.debug("found observer, calling : " + prefObserver.observe)
     
    136136        //           Log.debug("found observer, calling : " + prefObserver.observe + " done")
    137137      }
    138     }
     138    });
    139139  },
    140140  dropLocalChanges: function () {
    141     for each(let [aPrefName, aPrefValue] in Iterator(this._localPrefs)) {
    142       this._retrievePref(aPrefName);
     141    var this_object = this;
     142    for (let [aPrefName, aPrefValue] in this._localPrefs.values()) {
     143      this_object._retrievePref(aPrefName);
    143144      if (aPrefValue != this._localPrefs[aPrefName]) {
    144         for each(let [, prefObserver] in Iterator(this._localObservers)) {
     145        this_object._localObservers.map(function(prefObserver) {
    145146          if (prefObserver.pref == aPrefName) {
    146147            prefObserver.observe(prefObserver.context, aPrefValue, "nsPref:changed", aPrefName);
    147148          }
    148         }
     149        });
    149150      }
    150151    }
  • modules/vI_rdfDatasource.js

    rc5112d r0f7e1c  
    259259  _tagDefaultSMTP: function () {
    260260    Log.debug("upgrade: tagDefaultSMTP");
    261     for each(let treeType in Array("email", "maillist", "newsgroup", "filter")) {
     261    for (let treeType of Array("email", "maillist", "newsgroup", "filter")) {
    262262      var enumerator = this.getContainer(treeType).GetElements();
    263263      while (enumerator && enumerator.hasMoreElements()) {
     
    417417    var relevantIDs = new Object();
    418418    // search relevant Identities
    419     for each(let treeType in Array("email", "maillist", "newsgroup", "filter")) {
     419    for (let treeType of Array("email", "maillist", "newsgroup", "filter")) {
    420420      var enumerator = this.getContainer(treeType).GetElements();
    421421      while (enumerator && enumerator.hasMoreElements()) {
     
    487487      Log.debug("repairAccountMismatch change " + mismatchItems[i].oldkey + " into " + mismatchItems[i].key);
    488488      // search relevant Identities
    489       for each(let treeType in Array("email", "maillist", "newsgroup", "filter")) {
     489      for (let treeType of Array("email", "maillist", "newsgroup", "filter")) {
    490490        var enumerator = this.getContainer(treeType).GetElements();
    491491        while (enumerator && enumerator.hasMoreElements()) {
     
    504504    var relevantSMTPs = new Object();
    505505    // search relevant SMTPs
    506     for each(let treeType in Array("email", "maillist", "newsgroup", "filter")) {
     506    for (let treeType of Array("email", "maillist", "newsgroup", "filter")) {
    507507      var enumerator = this.getContainer(treeType).GetElements();
    508508      while (enumerator && enumerator.hasMoreElements()) {
     
    12601260      Log.debug("import: preparation done.");
    12611261
    1262       for each(let treeType in Array("email", "maillist", "newsgroup", "filter")) {
     1262      for (let treeType of Array("email", "maillist", "newsgroup", "filter")) {
    12631263        // re-initialize importDataSource to point rdfService to the right Resources
    12641264        this._rdfImportDataSource = new rdfDatasource(this._currentWindow, importRdfDataFile.leafName, true);
Note: See TracChangeset for help on using the changeset viewer.