Skip to content
Snippets Groups Projects
Commit a89b61b3 authored by mechtelm's avatar mechtelm
Browse files

Rebase to new add-feature-slider branch

parent 58e930c7
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,7 @@ export class IdService { ...@@ -17,6 +17,7 @@ export class IdService {
likert: 0, likert: 0,
likert_row: 0, likert_row: 0,
slider: 0, slider: 0,
'spell-correct': 0,
'radio-group-images': 0, 'radio-group-images': 0,
'drop-list': 0 'drop-list': 0
}; };
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import { IdService } from '../id.service'; import { IdService } from '../id.service';
import { LikertColumn, LikertRow } from '../interfaces/UIElementInterfaces'; import { LikertColumn, LikertRow } from '../interfaces/UIElementInterfaces';
export type UIElementType = 'text' | 'button' | 'text-field' | 'text-area' | 'checkbox' export type UIElementType = 'text' | 'button' | 'text-field' | 'text-area' | 'checkbox' | 'spell-correct'
| 'dropdown' | 'radio' | 'image' | 'audio' | 'video' | 'likert' | 'likert_row' | 'radio-group-images' | 'drop-list' | 'slider'; | 'dropdown' | 'radio' | 'image' | 'audio' | 'video' | 'likert' | 'likert_row' | 'radio-group-images' | 'drop-list' | 'slider';
export type InputElementValue = string[] | string | number | boolean | null; export type InputElementValue = string[] | string | number | boolean | null;
......
...@@ -45,6 +45,7 @@ import { LikertRadioButtonGroupComponent } ...@@ -45,6 +45,7 @@ import { LikertRadioButtonGroupComponent }
import { Magnifier } from './element-components/magnifier.component'; import { Magnifier } from './element-components/magnifier.component';
import { RadioGroupImagesComponent } from './element-components/compound-elements/radio-group-images.component'; import { RadioGroupImagesComponent } from './element-components/compound-elements/radio-group-images.component';
import { DropListComponent } from './element-components/compound-elements/drop-list.component'; import { DropListComponent } from './element-components/compound-elements/drop-list.component';
import { SpellCorrectComponent } from "./element-components/spell-correct.component";
@NgModule({ @NgModule({
imports: [ imports: [
...@@ -73,6 +74,7 @@ import { DropListComponent } from './element-components/compound-elements/drop-l ...@@ -73,6 +74,7 @@ import { DropListComponent } from './element-components/compound-elements/drop-l
AudioComponent, AudioComponent,
VideoComponent, VideoComponent,
SliderComponent, SliderComponent,
SpellCorrectComponent,
RadioButtonGroupComponent, RadioButtonGroupComponent,
CheckboxComponent, CheckboxComponent,
DropdownComponent, DropdownComponent,
...@@ -113,13 +115,13 @@ import { DropListComponent } from './element-components/compound-elements/drop-l ...@@ -113,13 +115,13 @@ import { DropListComponent } from './element-components/compound-elements/drop-l
AudioComponent, AudioComponent,
VideoComponent, VideoComponent,
SliderComponent, SliderComponent,
SpellCorrectComponent,
RadioButtonGroupComponent, RadioButtonGroupComponent,
CheckboxComponent, CheckboxComponent,
DropdownComponent, DropdownComponent,
MatSnackBarModule, MatSnackBarModule,
MatTooltipModule, MatTooltipModule,
MatDialogModule, MatDialogModule,
TranslateModule,
SafeResourceHTMLPipe SafeResourceHTMLPipe
], ],
providers: providers:
......
...@@ -28,6 +28,8 @@ import { DropListComponent } from '../element-components/compound-elements/drop- ...@@ -28,6 +28,8 @@ import { DropListComponent } from '../element-components/compound-elements/drop-
import { DropListElement } from '../models/compound-elements/drop-list'; import { DropListElement } from '../models/compound-elements/drop-list';
import { SliderElement } from '../models/slider-element'; import { SliderElement } from '../models/slider-element';
import { SliderComponent } from '../element-components/slider.component'; import { SliderComponent } from '../element-components/slider.component';
import { SpellCorrectElement } from '../models/spell-correct-element';
import { SpellCorrectComponent } from '../element-components/spell-correct.component';
export function createElement(elementModel: UIElement): UIElement { export function createElement(elementModel: UIElement): UIElement {
let newElement: UIElement; let newElement: UIElement;
...@@ -74,6 +76,9 @@ export function createElement(elementModel: UIElement): UIElement { ...@@ -74,6 +76,9 @@ export function createElement(elementModel: UIElement): UIElement {
case 'slider': case 'slider':
newElement = new SliderElement(elementModel); newElement = new SliderElement(elementModel);
break; break;
case 'spell-correct':
newElement = new SpellCorrectElement(elementModel);
break;
default: default:
throw new Error(`ElementType ${elementModel.type} not found!`); throw new Error(`ElementType ${elementModel.type} not found!`);
} }
...@@ -114,6 +119,8 @@ export function getComponentFactory( ...@@ -114,6 +119,8 @@ export function getComponentFactory(
return componentFactoryResolver.resolveComponentFactory(DropListComponent); return componentFactoryResolver.resolveComponentFactory(DropListComponent);
case 'slider': case 'slider':
return componentFactoryResolver.resolveComponentFactory(SliderComponent); return componentFactoryResolver.resolveComponentFactory(SliderComponent);
case 'spell-correct':
return componentFactoryResolver.resolveComponentFactory(SpellCorrectComponent);
default: default:
throw new Error('unknown element'); throw new Error('unknown element');
} }
......
...@@ -80,5 +80,10 @@ ...@@ -80,5 +80,10 @@
<mat-icon>linear_scale</mat-icon> <mat-icon>linear_scale</mat-icon>
Schieberegler Schieberegler
</button> </button>
<button mat-raised-button (click)="addUIElement('spell-correct')"
draggable="true" (dragstart)="$event.dataTransfer?.setData('elementType','spell-correct')">
<mat-icon>format_strikethrough</mat-icon>
Wort korrigieren
</button>
</mat-tab> </mat-tab>
</mat-tab-group> </mat-tab-group>
...@@ -18,6 +18,12 @@ ...@@ -18,6 +18,12 @@
(input)="updateModel('label', $any($event.target).value)"> (input)="updateModel('label', $any($event.target).value)">
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="combinedProperties.buttonLabel !== undefined" appearance="fill">
<mat-label>{{'propertiesPanel.spellCorrectButtonLabel' | translate }}</mat-label>
<input matInput type="text" [value]="combinedProperties.buttonLabel"
(input)="updateModel('buttonLabel', $any($event.target).value)">
</mat-form-field>
<ng-container *ngIf="combinedProperties.text"> <ng-container *ngIf="combinedProperties.text">
{{'propertiesPanel.text' | translate }} {{'propertiesPanel.text' | translate }}
<div class="text-text" [innerHTML]="$any(combinedProperties.text) | safeResourceHTML" <div class="text-text" [innerHTML]="$any(combinedProperties.text) | safeResourceHTML"
......
...@@ -115,7 +115,8 @@ ...@@ -115,7 +115,8 @@
"onlyOneItem": "Nur ein erlaubtes Element", "onlyOneItem": "Nur ein erlaubtes Element",
"duplicateElement": "Element duplizieren", "duplicateElement": "Element duplizieren",
"deleteElement": "Element löschen", "deleteElement": "Element löschen",
"noElementSelected": "Kein Element ausgewählt" "noElementSelected": "Kein Element ausgewählt",
"spellCorrectButtonLabel": "Wort zum Korrigieren"
}, },
"player": { "player": {
"autoStart": "Autostart", "autoStart": "Autostart",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment