]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
unify inputs requiring buttons like password inputs
authorRigel Kent <sendmemail@rigelk.eu>
Fri, 4 Dec 2020 14:58:55 +0000 (15:58 +0100)
committerRigel Kent <sendmemail@rigelk.eu>
Fri, 4 Dec 2020 15:01:53 +0000 (16:01 +0100)
26 files changed:
client/src/app/+admin/users/user-edit/user-edit.component.html
client/src/app/+login/login.component.html
client/src/app/+my-account/my-account-applications/my-account-applications.component.html
client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.html
client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.scss
client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.html
client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.scss
client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts
client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.scss
client/src/app/+reset-password/reset-password.component.html
client/src/app/+signup/+register/register-step-user.component.html
client/src/app/+videos/+video-edit/shared/video-edit.component.html
client/src/app/shared/form-validators/user-validators.ts
client/src/app/shared/shared-forms/dynamic-form-field.component.html
client/src/app/shared/shared-forms/index.ts
client/src/app/shared/shared-forms/input-readonly-copy.component.html [deleted file]
client/src/app/shared/shared-forms/input-readonly-copy.component.scss [deleted file]
client/src/app/shared/shared-forms/input-readonly-copy.component.ts [deleted file]
client/src/app/shared/shared-forms/input-toggle-hidden.component.html [new file with mode: 0644]
client/src/app/shared/shared-forms/input-toggle-hidden.component.scss [new file with mode: 0644]
client/src/app/shared/shared-forms/input-toggle-hidden.component.ts [new file with mode: 0644]
client/src/app/shared/shared-forms/shared-form.module.ts
client/src/app/shared/shared-share-modal/video-share.component.html
client/src/app/shared/shared-share-modal/video-share.component.scss
client/src/app/shared/shared-video-live/live-stream-information.component.html
client/src/sass/application.scss

index 0cb625b4ac751fbfa0db45933bf13898a71a75a8..819ced83488cb2b1ccd58f62205d548c6079b7e9 100644 (file)
             </ng-container>
           </ng-template>
         </my-help>
-        <input
-          type="password" id="password" autocomplete="new-password" class="form-control"
-          formControlName="password" [ngClass]="{ 'input-error': formErrors['password'] }"
-        >
+        <my-input-toggle-hidden formControlName="password" id="password"
+                          [ngClass]="{ 'input-error': formErrors['password'] }"
+                          autocomplete="new-password"></my-input-toggle-hidden>
         <div *ngIf="formErrors.password" class="form-error">
           {{ formErrors.password }}
         </div>
index 7ceae9311ddc813c928d2f3a956d5d093e91f828..390d77dd7927be706025cca62ebc126037a832e2 100644 (file)
         <div class="form-group">
           <label i18n for="password">Password</label>
           <div>
-            <input
-              type="password" name="password" id="password" i18n-placeholder placeholder="Password" required tabindex="2" autocomplete="current-password"
-              formControlName="password" class="form-control" [ngClass]="{ 'input-error': formErrors['password'] }"
-            >
+            <my-input-toggle-hidden formControlName="password" id="password"
+                                    i18n-placeholder placeholder="Password"
+                                    [ngClass]="{ 'input-error': formErrors['password'] }"
+                                    autocomplete="current-password"></my-input-toggle-hidden>
             <a i18n-title class="forgot-password-button" (click)="openForgotPasswordModal()" title="Click here to reset your password">I forgot my password</a>
           </div>
           <div *ngIf="formErrors.password" class="form-error">
index 3fbb79c718ba56b71709b26d648ffcbd1e6e6418..68d094a4f0868826021fd9628cbac6f03fc44c09 100644 (file)
@@ -8,7 +8,7 @@
     <h2 i18n class="applications-title">SUBSCRIPTION FEED</h2>
     <div i18n class="applications-description">
       Use third-party feed aggregators to retrieve the list of videos from
-      channels you subscribed to. Make sure to keep your token private.
+      channels you subscribed to.
     </div>
   </div>
 
 
     <div class="form-group">
       <label i18n for="feed-url">Feed URL</label>
