Changeset b73004


Ignore:
Timestamp:
Aug 12, 2008, 4:51:24 PM (11 years ago)
Author:
rene <rene@…>
Branches:
master
Children:
2f2f81
Parents:
750a78
Message:

added layouted output (getCompareMatrix) to comparison of storageExtras

Location:
chrome
Files:
4 added
4 edited

Legend:

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

    r750a78 rb73004  
    143143        var string = "";
    144144        for each (item in Items) {
    145             var classEqual = (this.comp.equals[item])?"equal":"nonequal";
     145            var classEqual = (this.comp.equals[item])?"equal":"unequal";
    146146            string += "<tr>" +
    147147                "<td class='col1 " + classEqual + "'>" + this.comp.labels[item] + "</td>" +
     
    150150                "</tr>"
    151151        }
     152        string += "<tr />"
     153        string += this.extras.getCompareMatrix();
    152154        return string;
    153155    },
  • chrome/content/v_identity/vI_storageExtras.js

    r750a78 rb73004  
    9898    },
    9999    equal : function(storageExtras) {
    100         for( var i = 0; i < this.extras.length; i++ ) {
    101             if (this.extras[i].active) vI_notificationBar.dump("## vI_storageExtras equal "+ this.extras[i].value + " : " + storageExtras.extras[i].value + "\n");
    102             if (this.extras[i].active &&
    103                 (this.extras[i].value != storageExtras.extras[i].value)) {
    104                     vI_notificationBar.dump("## vI_storageExtras not equal\n"); return false
     100        var equal = true;
     101        for( var i = 0; i < this.extras.length; i++ ) {
     102            if (this.extras[i].active) {
     103                vI_notificationBar.dump("## vI_storageExtras equal "+ this.extras[i].value + " : " + storageExtras.extras[i].value + "\n");
     104                equal = (this.extras[i].equal(storageExtras.extras[i].value) && equal) // in this order to compare all fields
    105105            }
    106106        }
    107         return true
     107        return equal;
     108    },
     109    getCompareMatrix : function() {
     110        var prefStrings = document.getElementById("vIStorageExtrasBundle");
     111        var string = "";
     112        for( var i = 0; i < this.extras.length; i++ ) {
     113            if (this.extras[i].active) {
     114                var classEqual = (this.extras[i].comp.equal)?"equal":"unequal";
     115                string += "<tr>" +
     116                    "<td class='col1 extras " + classEqual + "'>" + prefStrings.getString("vident.identityData.extras." + this.extras[i].field) + "</td>" +
     117                    "<td class='col2 extras " + classEqual + "'>" + this.extras[i].comp.compareValue + "</td>" +
     118                    "<td class='col3 extras " + classEqual + "'>" + this.extras[i].comp.value + "</td>" +
     119                    "</tr>"
     120            }
     121        }
     122        vI_notificationBar.dump("## vI_storageExtras getCompareMatrix "+string + "\n")
     123        return string;
    108124    },
    109125    status : function() {
     
    162178function vI_storageExtras_characterEncoding() {
    163179    this.active = vI_storageExtrasHelper.preferences.getBoolPref(this.option)
     180    this.comp = { value : null, compareValue : null, equal : null }
    164181}
    165182vI_storageExtras_characterEncoding.prototype = {
     
    168185    field : "charEnc",
    169186    option : "storageExtras_characterEncoding",
     187    comp : null,
     188   
     189    equal : function(compareValue) {
     190        this.comp.compareValue = compareValue?compareValue:"";
     191        this.comp.value = this.value?this.value:"";
     192        this.comp.equal = (this.value == null || this.value == compareValue);
     193        return this.comp.equal;
     194    },
    170195    // function to set or read the value from/to the MessageCompose Dialog
    171196    setValue : function() {
     
    208233function vI_storageExtras_msgFormat() {
    209234    this.active = vI_storageExtrasHelper.preferences.getBoolPref(this.option)
     235    this.comp = { value : null, compareValue : null, equal : null }
    210236}
    211237vI_storageExtras_msgFormat.prototype = {
     
    214240    field : "msgFormat",
    215241    option : "storageExtras_messageFormat",
     242    comp : null,
     243
     244    equal : function(compareValue) {
     245        this.comp.compareValue = compareValue?document.getElementById(compareValue).label:"";
     246        this.comp.value = this.value?document.getElementById(this.value).label:"";
     247        this.comp.equal = (this.value == null || this.value == compareValue);
     248        return this.comp.equal;
     249    },
    216250    // function to set or read the value from/to the MessageCompose Dialog
    217251    setValue : function() {
     
    247281function vI_storageExtras_sMime_messageEncryption() {
    248282    this.active = vI_storageExtrasHelper.preferences.getBoolPref(this.option)
     283    this.comp = { value : null, compareValue : null, equal : null }
    249284}
    250285vI_storageExtras_sMime_messageEncryption.prototype = {
     
    253288    field : "sMimeEnc",
    254289    option : "storageExtras_sMime_messageEncryption",
     290    comp : null,
     291
     292    __getLabel : function(value) {
     293        switch (value) {
     294            case null:
     295                return "<label />";
     296            case "true":
     297                return "<label class='bool checked'>yes</label>"
     298            case "false":
     299                return "<label class='bool'>no</label>"
     300        }
     301    },
     302
     303    equal : function(compareValue) {
     304        this.comp.value = this.__getLabel(this.value);
     305        this.comp.compareValue = this.__getLabel(compareValue);
     306        this.comp.equal = (this.value == null || this.value == compareValue);
     307        return this.comp.equal;
     308    },
    255309    // function to set or read the value from/to the MessageCompose Dialog
    256310    setValue : function() {
     
    289343    this.active = vI_storageExtrasHelper.preferences.getBoolPref(this.option) &&
    290344        document.getElementById(this.composeDialogElementID);
     345    this.comp = { value : null, compareValue : null, equal : null }
    291346}
    292347vI_storageExtras_checkbox.prototype = {
     
    295350    field : null,
    296351    option : null,
     352    comp : null,
    297353    composeDialogElementID : null,
    298354    updateFunction : null, // some elements have to be updated before the can be read
    299355    updateFunctionParam1 : null,
    300356   
     357    __getLabel : function(value) {
     358        switch (value) {
     359            case null:
     360                return "<label />";
     361            case "true":
     362                return "<label class='bool checked'>yes</label>"
     363            case "false":
     364                return "<label class='bool'>no</label>"
     365        }
     366    },
     367
     368    equal : function(compareValue) {
     369        this.comp.value = this.__getLabel(this.value);
     370        this.comp.compareValue = this.__getLabel(compareValue);
     371        this.comp.equal = (this.value == null || this.value == compareValue);
     372        return this.comp.equal;
     373    },
    301374    // function to set or read the value from/to the MessageCompose Dialog
    302375    setValue : function() {
  • chrome/content/v_identity/v_identity.xul

    r750a78 rb73004  
    4949  <stringbundleset id="stringbundleset">
    5050    <stringbundle id="vIdentBundle" src="chrome://v_identity/locale/v_identity.properties" />
     51    <stringbundle id="vIStorageExtrasBundle" src="chrome://v_identity/locale/vI_storageExtras.properties" />
    5152    <stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties" />
    5253  </stringbundleset>
  • chrome/skin/classic/v_identity/vI_DialogBrowser.css

    r750a78 rb73004  
    44embedded browser is not able to access chrome
    55*/
     6
     7label.bool {
     8    background-repeat:no-repeat;
     9    background-position: center;
     10    color: transparent;
     11}
     12
     13td.equal label.bool {
     14    background-image: url("chrome://v_identity/skin/notchecked-equal.png");
     15}
     16td.unequal label.bool {
     17    background-image: url("chrome://v_identity/skin/notchecked-unequal.png");
     18}
     19td.equal label.bool.checked {
     20    background-image: url("chrome://v_identity/skin/checked-equal.png");
     21}
     22td.unequal label.bool.checked {
     23    background-image: url("chrome://v_identity/skin/checked-unequal.png");
     24}
    625
    726h1 {
     
    3352
    3453th {
    35     font-weight: normal;
     54    /*font-weight: normal;*/
    3655    border-bottom: 1px solid;
    3756}
     
    4564.equal { }
    4665
    47 .nonequal.col2, .nonequal.col3 {
    48 /*  background-color: red; */
     66.unequal.col2, .unequal.col3 {
     67    background-color: #eaa;
    4968    font-weight: bold;
    5069}
     
    5473.col2 { }
    5574
    56 .col3 { }
     75.col3 {
     76    background: #eee;
     77 }
    5778
    5879.question {
Note: See TracChangeset for help on using the changeset viewer.