This is just some static backup of the original site, don't expect every link to work!

Ignore:
Timestamp:
Aug 16, 2011, 10:12:23 PM (11 years ago)
Author:
rene <rene@…>
Branches:
ng_0.8, ng_0.9
Children:
190674
Parents:
92fd25
Message:

clean namespace from pollution

File:
1 edited

Legend:

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

    r92fd25 rc3feaa  
    2222 * ***** END LICENSE BLOCK ***** */
    2323
    24 function vI_storageExtras_adapt(sourceId, targetId) {
     24virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     25function storageExtras_adapt(sourceId, targetId) {
    2526    var checked = document.getElementById(sourceId).getAttribute("checked");
    2627    if (targetId) var target = document.getElementById(targetId)
     
    3031}   
    3132
    32 var vI_storageExtrasHelper = {
     33var storageExtrasHelper = {
    3334    seamonkey_old : null,
    3435
     
    3839   
    3940    hideUnusedEditorFields : function() {
    40         var storageExtras = new vI_storageExtras();
     41        var localStorageExtras = new storageExtras();
    4142        var allHidden = true;
    4243        var hide = (document.getElementById("vI_storageExtras_hideUnusedEditorFields").getAttribute("checked") == "true")
    43         for( var i = 0; i < storageExtras.extras.length; i++ ) {
    44             var hidden = hide && !vI_storageExtrasHelper.preferences.getBoolPref(storageExtras.extras[i].option)
     44        for( var i = 0; i < localStorageExtras.extras.length; i++ ) {
     45            var hidden = hide && !storageExtrasHelper.preferences.getBoolPref(localStorageExtras.extras[i].option)
    4546            if (!hidden) allHidden = false
    46             document.getElementById("vI_" + storageExtras.extras[i].option).setAttribute("hidden", hidden)
    47             document.getElementById("vI_" + storageExtras.extras[i].option + "_store").setAttribute("hidden", hidden)
     47            document.getElementById("vI_" + localStorageExtras.extras[i].option).setAttribute("hidden", hidden)
     48            document.getElementById("vI_" + localStorageExtras.extras[i].option + "_store").setAttribute("hidden", hidden)
    4849        }
    4950        document.getElementById("storeValue").setAttribute("hidden", allHidden)
     
    5354}
    5455
    55 function vI_storageExtras(rdfDatasource, resource) {
    56 // function vI_storageExtras_checkbox(field, option, composeDialogElementID, updateFunction, identityValue) {
     56function storageExtras(rdfDatasource, resource) {
     57// function storageExtras_checkbox(field, option, composeDialogElementID, updateFunction, identityValue) {
    5758    this.extras = [
    58         new vI_storageExtras_checkbox(
     59        new storageExtras_checkbox(
    5960            "reciept", "storageExtras_returnReciept", "returnReceiptMenu", null, function(identity) { return identity.requestReturnReceipt; }),
    60         new vI_storageExtras_checkbox(
     61        new storageExtras_checkbox(
    6162            "fcc", "storageExtras_fcc", "fcc_switch", null, function(identity) { return identity.doFcc; }),
    62         new vI_storageExtras_characterEncoding(),
    63         new vI_storageExtras_msgFormat(),
    64         new vI_storageExtras_checkbox(
     63        new storageExtras_characterEncoding(),
     64        new storageExtras_msgFormat(),
     65        new storageExtras_checkbox(
    6566            "sMimeEnc", "storageExtras_sMime_messageEncryption", "menu_securityEncryptRequire1",
    6667                function() { return ((typeof(setSecuritySettings)=='function')?setSecuritySettings(1):null) },
    6768                function(identity) { return (identity.getIntAttribute('encryptionpolicy') == 2) }),
    68         new vI_storageExtras_checkbox(
     69        new storageExtras_checkbox(
    6970            "sMimeSig", "storageExtras_sMime_messageSignature", "menu_securitySign1",
    7071                function() { return ((typeof(setSecuritySettings)=='function')?setSecuritySettings(1):null) },
    7172                function(identity) { return (identity.getBoolAttribute('sign_mail')) }),
    72         new vI_storageExtras_checkbox(
     73        new storageExtras_checkbox(
    7374            "PGPEnc", "storageExtras_openPGP_messageEncryption", "enigmail_encrypted_send",
    7475                function() { return ((typeof(enigSetMenuSettings)=='function')?enigSetMenuSettings(''):null) },
    7576                function(identity) { return (identity.getIntAttribute('defaultEncryptionPolicy') > 0) }),
    76         new vI_storageExtras_checkbox(
     77        new storageExtras_checkbox(
    7778            "PGPSig", "storageExtras_openPGP_messageSignature", "enigmail_signed_send",
    7879                function() { return ((typeof(enigSetMenuSettings)=='function')?enigSetMenuSettings(''):null) },
    7980                function(identity) { return ((identity.getIntAttribute('defaultEncryptionPolicy') > 0)?identity.getBoolAttribute('pgpSignEncrypted'):identity.getBoolAttribute('pgpSignPlain')) }),
    80         new vI_storageExtras_checkbox(
     81        new storageExtras_checkbox(
    8182            "PGPMIME", "storageExtras_openPGP_PGPMIME", "enigmail_sendPGPMime",
    8283                function() { return ((typeof(enigSetMenuSettings)=='function')?enigSetMenuSettings(''):null) },
     
    8687}
    8788
    88 vI_storageExtras.prototype = {
     89storageExtras.prototype = {
    8990    loopForRDF : function(rdfDatasource, resource, type) {
    9091        for( var i = 0; i < this.extras.length; i++ ) {
    91 //          if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: loopForRDF " + rdfDatasource + "\n");
     92//          if (vI.notificationBar) vI.notificationBar.dump("## vI.rdfDatasource: loopForRDF " + rdfDatasource + "\n");
    9293            // only if pref set and feature(element available) or for dataEditor
    9394            if (typeof(gMsgCompose) == "undefined" || !gMsgCompose || this.extras[i].active) {
     
    103104    // just give a duplicate of the current storageExtras, else we will work with pointers
    104105    getDuplicate : function() {
    105         var newExtras = new vI_storageExtras();
     106        var newExtras = new storageExtras();
    106107        for( var i = 0; i < this.extras.length; i++ ) {
    107108            newExtras.extras[i].value = this.extras[i].value;
     
    166167        for( var i = 0; i < this.extras.length; i++ ) {
    167168            if (this.extras[i].active) this.extras[i].readIdentityValue(identity)
    168 //          vI_notificationBar.dump("## vI_storageExtras readIdentityValues "+ this.extras[i].field + "=" + this.extras[i].value + "\n");
     169//          vI.notificationBar.dump("## storageExtras readIdentityValues "+ this.extras[i].field + "=" + this.extras[i].value + "\n");
    169170        }
    170171    },
     
    173174        for( var i = 0; i < this.extras.length; i++ ) {
    174175            if (this.extras[i].active) this.extras[i].setValue()
    175 //          vI_notificationBar.dump("## vI_storageExtras setValue "+ this.extras[i].field + "=" + this.extras[i].value + "\n");
     176//          vI.notificationBar.dump("## storageExtras setValue "+ this.extras[i].field + "=" + this.extras[i].value + "\n");
    176177        }
    177178    },
    178179    readValues : function() {
    179180        for( var i = 0; i < this.extras.length; i++ ) {
    180 //          vI_notificationBar.dump("## vI_storageExtras preparing readValue "+ this.extras[i].field +"\n");
     181//          vI.notificationBar.dump("## storageExtras preparing readValue "+ this.extras[i].field +"\n");
    181182            if (this.extras[i].active) this.extras[i].readValue()
    182 //              vI_notificationBar.dump("## vI_storageExtras readValue "+ this.extras[i].field + "=" + this.extras[i].value + "\n");
     183//              vI.notificationBar.dump("## storageExtras readValue "+ this.extras[i].field + "=" + this.extras[i].value + "\n");
    183184        }
    184185    },
     
    189190        for( var i = 0; i < this.extras.length; i++ ) {
    190191            this.extras[i].readEditorValue();
    191 //          vI_notificationBar.dump("## vI_storageExtras readValue " + this.extras[i].field + "=" + this.extras[i].value + "\n");
    192         }
    193     },
    194 
    195     // add value's to the pref object, required for rdfDataTree
     192//          vI.notificationBar.dump("## storageExtras readValue " + this.extras[i].field + "=" + this.extras[i].value + "\n");
     193        }
     194    },
     195
     196    // add value's to the pref object, required for rdfDataTreeCollection
    196197    addPrefs : function(pref) {
    197198        for( var i = 0; i < this.extras.length; i++ )
     
    200201}
    201202
    202 function vI_storageExtras_characterEncoding_setMenuMark() {
     203function storageExtras_characterEncoding_setMenuMark() {
    203204    var maileditCharsetMenu = document.getElementById("maileditCharsetMenu")
    204205    var value = maileditCharsetMenu.getAttribute("unmarkedValue")
     
    209210    }
    210211}
    211 function vI_storageExtras_characterEncoding() {
    212     this.active = vI_storageExtrasHelper.preferences.getBoolPref("storage") &&
    213                 vI_storageExtrasHelper.preferences.getBoolPref(this.option)
     212function storageExtras_characterEncoding() {
     213    this.active = storageExtrasHelper.preferences.getBoolPref("storage") &&
     214                storageExtrasHelper.preferences.getBoolPref(this.option)
    214215    this.comp = { compareValue : null, equal : null }
    215216}
    216 vI_storageExtras_characterEncoding.prototype = {
     217storageExtras_characterEncoding.prototype = {
    217218    active : null,
    218219    value : null,
     
    246247            var onpopupshowing = maileditCharsetMenu.getAttribute("onpopupshowing")
    247248            document.getElementById("maileditCharsetMenu").setAttribute("onpopupshowing",
    248                 onpopupshowing + ";vI_storageExtras_characterEncoding_setMenuMark();")
     249                onpopupshowing + ";storageExtras_characterEncoding_setMenuMark();")
    249250        }
    250251        gMsgCompose.compFields.characterSet = this.value;
     
    254255        // read the value from the internal vI object, global object might not be available any more
    255256        // happens especially while storing after sending the message
    256         this.value = vI_main.gMsgCompose.compFields.characterSet;
     257        this.value = vI.main.gMsgCompose.compFields.characterSet;
    257258        if (gCharsetConvertManager) {
    258259            var charsetAlias = gCharsetConvertManager.getCharsetAlias(this.value);
     
    281282}
    282283
    283 function vI_storageExtras_msgFormat() {
    284     this.active = vI_storageExtrasHelper.preferences.getBoolPref("storage") &&
    285                 vI_storageExtrasHelper.preferences.getBoolPref(this.option)
     284function storageExtras_msgFormat() {
     285    this.active = storageExtrasHelper.preferences.getBoolPref("storage") &&
     286                storageExtrasHelper.preferences.getBoolPref(this.option)
    286287    this.comp = { value : null, compareValue : null, equal : null }
    287288}
    288 vI_storageExtras_msgFormat.prototype = {
     289storageExtras_msgFormat.prototype = {
    289290    active : null,
    290291    value : null,
     
    338339}
    339340
    340 function vI_storageExtras_sMime_messageEncryption() {
    341     this.active = vI_storageExtrasHelper.preferences.getBoolPref("storage") &&
    342                 vI_storageExtrasHelper.preferences.getBoolPref(this.option)
     341function storageExtras_sMime_messageEncryption() {
     342    this.active = storageExtrasHelper.preferences.getBoolPref("storage") &&
     343                storageExtrasHelper.preferences.getBoolPref(this.option)
    343344    this.comp = { value : null, compareValue : null, equal : null }
    344345}
    345 vI_storageExtras_sMime_messageEncryption.prototype = {
     346storageExtras_sMime_messageEncryption.prototype = {
    346347    active : null,
    347348    value : null,
     
    375376    // function to set or read the value from/to the MessageCompose Dialog
    376377    setValue : function() {
    377         vI_notificationBar.dump("## storageExtras_sMime_messageEncryption \n");
     378        vI.notificationBar.dump("## storageExtras_sMime_messageEncryption \n");
    378379        var doEncryptElem = document.getElementById("menu_securityEncryptRequire1");
    379380        if (this.value == null) return;
     
    405406
    406407// a general checkbox for extra options. Has to provide some additional information
    407 function vI_storageExtras_checkbox(field, option, composeDialogElementID, updateFunction, identityValue) {
     408function storageExtras_checkbox(field, option, composeDialogElementID, updateFunction, identityValue) {
    408409    this.field = field;     // description of the option
    409410    this.option = option;       // option string to get preference settings
     
    411412    this.updateFunction = updateFunction;
    412413    this.valueFromIdentityFunction = identityValue;
    413     this.active = vI_storageExtrasHelper.preferences.getBoolPref("storage") &&
    414                 vI_storageExtrasHelper.preferences.getBoolPref(this.option)
     414    this.active = storageExtrasHelper.preferences.getBoolPref("storage") &&
     415                storageExtrasHelper.preferences.getBoolPref(this.option)
    415416//      elements are never available in DataTree, so leave this out.
    416417//      && document.getElementById(this.composeDialogElementID);
    417418    this.comp = { compareValue : null, equal : null }
    418419}
    419 vI_storageExtras_checkbox.prototype = {
     420storageExtras_checkbox.prototype = {
    420421    active : null,
    421422    value : null,
     
    457458
    458459        if ((element.getAttribute("checked") == "true") != (this.value == "true")) {
    459             vI_notificationBar.dump("## vI_storageExtras change "+ this.field + " to " + this.value + " with doCommand\n");
     460            vI.notificationBar.dump("## storageExtras change "+ this.field + " to " + this.value + " with doCommand\n");
    460461            element.doCommand();
    461462        }
     
    483484    }
    484485}
     486
     487vI.storageExtras = storageExtras;
     488vI.storageExtrasHelper = storageExtrasHelper;
     489vI.storageExtras_adapt = storageExtras_adapt;
     490}});
Note: See TracChangeset for help on using the changeset viewer.