-      <my-input-readonly-copy [value]="feedUrl"></my-input-readonly-copy>
+      <my-input-toggle-hidden [value]="feedUrl" [withToggle]="false" [withCopy]="true" [show]="true" [readonly]="true"></my-input-toggle-hidden>
     </div>
 
     <div class="form-group">
       <label i18n for="feed-token">Feed Token</label>
-      <my-input-readonly-copy [value]="feedToken"></my-input-readonly-copy>
+      <my-input-toggle-hidden [value]="feedToken" [withCopy]="true" [readonly]="true"></my-input-toggle-hidden>
+
+      <div class="form-group-description" i18n>⚠️ Never share your feed token with anyone.</div>
     </div>
 
   </div>
index ce176d68294376f3baca3acd742eeee7649f848e..29823bdec0034ad935bd799b2c8b2ce0a729c7e3 100644 (file)
@@ -12,9 +12,8 @@
 <form role="form" class="change-email" (ngSubmit)="changeEmail()" [formGroup]="form" *ngIf="user.pluginAuth === null">
 
   <div class="form-group">
-    <label i18n for="new-email">New email</label>
     <input
-      type="email" id="new-email" i18n-placeholder placeholder="Your new email" class="form-control"
+      type="email" id="new-email" i18n-placeholder placeholder="New email" class="form-control"
       formControlName="new-email" [ngClass]="{ 'input-error': formErrors['new-email'] }"
     >
     <div *ngIf="formErrors['new-email']" class="form-error">
   </div>
 
   <div class="form-group">
-    <label i18n for="new-email">Your current password</label>
-    <input
-      type="password" id="password" i18n-placeholder placeholder="Your password" autocomplete="off"
-      formControlName="password" [ngClass]="{ 'input-error': formErrors['password'] }" class="form-control"
-    >
+    <my-input-toggle-hidden formControlName="password"
+                            id="password"
+                            i18n-placeholder placeholder="Current password"
+                            [ngClass]="{ 'input-error': formErrors['password'] }"
+                            autocomplete="current-password"></my-input-toggle-hidden>
     <div *ngIf="formErrors['password']" class="form-error">
       {{ formErrors['password'] }}
     </div>
index aec709ea028531478aced19d9a4bce098cc73b04..a8b9be0d1fe3d49baecb37a797fbf2c92ca8009d 100644 (file)
@@ -6,7 +6,11 @@ label {
   font-size: 100%;
 }
 
