From 65ac3d3ca6e2d6ddb5f96fa504d21e8585c67540 Mon Sep 17 00:00:00 2001 From: Micha Rosenbaum Date: Fri, 13 Jan 2017 22:49:02 +0100 Subject: [PATCH 1/9] Remove trailing whitespace from style.less --- less/style.less | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/less/style.less b/less/style.less index 190ae7d..58ee8c7 100644 --- a/less/style.less +++ b/less/style.less @@ -2,7 +2,7 @@ body { padding-top: 70px; } input { - outline: 0; + outline: 0; } .navbar a { @@ -66,17 +66,17 @@ input { margin: 15px 0; span { - font-weight: bold; + font-weight: bold; } } - + ul#items { list-style: none; padding: 0px; li.active { background-color: #e5e3e9; } - + li { cursor: pointer; padding: 5px 20px; @@ -91,19 +91,19 @@ input { display: none; list-style: none; padding-left: 5px; - + li.last { display: none; @media (min-width:768px) { - border-bottom: 0; + border-bottom: 0; display: block; } } li { border-bottom: 1px dotted gray; - + br { clear: both; } - + label { display: block; float: left; @@ -120,7 +120,7 @@ input { padding-left: 0; width: 300px; } - + input.password { width: 200px; } From f1ee8fb42b27ac7b40912c2c5b02033484af4015 Mon Sep 17 00:00:00 2001 From: Micha Rosenbaum Date: Sat, 14 Jan 2017 15:54:53 +0100 Subject: [PATCH 2/9] Add form to edit the encryption password MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The form uses layout of the form for editing passwords not the search box. It’s required that the user enters it’s current encryption password and the new password twice. Issue: https://github.com/Luzifer/cloudkeys-go/issues/10 --- templates/overview.html | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/templates/overview.html b/templates/overview.html index f79ed25..0373961 100644 --- a/templates/overview.html +++ b/templates/overview.html @@ -132,6 +132,38 @@ + + + From d08c29c0830531391b7c696a7ecafe5ad3f302cb Mon Sep 17 00:00:00 2001 From: Micha Rosenbaum Date: Sat, 14 Jan 2017 16:12:24 +0100 Subject: [PATCH 3/9] Add function to show the edit encryption password form showEditEncPWForm() is adapted from showForm(num) to edit and create passwords. It binds a click event handler to the primary button, that checks if the current password is correct and if the new password is entered twice. If all validations succeed, the entered password is used as the encryption password and the users data is updated with this new password. Issue: https://github.com/Luzifer/cloudkeys-go/issues/10 --- coffee/script.coffee | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/coffee/script.coffee b/coffee/script.coffee index 63fb88a..b0c664e 100644 --- a/coffee/script.coffee +++ b/coffee/script.coffee @@ -282,6 +282,38 @@ class CloudKeys return success + showEditEncPWForm: () -> + $('#editEncPWDialog input').val('') + $('#editEncPWDialog .hide').removeClass('hide') + $('#editEncPWDialog').modal({}) + + $('#editEncPWDialog .btn-primary').unbind('click').click => + $('#editEncPWDialog .has-error').removeClass('has-error') + confirmation = confirm('Do you really want to update your encryption password?') + + if confirmation isnt true + return + + if $('#editEncPW_current_password').val() isnt @password + $('#editEncPW_current_password').parent().addClass('has-error') + return + + new_password = $('#editEncPW_password').val() + + if new_password is undefined or new_password is '' + $('#editEncPW_password').parent().addClass('has-error') + return + + if new_password isnt $('#editEncPW_repeat_password').val() + $('#editEncPW_password, #editEncPW_repeat_password').parent().addClass('has-error') + return + + @password = new_password + @updateData => + $('#formEncPWClose').click() + return + + window.CloudKeys = new CloudKeys() $('#importLink').click => $('#importContainer').toggle(500) From 171df9ceda352c3765e14ba3d37268dad2b4127e Mon Sep 17 00:00:00 2001 From: Micha Rosenbaum Date: Sat, 14 Jan 2017 16:19:08 +0100 Subject: [PATCH 4/9] Add menu link to the edit encryption password form MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The menu link is in a new “Settings” dropdown. That is a good place to add a link to update the account password in the future. The “Settings” menu is placed next to the “Switch Account” dropdown. Issue: https://github.com/Luzifer/cloudkeys-go/issues/10 --- coffee/script.coffee | 2 ++ templates/overview.html | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/coffee/script.coffee b/coffee/script.coffee index b0c664e..56c2627 100644 --- a/coffee/script.coffee +++ b/coffee/script.coffee @@ -13,6 +13,8 @@ class CloudKeys @fetchData() $('#newEntityLink').click => @showForm() + $('#editEncPWLink').click => + @showEditEncPWForm() $('#passwordRequest').addClass('hide') diff --git a/templates/overview.html b/templates/overview.html index 0373961..d51b047 100644 --- a/templates/overview.html +++ b/templates/overview.html @@ -25,6 +25,13 @@
  • Import