Changeset 01d590


Ignore:
Timestamp:
Apr 9, 2010, 12:10:37 PM (12 years ago)
Author:
rene <rene@…>
Branches:
multiEdit, ng_0.6, ng_0.8, ng_0.9
Children:
c8e38d
Parents:
46d6d4
Message:

got rid of eval() function

Location:
chrome/content/v_identity
Files:
2 edited

Legend:

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

    r46d6d4 r01d590  
    6464    this.extras = [
    6565        new vI_storageExtras_checkbox(
    66             "reciept", "storageExtras_returnReciept", "returnReceiptMenu", null, "identity.requestReturnReceipt;"),
    67         new vI_storageExtras_checkbox(
    68             "fcc", "storageExtras_fcc", "fcc_switch", null, "identity.doFcc;"),
     66            "reciept", "storageExtras_returnReciept", "returnReceiptMenu", null, function() { return identity.requestReturnReceipt; }),
     67        new vI_storageExtras_checkbox(
     68            "fcc", "storageExtras_fcc", "fcc_switch", null, function() { return identity.doFcc; }),
    6969        new vI_storageExtras_characterEncoding(),
    7070        new vI_storageExtras_msgFormat(),
    7171        new vI_storageExtras_checkbox(
    7272            "sMimeEnc", "storageExtras_sMime_messageEncryption", "menu_securityEncryptRequire1",
    73                 "(typeof(setSecuritySettings)=='function')?setSecuritySettings(1):null;",
    74                 "identity.getIntAttribute('encryptionpolicy') == 2"),
     73                function() { return ((typeof(setSecuritySettings)=='function')?setSecuritySettings(1):null) },
     74                function() { return (identity.getIntAttribute('encryptionpolicy') == 2) }),
    7575        new vI_storageExtras_checkbox(
    7676            "sMimeSig", "storageExtras_sMime_messageSignature", "menu_securitySign1",
    77                 "(typeof(setSecuritySettings)=='function')?setSecuritySettings(1):null;",
    78                 "identity.getBoolAttribute('sign_mail')"),
     77                function() { return ((typeof(setSecuritySettings)=='function')?setSecuritySettings(1):null) },
     78                function() { return (identity.getBoolAttribute('sign_mail')) }),
    7979        new vI_storageExtras_checkbox(
    8080            "PGPEnc", "storageExtras_openPGP_messageEncryption", "enigmail_encrypted_send",
    81                 "(typeof(enigSetMenuSettings)=='function')?enigSetMenuSettings(''):null;",
    82                 "identity.getIntAttribute('defaultEncryptionPolicy') > 0"),
     81                function() { return ((typeof(enigSetMenuSettings)=='function')?enigSetMenuSettings(''):null) },
     82                function() { return (identity.getIntAttribute('defaultEncryptionPolicy') > 0) }),
    8383        new vI_storageExtras_checkbox(
    8484            "PGPSig", "storageExtras_openPGP_messageSignature", "enigmail_signed_send",
    85                 "(typeof(enigSetMenuSettings)=='function')?enigSetMenuSettings(''):null;",
    86                 "(identity.getIntAttribute('defaultEncryptionPolicy') > 0)?identity.getBoolAttribute('pgpSignEncrypted'):identity.getBoolAttribute('pgpSignPlain')"),
     85                function() { return ((typeof(enigSetMenuSettings)=='function')?enigSetMenuSettings(''):null) },
     86                function() { return ((identity.getIntAttribute('defaultEncryptionPolicy') > 0)?identity.getBoolAttribute('pgpSignEncrypted'):identity.getBoolAttribute('pgpSignPlain')) }),
    8787        new vI_storageExtras_checkbox(
    8888            "PGPMIME", "storageExtras_openPGP_PGPMIME", "enigmail_sendPGPMime",
    89                 "(typeof(enigSetMenuSettings)=='function')?enigSetMenuSettings(''):null;",
    90                 "identity.getBoolAttribute('pgpMimeMode')")
     89                function() { return ((typeof(enigSetMenuSettings)=='function')?enigSetMenuSettings(''):null) },
     90                function() { return (identity.getBoolAttribute('pgpMimeMode')) })
    9191        ]
    9292    if (document.getElementById("menu_securityNoEncryption1"))  // TB 2.x
     
    461461    // function to read the value from a given identity
    462462    readIdentityValue : function(identity) {
    463         this.value = eval(this.valueFromIdentityFunction)?"true":"false";
     463        this.value = (this.valueFromIdentityFunction)?"true":"false";
    464464    },
    465465    // function to set or read the value from/to the MessageCompose Dialog
     
    467467        var element = document.getElementById(this.composeDialogElementID);
    468468        if (!this.value || !element) return;
    469         if (this.updateFunction) eval(this.updateFunction);
     469        if (typeof(this.updateFunction)=="function") this.updateFunction;
    470470
    471471        if ((element.getAttribute("checked") == "true") != (this.value == "true")) {
     
    477477        var element = document.getElementById(this.composeDialogElementID)
    478478        if (!element) return;
    479         if (this.updateFunction) eval(this.updateFunction);
     479        if (typeof(this.updateFunction)=="function") this.updateFunction;
    480480        this.value = ((element.getAttribute("checked") == "true")?"true":"false")
    481481    },
  • chrome/content/v_identity/vI_upgrade.js

    r46d6d4 r01d590  
    5252        if (currentVersion[2].match(/pre/))
    5353            nextVersion += parseInt(currentVersion[2])
    54         else nextVersion += eval(parseInt(currentVersion[2])+1)
     54        else nextVersion += parseInt(currentVersion[2]) + 1
    5555        var extVersion = document.getElementById("extVersion").getAttribute("value");
    5656               
Note: See TracChangeset for help on using the changeset viewer.