1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 01:03:35 +00:00

various vault functionality

This commit is contained in:
Kyle Spearrin
2018-06-07 17:12:11 -04:00
parent a18a591f0a
commit 059df9c45d
11 changed files with 501 additions and 178 deletions

View File

@@ -14,6 +14,7 @@ import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { StateService } from 'jslib/abstractions/state.service';
import { AddEditComponent as BaseAddEditComponent } from 'jslib/angular/components/add-edit.component';
import { LoginUriView } from 'jslib/models/view/loginUriView';
@Component({
selector: 'app-vault-add-edit',
@@ -31,4 +32,28 @@ export class AddEditComponent extends BaseAddEditComponent implements OnInit {
async ngOnInit() {
await super.load();
}
toggleFavorite() {
this.cipher.favorite = !this.cipher.favorite;
}
launch(uri: LoginUriView) {
if (!uri.canLaunch) {
return;
}
this.analytics.eventTrack.next({ action: 'Launched Login URI' });
this.platformUtilsService.launchUri(uri.uri);
}
copy(value: string, typeI18nKey: string, aType: string) {
if (value == null) {
return;
}
this.analytics.eventTrack.next({ action: 'Copied ' + aType });
this.platformUtilsService.copyToClipboard(value, { doc: window.document });
this.toasterService.popAsync('info', null,
this.i18nService.t('valueCopied', this.i18nService.t(typeI18nKey)));
}
}