-input[type=password],
+my-input-toggle-hidden {
+  width: 340px;
+  display: block;
+}
+
 input[type=email] {
   @include peertube-input-text(340px);
 
@@ -20,10 +24,13 @@ input[type=submit] {
 
 .current-email,
 .pending-email {
-  font-size: 16px;
   margin-bottom: 15px;
 
   .email {
     font-weight: $font-semibold;
   }
 }
+
+.form-group {
+  width: max-content;
+}
index 4756cfecdc1e2579aaad2d8949804624ac83884e..f1127b6a1b2a81aa375d074be12129067d286c3c 100644 (file)
@@ -3,26 +3,29 @@
 <form role="form" (ngSubmit)="changePassword()" [formGroup]="form">
 
   <label i18n for="current-password">Change password</label>
-  <input
-    type="password" id="current-password" i18n-placeholder placeholder="Current password" autocomplete="current-password"
-    formControlName="current-password" [ngClass]="{ 'input-error': formErrors['current-password'] }" class="form-control"
-  >
+  <my-input-toggle-hidden formControlName="current-password"
+                          id="current-password"
+                          i18n-placeholder placeholder="Current password"
+                          [ngClass]="{ 'input-error': formErrors['current-password'] }"
+                          autocomplete="current-password"></my-input-toggle-hidden>
   <div *ngIf="formErrors['current-password']" class="form-error">
     {{ formErrors['current-password'] }}
   </div>
 
-  <input
-    type="password" id="new-password" i18n-placeholder placeholder="New password" autocomplete="new-password"
-    formControlName="new-password" [ngClass]="{ 'input-error': formErrors['new-password'] }" class="form-control"
-  >
+  <my-input-toggle-hidden formControlName="new-password"
+                          id="new-password"
+                          i18n-placeholder placeholder="New password"
+                          [ngClass]="{ 'input-error': formErrors['new-password'] }"
+                          autocomplete="new-password"></my-input-toggle-hidden>
   <div *ngIf="formErrors['new-password']" class="form-error">
     {{ formErrors['new-password'] }}
   </div>
 
-  <input
-    type="password" id="new-confirmed-password" i18n-placeholder placeholder="Confirm new password" autocomplete="new-password"
-    formControlName="new-confirmed-password" class="form-control"
-  >
+  <my-input-toggle-hidden formControlName="new-confirmed-password"
+                          id="new-confirmed-password"
+                          i18n-placeholder placeholder="Confirm new password"
+                          [ngClass]="{ 'input-error': formErrors['new-confirmed-password'] }"
+                          autocomplete="new-password"></my-input-toggle-hidden>
   <div *ngIf="formErrors['new-confirmed-password']" class="form-error">
     {{ formErrors['new-confirmed-password'] }}
   </div>
index 381afae078f40ad7c2c1236b9612df433a2ae97e..0d1f3094ad12843e7c10f524543c3d443a09f048 100644 (file)
@@ -6,14 +6,14 @@ label {
   font-size: 100%;
 }
 
-input[type=password] {
-  @include peertube-input-text(340px);
+my-input-toggle-hidden {
+  width: 340px;
   display: block;
+}
 
-  &#new-password,
-  &#new-confirmed-password  {
-    margin-top: 15px;
-  }
+#new-password,
+#new-confirmed-password  {
+  margin-top: 15px;
 }
 
 input[type=submit] {
@@ -22,4 +22,3 @@ input[type=submit] {
 
   margin-top: 15px;
 }
-
index ba68bab32dec089fef63fb1d13b7c15c3a3e36bc..e034aedef9495db54b944d497ad44f53e80a144d 100644 (file)
@@ -1,7 +1,7 @@
 import { filter } from 'rxjs/operators'
 import { Component, OnInit } from '@angular/core'
 import { AuthService, Notifier, UserService } from '@app/core'
-import { USER_CONFIRM_PASSWORD_VALIDATOR, USER_PASSWORD_VALIDATOR } from '@app/shared/form-validators/user-validators'
+import { USER_CONFIRM_PASSWORD_VALIDATOR, USER_PASSWORD_VALIDATOR, USER_EXISTING_PASSWORD_VALIDATOR } from '@app/shared/form-validators/user-validators'
 import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
 import { User } from '@shared/models'
 
@@ -25,7 +25,7 @@ export class MyAccountChangePasswordComponent extends FormReactive implements On
 
   ngOnInit () {
     this.buildForm({
-      'current-password': USER_PASSWORD_VALIDATOR,
+      'current-password': USER_EXISTING_PASSWORD_VALIDATOR,
       'new-password': USER_PASSWORD_VALIDATOR,
       'new-confirmed-password': USER_CONFIRM_PASSWORD_VALIDATOR
     })
index af30af4a0daefe8345fcb640f3326ae07470e8ac..db9c74f8977c124f8cc37ad3ad760e94172409dd 100644 (file)
@@ -6,10 +6,10 @@
   <form role="form" (ngSubmit)="resetPassword()" [formGroup]="form">
     <div class="form-group">
       <label i18n for="password">Password</label>
-      <input
-        type="password" name="password" id="password" i18n-placeholder placeholder="Password" required autocomplete="new-password"
-        formControlName="password" [ngClass]="{ 'input-error': formErrors['password'] }"
-      >
+      <my-input-toggle-hidden formControlName="password" id="password"
+                              i18n-placeholder placeholder="Password"
+                              [ngClass]="{ 'input-error': formErrors['password'] }"
+                              autocomplete="new-password"></my-input-toggle-hidden>
       <div *ngIf="formErrors.password" class="form-error">
         {{ formErrors.password }}
       </div>
 
     <div class="form-group">
       <label i18n for="password-confirm">Confirm password</label>
-      <input
-        type="password" name="password-confirm" id="password-confirm" i18n-placeholder placeholder="Confirmed password" required autocomplete="new-password"
-        formControlName="password-confirm" [ngClass]="{ 'input-error': formErrors['password-confirm'] }"
-      >
+      <my-input-toggle-hidden formControlName="password-confirm" id="password-confirm"
+                              i18n-placeholder placeholder="Confirmed password"
+                              [ngClass]="{ 'input-error': formErrors['password-confirm'] }"
+                              autocomplete="new-password"></my-input-toggle-hidden>
       <div *ngIf="formErrors['password-confirm']" class="form-error">
         {{ formErrors['password-confirm'] }}
       </div>
index 55fc097d0fbeff9567fe9c4cb217b7c4dd4235b0..6eab4df0c8ea65fe459a46f343d9f9617c6329d6 100644 (file)
 
   <div class="form-group">
     <label for="password" i18n>Password</label>
-    <input
-      type="password" id="password" i18n-placeholder placeholder="Password" autocomplete="new-password"
-      formControlName="password" class="form-control" [ngClass]="{ 'input-error': formErrors['password'] }"
-    >
+    <my-input-toggle-hidden formControlName="password" id="password"
+                            i18n-placeholder placeholder="Password"
+                            [ngClass]="{ 'input-error': formErrors['password'] }"
+                            autocomplete="new-password"></my-input-toggle-hidden>
     <div *ngIf="formErrors.password" class="form-error">
       {{ formErrors.password }}
     </div>
index f62464d35c031b45af6f852a80f321a855fd9155..4747cec27cabcb1ac671514e7f3c79d7145c8f34 100644 (file)
 
             <div class="form-group">
               <label for="liveVideoRTMPUrl" i18n>Live RTMP Url</label>
-              <my-input-readonly-copy id="liveVideoRTMPUrl" [value]="liveVideo.rtmpUrl"></my-input-readonly-copy>
+              <my-input-toggle-hidden id="liveVideoRTMPUrl" [value]="liveVideo.rtmpUrl" [withToggle]="false" [withCopy]="true" [show]="true" [readonly]="true"></my-input-toggle-hidden>
             </div>
 
             <div class="form-group">
               <label for="liveVideoStreamKey" i18n>Live stream key</label>
-              <my-input-readonly-copy id="liveVideoStreamKey" [value]="liveVideo.streamKey"></my-input-readonly-copy>
+              <my-input-toggle-hidden id="liveVideoStreamKey" [value]="liveVideo.streamKey" [withCopy]="true" [readonly]="true"></my-input-toggle-hidden>
 
               <div class="form-group-description" i18n>⚠️ Never share your stream key with anyone.</div>
             </div>
index 9efc5180d69300087e4b9e4dbeda5dba3636a1b3..115930146a88a6db98aa3ba044b113d16959c5e1 100644 (file)
@@ -39,6 +39,15 @@ export const USER_EMAIL_VALIDATOR: BuildFormValidator = {
   }
 }
 
+export const USER_EXISTING_PASSWORD_VALIDATOR: BuildFormValidator = {
+  VALIDATORS: [
+    Validators.required
+  ],
+  MESSAGES: {
+    'required': $localize`Password is required.`
+  }
+}
+
 export const USER_PASSWORD_VALIDATOR: BuildFormValidator = {
   VALIDATORS: [
     Validators.required,
index 6a3c31637920ac7f6cfdad41206de5f5e55b2b63..658d8ce5b70649fa4d76c1810eaed7e830f8e213 100644 (file)
@@ -5,7 +5,7 @@
 
   <input *ngIf="setting.type === 'input'" type="text" [id]="setting.name" [formControlName]="setting.name" />
 
-  <input *ngIf="setting.type === 'input-password'" type="password" [id]="setting.name" [formControlName]="setting.name" />
+  <my-input-toggle-hidden *ngIf="setting.type === 'input-password'" [formControlName]="setting.name" [id]="setting.name"></my-input-toggle-hidden>
 
   <textarea *ngIf="setting.type === 'input-textarea'" type="text" [id]="setting.name" [formControlName]="setting.name"></textarea>
 
index 66b4261913bf2b2ff37bdc3506913b7232371044..1d859b99123fd499ce30b0ca8f7ddd3b469eb906 100644 (file)
@@ -1,7 +1,7 @@
 export * from './form-validator.service'
 export * from './form-reactive'
 export * from './select'
-export * from './input-readonly-copy.component'
+export * from './input-toggle-hidden.component'
 export * from './input-switch.component'
 export * from './markdown-textarea.component'
 export * from './peertube-checkbox.component'
diff --git a/client/src/app/shared/shared-forms/input-readonly-copy.component.html b/client/src/app/shared/shared-forms/input-readonly-copy.component.html
deleted file mode 100644 (file)
index 7a75bd7..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<div class="input-group input-group-sm">
-  <input [id]="id" #urlInput (click)="urlInput.select()" type="text" class="form-control readonly" readonly [value]="value" />
-
-  <div class="input-group-append">
-    <button [cdkCopyToClipboard]="urlInput.value" (click)="activateCopiedMessage()" type="button" class="btn btn-outline-secondary">
-      <span class="glyphicon glyphicon-copy"></span>
-    </button>
-  </div>
-</div>
diff --git a/client/src/app/shared/shared-forms/input-readonly-copy.component.scss b/client/src/app/shared/shared-forms/input-readonly-copy.component.scss
deleted file mode 100644 (file)
index 8dc4f11..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-input.readonly {
-  font-size: 15px;
-}
diff --git a/client/src/app/shared/shared-forms/input-readonly-copy.component.ts b/client/src/app/shared/shared-forms/input-readonly-copy.component.ts
deleted file mode 100644 (file)
index b04d69d..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-import { Component, Input } from '@angular/core'
-import { Notifier } from '@app/core'
-
-@Component({
-  selector: 'my-input-readonly-copy',
-  templateUrl: './input-readonly-copy.component.html',
-  styleUrls: [ './input-readonly-copy.component.scss' ]
-})
-export class InputReadonlyCopyComponent {
-  @Input() id: string
-  @Input() value = ''
-
-  constructor (private notifier: Notifier) { }
-
-  activateCopiedMessage () {
-    this.notifier.success($localize`Copied`)
-  }
-}
diff --git a/client/src/app/shared/shared-forms/input-toggle-hidden.component.html b/client/src/app/shared/shared-forms/input-toggle-hidden.component.html
new file mode 100644 (file)
index 0000000..f59dc62
--- /dev/null
@@ -0,0 +1,13 @@
+<div class="input-group input-group-sm">
+  <input [id]="id" [autocomplete]="autocomplete" [value]="value" [placeholder]="placeholder" [(ngModel)]="value" (ngModelChange)="update()" [ngClass]="{ 'readonly': readonly }" [readonly]="readonly"
+         #input (click)="input.select()" (input)="update()" (change)="update()" [type]="inputType" class="form-control" />
+
+  <div *ngIf="withToggle || withCopy" class="input-group-append">
+    <button *ngIf="withToggle" (click)="toggle()" type="button" class="btn btn-outline-secondary" [title]="toggleTitle">
+      <span class="glyphicon glyphicon-eye-{{ show ? 'open' : 'close' }}"></span>
+    </button>
+    <button *ngIf="withCopy" [cdkCopyToClipboard]="input.value" (click)="activateCopiedMessage()" type="button" class="btn btn-outline-secondary" i18n-title title="Copy">
+      <span class="glyphicon glyphicon-copy"></span>
+    </button>
+  </div>
+</div>
diff --git a/client/src/app/shared/shared-forms/input-toggle-hidden.component.scss b/client/src/app/shared/shared-forms/input-toggle-hidden.component.scss
new file mode 100644 (file)
index 0000000..e20f69b
--- /dev/null
@@ -0,0 +1,11 @@
+@import '_variables';
+@import '_mixins';
+
+input {
+  @include peertube-input-text(auto);
+
+  // set again properties of peertube-input-text that are overriden by .input-group
+  font-size: 15px !important;
+  padding-left: 15px !important;
+  padding-right: 15px !important;
+}
diff --git a/client/src/app/shared/shared-forms/input-toggle-hidden.component.ts b/client/src/app/shared/shared-forms/input-toggle-hidden.component.ts
new file mode 100644 (file)
index 0000000..0e97442
--- /dev/null
@@ -0,0 +1,66 @@
+import { Component, forwardRef, Input } from '@angular/core'
+import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
+import { Notifier } from '@app/core'
+
+@Component({
+  selector: 'my-input-toggle-hidden',
+  templateUrl: './input-toggle-hidden.component.html',
+  styleUrls: [ './input-toggle-hidden.component.scss' ],
+  providers: [
+    {
+      provide: NG_VALUE_ACCESSOR,
+      useExisting: forwardRef(() => InputToggleHiddenComponent),
+      multi: true
+    }
+  ]
+})
+export class InputToggleHiddenComponent implements ControlValueAccessor {
+  @Input() id = Math.random().toString(11).slice(2, 8) // id cannot be left empty or undefined
+  @Input() value = ''
+  @Input() autocomplete = 'off'
+  @Input() placeholder = ''
+  @Input() withToggle = true
+  @Input() withCopy = false
+  @Input() readonly = false
+  @Input() show = false
+
+  constructor (private notifier: Notifier) { }
+
+  get inputType () {
+    return this.show
+      ? 'text'
+      : 'password'
+  }
+
+  get toggleTitle () {
+    return this.show
+      ? $localize`Hide`
+      : $localize`Show`
+  }
+
+  toggle () {
+    this.show = !this.show
+  }
+
+  activateCopiedMessage () {
+    this.notifier.success($localize`Copied`)
+  }
+
+  propagateChange = (_: any) => { /* empty */ }
+
+  writeValue (value: string) {
+    this.value = value
+  }
+
+  registerOnChange (fn: (_: any) => void) {
+    this.propagateChange = fn
+  }
+
+  registerOnTouched () {
+    // Unused
+  }
+
+  update () {
+    this.propagateChange(this.value)
+  }
+}
index 060abc99580727f80dbe14ef5baa4f8360cc22aa..22e8dd05ac8f1ee861c54f5ac94b418f5c8490bd 100644 (file)
@@ -7,7 +7,7 @@ import { SharedGlobalIconModule } from '../shared-icons'
 import { SharedMainModule } from '../shared-main/shared-main.module'
 import { DynamicFormFieldComponent } from './dynamic-form-field.component'
 import { FormValidatorService } from './form-validator.service'
-import { InputReadonlyCopyComponent } from './input-readonly-copy.component'
+import { InputToggleHiddenComponent } from './input-toggle-hidden.component'
 import { InputSwitchComponent } from './input-switch.component'
 import { MarkdownTextareaComponent } from './markdown-textarea.component'
 import { PeertubeCheckboxComponent } from './peertube-checkbox.component'
@@ -30,7 +30,7 @@ import { TimestampInputComponent } from './timestamp-input.component'
   ],
 
   declarations: [
-    InputReadonlyCopyComponent,
+    InputToggleHiddenComponent,
     MarkdownTextareaComponent,
     PeertubeCheckboxComponent,
     PreviewUploadComponent,
@@ -55,7 +55,7 @@ import { TimestampInputComponent } from './timestamp-input.component'
     InputMaskModule,
     NgSelectModule,
 
-    InputReadonlyCopyComponent,
+    InputToggleHiddenComponent,
     MarkdownTextareaComponent,
     PeertubeCheckboxComponent,
     PreviewUploadComponent,
index 80b4e446a40b0aae8a7473913df5b7d764b5049a..bcb1db4c431cde1d403295c0c23d3e85b4179b5c 100644 (file)
@@ -18,7 +18,7 @@
           <ng-template ngbNavContent>
             <div class="nav-content">
 
-              <my-input-readonly-copy [value]="getPlaylistUrl()"></my-input-readonly-copy>
+              <my-input-toggle-hidden [value]="getPlaylistUrl()" [withToggle]="false" [withCopy]="true" [show]="true" [readonly]="true"></my-input-toggle-hidden>
             </div>
           </ng-template>
         </ng-container>
@@ -38,7 +38,7 @@
 
           <ng-template ngbNavContent>
             <div class="nav-content">
-              <my-input-readonly-copy [value]="getPlaylistIframeCode()"></my-input-readonly-copy>
+              <my-input-toggle-hidden [value]="getPlaylistIframeCode()" [withToggle]="false" [withCopy]="true" [show]="true" [readonly]="true"></my-input-toggle-hidden>
 
               <div i18n *ngIf="notSecure()" class="alert alert-warning">
                 The url is not secured (no HTTPS), so the embed video won't work on HTTPS websites (web browsers block non secured HTTP requests on HTTPS websites).
@@ -72,7 +72,7 @@
 
           <ng-template ngbNavContent>
             <div class="nav-content">
-              <my-input-readonly-copy [value]="getVideoUrl()"></my-input-readonly-copy>
+              <my-input-toggle-hidden [value]="getVideoUrl()" [withToggle]="false" [withCopy]="true" [show]="true" [readonly]="true"></my-input-toggle-hidden>
             </div>
           </ng-template>
         </ng-container>
@@ -92,7 +92,7 @@
 
           <ng-template ngbNavContent>
             <div class="nav-content">
-              <my-input-readonly-copy [value]="getVideoIframeCode()"></my-input-readonly-copy>
+              <my-input-toggle-hidden [value]="getVideoIframeCode()" [withToggle]="false" [withCopy]="true" [show]="true" [readonly]="true"></my-input-toggle-hidden>
 
               <div i18n *ngIf="notSecure()" class="alert alert-warning">
                 The url is not secured (no HTTPS), so the embed video won't work on HTTPS websites (web browsers block non secured HTTP requests on HTTPS websites).
index 091d4dc3bb556d4e46a022d66beae6402a5d01b4..e4d3aacff5cf20708f0f325a3d9a106aeba7001e 100644 (file)
@@ -1,7 +1,7 @@
 @import '_mixins';
 @import '_variables';
 
-my-input-readonly-copy {
+my-input-toggle-hidden {
   width: 100%;
 }
 
index 6693c1af29b8daf7184b1d7e81ef934714e2a9e6..8d9467fe5e86d490a0fc0f17c799e7a55b42582c 100644 (file)
 
     <div class="form-group">
       <label for="liveVideoRTMPUrl" i18n>Live RTMP Url</label>
-      <my-input-readonly-copy id="liveVideoRTMPUrl" [value]="live.rtmpUrl"></my-input-readonly-copy>
+      <my-input-toggle-hidden id="liveVideoRTMPUrl" [value]="live.rtmpUrl" [withToggle]="false" [withCopy]="true" [show]="true" [readonly]="true"></my-input-toggle-hidden>
     </div>
 
     <div class="form-group">
       <label for="liveVideoStreamKey" i18n>Live stream key</label>
-      <my-input-readonly-copy id="liveVideoStreamKey" [value]="live.streamKey"></my-input-readonly-copy>
+      <my-input-toggle-hidden id="liveVideoStreamKey" [value]="live.streamKey" [withCopy]="true" [readonly]="true"></my-input-toggle-hidden>
 
       <div class="form-group-description" i18n>⚠️ Never share your stream key with anyone.</div>
     </div>
index ece8411af88c9b6f2fb9c5bae562482bcd431f79..3f6e6c8a79cfb505d18e99bbb1a2033b0fe2978e 100644 (file)
@@ -120,7 +120,8 @@ code {
   margin-top: 5px;
 }
 
-.input-error {
+.input-error
+my-input-toggle-hidden ::ng-deep input {
   border-color: $red !important;
 }