Changeset 997e80


Ignore:
Timestamp:
Jul 23, 2011, 7:13:22 PM (11 years ago)
Author:
rene <rene@…>
Branches:
ng_0.6
Children:
24b0b0
Parents:
7c86b4
Message:

prevent namespace pollution

Location:
chrome/content/v_identity
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • chrome/content/v_identity/vI_rdfDataEditor.xul

    r7c86b4 r997e80  
    3333    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    3434    onload="vI_rdfDataEditor.init();"
    35     ondialogaccept="window.arguments[3].treeType = vI_rdfDataEditor.accept();"
     35    ondialogaccept="window.arguments[3].vI_treeType = vI_rdfDataEditor.accept();"
    3636    title="&vI_rdfDataEditor.dlgTitle.label;" >
    3737
  • chrome/content/v_identity/vI_rdfDataTree.js

    r7c86b4 r997e80  
    3838
    3939
    40 function rdfDataTree(treeType, vI_rdfDatasource) {
    41     this.treeType = treeType;
     40function rdfDataTree(vI_treeType, vI_rdfDatasource) {
     41    this.vI_treeType = vI_treeType;
    4242    this._vI_rdfDatasource = vI_rdfDatasource;
    4343    this.filterText = "";
     
    4848    idData : null,
    4949    filterText : null,
    50     treeType : null,
     50    vI_treeType : null,
    5151    _vI_rdfDatasource : null,
    5252
    53     get treeElem() { return document.getElementById("rdfDataTree_" + this.treeType); },
    54     get tabElem() { return document.getElementById(this.treeType + "Tab"); },
     53    get treeElem() { return document.getElementById("rdfDataTree_" + this.vI_treeType); },
     54    get tabElem() { return document.getElementById(this.vI_treeType + "Tab"); },
    5555   
    5656    //this function is called every time the tree is sorted, filtered, or reloaded
     
    6363        if (this.idData == null) {
    6464            this.idData = [];
    65             this._vI_rdfDatasource.readAllEntriesFromRDF(this.addNewDatum, this.treeType, this.idData);
     65            this._vI_rdfDatasource.readAllEntriesFromRDF(this.addNewDatum, this.vI_treeType, this.idData);
    6666        }
    6767        if (this.filterText == "") {
     
    9191
    9292        // set Tab label
    93         this.tabElem.setAttribute("label", this.treeType + " (" + this.idTable.length + ")");
     93        this.tabElem.setAttribute("label", this.vI_treeType + " (" + this.idTable.length + ")");
    9494//         if (vI_notificationBar) vI_notificationBar.dump("## rdfDataTree: loadTable done.\n");
    9595    },
     
    146146            .getService(Components.interfaces.nsIPromptService),
    147147
    148     treeTypes : Array("email", "maillist", "newsgroup", "filter"),
     148    vI_treeTypes : Array("email", "maillist", "newsgroup", "filter"),
    149149
    150150    trees : {},
     
    187187        vI_rdfDataTree._vI_rdfDatasource = new vI_rdfDatasource("virtualIdentity.rdf");
    188188       
    189         for each (var treeType in vI_rdfDataTree.treeTypes)
    190             vI_rdfDataTree.trees[treeType] = new rdfDataTree(treeType, vI_rdfDataTree._vI_rdfDatasource);
     189        for each (var vI_treeType in vI_rdfDataTree.vI_treeTypes)
     190            vI_rdfDataTree.trees[vI_treeType] = new rdfDataTree(vI_treeType, vI_rdfDataTree._vI_rdfDatasource);
    191191    },
    192192   
     
    232232        this.getColumnProperties = function(colid,col,props){};
    233233        this.cycleHeader = function(col, elem) {
    234             var treeType = vI_rdfDataTree.tabbox.selectedPanel.id;
    235             if (treeType != "filter")
    236                 vI_rdfDataTree.trees[treeType].sort(col.id.substr(0,col.id.indexOf("_")));
     234            var vI_treeType = vI_rdfDataTree.tabbox.selectedPanel.id;
     235            if (vI_treeType != "filter")
     236                vI_rdfDataTree.trees[vI_treeType].sort(col.id.substr(0,col.id.indexOf("_")));
    237237        };
    238238        this.getCellProperties = function(row,col,props){
     
    250250    __setFilter : function (text) {
    251251        // loop trough all trees
    252         for each (var treeType in vI_rdfDataTree.treeTypes) {
    253             var tree = vI_rdfDataTree.trees[treeType];
     252        for each (var vI_treeType in vI_rdfDataTree.vI_treeTypes) {
     253            var tree = vI_rdfDataTree.trees[vI_treeType];
    254254            tree.filterText = text;
    255255            tree.loadTable();
     
    292292
    293293    modifySelected : function() {
    294         var treeType = vI_rdfDataTree.tabbox.selectedPanel.id;
    295         var tree = vI_rdfDataTree.trees[treeType];
     294        var vI_treeType = vI_rdfDataTree.tabbox.selectedPanel.id;
     295        var tree = vI_rdfDataTree.trees[vI_treeType];
    296296        if (tree.treeElem.view.selection.count == 0) return;
    297297        if (tree.treeElem.view.selection.count > 5) {
     
    305305        var numRanges = tree.treeElem.view.selection.getRangeCount();
    306306
    307         var retVar = { treeType: null };
     307        var retVar = { vI_treeType: null };
    308308        for (var t=0; t<numRanges; t++){
    309309            tree.treeElem.view.selection.getRangeAt(t,start,end);
     
    311311                window.openDialog("chrome://v_identity/content/vI_rdfDataEditor.xul",0,
    312312                    "chrome, dialog, modal, alwaysRaised, resizable=yes",
    313                     tree.idTable[v], treeType,
     313                    tree.idTable[v], vI_treeType,
    314314                    vI_rdfDataTree._vI_rdfDatasource, retVar).focus();
    315315        }
    316316       
    317317        // reload all trees (multiple types might have changed)
    318         for each (var treeType in vI_rdfDataTree.treeTypes) {
    319             vI_rdfDataTree.trees[treeType].idData = null;
    320             vI_rdfDataTree.trees[treeType].idTable = null;
    321             vI_rdfDataTree.trees[treeType].loadTable()
    322         }
    323         vI_rdfDataTree.tabbox.selectedTab = document.getElementById(retVar.treeType + "Tab");
     318        for each (var vI_treeType in vI_rdfDataTree.vI_treeTypes) {
     319            vI_rdfDataTree.trees[vI_treeType].idData = null;
     320            vI_rdfDataTree.trees[vI_treeType].idTable = null;
     321            vI_rdfDataTree.trees[vI_treeType].loadTable()
     322        }
     323        vI_rdfDataTree.tabbox.selectedTab = document.getElementById(retVar.vI_treeType + "Tab");
    324324        vI_rdfDataTree.hideInfoBox();
    325325    },
    326326   
    327327    removeSelected : function() {
    328         var treeType = vI_rdfDataTree.tabbox.selectedPanel.id;
    329         var tree = vI_rdfDataTree.trees[treeType];
     328        var vI_treeType = vI_rdfDataTree.tabbox.selectedPanel.id;
     329        var tree = vI_rdfDataTree.trees[vI_treeType];
    330330        if (tree.treeElem.view.selection.count == 0) return;
    331331        var warning = vI_rdfDataTree._strings.getString("vI_rdfDataTree.remove.Warning1") + " " +
     
    341341            tree.treeElem.view.selection.getRangeAt(t,start,end);
    342342            for (var v=start.value; v<=end.value; v++){
    343                 vI_rdfDataTree._vI_rdfDatasource.removeVIdentityFromRDF(tree.idTable[v]["resource"], treeType)
     343                vI_rdfDataTree._vI_rdfDatasource.removeVIdentityFromRDF(tree.idTable[v]["resource"], vI_treeType)
    344344            }
    345345        }
     
    351351   
    352352    moveConstraints : function() {
    353         var treeType = vI_rdfDataTree.tabbox.selectedPanel.id;
    354         if (treeType != "filter") return;
    355         var tree = vI_rdfDataTree.trees[treeType];
     353        var vI_treeType = vI_rdfDataTree.tabbox.selectedPanel.id;
     354        if (vI_treeType != "filter") return;
     355        var tree = vI_rdfDataTree.trees[vI_treeType];
    356356        if (tree.treeElem.view.selection.count == 0) {
    357357            document.getElementById("reorderUpButton_filter").setAttribute("disabled","true");
     
    376376
    377377    moveUpSelected : function() {
    378         var treeType = vI_rdfDataTree.tabbox.selectedPanel.id;
    379         if (treeType != "filter") return; // just to be safe, button should be disabled
    380         var tree = vI_rdfDataTree.trees[treeType];
     378        var vI_treeType = vI_rdfDataTree.tabbox.selectedPanel.id;
     379        if (vI_treeType != "filter") return; // just to be safe, button should be disabled
     380        var tree = vI_rdfDataTree.trees[vI_treeType];
    381381        if (tree.treeElem.view.selection.count == 0) return; // just to be safe, button should be disabled
    382382
     
    396396
    397397    moveDownSelected : function() {
    398         var treeType = vI_rdfDataTree.tabbox.selectedPanel.id;
    399         if (treeType != "filter") return; // just to be safe, button should be disabled
    400         var tree = vI_rdfDataTree.trees[treeType];
     398        var vI_treeType = vI_rdfDataTree.tabbox.selectedPanel.id;
     399        if (vI_treeType != "filter") return; // just to be safe, button should be disabled
     400        var tree = vI_rdfDataTree.trees[vI_treeType];
    401401        if (tree.treeElem.view.selection.count == 0) return; // just to be safe, button should be disabled
    402402
     
    425425        vI_rdfDataTree.infoBoxHidden = true;
    426426        document.getElementById("vI_rdfDataTreeInfoBox").setAttribute("style", "height:0px");
    427         for each (var treeType in vI_rdfDataTree.treeTypes) {
    428             try { if (vI_rdfDataTree.trees[treeType])
    429                 vI_rdfDataTree.trees[treeType].treeElem.view.selection.selectNone() } catch (e) { }
     427        for each (var vI_treeType in vI_rdfDataTree.vI_treeTypes) {
     428            try { if (vI_rdfDataTree.trees[vI_treeType])
     429                vI_rdfDataTree.trees[vI_treeType].treeElem.view.selection.selectNone() } catch (e) { }
    430430        }
    431431    },
    432432
    433433    selectAll : function() {
    434         var treeType = vI_rdfDataTree.tabbox.selectedPanel.id;
    435         var tree = vI_rdfDataTree.trees[treeType];
     434        var vI_treeType = vI_rdfDataTree.tabbox.selectedPanel.id;
     435        var tree = vI_rdfDataTree.trees[vI_treeType];
    436436        tree.treeElem.view.selection.selectAll();
    437437    },
    438438   
    439439    newItem : function() {
    440         var treeType = vI_rdfDataTree.tabbox.selectedPanel.id;
     440        var vI_treeType = vI_rdfDataTree.tabbox.selectedPanel.id;
    441441        var newItemPreset = { identityData : new vI_identityData ("", null, null, vI_NO_SMTP_TAG, null, null) };
    442442        // XXXX create useful preset
    443         var retVar = { treeType: null };
     443        var retVar = { vI_treeType: null };
    444444
    445445        window.openDialog("chrome://v_identity/content/vI_rdfDataEditor.xul",0,
    446446            "chrome, dialog, modal, alwaysRaised, resizable=yes",
    447             newItemPreset, treeType,
     447            newItemPreset, vI_treeType,
    448448            vI_rdfDataTree._vI_rdfDatasource, retVar).focus();
    449449
    450450        // reload all trees (multiple types might have changed)
    451         for each (var treeType in vI_rdfDataTree.treeTypes) {
    452             vI_rdfDataTree.trees[treeType].idData = null;
    453             vI_rdfDataTree.trees[treeType].idTable = null;
    454             vI_rdfDataTree.trees[treeType].loadTable()
    455         }
    456         vI_rdfDataTree.tabbox.selectedTab = document.getElementById(retVar.treeType + "Tab");
     451        for each (var vI_treeType in vI_rdfDataTree.vI_treeTypes) {
     452            vI_rdfDataTree.trees[vI_treeType].idData = null;
     453            vI_rdfDataTree.trees[vI_treeType].idTable = null;
     454            vI_rdfDataTree.trees[vI_treeType].loadTable()
     455        }
     456        vI_rdfDataTree.tabbox.selectedTab = document.getElementById(retVar.vI_treeType + "Tab");
    457457        vI_rdfDataTree.hideInfoBox();
    458458    }
  • chrome/content/v_identity/vI_rdfDatasource.js

    r7c86b4 r997e80  
    207207    _tagDefaultSMTP: function() {
    208208        if (vI_notificationBar) vI_notificationBar.dump("upgrade: tagDefaultSMTP ");
    209         for each (treeType in Array("email", "maillist", "newsgroup", "filter")) {
    210             var enumerator = this.getContainer(treeType).GetElements();
     209        for each (vI_treeType in Array("email", "maillist", "newsgroup", "filter")) {
     210            var enumerator = this.getContainer(vI_treeType).GetElements();
    211211            while (enumerator && enumerator.hasMoreElements()) {
    212212                var resource = enumerator.getNext();
     
    366366        var relevantIDs = new Object();
    367367        // search relevant Identities
    368         for each (treeType in Array("email", "maillist", "newsgroup", "filter")) {
    369             var enumerator = this.getContainer(treeType).GetElements();
     368        for each (vI_treeType in Array("email", "maillist", "newsgroup", "filter")) {
     369            var enumerator = this.getContainer(vI_treeType).GetElements();
    370370            while (enumerator && enumerator.hasMoreElements()) {
    371371                var resource = enumerator.getNext();
     
    426426            if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: repairAccountMismatch change " + mismatchItems[i].oldkey + " into " + mismatchItems[i].key + ": ");
    427427            // search relevant Identities
    428             for each (treeType in Array("email", "maillist", "newsgroup", "filter")) {
    429                 var enumerator = this.getContainer(treeType).GetElements();
     428            for each (vI_treeType in Array("email", "maillist", "newsgroup", "filter")) {
     429                var enumerator = this.getContainer(vI_treeType).GetElements();
    430430                while (enumerator && enumerator.hasMoreElements()) {
    431431                    var resource = enumerator.getNext();
     
    445445        var relevantSMTPs = new Object();
    446446        // search relevant SMTPs
    447         for each (treeType in Array("email", "maillist", "newsgroup", "filter")) {
    448             var enumerator = this.getContainer(treeType).GetElements();
     447        for each (vI_treeType in Array("email", "maillist", "newsgroup", "filter")) {
     448            var enumerator = this.getContainer(vI_treeType).GetElements();
    449449            while (enumerator && enumerator.hasMoreElements()) {
    450450                var resource = enumerator.getNext();
     
    613613   
    614614    // this will be used from rdfDataTree to get all RDF values, callFunction is vI_rdfDataTree.__addNewDatum
    615     readAllEntriesFromRDF : function (addNewDatum, treeType, idData) {
     615    readAllEntriesFromRDF : function (addNewDatum, vI_treeType, idData) {
    616616//      if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: readAllEntriesFromRDF " + this._rdfService  + " " + this._rdfDataSource + " " + this + "\n");
    617         var enumerator = this.getContainer(treeType).GetElements();
     617        var enumerator = this.getContainer(vI_treeType).GetElements();
    618618        while (enumerator && enumerator.hasMoreElements()) {
    619619            var resource = enumerator.getNext();
     
    944944            if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasourceImporter import: starting import:\n");
    945945
    946             for each (treeType in Array("email", "maillist", "newsgroup", "filter")) {
     946            for each (vI_treeType in Array("email", "maillist", "newsgroup", "filter")) {
    947947                // re-initialize importDataSource to point rdfService to the right Resources
    948948                this._rdfImportDataSource = new vI_rdfDatasource(importRdfDataFile.leafName, true);
    949                 var container = this._rdfImportDataSource.getContainer(treeType)
     949                var container = this._rdfImportDataSource.getContainer(vI_treeType)
    950950                if (container.GetCount() == 0) continue;
    951                 if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasourceImporter importing " + treeType + ": " + container.GetCount()+ " datasets from " + this._rdfImportDataSource._rdfDataSource.URI + "\n");
     951                if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasourceImporter importing " + vI_treeType + ": " + container.GetCount()+ " datasets from " + this._rdfImportDataSource._rdfDataSource.URI + "\n");
    952952                var enumerator = container.GetElements();
    953953                // re-initialize dataSource to point rdfService to the right Resources
     
    968968                    var localIdentityData = new vI_identityData(email, fullName, id, smtp, extras)
    969969                   
    970                     this._rdfDataSource.updateRDF(name, treeType, localIdentityData, false, false, null, null)
    971                     var resource = this._rdfDataSource._getRDFResourceForVIdentity(name, treeType);
     970                    this._rdfDataSource.updateRDF(name, vI_treeType, localIdentityData, false, false, null, null)
     971                    var resource = this._rdfDataSource._getRDFResourceForVIdentity(name, vI_treeType);
    972972                    if (id) this._rdfDataSource._setRDFValue(resource, "id", id);       // localIdentityData can only store valid id's, this one might be a temporary invalid id
    973973                    if (smtp) this._rdfDataSource._setRDFValue(resource, "smtp", smtp); // localIdentityData can only store valid smtp's, this one might be a temporary invalid smtp
Note: See TracChangeset for help on using the changeset viewer.