|
|
@@ -3,6 +3,9 @@ import angular from 'angular'; |
|
|
|
|
|
|
|
import Clipboard from 'clipboard'; |
|
|
|
|
|
|
|
window.jQuery = $ = require('jquery'); |
|
|
|
var bootstrap = require('bootstrap/dist/js/bootstrap'); |
|
|
|
|
|
|
|
class lesspassController { |
|
|
|
constructor($scope) { |
|
|
|
var vm = this; |
|
|
@@ -20,13 +23,26 @@ class lesspassController { |
|
|
|
}, function () { |
|
|
|
vm.updatePassword(); |
|
|
|
}); |
|
|
|
|
|
|
|
$scope.$watchCollection(function () { |
|
|
|
return vm.site; |
|
|
|
}, function () { |
|
|
|
vm.updatePassword(); |
|
|
|
}); |
|
|
|
|
|
|
|
new Clipboard('.copy-btn'); |
|
|
|
var clipboard = new Clipboard('#copy-btn'); |
|
|
|
clipboard.on('success', function (e) { |
|
|
|
var copyBtn = document.getElementById("copy-btn"); |
|
|
|
var t = $(copyBtn).tooltip({title: 'Copié'}); |
|
|
|
t.tooltip('show'); |
|
|
|
e.clearSelection(); |
|
|
|
}); |
|
|
|
|
|
|
|
clipboard.on('error', function (e) { |
|
|
|
var passwordGenerated = document.getElementById("password_generated"); |
|
|
|
var t = $(passwordGenerated).tooltip({title: 'Cmd + C pour copier le mot de passe'}); |
|
|
|
t.tooltip('show'); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
updatePasswordTypes(type) { |
|
|
@@ -41,7 +57,7 @@ class lesspassController { |
|
|
|
} |
|
|
|
|
|
|
|
updatePassword() { |
|
|
|
if(this.password && this.site.site_name){ |
|
|
|
if (this.password && this.site.site_name) { |
|
|
|
this.generatedPassword = lesspass.create_password(this.password, this.site); |
|
|
|
} |
|
|
|
} |
|
|
|