fix #96: regenerate password button

This commit is contained in:
Antelle 2016-02-23 09:43:43 +03:00
parent 0d256ac6c3
commit 6f929ffd5b
5 changed files with 22 additions and 2 deletions

View File

@ -51,6 +51,7 @@ var Locale = {
footerTitleLock: 'Lock', footerTitleLock: 'Lock',
genLen: 'Length', genLen: 'Length',
genNewPass: 'New password',
genPresetDefault: 'default preset', genPresetDefault: 'default preset',
genPresetDerived: 'like old password', genPresetDerived: 'like old password',
genPresetPronounceable: 'pronounceable', genPresetPronounceable: 'pronounceable',

View File

@ -17,7 +17,8 @@ var GeneratorView = Backbone.View.extend({
'change .gen__length-range': 'lengthChange', 'change .gen__length-range': 'lengthChange',
'change .gen__check input[type=checkbox]': 'checkChange', 'change .gen__check input[type=checkbox]': 'checkChange',
'click .gen__btn-ok': 'btnOkClick', 'click .gen__btn-ok': 'btnOkClick',
'change .gen__sel-tpl': 'templateChange' 'change .gen__sel-tpl': 'templateChange',
'click .gen__btn-refresh': 'newPass'
}, },
valuesMap: [3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,24,26,28,30,32,48,64], valuesMap: [3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,24,26,28,30,32,48,64],
@ -134,6 +135,10 @@ var GeneratorView = Backbone.View.extend({
var preset = _.find(this.presets, function(t) { return t.name === name; }); var preset = _.find(this.presets, function(t) { return t.name === name; });
this.gen = _.clone(preset); this.gen = _.clone(preset);
this.render(); this.render();
},
newPass: function() {
this.render();
} }
}); });

View File

@ -5,6 +5,16 @@
width: 11em; width: 11em;
&__length-range { &__length-range {
} }
&__btn-refresh {
float: right;
cursor: pointer;
position: relative;
top: 2px;
@include th {
color: muted-color();
&:hover { color: text-color(); }
}
}
&__sel-tpl { &__sel-tpl {
width: 100%; width: 100%;
margin-top: $base-padding-v; margin-top: $base-padding-v;

View File

@ -1,5 +1,7 @@
<div class="gen"> <div class="gen">
<div>{{res 'genLen'}}: <span class="gen__length-range-val">{{opt.length}}</span></div> <div>{{res 'genLen'}}: <span class="gen__length-range-val">{{opt.length}}</span>
<i class="fa fa-refresh gen__btn-refresh" title="{{res 'genNewPass'}}"></i>
</div>
<select class="gen__sel-tpl input-base"> <select class="gen__sel-tpl input-base">
{{#each presets as |ps|}} {{#each presets as |ps|}}
<option value="{{ps.name}}" {{#ifeq ps.name ../preset}}selected{{/ifeq}}>{{ps.title}}</option> <option value="{{ps.name}}" {{#ifeq ps.name ../preset}}selected{{/ifeq}}>{{ps.title}}</option>

View File

@ -7,6 +7,8 @@ Storage providers, usability improvements
`+` option to lock on password copy `+` option to lock on password copy
`+` save/restore window position after close `+` save/restore window position after close
`+` shortcut to copy username `+` shortcut to copy username
`+` password generation presets
`+` regenerate password button
`-` fix #88: capslock indicator `-` fix #88: capslock indicator
##### v1.0.3 (TBD) ##### v1.0.3 (TBD)