Guillaume Vincent преди 7 години
родител
ревизия
31d5140072
променени са 3 файла, в които са добавени 19 реда и са изтрити 20 реда
  1. +1
    -16
      src/components/Menu.vue
  2. +1
    -0
      src/services/tooltip.js
  3. +17
    -4
      src/views/PasswordGenerator.vue

+ 1
- 16
src/components/Menu.vue Целия файл

@@ -28,10 +28,6 @@
v-if="!saved && isAuthenticated && $store.state.password.site !== ''">
<i class="fa fa-lg fa-save pointer"></i>
</span>
<span class="white-link btn-copy pl-3" v-bind:data-clipboard-text="passwordURL"
v-if="$store.state.password.site !== ''">
<i class="fa fa-lg fa-share-alt pointer"></i>
</span>
<router-link class="white-link pl-3" :to="{ name: 'configureOptions'}">
<i class="fa fa-lg fa-cog" aria-hidden="true"></i>
</router-link>
@@ -52,8 +48,6 @@
</template>
<script type="text/ecmascript-6">
import {mapGetters} from 'vuex';
import Clipboard from 'clipboard';
import {showTooltip} from '../services/tooltip';

export default {
data(){
@@ -61,14 +55,6 @@
saved: false
}
},
created(){
const clipboard = new Clipboard('.btn-copy');
clipboard.on('success', event => {
if (event.text) {
showTooltip(event.trigger, this.$t('copied', 'copied !'));
}
});
},
methods: {
fullReload(){
this.$store.dispatch('savePassword', {password: this.defaultPassword});
@@ -90,8 +76,7 @@
'isAuthenticated',
'isGuest',
'password',
'defaultPassword',
'passwordURL'
'defaultPassword'
])
}
</script>

+ 1
- 0
src/services/tooltip.js Целия файл

@@ -4,5 +4,6 @@ export function showTooltip(elem, msg) {
elem.setAttribute('aria-label', msg);
setTimeout(function() {
elem.setAttribute('class', classNames);
elem.setAttribute('aria-label', '');
}, 2000);
}

+ 17
- 4
src/views/PasswordGenerator.vue Целия файл

@@ -86,17 +86,24 @@
</button>
</div>
</div>
<div class="col-9" v-show="generatedPassword">
<div class="col-8" v-show="generatedPassword">
<div class="input-group">
<span class="input-group-btn">
<button id="copyPasswordButton" type="button" data-clipboard-text="" class="btn btn-copy"
<button id="copyPasswordButton"
class="btn btn-copy"
type="button"
data-clipboard-text=""
ref="copyPasswordButton"
v-bind:class="{ 'btn-warning': password.version===1, 'btn-primary': password.version===2 }">
<i class="fa fa-clipboard" aria-hidden="true"></i>
</button>
</span>
<input type="password" id="generated-password" class="form-control" tabindex="-1"
ref="generatedPassword" v-bind:value="generatedPassword"
<input id="generated-password"
type="password"
class="form-control"
tabindex="-1"
ref="generatedPassword"
v-bind:value="generatedPassword"
v-bind:class="{ 'btn-outline-warning': password.version===1, 'btn-outline-primary': password.version===2 }">
<span class="input-group-btn">
<button id="revealGeneratedPassword" type="button" class="btn"
@@ -108,6 +115,12 @@
</div>
</div>
<div class="col col-auto">
<button class="btn btn-copy btn-secondary"
type="button"
v-bind:data-clipboard-text="passwordURL"
v-bind:disabled="password.site.length === 0">
<i class="fa fa-lg fa-share-alt pointer" aria-hidden="true"></i>
</button>
<button type="button" class="btn btn-secondary" v-on:click="showOptions=!showOptions">
<i class="fa fa-sliders" aria-hidden="true"></i>
</button>


Зареждане…
Отказ
Запис