From 18c745c9d6ef7357fc8af319bc14ea53e82716b8 Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Fri, 27 Mar 2020 01:06:06 -0400 Subject: [PATCH] added CW settings --- .../settings/settings.component.html | 57 ++++++++++++++++--- .../settings/settings.component.scss | 23 ++++++++ .../settings/settings.component.ts | 37 ++++++++++++ src/sass/_variables.scss | 6 +- 4 files changed, 113 insertions(+), 10 deletions(-) diff --git a/src/app/components/floating-column/settings/settings.component.html b/src/app/components/floating-column/settings/settings.component.html index 60e55587..ad0b33d1 100644 --- a/src/app/components/floating-column/settings/settings.component.html +++ b/src/app/components/floating-column/settings/settings.component.html @@ -39,28 +39,66 @@
switch column:
- +
- +
- this settings needs a reload to be effective. + this settings needs a reload to be effective. +
+ +

Content-Warning Policies

+
+ global behavior:
+ + +
+ + + +
+
+ but add CW on content containing:
+
+ +
+
+ + + +
+
+ unless content is containing:
+
+ +
+
+ + hide completely content containing:
+
+ +

About

- Sengi version: {{version}}
+ Sengi version: {{version}}
check for updates

- +

RESET

@@ -79,6 +117,7 @@ (click)="cancelClearAll()"> Cancel +
diff --git a/src/app/components/floating-column/settings/settings.component.scss b/src/app/components/floating-column/settings/settings.component.scss index b2540c13..f2fbd754 100644 --- a/src/app/components/floating-column/settings/settings.component.scss +++ b/src/app/components/floating-column/settings/settings.component.scss @@ -57,7 +57,30 @@ font-weight: bold; text-decoration: underline; } + } + + &__text-input { + } + + &__cw-settings { + padding: 0 0 10px 15px; + } +} + +.form-control { + border: 1px solid $settings-text-input-border; + color: $settings-text-input-foreground; + background-color: $settings-text-input-background; + height: 24px; + + &:focus { + box-shadow: none; + } +} + +.sub-text-input { + padding: 0 5px; } .sound { diff --git a/src/app/components/floating-column/settings/settings.component.ts b/src/app/components/floating-column/settings/settings.component.ts index 72a5d07a..0bf96510 100644 --- a/src/app/components/floating-column/settings/settings.component.ts +++ b/src/app/components/floating-column/settings/settings.component.ts @@ -27,6 +27,32 @@ export class SettingsComponent implements OnInit { columnShortcutEnabled: ColumnShortcut = ColumnShortcut.Ctrl; columnShortcutChanged = false; + contentWarningPolicy: ContentWarningPolicy = ContentWarningPolicy.None; + + private addCwOnContent: string; + set setAddCwOnContent(value: string) { + this.addCwOnContent = value.trim(); + } + get setAddCwOnContent(): string { + return this.addCwOnContent; + } + + private removeCwOnContent: string; + set setRemoveCwOnContent(value: string) { + this.removeCwOnContent = value.trim(); + } + get setRemoveCwOnContent(): string { + return this.removeCwOnContent; + } + + private contentHidedCompletely: string; + set setContentHidedCompletely(value: string) { + this.contentHidedCompletely = value.trim(); + } + get setContentHidedCompletely(): string { + return this.contentHidedCompletely; + } + constructor( private formBuilder: FormBuilder, private serviceWorkersService: ServiceWorkerService, @@ -64,6 +90,11 @@ export class SettingsComponent implements OnInit { this.toolsService.saveSettings(settings); } + + onCwPolicyChange(id: ContentWarningPolicy) { + this.contentWarningPolicy = id; + } + reload(): boolean { window.location.reload(); return false; @@ -140,4 +171,10 @@ export class SettingsComponent implements OnInit { enum ColumnShortcut { Ctrl = 1, Win = 2 +} + +enum ContentWarningPolicy { + None = 0, + HideAll = 1, + AddOnAllContent = 2 } \ No newline at end of file diff --git a/src/sass/_variables.scss b/src/sass/_variables.scss index 23905ab1..7b0d3918 100644 --- a/src/sass/_variables.scss +++ b/src/sass/_variables.scss @@ -95,4 +95,8 @@ $scheduler-background: #3e455f; $notification-column-selector-background: #171c29; $notification-column-selector-color: #999fb1; -$notification-column-selector-color-hover: white; \ No newline at end of file +$notification-column-selector-color-hover: white; + +$settings-text-input-background: #242836; +$settings-text-input-foreground: white; +$settings-text-input-border: #32384d; \ No newline at end of file