Thomas Bruederli
2015-11-16 310d4939ba9ce9d5eecbf3d6b89430ce08f4ce03
Tweak recently added encryption functions to not violate ECMASCRIPT3 syntax
2 files modified
40 ■■■■ changed files
program/js/app.js 18 ●●●● patch | view | raw | blame | history
program/js/publickey.js 22 ●●●● patch | view | raw | blame | history
program/js/app.js
@@ -3393,12 +3393,12 @@
    mailvelope.getKeyring(keyring).then(function(kr) {
      ref.mailvelope_keyring = kr;
      ref.mailvelope_init(action, kr);
    }).catch(function(err) {
    }, function(err) {
      // attempt to create a new keyring for this app/user
      mailvelope.createKeyring(keyring).then(function(kr) {
        ref.mailvelope_keyring = kr;
        ref.mailvelope_init(action, kr);
      }).catch(function(err) {
      }, function(err) {
        console.error(err);
      });
    });
@@ -3526,7 +3526,7 @@
            ref.remove_from_attachment_list(name);
          });
        }
      }).catch(function(err) {
      }, function(err) {
        console.error(err);
        console.log(options);
      });
@@ -3649,15 +3649,15 @@
          form.submit();
        }).catch(function(err) {
        }, function(err) {
          console.log(err);
        });  // mailvelope_editor.encrypt()
      }).catch(function(err) {
      }, function(err) {
        console.error(err);
      });  // mailvelope_keyring.validKeyForAddress(senders)
    }).catch(function(err) {
    }, function(err) {
      console.error(err);
    });  // mailvelope_keyring.validKeyForAddress(recipients)
@@ -3671,7 +3671,7 @@
      $(selector).addClass('mailvelope').children().not('iframe').hide();
      ref.hide_message(msgid);
      setTimeout(function() { $(window).resize(); }, 10);
    }).catch(function(err) {
    }, function(err) {
      console.error(err);
      ref.hide_message(msgid);
      ref.display_message('Message decryption failed: ' + err.message, 'error')
@@ -3727,7 +3727,7 @@
      if (missing_keys.length) {
        ref.display_message(ref.get_label('nopubkeyfor').replace('$email', missing_keys.join(', ')), 'warning');
      }
    }, function() {
    }).fail(function() {
      console.error('Pubkey lookup failed with', arguments);
      ref.hide_message(lock);
      ref.display_message('pubkeysearcherror', 'error');
@@ -3825,7 +3825,7 @@
              btn.closest('.key').fadeOut();
              ref.display_message(ref.get_label('keyimportsuccess').replace('$key', $key), 'confirmation');
            }
          }).catch(function(err) {
          }, function(err) {
            console.log(err);
          });
        });
program/js/publickey.js
@@ -6,7 +6,7 @@
    */
    var DEFAULT_KEYSERVERS = [
        "https://keys.fedoraproject.org/",
        "https://keybase.io/",
        "https://keybase.io/"
    ];
    /*
@@ -280,7 +280,7 @@
                                "expirationdate": null,
                                "revoked": false,
                                "disabled": false,
                                "expired": false,
                                "expired": false
                            }]
                        };
@@ -292,7 +292,7 @@
                                "expirationdate": null,
                                "revoked": false,
                                "disabled": false,
                                "expired": false,
                                "expired": false
                            });
                        }
@@ -306,7 +306,7 @@
                                "expirationdate": null,
                                "revoked": false,
                                "disabled": false,
                                "expired": false,
                                "expired": false
                            });
                        }
@@ -320,7 +320,7 @@
                                "expirationdate": null,
                                "revoked": false,
                                "disabled": false,
                                "expired": false,
                                "expired": false
                            });
                        }
@@ -334,7 +334,7 @@
                                "expirationdate": null,
                                "revoked": false,
                                "disabled": false,
                                "expired": false,
                                "expired": false
                            });
                        }
@@ -348,7 +348,7 @@
                                "expirationdate": null,
                                "revoked": false,
                                "disabled": false,
                                "expired": false,
                                "expired": false
                            });
                        }
@@ -362,7 +362,7 @@
                                "expirationdate": null,
                                "revoked": false,
                                "disabled": false,
                                "expired": false,
                                "expired": false
                            });
                        }
@@ -375,7 +375,7 @@
                                    "expirationdate": null,
                                    "revoked": false,
                                    "disabled": false,
                                    "expired": false,
                                    "expired": false
                                });
                            }
                        }
@@ -422,7 +422,7 @@
                                "revoked": vals[6].indexOf("r") !== -1,
                                "disabled": vals[6].indexOf("d") !== -1,
                                "expired": vals[6].indexOf("e") !== -1,
                                "uids": [],
                                "uids": []
                            }
                        }
@@ -435,7 +435,7 @@
                                "expirationdate": vals[3] === "" ? null : parseInt(vals[3]),
                                "revoked": vals[4].indexOf("r") !== -1,
                                "disabled": vals[4].indexOf("d") !== -1,
                                "expired": vals[4].indexOf("e") !== -1,
                                "expired": vals[4].indexOf("e") !== -1
                            });
                        }
                    }