mirror of
https://github.com/dev-claw/vripper-project.git
synced 2026-08-19 08:35:41 +02:00
@@ -2,13 +2,13 @@
|
||||
<mat-dialog-content
|
||||
class="mat-typography"
|
||||
style="min-width: 50vw; min-height: 50vh">
|
||||
<mat-form-field
|
||||
appearance="outline"
|
||||
style="width: 100%; height: calc(100% - 20px); padding-top: 20px">
|
||||
<mat-form-field appearance="outline" style="width: 100%; padding-top: 20px">
|
||||
<mat-label>Add new links</mat-label>
|
||||
<textarea
|
||||
[formControl]="formControl"
|
||||
cdkTextareaAutosize
|
||||
[cdkTextareaAutosize]="true"
|
||||
[cdkAutosizeMinRows]="5"
|
||||
(paste)="onPaste($event)"
|
||||
matInput
|
||||
name="url"
|
||||
placeholder="Put each link in a new line"
|
||||
|
||||
@@ -4,7 +4,6 @@ import { MatDialogModule } from '@angular/material/dialog';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { FormControl, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { TextFieldModule } from '@angular/cdk/text-field';
|
||||
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
||||
import { DialogRef } from '@angular/cdk/dialog';
|
||||
|
||||
@@ -17,7 +16,6 @@ import { DialogRef } from '@angular/cdk/dialog';
|
||||
MatButtonModule,
|
||||
MatInputModule,
|
||||
ReactiveFormsModule,
|
||||
TextFieldModule,
|
||||
],
|
||||
templateUrl: './scan.component.html',
|
||||
styleUrls: ['./scan.component.scss'],
|
||||
@@ -39,4 +37,12 @@ export class ScanComponent {
|
||||
this.dialogRef.updatePosition();
|
||||
});
|
||||
}
|
||||
|
||||
onPaste(event: ClipboardEvent) {
|
||||
event.preventDefault();
|
||||
const oldValue = this.formControl.value || '';
|
||||
this.formControl.setValue(
|
||||
`${oldValue}${event?.clipboardData?.getData('text')}\n`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user