diff --git a/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.html b/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.html index 41e49a5bc57b18438a544a3cc421afe68e006f68..ee19adcd5a99786546ba01c0c978ad8955c768eb 100644 --- a/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.html +++ b/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.html @@ -1,6 +1,5 @@ <div id="wholeDialog" class="drawer-container" fxLayout="column" fxLayoutGap="5px"> <div class="cloud-configuration-form" fxLayout="column" *ngIf="!extendedView && !cleanUpView"> - <h2>{{'tag-cloud-config.title' | translate}}</h2> <div class="input-row special-settings demo-cloud-settings" fxLayout="row" fxLayoutGap="5px" fxLayout.xs="column"> <div class="input-row" fxLayout="row" fxLayoutGap="5px" fxLayout.xs="column"> <mat-slide-toggle fxFlex (change)="parent.dataManager.demoActive = !parent.dataManager.demoActive" @@ -10,10 +9,10 @@ </div> <br> <mat-accordion id="accordion"> - <mat-expansion-panel [expanded]="step == 0" (opened)="setStep(0)" class="matExpansionPanel" hideToggle> + <mat-expansion-panel [expanded]="step == 0" (opened)="setStep(0)" class="matExpansionPanel"> <mat-expansion-panel-header> <mat-panel-title> - <h3>{{'tag-cloud-config.general' | translate}}</h3> + <label class=" expansion-title settings-heading">{{'tag-cloud-config.general' | translate}}</label> </mat-panel-title> </mat-expansion-panel-header> <div class="input-row firstElementOfExpansionPanel" fxLayout="row" fxLayoutGap="5px" fxLayout.xs="column"> @@ -28,6 +27,7 @@ <div class="input-row special-settings automatic-spelling" fxLayout="row" fxLayoutGap="5px" fxLayout.xs="column"> <mat-radio-group matTooltip="{{'tag-cloud-config.notation-tooltip' | translate}}" aria-label="Notation:"> {{'tag-cloud-config.notation' | translate}} <div><mat-radio-button value="1" (change)="textStyleChanged(1)" [checked]="cloudParameters.textTransform == 1">{{'tag-cloud-config.lowerCase' | translate}}</mat-radio-button> </div> + <div><mat-radio-button value="2" (change)="textStyleChanged(3)" [checked]="cloudParameters.textTransform == 3">{{'tag-cloud-config.upperCase' | translate}}</mat-radio-button> </div> <div><mat-radio-button value="2" (change)="textStyleChanged(2)" [checked]="cloudParameters.textTransform == 2">{{'tag-cloud-config.capitalization' | translate}}</mat-radio-button> </div> <div><mat-radio-button value="0" (change)="textStyleChanged(0)" [checked]="cloudParameters.textTransform == 0">{{'tag-cloud-config.standard' | translate}}</mat-radio-button> </div> </mat-radio-group> @@ -59,6 +59,33 @@ [value]="cloudParameters.delayWord" matTooltip="{{'tag-cloud-config.word-delay-tooltip' | translate}}"> </mat-slider> </div> + <mat-action-row> + <button mat-icon-button (click)="nextStep()"><mat-icon>expand_more</mat-icon></button> </mat-action-row> + </mat-expansion-panel> + <mat-expansion-panel [expanded]="step == 1" (opened)="setStep(1)" class="matExpansionPanel"> + <mat-expansion-panel-header> + <mat-panel-title> + <label class=" expansion-title settings-heading">{{'tag-cloud-config.font' | translate}}</label> + </mat-panel-title> + </mat-expansion-panel-header> + <div class="input-row" fxLayout="column" fxLayoutGap="5px"> + <mat-form-field appearance="fill"> + <mat-label>{{'tag-cloud-config.font-family' | translate}}</mat-label> + <mat-select (selectionChange)="valueChanged()" [(ngModel)]="cloudParameters.fontFamily"> + <mat-option value="sans-serif">Normal</mat-option> + <mat-option value="Abril Fatface">Abril Fatface</mat-option> + <mat-option value="Dancing Script">Dancing Script</mat-option> + <mat-option value="Indie Flower">Indie Flower</mat-option> + <mat-option value="Permanent Marker">Permanent Marker</mat-option> + </mat-select> + </mat-form-field> + </div> + <div class="input-row special-settings automatic-spelling" fxLayout="row" fxLayoutGap="5px" fxLayout.xs="column"> + <mat-radio-group matTooltip="{{'tag-cloud-config.notation-tooltip' | translate}}" aria-label="Notation:"> + <div><mat-slide-toggle value="italic" (change)="italicChecked($event)"[ngModelOptions]="{standalone: true}">{{'tag-cloud-config.font-style-italic' | translate}}</mat-slide-toggle> </div> + <div><mat-slide-toggle value="bold" (change)="boldChecked($event)" [ngModelOptions]="{standalone: true}">{{'tag-cloud-config.font-style-bold' | translate}}</mat-slide-toggle> </div> + </mat-radio-group> + </div> <div class="input-row" fxLayout="column" fxLayoutGap="5px"> <mat-form-field fxFlex fxLayout.xs="column"> <mat-label>{{'tag-cloud-config.font-size-min' | translate}}</mat-label> @@ -76,12 +103,14 @@ </mat-form-field> </div> <mat-action-row> - <button mat-icon-button (click)="nextStep()"><mat-icon>expand_more</mat-icon></button> </mat-action-row> + <button mat-icon-button (click)="prevStep()"><mat-icon>expand_less</mat-icon></button> + <button mat-icon-button (click)="nextStep()"><mat-icon>expand_more</mat-icon></button> + </mat-action-row> </mat-expansion-panel> - <mat-expansion-panel [expanded]="step == 1" (opened)="setStep(1)" class="matExpansionPanel" hideToggle> + <mat-expansion-panel [expanded]="step == 2" (opened)="setStep(2)" class="matExpansionPanel"> <mat-expansion-panel-header> <mat-panel-title> - <h3>{{'tag-cloud-config.hover-title' | translate}}</h3> + <label class=" expansion-title settings-heading">{{'tag-cloud-config.hover-title' | translate}}</label> </mat-panel-title> </mat-expansion-panel-header> <div> @@ -121,17 +150,17 @@ <button mat-icon-button (click)="nextStep()"><mat-icon>expand_more</mat-icon></button> </mat-action-row> </mat-expansion-panel> - <mat-expansion-panel [expanded]="step == 2" (opened)="setStep(2)" class="matExpansionPanel" hideToggle> + <mat-expansion-panel [expanded]="step == 3" (opened)="setStep(3)" class="matExpansionPanel"> <mat-expansion-panel-header> <mat-panel-title> - <h3>{{'tag-cloud-config.weight-class-settings' | translate}}</h3> + <label class=" expansion-title settings-heading">{{'tag-cloud-config.weight-class-settings' | translate}}</label> </mat-panel-title> </mat-expansion-panel-header> <div class="input-row" fxLayout="row" fxLayoutGap="5px" fxLayout.xs="column"> <div class="cloud-configuration-form" fxLayout="column"> <div *ngFor="let weightClass of weightClasses" class="weight-class-setting"> <div class ="weight-class-setting-content"> - <h3 class="weight-class-heading">{{'tag-cloud-config.weight-class' | translate}} {{weightClasses.indexOf(weightClass) + 1}}</h3> + <label class=" expansion-title weight-class-heading">{{'tag-cloud-config.weight-class' | translate}} {{weightClasses.indexOf(weightClass) + 1}}</label> <div class="input-row" fxLayout="column" fxLayoutGap="5px"> <div fxLayout="row" fxLayoutGap="5px"> <mat-form-field fxFlex="100%"> @@ -170,8 +199,11 @@ </mat-accordion> <br> <div class="button-row"> - <button (click)="cancel()" mat-button class="secondary">{{'tag-cloud-config.cancel-btn' | translate}}</button> - <button (click)="save()" mat-button class="primary">{{'tag-cloud-config.save-btn' | translate}}</button> + <button (click)="reset()" mat-button class="reset tag-config-button" >{{'tag-cloud-config.reset-btn' | translate}}</button> + </div> + <div class="button-row"> + <button (click)="cancel()" mat-button class="secondary tag-config-button">{{'tag-cloud-config.cancel-btn' | translate}}</button> + <button (click)="save()" mat-button class="primary tag-config-button">{{'tag-cloud-config.save-btn' | translate}}</button> </div> </div> </div> diff --git a/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.scss b/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.scss index 85ba0670d217f1caee2f1dace0c92582a07ecf4f..ad76e0495520f53011b6c5e723a1afdae8804824 100644 --- a/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.scss +++ b/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.scss @@ -1,16 +1,12 @@ -* { - color: var(--on-dialog); -} - h2{ color: var(--on-dialog); font-size: 1.7rem; } -h3 { - +.expansion-title{ color: var(--primary); padding-bottom: 6px; + font-size: 1.2rem; } #commentSlider { @@ -35,8 +31,8 @@ div { color: var(--on-secondary); } -::ng-deep .mat-button { - min-width: 105px; +.tag-config-button{ + min-width: 135px; } .close-btn mat-icon{ @@ -146,15 +142,24 @@ mat-divider { } .button-row{ - margin: auto auto 50px auto ; + width: 100%; + margin: auto auto 20px auto ; +} +.reset { + margin: 25px auto auto auto; + background-color: var(--white); + color: black; + width: 100%; } - .cloud-configuration-form{ width: 290px; } .drawer-container{ + color: var(--on-dialog)!important; margin: 20px; + align-items: center; + justify-content: center; } ::ng-deep.custom-color-picker{ @@ -168,6 +173,11 @@ mat-divider { transform: translateY(-35px); } +.settings-heading { + margin-left: 0; + margin-right: auto; +} + ::ng-deep.mat-drawer-backdrop.mat-drawer-shown{ display: none; } @@ -179,6 +189,8 @@ mat-divider { .weight-class-setting-content { border-top: 3px solid var(--primary); + padding-top: 20px; + padding-bottom: 15px; } .weight-class-heading { @@ -207,6 +219,7 @@ mat-divider { border-top: none; border-bottom: 2px solid var(--primary); padding: 10px 0; + margin-bottom: 20px; } #rotation{ @@ -215,6 +228,7 @@ mat-divider { .matExpansionPanel{ background-color: var(--dialog); + color: var(--on-dialog)!important; margin: 2px; padding: 5px; } @@ -223,3 +237,6 @@ mat-divider { border-top: 2px solid var(--primary); padding-top: 10px; } +.automatic-spelling{ + padding-bottom: 30px; +} diff --git a/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.ts b/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.ts index a2be830f62756dc06140d3f07ae6f96cb0ca4bdd..b293f81ea403fae6784ffaa5116f76c0c8263df5 100644 --- a/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.ts +++ b/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.ts @@ -26,7 +26,7 @@ export class CloudConfigurationComponent implements OnInit { alphabeticalSorting: boolean; rotation: number; highestWeight: number; - step:number = 0; + step:number = 10; weightClasses: WeightClass[] = [ { maxTagNumber: 20, @@ -143,6 +143,8 @@ export class CloudConfigurationComponent implements OnInit { valueChanged() { this.parseJsonToArrayWeightClasses(); this.parent.setCloudParameters(this.cloudParameters, false); + console.log(this.cloudParameters); + } cancel() { @@ -193,4 +195,20 @@ export class CloudConfigurationComponent implements OnInit { this.step--; } + reset(){ + this.parent.resetColorsToTheme(); + this.parent.configurationOpen = false; + this.cloudParameters = this.parent.currentCloudParameters; + } + + italicChecked(event){ + console.log(event.checked); + + event.checked == true ? this.cloudParameters.fontStyle = "italic" : this.cloudParameters.fontStyle = "normal"; + this.valueChanged(); + } + boldChecked(event){ + event.checked == true ? this.cloudParameters.fontWeight = "bold" : this.cloudParameters.fontWeight = "normal"; + this.valueChanged(); + } } diff --git a/src/app/components/shared/_dialogs/create-comment/create-comment.component.html b/src/app/components/shared/_dialogs/create-comment/create-comment.component.html index cf8f157b1449251c64d16c7981461751a3dda21d..2a7cb1d793eee5ac71d438944affdd5bb3f2a9de 100644 --- a/src/app/components/shared/_dialogs/create-comment/create-comment.component.html +++ b/src/app/components/shared/_dialogs/create-comment/create-comment.component.html @@ -5,8 +5,13 @@ matTooltip="{{ 'spacy-dialog.lang-button-hint' | translate }}" matTooltipShowDelay="750"> <i class="material-icons">language</i> - {{'spacy-dialog.' + (selectedLang === 'auto' ? 'auto' : languagetoolService.mapLanguageToSpacyModel(selectedLang)) | translate}} - <mat-select class="select-list" #select [(ngModel)]="selectedLang"> + <span *ngIf="!(selectedLang === 'auto')"> + {{'spacy-dialog.' + (languagetoolService.mapLanguageToSpacyModel(selectedLang)) | translate}} + </span> + <span *ngIf="(selectedLang === 'auto')" id="langSelect"> + auto + </span> + <mat-select class="select-list" #select [(ngModel)]="selectedLang"> <mat-option *ngFor="let lang of languages" [value]="lang"> <span *ngIf="lang == 'de-DE'">{{ 'spacy-dialog.de' | translate }}</span> <span *ngIf="lang == 'en-US'">{{ 'spacy-dialog.en' | translate }}</span> @@ -45,19 +50,18 @@ <ars-row [overflow]="'visible'" style="max-height:calc( 100vh - 250px )"> <mat-form-field style="width:100%;"> <input [disabled]="true" matInput> - <div [contentEditable]="true" - (paste)="clearHTML($event); - maxLength(commentBody)" - [spellcheck]="false" - spellcheck="false" - (focus)="eventService.makeFocusOnInputTrue()" - style="margin-top:15px;width:100%;" - (blur)="eventService.makeFocusOnInputFalse()" - #commentBody - aria-labelledby="ask-question-description" - autofocus - (input)="maxLength(commentBody)" - id="answer-input"> + <div + [contentEditable]="true" + (paste)="onPaste($event); maxLength(commentBody)" + [spellcheck]="false" + (focus)="eventService.makeFocusOnInputTrue()" + style="margin-top:15px;width:100%;" + (blur)="eventService.makeFocusOnInputFalse()" + #commentBody + aria-labelledby="ask-question-description" + autofocus + (input)="maxLength(commentBody)" + id="answer-input"> </div> <mat-placeholder class="placeholder"> {{ 'comment-page.enter-comment' | translate }} @@ -73,8 +77,9 @@ </span> </mat-hint> <span *ngIf="!this.hasSpellcheckConfidence"> - <p>{{ 'spacy-dialog.force-language-selection' | translate }}</p> + <p class="lang-confidence">{{ 'spacy-dialog.force-language-selection' | translate }}</p> </span> + </mat-form-field> </ars-row> </mat-tab> diff --git a/src/app/components/shared/_dialogs/create-comment/create-comment.component.scss b/src/app/components/shared/_dialogs/create-comment/create-comment.component.scss index ed1f61edb7ff37e8a7fcb65d761bfdf70601f4db..09f756425cc41ece379423affb91493d8de00cec 100644 --- a/src/app/components/shared/_dialogs/create-comment/create-comment.component.scss +++ b/src/app/components/shared/_dialogs/create-comment/create-comment.component.scss @@ -21,6 +21,7 @@ app-comment-list { -webkit-appearance: textarea; min-height: 50px; cursor: text; + word-wrap: break-word; &:focus { outline: none; @@ -133,13 +134,33 @@ mat-hint { stroke: var(--on-primary); } +.lang-confidence { + animation: shake 0.5s; + color: var(--red); + font-size: 16px; +} + +@keyframes shake { + 0% { transform: translate(1px, 1px) rotate(0deg); } + 10% { transform: translate(0px, 0) rotate(-1deg); } + 20% { transform: translate(0px, 0px) rotate(1deg); } + 30% { transform: translate(3px, 2px) rotate(0deg); } + 40% { transform: translate(1px, 0) rotate(1deg); } + 50% { transform: translate(-1px, 2px) rotate(-1deg); } + 60% { transform: translate(-1px, 1px) rotate(0deg); } + 70% { transform: translate(3px, 1px) rotate(-1deg); } + 80% { transform: translate(-1px, 0) rotate(1deg); } + 90% { transform: translate(1px, 2px) rotate(0deg); } + 100% { transform: translate(1px, -0) rotate(-1deg); } +} + .spellcheck { @media screen and (max-width:500px) { overflow: auto; display: flex; justify-content: space-between; flex-direction: column !important; - flex-wrap: wrap; + flex-wrap: wrap; align-items: flex-end; - } -} \ No newline at end of file + } +} diff --git a/src/app/components/shared/_dialogs/create-comment/create-comment.component.ts b/src/app/components/shared/_dialogs/create-comment/create-comment.component.ts index 992447b3c8cde1042d8017f3eb3ae6804bcd5aef..220f59a30098440961b456720c5339d0475a3ad5 100644 --- a/src/app/components/shared/_dialogs/create-comment/create-comment.component.ts +++ b/src/app/components/shared/_dialogs/create-comment/create-comment.component.ts @@ -36,6 +36,8 @@ export class CreateCommentComponent implements OnInit, OnDestroy { isSpellchecking = false; hasSpellcheckConfidence = true; + newLang = 'auto'; + constructor( private notification: NotificationService, public dialogRef: MatDialogRef<CommentListComponent>, @@ -73,10 +75,19 @@ export class CreateCommentComponent implements OnInit, OnDestroy { this.dialogRef.close(); } - clearHTML(e) { + onPaste(e){ e.preventDefault(); + const elem = document.getElementById('answer-input'); const text = e.clipboardData.getData('text'); - document.getElementById('answer-input').innerText += text.replace(/<[^>]*>?/gm, ''); + elem.innerText += text.replace(/<[^>]*>?/gm, ''); + + const range = document.createRange(); + range.setStart(elem.lastChild, elem.lastChild.textContent.length); + range.collapse(true); + + const sel = window.getSelection(); + sel.removeAllRanges(); + sel.addRange(range); } checkInputData(body: string): boolean { @@ -179,7 +190,19 @@ export class CreateCommentComponent implements OnInit, OnDestroy { this.hasSpellcheckConfidence = false; return; } - + if(this.selectedLang === 'auto' && (document.getElementById('langSelect').innerText.includes(this.newLang) + || document.getElementById('langSelect').innerText.includes('auto'))) { + if(wordsCheck.language.name.includes('German')){ + this.selectedLang = 'de-DE'; + }else if(wordsCheck.language.name.includes('English')){ + this.selectedLang= 'en-US'; + }else if(wordsCheck.language.name.includes('French')){ + this.selectedLang = 'fr'; + }else{ + this.newLang = wordsCheck.language.name; + } + document.getElementById('langSelect').innerHTML = this.newLang; + } if (wordsCheck.matches.length > 0) { wordsCheck.matches.forEach(grammarError => { const wrongWord = commentBody.innerText.slice(grammarError.offset, grammarError.offset + grammarError.length); diff --git a/src/app/components/shared/_dialogs/spacy-dialog/spacy-dialog.component.html b/src/app/components/shared/_dialogs/spacy-dialog/spacy-dialog.component.html index 66a7e1f1efe14fc99d2c6a26ae55b71ad4ab80e2..284ed824d7f5c473f1b6461a0c633d9f22a66128 100644 --- a/src/app/components/shared/_dialogs/spacy-dialog/spacy-dialog.component.html +++ b/src/app/components/shared/_dialogs/spacy-dialog/spacy-dialog.component.html @@ -6,6 +6,7 @@ id="checkAll" (change)="selectAll(checkall.checked)" #checkall + [checked]="allKeywordsSelected()" matTooltip="{{ 'spacy-dialog.select-all-hint' | translate }}" matTooltipShowDelay="750"> </mat-checkbox> @@ -55,10 +56,15 @@ </mat-list-item> </mat-list> </ars-row> - <span *ngIf="keywords.length <= 0 && !this.isLoading"> - <p>{{ 'spacy-dialog.empty-nouns' | translate }}</p> - </span> - + <ars-row> + <span *ngIf="keywords.length <= 0 && !this.isLoading"> + <p>{{ 'spacy-dialog.empty-nouns' | translate }}</p> + </span> + <span *ngIf="!langSupported"> + <p class="manual-input-title">{{ 'spacy-dialog.add-manually' | translate }}</p> + <textarea class="manual-input" [(ngModel)]="manualKeywords" (input)="manualKeywordsToKeywords()"></textarea> + </span> + </ars-row> </div> </ars-row> diff --git a/src/app/components/shared/_dialogs/spacy-dialog/spacy-dialog.component.scss b/src/app/components/shared/_dialogs/spacy-dialog/spacy-dialog.component.scss index 8fc238f37097e3c64d50f079b433f42f1e91bac7..81cd32b18d2a08e7bdd29411015eb614f8b12d03 100644 --- a/src/app/components/shared/_dialogs/spacy-dialog/spacy-dialog.component.scss +++ b/src/app/components/shared/_dialogs/spacy-dialog/spacy-dialog.component.scss @@ -48,6 +48,17 @@ padding-left: 15px; cursor: pointer; } +.manual-input{ + background-color: transparent; + border: 1px solid var(--on-dialog); + padding: 5px; + border-radius: 5px; + color: var(--on-dialog); + width: 100% +} +.manual-input-title{ + margin-top: 15px; +} .select-list{ width: calc(100% - 24px); } diff --git a/src/app/components/shared/_dialogs/spacy-dialog/spacy-dialog.component.ts b/src/app/components/shared/_dialogs/spacy-dialog/spacy-dialog.component.ts index 06ee485a9838ce22483b93f1a3bf55b3ea2111ed..c77fddc5eaf9dcc62dbeeef9872f740eb5a6b057 100644 --- a/src/app/components/shared/_dialogs/spacy-dialog/spacy-dialog.component.ts +++ b/src/app/components/shared/_dialogs/spacy-dialog/spacy-dialog.component.ts @@ -26,6 +26,8 @@ export class SpacyDialogComponent implements OnInit, AfterContentInit { keywords: Keyword[] = []; keywordsOriginal: Keyword[] = []; isLoading = false; + langSupported: boolean; + manualKeywords = ''; constructor( protected langService: LanguageService, @@ -38,10 +40,13 @@ export class SpacyDialogComponent implements OnInit, AfterContentInit { this.comment = this.data.comment; this.commentLang = this.data.commentLang; this.commentBodyChecked = this.data.commentBodyChecked; + this.langSupported = this.commentLang !== 'auto'; } ngAfterContentInit(): void { - this.evalInput(this.commentLang); + if(this.langSupported) { + this.evalInput(this.commentLang); + } } /** @@ -53,32 +58,34 @@ export class SpacyDialogComponent implements OnInit, AfterContentInit { buildCreateCommentActionCallback() { return () => { - this.comment.keywordsFromQuestioner = this.keywords.filter(kw => kw.selected).map(kw => kw.word); - this.comment.keywordsFromSpacy = this.keywordsOriginal.map(kw => kw.word); + this.comment.keywordsFromQuestioner = this.keywords.filter(kw => kw.selected && kw.word.length).map(kw => kw.word); + this.comment.keywordsFromSpacy = this.keywordsOriginal.filter(kw => kw.word.length).map(kw => kw.word); this.dialogRef.close(this.comment); }; } evalInput(model: Model) { - const keywords: Keyword[] = []; - this.isLoading = true; // N at first pos = all Nouns(NN de/en) including singular(NN, NNP en), plural (NNPS, NNS en), proper Noun(NNE, NE de) this.spacyService.getKeywords(this.commentBodyChecked, model) .subscribe(words => { + const keywords: Keyword[] = []; for (const word of words) { - if (keywords.findIndex(item => item.word === word) < 0) { + const newWord = word.trim(); + if (keywords.findIndex(item => item.word === newWord) < 0) { keywords.push({ - word, + word: newWord, completed: false, editing: false, selected: false }); } } + + // Deep copy this.keywords = keywords; - this.keywordsOriginal = keywords; + this.keywordsOriginal = JSON.parse(JSON.stringify(keywords)); }, () => { this.keywords = []; this.keywordsOriginal = []; @@ -112,4 +119,29 @@ export class SpacyDialogComponent implements OnInit, AfterContentInit { }); } } + + allKeywordsSelected(): boolean { + for(const kw of this.keywords) { + if(!kw.selected) { + return false; + } + } + return true; + } + + manualKeywordsToKeywords(){ + const tempKeywords = this.manualKeywords.replace(/\s/g,''); + if(tempKeywords.length) { + this.keywords = tempKeywords.split(',').map((keyword) => ( + { + word: keyword, + completed: true, + editing: false, + selected: true + } + )); + } else { + this.keywords = []; + } + } } diff --git a/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.html b/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.html index 35c0f0bf072e914cff48b411e4e84c62bfeaf805..4681fb59a72181f610e00b2641d79d0ce621da93 100644 --- a/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.html +++ b/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.html @@ -11,7 +11,7 @@ <mat-label class="color-on-surface"> {{"topic-cloud-dialog.select-choice" | translate}} </mat-label> - <mat-radio-group class="radio-button-group" [(ngModel)]="keywordORfulltext"> + <mat-radio-group class="radio-button-group" (change)=(updateKeywords()) [(ngModel)]="keywordORfulltext"> <mat-radio-button checked="true" [value]="keywordOrFulltextENUM[0]" class="radio-button-item"> {{"topic-cloud-dialog.keyword" | translate}} </mat-radio-button> @@ -27,81 +27,86 @@ <mat-slide-toggle [(ngModel)]="considerVotes"> {{'topic-cloud-dialog.consider-votes' | translate}} </mat-slide-toggle> - <mat-slide-toggle (change)="refreshAllLists()" [(ngModel)]="profanityFilter"> - {{'topic-cloud-dialog.profanity' | translate}} - </mat-slide-toggle> - <mat-slide-toggle [(ngModel)]="blacklistIsActive"> - {{'topic-cloud-dialog.hide-blacklist-words' | translate}} - </mat-slide-toggle> + <div *ngIf="isCreatorOrMod"> + <mat-slide-toggle (change)="refreshAllLists()" [(ngModel)]="profanityFilter"> + {{'topic-cloud-dialog.profanity' | translate}} + </mat-slide-toggle> + <mat-slide-toggle [(ngModel)]="blacklistIsActive"> + {{'topic-cloud-dialog.hide-blacklist-words' | translate}} + </mat-slide-toggle> + </div> <mat-accordion class="new-profanity-word" multi> - <mat-expansion-panel class="color-background" (opened)="enterProfanityWord=true; focusInput('bad-word-input')" - (closed)="enterProfanityWord = false"> - <mat-expansion-panel-header class="color-background"> - <mat-panel-title> - {{'topic-cloud-dialog.edit-profanity-list' | translate}} - </mat-panel-title> - </mat-expansion-panel-header> + <div *ngIf="isCreatorOrMod"> + <mat-expansion-panel class="color-background" (opened)="enterProfanityWord=true; focusInput('bad-word-input')" + (closed)="enterProfanityWord = false"> + <mat-expansion-panel-header class="color-background"> + <mat-panel-title> + {{'topic-cloud-dialog.edit-profanity-list' | translate}} + </mat-panel-title> + </mat-expansion-panel-header> - <mat-form-field> - <mat-label>{{'topic-cloud-dialog.enter-word' | translate}}</mat-label> - <input matInput id="bad-word-input" [(ngModel)]="newProfanityWord"> - </mat-form-field> + <mat-form-field> + <mat-label>{{'topic-cloud-dialog.enter-word' | translate}}</mat-label> + <input matInput id="bad-word-input" [(ngModel)]="newProfanityWord"> + </mat-form-field> - <button mat-stroked-button color="primary" class="margin-left" (click)="addProfanityWord()"> - {{'topic-cloud-dialog.add-word' | translate}} - </button> + <button mat-stroked-button class="margin-left color-on-background" (click)="addProfanityWord()"> + {{'topic-cloud-dialog.add-word' | translate}} + </button> + + <mat-list role="list" *ngIf="showProfanityList" class="margin-bottom"> + <mat-list-item class="color-on-surface" *ngFor="let word of getProfanityList()" role="listitem">{{word}} + <button style="margin-left: auto" mat-icon-button class="red" + (click)="removeWordFromProfanityList(word)"> + <mat-icon mat-list-icon style="margin-bottom: 6px;">delete</mat-icon> + </button> + </mat-list-item> + </mat-list> - <mat-list role="list" *ngIf="showProfanityList" class="margin-bottom"> - <mat-list-item class="color-on-surface" *ngFor="let word of getProfanityList()" role="listitem">{{word}} - <button style="margin-left: auto" mat-icon-button class="red" (click)="removeWordFromProfanityList(word)"> - <mat-icon mat-list-icon style="margin-bottom: 6px;">delete</mat-icon> + <div> + <button mat-raised-button *ngIf="getProfanityList().length > 0" class="primaryBackground" + (click)="showProfanityList=!showProfanityList"> + {{showProfanityList ? ('topic-cloud-dialog.hide-profanity-list' | translate) : + ('topic-cloud-dialog.show-profanity-list' | translate)}} </button> - </mat-list-item> - </mat-list> - - <div> - <button mat-raised-button *ngIf="getProfanityList().length > 0" class="primaryBackground" - (click)="showProfanityList=!showProfanityList"> - {{showProfanityList ? ('topic-cloud-dialog.hide-profanity-list' | translate) : - ('topic-cloud-dialog.show-profanity-list' | translate)}} - </button> - </div> - </mat-expansion-panel> + </div> + </mat-expansion-panel> - <mat-expansion-panel class="color-background margin-bottom" - (opened)="enterBlacklistWord = true; focusInput('blacklist-word-input')" - (closed)="enterBlacklistWord = false"> - <mat-expansion-panel-header class="color-background"> - <mat-panel-title> - {{'topic-cloud-dialog.edit-blacklist-list' | translate}} - </mat-panel-title> - </mat-expansion-panel-header> + <mat-expansion-panel class="color-background margin-bottom" + (opened)="enterBlacklistWord = true; focusInput('blacklist-word-input')" + (closed)="enterBlacklistWord = false"> + <mat-expansion-panel-header class="color-background"> + <mat-panel-title> + {{'topic-cloud-dialog.edit-blacklist-list' | translate}} + </mat-panel-title> + </mat-expansion-panel-header> - <mat-form-field> - <mat-label>{{'topic-cloud-dialog.enter-word' | translate}}</mat-label> - <input matInput id="blacklist-word-input" [(ngModel)]="newBlacklistWord"> - </mat-form-field> + <mat-form-field> + <mat-label>{{'topic-cloud-dialog.enter-word' | translate}}</mat-label> + <input matInput id="blacklist-word-input" [(ngModel)]="newBlacklistWord"> + </mat-form-field> - <button mat-stroked-button color="primary" class="margin-left" (click)="addBlacklistWord()"> - {{'topic-cloud-dialog.add-word' | translate}} - </button> - <mat-list role="list" *ngIf="showBlacklistWordList && blacklist.length > 0" class="margin-bottom"> - <mat-list-item class="color-on-surface" *ngFor="let word of blacklist" role="listitem">{{word}} - <button style="margin-left: auto" mat-icon-button class="red" (click)="removeWordFromBlacklist(word)"> - <mat-icon mat-list-icon style="margin-bottom: 6px;">delete</mat-icon> - </button> - </mat-list-item> - </mat-list> - - <div> - <button mat-raised-button class="primaryBackground" *ngIf="blacklist.length > 0" - (click)="showBlacklistWordList=!showBlacklistWordList"> - {{showBlacklistWordList ? ('topic-cloud-dialog.hide-blacklist' | translate) : - ('topic-cloud-dialog.show-blacklist' | translate)}} + <button mat-stroked-button class="margin-left color-on-background" (click)="addBlacklistWord()"> + {{'topic-cloud-dialog.add-word' | translate}} </button> - </div> - </mat-expansion-panel> + <mat-list role="list" *ngIf="showBlacklistWordList && blacklist.length > 0" class="margin-bottom"> + <mat-list-item class="color-on-surface" *ngFor="let word of blacklist" role="listitem">{{word}} + <button style="margin-left: auto" mat-icon-button class="red" (click)="removeWordFromBlacklist(word)"> + <mat-icon mat-list-icon style="margin-bottom: 6px;">delete</mat-icon> + </button> + </mat-list-item> + </mat-list> + + <div> + <button mat-raised-button class="primaryBackground" *ngIf="blacklist.length > 0" + (click)="showBlacklistWordList=!showBlacklistWordList"> + {{showBlacklistWordList ? ('topic-cloud-dialog.hide-blacklist' | translate) : + ('topic-cloud-dialog.show-blacklist' | translate)}} + </button> + </div> + </mat-expansion-panel> + </div> <mat-expansion-panel class="color-background"> <mat-expansion-panel-header class="color-background"> <mat-panel-title> @@ -113,7 +118,7 @@ <mat-tab label="{{'topic-cloud-dialog.german' | translate}}"> <mat-selection-list *ngIf="wantedLabels" [(ngModel)]="wantedLabels.de"> - <mat-option class="color-on-surface" (click)="selectAllDE(); allSelectedDE = !allSelectedDE"> + <mat-option class="color-on-surface" (click)="selectAllDE()"> <mat-label> <mat-icon>playlist_add_check</mat-icon> {{'topic-cloud-dialog.select-all' | translate}} @@ -128,7 +133,7 @@ <mat-tab label="{{'topic-cloud-dialog.english' | translate}}"> <mat-selection-list *ngIf="wantedLabels" [(ngModel)]="wantedLabels.en"> - <mat-option class="color-on-surface" (click)="selectAllEN(); allSelectedEN = !allSelectedEN"> + <mat-option class="color-on-surface" (click)="selectAllEN()"> <mat-label> <mat-icon>playlist_add_check</mat-icon> {{'topic-cloud-dialog.select-all' | translate}} @@ -151,7 +156,7 @@ <mat-icon>search</mat-icon> </mat-label> <div style="margin-left: 10px; margin-top: 6px;"> - <mat-form-field [ngClass]="{'search': searchMode}"> + <mat-form-field [ngClass]="{'search': searchMode, 'smallerInput': deviceType === 'mobile'}"> <input #searchBox class="searchBox" (input)="searchKeyword()" [(ngModel)]="searchedKeyword" matInput type="text" placeholder="{{'topic-cloud-dialog.keyword-search' | translate}}"> <button *ngIf="searchedKeyword" (click)="searchedKeyword = ''; searchMode = false;" mat-button matSuffix @@ -162,15 +167,15 @@ </div> <div fxLayoutAlign="center center" style="margin-left: auto; font-weight: bold;"> - <mat-icon svgIcon="hashtag" - [ngClass]="{'animation-blink': searchMode}" - class="oldtypo-h2 comment_tag-icon"></mat-icon> - <p [ngClass]="{'animation-blink': searchMode}">{{searchMode ? filteredKeywords.length : + <mat-icon [ngClass]="{'animation-blink': searchMode}" class="oldtypo-h2 comment_tag-icon" + matTooltip="{{'topic-cloud-dialog.keyword-counter' | translate}}">tag</mat-icon> + <p [ngClass]="{'animation-blink': searchMode}" matTooltip="{{'topic-cloud-dialog.keyword-counter' | translate}}"> + {{searchMode ? filteredKeywords.length : keywords.length}}</p> </div> <div class="margin-left vertical-center"> <button [ngClass]="{'animation-blink': sortMode!=='alphabetic'}" mat-icon-button [matMenuTriggerFor]="sortMenu"> - <mat-icon>sort</mat-icon> + <mat-icon matTooltip="{{'topic-cloud-dialog.sort' | translate}}">sort</mat-icon> </button> </div> </div> @@ -217,34 +222,36 @@ [isCollapsed]="!panelOpenState" [profanityFilter]="profanityFilter"></app-topic-dialog-comment> </div> - <!-- Only visible when not editing --> - <div *ngIf="!edit" align="end"> - <mat-divider></mat-divider> - - <button class="margin-right" mat-icon-button style="align-self:flex-end;" (click)="editKeyword(i)"> - <mat-icon class="primary">edit</mat-icon> - </button> - <button class="margin-right" mat-icon-button style="align-self:flex-end;" - (click)="openConfirmDialog('delete-message','delete',keyword)"> - <mat-icon class="red">delete</mat-icon> - </button> - </div> + <div *ngIf="isCreatorOrMod"> + <!-- Only visible when not editing --> + <div *ngIf="!edit" align="end"> + <mat-divider></mat-divider> + <button class="margin-right" mat-icon-button style="align-self:flex-end;" (click)="editKeyword(i)"> + <mat-icon class="primary" matTooltip="{{'topic-cloud-dialog.edit' | translate}}">edit</mat-icon> + </button> + <button class="margin-right" mat-icon-button style="align-self:flex-end;" + (click)="openConfirmDialog('delete-message','delete',keyword)"> + <mat-icon class="red" matTooltip="{{'topic-cloud-dialog.delete' | translate}}">delete</mat-icon> + </button> + </div> - <!-- Only visible when editing --> - <div *ngIf="edit"> - <mat-divider></mat-divider> - <mat-form-field> - <mat-label>{{'topic-cloud-dialog.edit-keyword-tip' | translate}}</mat-label> - <input matInput id="{{'edit-input'+i}}" [(ngModel)]="newKeyword"> - </mat-form-field> - <!-- TODO: textinput and buttons in one row --> - <div align="end"> - <button mat-raised-button class="redBackground margin-right" - (click)="cancelEdit()">{{'topic-cloud-dialog.cancel' | translate}}</button> - <button mat-raised-button class="primaryBackground" (click)="confirmEdit(keyword)">{{'topic-cloud-dialog.save' - | translate}}</button> + <!-- Only visible when editing --> + <div *ngIf="edit"> + <mat-divider></mat-divider> + <mat-form-field> + <mat-label>{{'topic-cloud-dialog.edit-keyword-tip' | translate}}</mat-label> + <input matInput id="{{'edit-input'+i}}" [(ngModel)]="newKeyword"> + </mat-form-field> + <!-- TODO: textinput and buttons in one row --> + <div align="end"> + <button mat-raised-button class="redBackground margin-right" + (click)="cancelEdit()">{{'topic-cloud-dialog.cancel' | translate}}</button> + <button mat-raised-button class="primaryBackground" + (click)="confirmEdit(keyword)">{{'topic-cloud-dialog.save' + | translate}}</button> + </div> </div> </div> </mat-expansion-panel> </mat-accordion> -</mat-dialog-content> +</mat-dialog-content> \ No newline at end of file diff --git a/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.scss b/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.scss index c283bcb67cc19596c035738be223da967e7815ce..d725531488544c006202dcd5dae899b9fd729d18 100644 --- a/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.scss +++ b/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.scss @@ -62,6 +62,10 @@ mat-list-item:hover { color: var(--on-surface); } +.color-on-background { + color: var(--on-background); +} + .search { box-sizing: border-box; padding: 0 10px 0 5px; @@ -74,6 +78,10 @@ mat-list-item:hover { transition: width 300ms linear; } +.smallerInput{ + max-width: 100px; +} + label { color: var(--on-surface) } diff --git a/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.ts b/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.ts index 4540506808389e7cdfe49e046a9a3562d4b4b4d9..4150e7ab4b9bcc8cecfb1c5a1cb2358842cd08b9 100644 --- a/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.ts +++ b/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.ts @@ -37,14 +37,13 @@ export class TopicCloudAdministrationComponent implements OnInit, OnDestroy { sortMode = 'alphabetic'; searchedKeyword = undefined; searchMode = false; + deviceType: string; filteredKeywords: Keyword[] = []; showProfanityList = false; showBlacklistWordList = false; showSettingsPanel = false; keywordORfulltext: string = undefined; userRole: UserRole; - allSelectedDE = true; - allSelectedEN = true; spacyLabels: Labels; wantedLabels: { de: string[]; @@ -70,14 +69,15 @@ export class TopicCloudAdministrationComponent implements OnInit, OnDestroy { } ngOnInit(): void { - this.wsCommentServiceService.getCommentStream(localStorage.getItem('roomId')).subscribe(_ => this.initKeywords()); + this.deviceType = localStorage.getItem('deviceType'); + this.wsCommentServiceService.getCommentStream(localStorage.getItem('roomId')).subscribe(_ => this.updateKeywords()); this.blacklistSubscription = this.topicCloudAdminService.getBlacklist().subscribe(list => this.blacklist = list); - this.isCreatorOrMod = this.data ? (this.data.user.role !== UserRole.PARTICIPANT) : true; + this.isCreatorOrMod = this.data.user.role !== UserRole.PARTICIPANT; this.translateService.use(localStorage.getItem('currentLang')); this.spacyLabels = spacyLabels; this.wantedLabels = undefined; this.setDefaultAdminData(); - this.initKeywords(); + this.updateKeywords(); } ngOnDestroy(){ @@ -87,11 +87,21 @@ export class TopicCloudAdministrationComponent implements OnInit, OnDestroy { } } - initKeywords(){ + updateKeywords(){ this.commentService.getFilteredComments(localStorage.getItem('roomId')).subscribe(comments => { this.keywords = []; comments.map(comment => { - const keywords = this.keywordORfulltext === KeywordOrFulltext[0] ? comment.keywordsFromQuestioner : comment.keywordsFromSpacy; + let keywords = comment.keywordsFromQuestioner; + if (this.keywordORfulltext === KeywordOrFulltext[KeywordOrFulltext.keyword]){ + keywords = comment.keywordsFromSpacy; + } else if (this.keywordORfulltext === KeywordOrFulltext[KeywordOrFulltext.both]){ + keywords = comment.keywordsFromQuestioner.concat(comment.keywordsFromSpacy); + } + + if (!keywords){ + keywords = []; + } + keywords.map(_keyword => { const existingKey = this.checkIfKeywordExists(_keyword); if (existingKey){ @@ -348,24 +358,24 @@ export class TopicCloudAdministrationComponent implements OnInit, OnDestroy { } selectAllDE() { - if (this.allSelectedDE) { - this.wantedLabels.de = [] - } else { + if (this.wantedLabels.de.length < this.spacyLabels.de.length) { this.wantedLabels.de = []; this.spacyLabels.de.forEach(label => { this.wantedLabels.de.push(label.tag); }); + } else { + this.wantedLabels.de = []; } } selectAllEN() { - if (this.allSelectedEN) { + if (this.wantedLabels.en.length < this.spacyLabels.en.length) { this.wantedLabels.en = []; this.spacyLabels.en.forEach(label => { this.wantedLabels.en.push(label.tag); }); } else { - this.wantedLabels.en = [] + this.wantedLabels.en = []; } } } diff --git a/src/app/components/shared/comment/comment.component.ts b/src/app/components/shared/comment/comment.component.ts index acb0137a08a3993db91ce1d531533a3f536a2d52..768371bf740d8c98d3e7b4ed3fd4f2b7dbf74970 100644 --- a/src/app/components/shared/comment/comment.component.ts +++ b/src/app/components/shared/comment/comment.component.ts @@ -18,6 +18,7 @@ import { UserRole } from '../../../models/user-roles.enum'; import { Rescale } from '../../../models/rescale'; import { RowComponent } from '../../../../../projects/ars/src/lib/components/layout/frame/row/row.component'; import { User } from '../../../models/user'; +import { Observable } from 'rxjs'; @Component({ selector: 'app-comment', @@ -40,7 +41,9 @@ export class CommentComponent implements OnInit, AfterViewInit { @Input() moderator: boolean; @Input() userRole: UserRole; @Input() user: User; + @Input() disabled = false; @Output() clickedOnTag = new EventEmitter<string>(); + @Output() clickedOnKeyword = new EventEmitter<string>(); @Output() clickedUserNumber = new EventEmitter<number>(); isStudent = false; isCreator = false; @@ -57,6 +60,7 @@ export class CommentComponent implements OnInit, AfterViewInit { @ViewChild('commentExpander', { static: true })commentExpander: RowComponent; isExpanded = false; isExpandable = false; + selectedKeyword: string = ''; constructor(protected authenticationService: AuthenticationService, private route: ActivatedRoute, @@ -127,7 +131,10 @@ export class CommentComponent implements OnInit, AfterViewInit { } setRead(comment: Comment): void { - this.commentService.toggleRead(comment).subscribe(); + // @ts-ignore + + this.commentService.toggleRead(comment).subscribe(c => {this.comment = c; this.comment.keywordsFromQuestioner = JSON.parse(c.keywordsFromQuestioner)}); + // @ts-ignore } markCorrect(comment: Comment, type: CorrectWrong): void { @@ -136,11 +143,16 @@ export class CommentComponent implements OnInit, AfterViewInit { } else { comment.correct = type; } - this.commentService.markCorrect(comment).subscribe(); + // @ts-ignore + this.commentService.markCorrect(comment).subscribe(c => {this.comment = c; this.comment.keywordsFromQuestioner = JSON.parse(c.keywordsFromQuestioner)}); + // @ts-ignore } + setFavorite(comment: Comment): void { - this.commentService.toggleFavorite(comment).subscribe(); + // @ts-ignore + this.commentService.toggleFavorite(comment).subscribe(c => {this.comment = c; this.comment.keywordsFromQuestioner = JSON.parse(c.keywordsFromQuestioner)}); + // @ts-ignore } voteUp(comment: Comment): void { @@ -207,11 +219,15 @@ export class CommentComponent implements OnInit, AfterViewInit { } setAck(comment: Comment): void { - this.commentService.toggleAck(comment).subscribe(); + //@ts-ignore + this.commentService.toggleAck(comment).subscribe(c => {this.comment = c; this.comment.keywordsFromQuestioner = JSON.parse(c.keywordsFromQuestioner)}); + //@ts-ignore } setBookmark(comment: Comment): void { - this.commentService.toggleBookmark(comment).subscribe(); + //@ts-ignore + this.commentService.toggleBookmark(comment).subscribe(c => {this.comment = c; this.comment.keywordsFromQuestioner = JSON.parse(c.keywordsFromQuestioner)}); + //@ts-ignore } goToFullScreen(element: Element): void { diff --git a/src/app/components/shared/dialog/topic-dialog-comment/topic-dialog-comment.component.ts b/src/app/components/shared/dialog/topic-dialog-comment/topic-dialog-comment.component.ts index 73b5b508b750e6094a9fe7492bffe5c3b29d7d75..0b9fabd09ec1d5f346d5053781666fd1eb650de9 100644 --- a/src/app/components/shared/dialog/topic-dialog-comment/topic-dialog-comment.component.ts +++ b/src/app/components/shared/dialog/topic-dialog-comment/topic-dialog-comment.component.ts @@ -6,7 +6,7 @@ import { TopicCloudAdminService } from '../../../../services/util/topic-cloud-ad templateUrl: './topic-dialog-comment.component.html', styleUrls: ['./topic-dialog-comment.component.scss'] }) -export class TopicDialogCommentComponent implements OnInit, OnChanges { +export class TopicDialogCommentComponent implements OnInit { @Input() question: string; @Input() keyword: string ; @@ -15,29 +15,27 @@ export class TopicDialogCommentComponent implements OnInit, OnChanges { @Input() profanityFilter = true; public badWords = []; - questionWithProfinity: string = undefined; + questionWithoutProfanity: string = undefined; public shortQuestion: string; + public parts: string[]; + public partsWithoutProfanity: string[]; constructor(private topicCloudAdminService: TopicCloudAdminService) { } - ngOnChanges(changes: SimpleChanges) { - } - get partsOfQuestion() { if (this.profanityFilter) { - const question = this.topicCloudAdminService.filterProfanityWords(this.question); - return question - .slice(0,this.isCollapsed? this.question.length: this.maxShowedCharachters) - .split(new RegExp(this.keyword,'i')); + return this.partsWithoutProfanity; } else { - return this.question - .slice(0,this.isCollapsed? this.question.length: this.maxShowedCharachters) - .split(new RegExp(this.keyword,'i')); + return this.parts; } } ngOnInit(): void { - this.questionWithProfinity = this.topicCloudAdminService.filterProfanityWords(this.question); + this.questionWithoutProfanity = this.topicCloudAdminService.filterProfanityWords(this.question); + this.partsWithoutProfanity = this.questionWithoutProfanity.slice(0,this.isCollapsed? this.question.length: this.maxShowedCharachters) + .split(new RegExp(this.keyword,'i')); + this.parts = this.question.slice(0,this.isCollapsed? this.question.length: this.maxShowedCharachters) + .split(new RegExp(this.keyword,'i')); } } diff --git a/src/app/components/shared/footer/footer.component.scss b/src/app/components/shared/footer/footer.component.scss index 57723619c9ee34f3bbdd97e10cc4193196bfe863..cc3e6bd41e744d579df8cc48cd5a1690561419da 100644 --- a/src/app/components/shared/footer/footer.component.scss +++ b/src/app/components/shared/footer/footer.component.scss @@ -195,11 +195,9 @@ mat-icon { padding:0px; margin:0px; margin-left:15px; - color:var(--on-dialog); } .title_bold{ - color:rgba(0,0,0,0.9); font-weight:500; } diff --git a/src/app/components/shared/header/header.component.scss b/src/app/components/shared/header/header.component.scss index a6e4125f8ccaefefcaa5a7f435a7632a5452948b..be81643b313af5a7b224d859a62e5ed864334d49 100644 --- a/src/app/components/shared/header/header.component.scss +++ b/src/app/components/shared/header/header.component.scss @@ -73,7 +73,7 @@ button:focus { } svg { - -webkit-filter: invert(100%); /* safari 6.0 - 9.0 */ + -webkit-filter: invert(100%); filter: invert(100%); } @@ -117,7 +117,26 @@ svg { * { background-color: transparent !important; } + *:hover { + color: var(--dialog); + background-color: var(--on-dialog) !important; + + mat-icon{ + color: var(--dialog); + background-color: var(--on-dialog) !important; + } + } } h1{ color: red; } +::ng-deep .mat-menu-item:hover .qrcode svg > path { + fill: var(--dialog); + color: var(--dialog); + background-color: var(--on-dialog) !important; + } + + ::ng-deep #cdk-overlay-0 .mat-menu-content > button:hover mat-icon{ + color: var(--dialog); + background-color: var(--on-dialog) !important; + } \ No newline at end of file diff --git a/src/app/components/shared/tag-cloud/tag-cloud-pop-up/tag-cloud-pop-up.component.ts b/src/app/components/shared/tag-cloud/tag-cloud-pop-up/tag-cloud-pop-up.component.ts index c4fed49e87dcc9ad06cfcf33b36a6378bcfd9316..0c25bfda2a286c6c3f77110629964be649708243 100644 --- a/src/app/components/shared/tag-cloud/tag-cloud-pop-up/tag-cloud-pop-up.component.ts +++ b/src/app/components/shared/tag-cloud/tag-cloud-pop-up/tag-cloud-pop-up.component.ts @@ -81,7 +81,11 @@ export class TagCloudPopUpComponent implements OnInit, AfterViewInit { this.checkLanguage = checkLanguage; if (checkLanguage) { this.spellingData = []; - this.languagetoolService.checkSpellings(tag, this.selectedLang).subscribe(correction => { + this.languagetoolService.checkSpellings(tag, 'auto').subscribe(correction => { + const langKey = correction.language.code.split('-')[0].toUpperCase(); + if (['DE', 'FR', 'EN'].indexOf(langKey) < 0) { + return; + } for (const match of correction.matches) { if (match.replacements != null && match.replacements.length > 0) { for (const replacement of match.replacements) { @@ -137,11 +141,20 @@ export class TagCloudPopUpComponent implements OnInit, AfterViewInit { array[index] = tagReplacementInput; } }; + const tagReplacementInputLower = tagReplacementInput.toLowerCase(); this.tagData.comments.forEach(comment => { const changes = new TSMap<string, any>(); - comment.keywordsFromQuestioner.forEach(renameKeyword); + if (comment.keywordsFromQuestioner.findIndex(e => e.toLowerCase() === tagReplacementInputLower) >= 0) { + comment.keywordsFromQuestioner = comment.keywordsFromQuestioner.filter(e => e !== this.tag); + } else { + comment.keywordsFromQuestioner.forEach(renameKeyword); + } changes.set('keywordsFromQuestioner', JSON.stringify(comment.keywordsFromQuestioner)); - comment.keywordsFromSpacy.forEach(renameKeyword); + if (comment.keywordsFromSpacy.findIndex(e => e.toLowerCase() === tagReplacementInputLower) >= 0) { + comment.keywordsFromSpacy = comment.keywordsFromSpacy.filter(e => e !== this.tag); + } else { + comment.keywordsFromSpacy.forEach(renameKeyword); + } changes.set('keywordsFromSpacy', JSON.stringify(comment.keywordsFromSpacy)); this.commentService.patchComment(comment, changes).subscribe(_ => { this.translateService.get('topic-cloud-dialog.keyword-edit').subscribe(msg => { diff --git a/src/app/components/shared/tag-cloud/tag-cloud.component.html b/src/app/components/shared/tag-cloud/tag-cloud.component.html index ece66e1f97ae2378b904bfac66a9605ab499c5d7..a706a462c875130cbac5257b2634e2bc87f9a7ba 100644 --- a/src/app/components/shared/tag-cloud/tag-cloud.component.html +++ b/src/app/components/shared/tag-cloud/tag-cloud.component.html @@ -1,3 +1,5 @@ +<link rel="preconnect" href="https://fonts.gstatic.com"> +<link href="https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Dancing+Script&family=Indie+Flower&family=Permanent+Marker&display=swap" rel="stylesheet"> <ars-screen ars-flex-box> <mat-drawer-container class="spacyTagCloudContainer"> <mat-drawer [(opened)]="configurationOpen" position="end" mode="over"> diff --git a/src/app/components/shared/tag-cloud/tag-cloud.component.scss b/src/app/components/shared/tag-cloud/tag-cloud.component.scss index c9a1a5ffe7f3871e3e3e73877ab63cf16b4ca252..43a9e2415f6a7e747c6178f3d7d6afa0c16842cc 100644 --- a/src/app/components/shared/tag-cloud/tag-cloud.component.scss +++ b/src/app/components/shared/tag-cloud/tag-cloud.component.scss @@ -1,12 +1,14 @@ $header-size: 67px; $margin: 15px; -.mat-drawer.mat-drawer-push { +mat-drawer, +.mat-drawer { background-color: var(--background); -} -mat-drawer { - background-color: var(--dialog); + @media (max-width: 450px) { + width: 100vw; + } + } ars-fill { diff --git a/src/app/components/shared/tag-cloud/tag-cloud.component.ts b/src/app/components/shared/tag-cloud/tag-cloud.component.ts index b0d32a0a21568814681165aff06b8dc1dd105f2a..615d6f17d151a079f12b730aa988253138229010 100644 --- a/src/app/components/shared/tag-cloud/tag-cloud.component.ts +++ b/src/app/components/shared/tag-cloud/tag-cloud.component.ts @@ -61,20 +61,33 @@ class TagComment implements CloudData { const colorRegex = /rgba?\((\d+), (\d+), (\d+)(?:, (\d(?:\.\d+)?))?\)/; const transformationScaleKiller = /scale\([^)]*\)/; -const defaultColors: string[] = [ - // variable, fallback - 'var(--secondary, greenyellow)', // hover - 'var(--moderator, lightblue)', // w1 - 'var(--blue, green)', // w2 - 'var(--grey, yellow)', // w3 - 'var(--red, orange)', // w4 - 'var(--primary, pink)', // w5 - 'var(--yellow, gray)', // w6 - 'var(--on-background, lightgreen)', // w7 - 'var(--purple, tomato)', // w8 - 'var(--magenta, white)', // w9 - 'var(--light-green, brown)', // w10 - 'var(--background, black)' //background +type DefaultColors = [ + hover: string, + w1: string, + w2: string, + w3: string, + w4: string, + w5: string, + w6: string, + w7: string, + w8: string, + w9: string, + w10: string, + background: string +]; +const defaultColors: DefaultColors = [ + 'var(--secondary, greenyellow)', + 'var(--moderator, lightblue)', + 'var(--blue, green)', + 'var(--grey, yellow)', + 'var(--red, orange)', + 'var(--primary, pink)', + 'var(--yellow, gray)', + 'var(--on-background, lightgreen)', + 'var(--purple, tomato)', + 'var(--magenta, white)', + 'var(--light-green, brown)', + 'var(--background, black)' ]; const getResolvedDefaultColors = (): string[] => { @@ -83,7 +96,7 @@ const getResolvedDefaultColors = (): string[] => { document.body.appendChild(elem); const results = []; for (const color of defaultColors) { - elem.style.backgroundColor = 'rgb(0, 0, 0)'; // fallback + elem.style.backgroundColor = 'rgb(0, 0, 0)'; elem.style.backgroundColor = color; const result = window.getComputedStyle(elem).backgroundColor.match(colorRegex); const r = parseInt(result[1], 10); @@ -110,7 +123,7 @@ const getDefaultCloudParameters = (): CloudParameters => { {maxVisibleElements: -1, color: resDefaultColors[10], rotation: 0}, ]; return { - fontFamily: 'Helvetica,Arial,sans-serif', + fontFamily: 'Dancing Script', fontWeight: 'normal', fontStyle: 'normal', fontSize: '10px', @@ -122,7 +135,7 @@ const getDefaultCloudParameters = (): CloudParameters => { hoverTime: 0.6, hoverDelay: 0.4, delayWord: 0, - randomAngles: false, + randomAngles: true, checkSpelling: true, sortAlphabetically: false, textTransform: CloudTextStyle.normal, @@ -145,18 +158,16 @@ export class TagCloudComponent implements OnInit, AfterViewInit, OnDestroy { directSend = true; shortId: string; options: CloudOptions = { - // if width is between 0 and 1 it will be set to the width of the upper element multiplied by the value width: 1, - // if height is between 0 and 1 it will be set to the height of the upper element multiplied by the value height: 1, overflow: false, - font: 'Georgia', // not working + font: 'Not used', delay: 0 }; zoomOnHoverOptions: ZoomOnHoverOptions = { - scale: 1.3, // Elements will become 130 % of current size on hover - transitionTime: 0.6, // it will take 0.6 seconds until the zoom level defined in scale property has been reached - delay: 0.4 // Zoom will take affect after 0.4 seconds + scale: 1.3, + transitionTime: 0.6, + delay: 0.4 }; userRole: UserRole; data: TagComment[] = []; @@ -164,7 +175,6 @@ export class TagCloudComponent implements OnInit, AfterViewInit, OnDestroy { lastDebounceTime = 0; configurationOpen = false; isLoading = true; - //Subscriptions headerInterface = null; themeSubscription = null; private _currentSettings: CloudParameters; @@ -382,7 +392,6 @@ export class TagCloudComponent implements OnInit, AfterViewInit, OnDestroy { return; } this._subscriptionCommentlist = this.eventService.on('commentListCreated').subscribe(() => { - //send tag.text instead of 'Autos' -> wait for group 3 to implement... this.eventService.broadcast('setTagConfig', tag.text); this._subscriptionCommentlist.unsubscribe(); }); @@ -412,7 +421,6 @@ export class TagCloudComponent implements OnInit, AfterViewInit, OnDestroy { if (!dataUpdate) { this.child.reDraw(); } - // This should fix the hover bug (scale was not turned off sometimes) if (this.dataManager.currentData === null) { return; } @@ -441,7 +449,6 @@ export class TagCloudComponent implements OnInit, AfterViewInit, OnDestroy { for (let i = rules.length - 1; i >= 0; i--) { customTagCloudStyles.sheet.deleteRule(i); } - // global let textTransform = ''; if (this._currentSettings.textTransform === CloudTextStyle.capitalized) { textTransform = 'text-transform: capitalize;'; @@ -454,8 +461,7 @@ export class TagCloudComponent implements OnInit, AfterViewInit, OnDestroy { textTransform + ' font-family: ' + this._currentSettings.fontFamily + '; ' + 'font-size: ' + this._currentSettings.fontSize + '; ' + 'font-weight: ' + this._currentSettings.fontWeight + '; ' + - 'font-style' + this._currentSettings.fontStyle + '; }'); - // custom spans + 'font-style:' + this._currentSettings.fontStyle + '; }'); const fontRange = (this._currentSettings.fontSizeMax - this._currentSettings.fontSizeMin) / 10; for (let i = 1; i <= 10; i++) { customTagCloudStyles.sheet.insertRule('.spacyTagCloud > span.w' + i + ', ' + @@ -479,15 +485,11 @@ export class TagCloudComponent implements OnInit, AfterViewInit, OnDestroy { if (!this._currentSettings) { return 2; } - /* - hoverScale, hoverTime, hoverDelay, delayWord can be updated without refreshing - */ const cssUpdates = ['backgroundColor', 'fontColor']; const dataUpdates = ['randomAngles', 'sortAlphabetically', 'fontSizeMin', 'fontSizeMax', 'textTransform', 'fontStyle', 'fontWeight', 'fontFamily', 'fontSize']; const cssWeightUpdates = ['color']; const dataWeightUpdates = ['maxVisibleElements', 'rotation']; - //data updates for (const key of dataUpdates) { if (this._currentSettings[key] !== parameters[key]) { return 2; @@ -500,7 +502,6 @@ export class TagCloudComponent implements OnInit, AfterViewInit, OnDestroy { } } } - //css updates for (const key of cssUpdates) { if (this._currentSettings[key] !== parameters[key]) { return 1; diff --git a/src/app/services/http/languagetool.service.ts b/src/app/services/http/languagetool.service.ts index 20d58c87d5be5a5abecc068f35e10913958e238f..145c3693dfd3820fa5b950c3d19311559ac5b785 100644 --- a/src/app/services/http/languagetool.service.ts +++ b/src/app/services/http/languagetool.service.ts @@ -25,7 +25,7 @@ export class LanguagetoolService extends BaseHttpService { case 'fr': return 'fr'; default: - return 'de'; + return 'auto'; } } diff --git a/src/app/services/http/spacy.service.ts b/src/app/services/http/spacy.service.ts index 394000f9c7c237963f8200ee39dce98671221c43..f8965a97af82353795b7a9a5a8b739e3b23f32b4 100644 --- a/src/app/services/http/spacy.service.ts +++ b/src/app/services/http/spacy.service.ts @@ -4,7 +4,7 @@ import { Observable } from 'rxjs'; import { BaseHttpService } from './base-http.service'; import { catchError, map, tap } from 'rxjs/operators'; -export type Model = 'de' | 'en' | 'fr' | 'es' | 'it' | 'nl' | 'pt'; +export type Model = 'de' | 'en' | 'fr' | 'es' | 'it' | 'nl' | 'pt' | 'auto'; //[B]egin, [I]nside, [O]utside or unset type EntityPosition = 'B' | 'I' | 'O' | ''; diff --git a/src/app/services/util/topic-cloud-admin.service.ts b/src/app/services/util/topic-cloud-admin.service.ts index 6fe470befa0fb87ad3aa1aab50fb33a888f56fcb..2eb50526ba23d6c965d51cbb8444d610682d1469 100644 --- a/src/app/services/util/topic-cloud-admin.service.ts +++ b/src/app/services/util/topic-cloud-admin.service.ts @@ -46,7 +46,7 @@ export class TopicCloudAdminService { }, considerVotes: false, profanityFilter: true, - blacklistIsActive: false, + blacklistIsActive: true, keywordORfulltext: KeywordOrFulltext.keyword }; } @@ -56,35 +56,25 @@ export class TopicCloudAdminService { setAdminData(_adminData: TopicCloudAdminData) { localStorage.setItem(this.adminKey, JSON.stringify(_adminData)); this.getBlacklist().subscribe(list => { - _adminData.blacklist = this.getCustomProfanityList().concat(list).concat(this.profanityWords); + _adminData.blacklist = []; + if (_adminData.profanityFilter){ + _adminData.blacklist = this.getCustomProfanityList().concat(this.profanityWords); + } + if (_adminData.blacklistIsActive){ + _adminData.blacklist.concat(list); + } this.adminData.next(_adminData); }); } getBlacklist(): Observable<string[]> { - // TODO: add watcher for another moderators this.getRoom().subscribe(room => { - this.blacklist.next(JSON.parse(room.blacklist)); + const list = room.blacklist ? JSON.parse(room.blacklist) : []; + this.blacklist.next(list); }); return this.blacklist.asObservable(); } - filterProfanityWords(str: string): string { - let questionWithProfanity = str; - this.profanityWords.concat(this.getCustomProfanityList()).map((word) => { - questionWithProfanity = questionWithProfanity - .toLowerCase() - .includes(word.toLowerCase()) - ? this.replaceString( - questionWithProfanity.toLowerCase(), - word.toLowerCase(), - this.generateCensoredWord(word.length) - ) - : questionWithProfanity; - }); - return questionWithProfanity; - } - getCustomProfanityList(): string[] { const list = localStorage.getItem(this.profanityKey); return list ? list.split(',') : []; @@ -123,8 +113,10 @@ export class TopicCloudAdminService { if (word !== undefined) { this.getRoom().subscribe(room => { const newlist = JSON.parse(room.blacklist); - newlist.push(word); - this.updateBlacklist(newlist, room); + if (!newlist.includes(word)){ + newlist.push(word.toLowerCase()); + } + this.updateBlacklist(newlist, room, 'add-successful'); }); } } @@ -135,22 +127,24 @@ export class TopicCloudAdminService { if (room.blacklist.length > 0){ const newlist = JSON.parse(room.blacklist); newlist.splice(newlist.indexOf(word, 0), 1); - this.updateBlacklist(newlist, room); + this.updateBlacklist(newlist, room, 'remove-successful'); } }); } } - updateBlacklist(list: string[], room: Room){ + updateBlacklist(list: string[], room: Room, msg?: string) { room.blacklist = JSON.stringify(list); - this.updateRoom(room); + this.updateRoom(room, msg); } - updateRoom(updatedRoom: Room){ + updateRoom(updatedRoom: Room, message?: string) { this.roomService.updateRoom(updatedRoom).subscribe(_ => { - this.translateService.get('topic-cloud.changes-successful').subscribe(msg => { + if (!message) { + message = 'changes-successful'; + } + this.translateService.get('topic-cloud.' + message).subscribe(msg => { this.notificationService.show(msg); - /* update blacklist for subscribers */ this.blacklist.next(JSON.parse(updatedRoom.blacklist)); }); }, @@ -162,7 +156,7 @@ export class TopicCloudAdminService { } getDefaultSpacyTagsDE(): string[] { - let tags: string[] = []; + const tags: string[] = []; spacyLabels.de.forEach(label => { tags.push(label.tag); }); @@ -170,15 +164,31 @@ export class TopicCloudAdminService { } getDefaultSpacyTagsEN(): string[] { - let tags: string[] = []; + const tags: string[] = []; spacyLabels.en.forEach(label => { tags.push(label.tag); }); return tags; } + filterProfanityWords(str: string): string { + let questionWithProfanity = str; + this.profanityWords.concat(this.getCustomProfanityList()).map((word) => { + questionWithProfanity = questionWithProfanity + .toLowerCase() + .includes(word.toLowerCase()) + ? this.replaceString( + questionWithProfanity, + word, + this.generateCensoredWord(word.length) + ) + : questionWithProfanity; + }); + return questionWithProfanity; + } + private replaceString(str: string, search: string, replace: string) { - return str.split(search).join(replace); + return str.replace(new RegExp(search, 'gi'), replace); } private generateCensoredWord(count: number) { diff --git a/src/assets/i18n/creator/de.json b/src/assets/i18n/creator/de.json index 194f3250feb4f5931838c6288c274aad0d25f97e..f9d6f7c6fd81bd8a5c5b64cd481fb4c504eed969 100644 --- a/src/assets/i18n/creator/de.json +++ b/src/assets/i18n/creator/de.json @@ -94,7 +94,8 @@ "select-keyword-hint": "Dieses Stickwort auswählen", "edit-keyword-hint": "Stichwort editieren", "editing-done-hint": "Editierung abschliessen", - "force-language-selection": "Bitte wähle eine Sprache aus." + "force-language-selection": "Automatische Spracherkennung unpräzise, bitte gewählte Sprache prüfen!", + "add-manually": "Geben Sie bitte die Stichwörter unten mit separatem Komma ein" }, "comment-page": { "a11y-comment_delete": "Löscht diese Frage", @@ -341,8 +342,7 @@ "preview": "Vorschau" }, "tag-cloud-config":{ - "title":"Tag-Cloud Einstellungen", - "general":"Allgemeine Einstellungen", + "general":"Allgemein", "overflow":"Überlauf", "height":"Höhe", "random-angle":"Zufallswinkel", @@ -350,16 +350,15 @@ "background":"Hintergrundfarbe", "word-delay":"Wortverzögerung", "hover-color":"Schriftfarbe", - "hover-scale":"Hover Skala", - "hover-time":"Hover Zeit", - "hover-title":"Hover Einstellungen", - "hover-delay":"Hover Verzögerung", + "hover-scale":"Fokus Skala", + "hover-time":"Fokus Zeit", + "hover-title":"Fokus", + "hover-delay":"Fokus Verzögerung", "cancel-btn":"Abbruch", "save-btn":"Speichern", "font-size-min":"Schriftgröße min", "font-size-max":"Schriftgröße max", "select-color": "Farbauswahl", - "random-angle-tooltip": "Anordnung der Winkel zufällig generieren", "background-tooltip": "Auswahl der Hintergrundfarbe", "word-delay-tooltip": "Animationsverzögerung der Wörter", @@ -369,18 +368,18 @@ "hover-scale-tooltip": "Skallierung der Wörter beim Erscheinen", "hover-time-tooltip": "Festlegen der Erscheinungszeit der Wörter", "hover-delay-tooltip": "Hover-Verzögerung der Wörter", - - "weight-class-settings": "Wichtigkeitsklasse Einstellungen", - "weight-class": "Wichtigkeitsklasse", + "weight-class-settings": "Relevanz-Gruppen", + "weight-class": "Relevanz-Gruppe", "back-btn": "Zurück", "weight-color": "Schriftfarbe", "weight-number": "max. Anzahl Schlüsselwörter", "weight-color-tooltip": "Auswahl der Schriftfarbe", "weight-number-tooltip": "maximale Anzahl der Schlüsselwörter festlegen", - "automatic-spelling": "Automatische Rechtschreibung", + "automatic-spelling": "Rechtschreibüberprüfung", "notation": "Notation:", "lowerCase": "Kleinschreibung", - "capitalization": "Großschreibung", + "capitalization": "Kapitälchen", + "upperCase": "Großschreibung", "standard": "Standard", "alphabetical-sorting": "Alphabetische Sortierung", "cleanUpView": "Tag-Cleanup Einstellungen", @@ -391,6 +390,11 @@ "alphabetical-sorting-tooltip": "Alphabetische Sortierung", "highestWeight-tooltip": "x Tags mit der höchsten Gewichtung anzeigen", "rotate-weight": "Einige Einträge dieser Klasse zufällig um x Grad drehen", - "rotate-weight-tooltip": "einige Einträge dieser Wichtigkeitsklassen zufällig um x Grad drehen" + "rotate-weight-tooltip": "einige Einträge dieser Wichtigkeitsklassen zufällig um x Grad drehen", + "font":"Schrift", + "reset-btn": "Zurücksetzten", + "font-style-bold" : "Fett", + "font-style-italic": "Kursiv", + "font-family":"Schrift Art" } } diff --git a/src/assets/i18n/creator/en.json b/src/assets/i18n/creator/en.json index 55c278f278981ceb9c6057848f915e32124b8ab3..cd2f7c0e183d818b87f912e2fb6c529f1c199890 100644 --- a/src/assets/i18n/creator/en.json +++ b/src/assets/i18n/creator/en.json @@ -95,7 +95,8 @@ "select-keyword-hint": "Select this keyword", "edit-keyword-hint": "Edit keyword", "editing-done-hint": "Finish editing", - "force-language-selection": "Please select a language." + "force-language-selection": "Language detection inaccurate, please check language settings!", + "add-manually": "You can manually enter the keywords separated with a comma " }, "comment-page": { "a11y-comment_delete": "Deletes this question", @@ -342,8 +343,7 @@ "preview": "Preview" }, "tag-cloud-config":{ - "title":"Tag-Cloud Options", - "general":"General Options", + "general":"General", "overflow":"Overflow", "height":"Height", "random-angle":"Randomize angle", @@ -353,14 +353,13 @@ "hover-color":"Font-color", "hover-scale":"Scale", "hover-time":"Hover time", - "hover-title":"Hover Options", + "hover-title":"Hover", "hover-delay":"Hover delay", "cancel-btn":"Cancel", "save-btn":"Save", "font-size-min":"Font size min", "font-size-max":"Font size max", "select-color": "Selected color", - "random-angle-tooltip": "Generate angle randomly", "background-tooltip": "Select background-color", "word-delay-tooltip": "Select word-delay", @@ -370,28 +369,33 @@ "hover-scale-tooltip": "Select hover-scale", "hover-time-tooltip": "Select hover-time", "hover-delay-tooltip": "Select hover-delay", - - "weight-class-settings": "Weight-class Settings", - "weight-class": "Weight class", + "weight-class-settings": "Weight-classes", + "weight-class": "Weight-class", "back-btn": "Back", "weight-color": "Font color", "weight-number": "max. number of keywords", "weight-color-tooltip": "Select font-color", "weight-number-tooltip": "Select maximal number of keywords", - "automatic-spelling": "Automatic spelling", + "automatic-spelling": "Spell check", "notation": "Notation:", "lowerCase": "Lower case", "capitalization": "Capitalization", + "upperCase": "Upper Case", "standard": "Standard", "alphabetical-sorting": "Alphabetical sorting", "cleanUpView": "Tag-Cleanup Settings", "rotation": "rotation of random entries", "highestWeight": "Number of tags with highest weight", - "automatic-spelling-tooltip": "automatic spelling check", + "automatic-spelling-tooltip": "spell check", "notation-tooltip": "Notation-Settings: small, large, standard", "alphabetical-sorting-tooltip": "Alphabetical sorting", "rotate-weight-tooltip": "Rotate some entries randomly by x degrees", "highestWeight-tooltip": "show x tags with the highest weight", - "rotate-weight": "Rotate some entries of this weight class randomly by x degrees" + "rotate-weight": "Rotate some entries of this weight class randomly by x degrees", + "font":"Font", + "reset-btn": "Reset", + "font-style-bold" : "Bold", + "font-style-italic": "Italic", + "font-family":"Font Family" } } diff --git a/src/assets/i18n/home/de.json b/src/assets/i18n/home/de.json index 97960beca17eaa6db471becb2dd7cc4a32821d86..d782b388faf7b8f76627c0e577b6790301aaae44 100644 --- a/src/assets/i18n/home/de.json +++ b/src/assets/i18n/home/de.json @@ -314,8 +314,10 @@ "session": "Raum" }, "topic-cloud": { - "changes-gone-wrong": "Etwas ist schief gelaufen!", - "changes-successful": "Änderungen gespeichert." + "changes-gone-wrong": "Etwas ist schiefgelaufen!", + "changes-successful": "Änderungen gespeichert.", + "add-successful": "Wort hinzugefügt", + "remove-successful": "Wort entfernt" }, "worker-dialog": { "running": "Laufend" diff --git a/src/assets/i18n/home/en.json b/src/assets/i18n/home/en.json index 083ae2f8cb72e45a07f24cc7eb4199f6154de77f..32e8901a62828fbf6c031af10f45fced05a79211 100644 --- a/src/assets/i18n/home/en.json +++ b/src/assets/i18n/home/en.json @@ -319,7 +319,9 @@ }, "topic-cloud": { "changes-gone-wrong": "Something went wrong!", - "changes-successful": "Successfully updated." + "changes-successful": "Successfully updated.", + "add-successful": "Word added", + "remove-successful": "Word removed" }, "worker-dialog": { "running": "running" diff --git a/src/assets/i18n/participant/de.json b/src/assets/i18n/participant/de.json index 800272a2057b95ef362e5f269befd79433b5f8b1..a3efc8b1d106470ec9fbdecec193c75e40bf3de8 100644 --- a/src/assets/i18n/participant/de.json +++ b/src/assets/i18n/participant/de.json @@ -99,7 +99,8 @@ "select-keyword-hint": "Dieses Stickwort auswählen", "edit-keyword-hint": "Stichwort editieren", "editing-done-hint": "Editierung abschliessen", - "force-language-selection": "Bitte wähle eine Sprache aus." + "force-language-selection": "Automatische Spracherkennung unpräzise, bitte gewählte Sprache prüfen!", + "add-manually": "Geben Sie bitte die Stichwörter unten mit separatem Komma ein" }, "comment-page": { "a11y-comment_input": "Gib deine Frage ein", @@ -289,7 +290,9 @@ "changes-gone-wrong": "Etwas ist schiefgelaufen", "english": "Englisch", "german": "Deutsch", - "select-all": "Alle auswählen" + "select-all": "Alle auswählen", + "keyword-counter": "Anzahl der Themen", + "sort": "Sortieren" }, "topic-cloud-confirm-dialog": { "cancel": "Abbrechen", @@ -304,8 +307,7 @@ "read-less": "Weniger lesen" }, "tag-cloud-config": { - "title": "Tag-Cloud Einstellungen", - "general": "Allgemeine Einstellungen", + "general": "Allgemein", "overflow": "Überlauf", "height": "Höhe", "random-angle": "Zufallswinkel", @@ -313,10 +315,10 @@ "background": "Hintergrundfarbe", "word-delay": "Wortverzögerung", "hover-color": "Schriftfarbe", - "hover-scale": "Hover Skala", - "hover-time": "Hover Zeit", - "hover-title": "Hover Einstellungen", - "hover-delay": "Hover Verzögerung", + "hover-scale": "Fokus Skala", + "hover-time": "Fokus Zeit", + "hover-title": "Fokus", + "hover-delay": "Fokus Verzögerung", "cancel-btn": "Abbruch", "save-btn": "Speichern", "font-size-min": "Schriftgröße min", @@ -333,16 +335,17 @@ "hover-delay-tooltip": "Hover-Verzögerung der Wörter", "extended-btn": "Wichtigkeitsklasse", "back-btn": "Zurück", - "weight-class-settings": "Wichtigkeitsklassen Einstellungen", - "weight-class": "Wichtigkeitsklasse", + "weight-class-settings": "Relevanz-Gruppen", + "weight-class": "Relevanz-Gruppe", "weight-color": "Schriftfarbe", "weight-number": "max. Anzahl Schlüsselwörter", "weight-color-tooltip": "Auswahl der Schriftfarbe", "weight-number-tooltip": "maximale Anzahl der Schlüsselwörter festlegen", - "automatic-spelling": "Automatische Rechtschreibung", + "automatic-spelling": "Rechtschreibüberprüfung", "notation": "Notation:", "lowerCase": "Kleinschreibung", - "capitalization": "Großschreibung", + "capitalization": "Kapitälchen", + "upperCase": "Großschreibung", "standard": "Standard", "alphabetical-sorting": "Alphabetische Sortierung", "cleanUpView": "Tag-Cleanup Einstellungen", @@ -353,6 +356,11 @@ "alphabetical-sorting-tooltip": "Alphabetische Sortierung", "highestWeight-tooltip": "x Tags mit der höchsten Gewichtung anzeigen", "rotate-weight": "Einige Einträge dieser Klasse zufällig um x Grad drehen", - "rotate-weight-tooltip": "einige Einträge dieser Wichtigkeitsklasse zufällig um x Grad drehen" + "rotate-weight-tooltip": "einige Einträge dieser Wichtigkeitsklasse zufällig um x Grad drehen", + "font":"Schrift", + "reset-btn": "Zurücksetzten", + "font-style-bold" : "Fett", + "font-style-italic": "Kursiv", + "font-family":"Schrift Art" } } diff --git a/src/assets/i18n/participant/en.json b/src/assets/i18n/participant/en.json index 218f91314adbdc87d0ecca09914245e3bc4251f3..c0bea49f45398eec81c16ddb51f6233a6ff8d592 100644 --- a/src/assets/i18n/participant/en.json +++ b/src/assets/i18n/participant/en.json @@ -109,7 +109,8 @@ "select-keyword-hint": "Select this keyword", "edit-keyword-hint": "Edit keyword", "editing-done-hint": "Finish editing", - "force-language-selection": "Please select a language." + "force-language-selection": "Language detection inaccurate, please check language settings!", + "add-manually": "You can manually enter the keywords separated with a comma " }, "comment-page": { "a11y-comment_input": "Enter your question", @@ -295,7 +296,9 @@ "changes-gone-wrong": "somthing has gone wrong", "english": "English", "german": "German", - "select-all": "Select all" + "select-all": "Select all", + "keyword-counter": "Topic count", + "sort": "Sort" }, "topic-cloud-confirm-dialog":{ "cancel": "Cancel", @@ -310,8 +313,7 @@ "read-less": "Read less" }, "tag-cloud-config":{ - "title":"Tag-Cloud Options", - "general":"General Options", + "general":"General", "overflow":"Overflow", "height":"Height", "random-angle":"Randomize angle", @@ -321,7 +323,7 @@ "hover-color":"Font-color", "hover-scale":"Scale", "hover-time":"Hover time", - "hover-title":"Hover Options", + "hover-title":"Hover", "hover-delay":"Hover delay", "cancel-btn":"Cancel", "save-btn":"Save", @@ -338,17 +340,18 @@ "hover-time-tooltip": "Select hover-time", "hover-delay-tooltip": "Select hover-delay", "extended-btn": "Weight classes", - "weight-class-settings": "Weight-class Settings", - "weight-class": "Weight class", + "weight-class-settings": "Weight-classes", + "weight-class": "Weight-class", "back-btn": "Back", "weight-color": "Font color", "weight-number": "max. number of keywords", "weight-color-tooltip": "Select font-color", "weight-number-tooltip": "Select maximal number of keywords", - "automatic-spelling": "Automatic spelling", + "automatic-spelling": "Spell check", "notation": "Notation:", "lowerCase": "Lower case", "capitalization": "Capitalization", + "upperCase": "Upper Case", "standard": "Standard", "alphabetical-sorting": "Alphabetical sorting", "cleanUpView": "Tag-Cleanup Settings", @@ -359,6 +362,11 @@ "alphabetical-sorting-tooltip": "Alphabetical sorting", "rotate-weight-tooltip": "Rotate some entries randomly by x degrees", "highestWeight-tooltip": "show x tags with the highest weight", - "rotate-weight": "Rotate some entries of this weight class randomly by x degrees" + "rotate-weight": "Rotate some entries of this weight class randomly by x degrees", + "font":"Font", + "reset-btn": "Reset", + "font-style-bold" : "Bold", + "font-style-italic": "Italic", + "font-family":"Font Family" } } diff --git a/src/theme/dark-theme/_dark-theme.scss b/src/theme/dark-theme/_dark-theme.scss index 6665aa50c89fcf6c94d3c8b85d2d9124a0f7e038..cc5ed6bf300c4559b2682056b86a2dbf5269f619 100644 --- a/src/theme/dark-theme/_dark-theme.scss +++ b/src/theme/dark-theme/_dark-theme.scss @@ -28,3 +28,8 @@ a { background-color: var(--dialog) !important; color: var(--on-dialog) !important; } + +.mat-menu-panel .mat-menu-item:hover { + background-color: var(--on-dialog) !important; + color: var(--dialog) !important; +}