Skip to content

Commit 078dda0

Browse files
authored
Merge pull request #229 from negue/fix/ready-to-release
List of fixes for 2021.2
2 parents da1dc8a + 541fb4c commit 078dda0

File tree

21 files changed

+204
-105
lines changed

21 files changed

+204
-105
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
## Unreleased
1+
## 2021.2.0
22

3-
* [x] Drag&Drop Media in a preview Area
3+
* [x] Drag&Drop Media in the `Assign / arrange media`-View
44
* [x] Select the media folder in Electron with a dialog
55
* [x] Open multiple target screens with one URL
66
* [x] QR-Code to scan a target screen url to open it easier on tablets
7+
* [x] Support full animation list from https://animate.style/
78

89
## 2021.1.2
910

projects/contracts/src/lib/animations.ts

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
export const ATTENTION_SEEKERS = [
32
'animate__bounce',
43
'animate__flash',
@@ -12,6 +11,8 @@ export const ATTENTION_SEEKERS = [
1211
'animate__wobble',
1312
'animate__jello',
1413
'animate__heartBeat',
14+
'animate__flip',
15+
1516
]
1617

1718
export const ANIMATION_IN_ARRAY = [
@@ -20,10 +21,49 @@ export const ANIMATION_IN_ARRAY = [
2021
'animate__backInRight',
2122
'animate__backInUp',
2223
'animate__flipInX',
24+
'animate__flipInY',
2325
'animate__lightSpeedInRight',
26+
'animate__lightSpeedInLeft',
2427
'animate__jackInTheBox',
2528
'animate__rollIn',
2629

30+
"animate__bounceIn",
31+
"animate__bounceInDown",
32+
"animate__bounceInLeft",
33+
"animate__bounceInRight",
34+
"animate__bounceInUp",
35+
36+
"animate__fadeIn",
37+
"animate__fadeInDown",
38+
"animate__fadeInDownBig",
39+
"animate__fadeInLeft",
40+
"animate__fadeInLeftBig",
41+
"animate__fadeInRight",
42+
"animate__fadeInRightBig",
43+
"animate__fadeInUp",
44+
"animate__fadeInUpBig",
45+
"animate__fadeInTopLeft",
46+
"animate__fadeInTopRight",
47+
"animate__fadeInBottomLeft",
48+
"animate__fadeInBottomRight",
49+
50+
"animate__rotateIn",
51+
"animate__rotateInDownLeft",
52+
"animate__rotateInDownRight",
53+
"animate__rotateInUpLeft",
54+
"animate__rotateInUpRight",
55+
56+
"animate__zoomIn",
57+
"animate__zoomInDown",
58+
"animate__zoomInLeft",
59+
"animate__zoomInRight",
60+
"animate__zoomInUp",
61+
62+
"animate__slideInDown",
63+
"animate__slideInLeft",
64+
"animate__slideInRight",
65+
"animate__slideInUp",
66+
2767
...ATTENTION_SEEKERS
2868
];
2969

@@ -32,7 +72,50 @@ export const ANIMATION_OUT_ARRAY = [
3272
'animate__backOutLeft',
3373
'animate__backOutRight',
3474
'animate__backOutUp',
75+
'animate__bounceOut',
76+
'animate__bounceOutDown',
77+
'animate__bounceOutLeft',
3578
'animate__bounceOutRight',
79+
'animate__bounceOutUp',
80+
81+
82+
"animate__fadeOut",
83+
"animate__fadeOutDown",
84+
"animate__fadeOutDownBig",
85+
"animate__fadeOutLeft",
86+
"animate__fadeOutLeftBig",
87+
"animate__fadeOutRight",
88+
"animate__fadeOutRightBig",
89+
"animate__fadeOutUp",
90+
"animate__fadeOutUpBig",
91+
"animate__fadeOutTopLeft",
92+
"animate__fadeOutTopRight",
93+
"animate__fadeOutBottomRight",
94+
"animate__fadeOutBottomLeft",
95+
96+
"animate__lightSpeedOutRight",
97+
"animate__lightSpeedOutLeft",
98+
99+
"animate__flipOutX",
100+
"animate__flipOutY",
101+
102+
"animate__rotateOut",
103+
"animate__rotateOutDownLeft",
104+
"animate__rotateOutDownRight",
105+
"animate__rotateOutUpLeft",
106+
"animate__rotateOutUpRight",
107+
108+
"animate__zoomOut",
109+
"animate__zoomOutDown",
110+
"animate__zoomOutLeft",
111+
"animate__zoomOutRight",
112+
"animate__zoomOutUp",
113+
114+
115+
"animate__slideOutDown",
116+
"animate__slideOutLeft",
117+
"animate__slideOutRight",
118+
"animate__slideOutUp",
36119

37120
'animate__hinge',
38121
'animate__rollOut',

projects/utils/src/lib/dynamicIframe.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Clip } from "@memebox/contracts";
1+
import {Clip} from "@memebox/contracts";
22

33
export interface HtmlExternalFile {
44
type: 'css'|'script';
@@ -69,13 +69,16 @@ export function dynamicIframe (iframe: HTMLIFrameElement,
6969

7070
// HTML => collection HTML-Elements as string
7171

72-
if (content.css) {
73-
elementsToReplace.push(`
74-
<style>
75-
${content.css}
76-
</style>
77-
`);
78-
}
72+
73+
elementsToReplace.push(`
74+
<style>
75+
body {
76+
overflow: hidden;
77+
}
78+
${content.css}
79+
</style>
80+
`);
81+
7982
// add all strings into one? and then apply innerHTML
8083

8184
let targetElement = iframeDocument.body.querySelector('.customHTML');

server/express-server.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,15 @@ app.get(FILE_BY_ID_ENDPOINT, function(req, res){
215215
}
216216

217217
console.error(`file not found: ${mediaId}`);
218+
219+
res.status(404);
220+
res.send({
221+
ok: false
222+
});
218223
});
219224

220225

221-
// TODO use IDs instead of names ?
222-
// TODO use express.static ?
223-
// after the json "database" is done
224-
// use filename which is under
226+
// TODO - Remove on the next version
225227
// dev mode : "/src/assets"
226228
// prod mode: "/assets"
227229
app.get(FILE_ENDPOINT, function(req, res){
@@ -251,6 +253,11 @@ app.get(FILE_ENDPOINT, function(req, res){
251253
}
252254

253255
console.error(`file not found: ${firstParam}`);
256+
257+
res.status(404);
258+
res.send({
259+
ok: false
260+
});
254261
});
255262

256263

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
11
import {Pipe, PipeTransform} from '@angular/core';
22
import {EXPRESS_BASE} from "../../state/app.service";
3+
import {Clip, SERVER_URL} from "@memebox/contracts";
34

45
@Pipe({
56
name: 'mediaToUrl'
67
})
78
export class MediaToUrlPipe implements PipeTransform {
89

9-
transform(mediaId: string): string {
10-
return `${EXPRESS_BASE}/fileById/${mediaId}`;
10+
transform(media: Clip, useOldWay = false): string {
11+
if (media.path?.includes(SERVER_URL) && media.id && !useOldWay) {
12+
return `${EXPRESS_BASE}/fileById/${media.id}`;
13+
} else {
14+
// Online URL (not local) OR new media dialog
15+
return replaceholder(media.path);
16+
}
1117
}
1218

1319
}
20+
21+
function replaceholder (value: string): string{
22+
if (value) {
23+
return value.replace(SERVER_URL, EXPRESS_BASE);
24+
}
25+
26+
return '';
27+
}

src/app/core/pipes/pipes.module.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {NgModule} from "@angular/core";
22
import {CommonModule} from "@angular/common";
33

44
import {SafePipe} from "./safe-url/safe-url.pipe";
5-
import {ReplaceholderPipe} from './replaceholder.pipe';
65
import {ReadableMsPipe} from './readable-ms.pipe';
76
import {ClipToIframePipe} from './clip-to-iframe.pipe';
87
import {PositionToStringPipe} from "./position-to-string.pipe";
@@ -11,7 +10,7 @@ import {VisibilityToStringPipe} from "./visibility-to-string.pipe";
1110
import {MediaToUrlPipe} from "./media-to-url.pipe";
1211

1312
const PIPES = [
14-
SafePipe, ReplaceholderPipe,
13+
SafePipe,
1514
ReadableMsPipe, ClipToIframePipe,
1615
PositionToStringPipe, SettingsToSizingTypePipe,
1716
VisibilityToStringPipe, MediaToUrlPipe

src/app/core/pipes/replaceholder.pipe.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/app/manage/media/media-overview/media-info/media-info.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ <h2 class="mat-h2 mediaInfo__titleRow__name">{{info.name}}</h2>
3636
<gewd-auto-scale *ngIf="info.type === 0 && (info.previewUrl || info.path)"
3737
width="300" height="188"
3838
class="mediaInfo__preview__img">
39-
<img [src]="info.id | mediaToUrl | safeurl"
39+
<img [src]="info | mediaToUrl | safeurl"
4040
[alt]="info.name">
4141
</gewd-auto-scale>
4242

src/app/screens/target-screen/target-screen.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
(playing)="addLog('playing', $event)"
4545
(progress)="addLog('progress', $event)"
4646
[class.visible]="mediaToggleVar.isVisible$ | async"
47-
[src]="entry.value.clip.id | mediaToUrl"
47+
[src]="entry.value.clip | mediaToUrl"
4848
[loop]="entry.value.clipSetting.loop"
4949
[volume]="entry.value.clip.volumeSetting / 100"
5050
></video>
@@ -54,7 +54,7 @@
5454
(play)="addLog('play', $event)"
5555
(playing)="addLog('playing', $event)"
5656
[class.visible]="mediaToggleVar.isVisible$ | async"
57-
[src]="entry.value.clip.id | mediaToUrl"
57+
[src]="entry.value.clip | mediaToUrl"
5858
[volume]="entry.value.clip.volumeSetting / 100"
5959
[loop]="entry.value.clipSetting.loop"
6060
controls
@@ -63,7 +63,7 @@
6363
<img #img *ngSwitchCase="0" class="media-clip"
6464
(loadstart)="addToMap(entry.value.clip, img)"
6565
[class.visible]="mediaToggleVar.isVisible$ | async"
66-
[src]="entry.value.clip.id | mediaToUrl"
66+
[src]="entry.value.clip | mediaToUrl"
6767
/>
6868
<iframe #iFrame *ngSwitchCase="3" class="media-clip"
6969
(load)="addToMap(entry.value.clip, iFrame)"

src/app/screens/target-screen/target-screen.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {AppService} from "../../state/app.service";
99
import {ActivatedRoute} from "@angular/router";
1010
import {KeyValue} from "@angular/common";
1111
import {ConnectionState, WebsocketService} from "../../core/services/websocket.service";
12-
import {replaceholder} from "../../core/pipes/replaceholder.pipe";
1312

1413
// TODO Extract Target-Screen Component from the PAGE itself
1514

@@ -51,8 +50,7 @@ export class TargetScreenComponent implements OnInit, OnDestroy {
5150
result[key] = {
5251
clipSetting: entry,
5352
clip: {
54-
...allClips[key],
55-
path: replaceholder(allClips?.[key]?.path)
53+
...allClips[key]
5654
},
5755
backgroundColor: this.random_rgba()
5856
}

src/app/shared/components/clip-preview/clip-preview.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
[style.width]="width"
66

77
[style.--clip-setting-img-fit]="setting?.imgFit"
8-
[src]="clip.id | mediaToUrl"
8+
[src]="clip | mediaToUrl: useOldPathEndpoint"
99
draggable="false"/>
1010

1111
<!-- Iframe => Iframe -->
12-
<div *ngSwitchCase="MediaType.IFrame">
12+
<ng-container *ngSwitchCase="MediaType.IFrame">
1313
<ng-container *ngIf="(height || width) || !showIframe; else canShowIframe">
1414
<app-clip-type [type]="clip.type"
1515
[iconSize]="height || width"></app-clip-type>
@@ -21,7 +21,7 @@
2121
[src]="clip.path | safeurl"
2222
></iframe>
2323
</ng-template>
24-
</div>
24+
</ng-container>
2525

2626

2727
<!-- All others => AppClipType -->

src/app/shared/components/clip-preview/clip-preview.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ export class ClipPreviewComponent implements OnInit {
2323
@Input()
2424
public showIframe = true;
2525

26+
@Input()
27+
public useOldPathEndpoint = false;
28+
2629
constructor() { }
2730

2831
ngOnInit(): void {

src/app/shared/components/filter/filter.component.scss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
.filterRow__icon {
2222
margin-right: 1rem;
23-
height: 4rem;
24-
width: 4rem;
23+
height: 3rem;
24+
width: 3rem;
2525
}
2626

2727
.filterChip {
@@ -40,3 +40,7 @@
4040
.filterEntry__icon {
4141
margin-right: 0.5rem;
4242
}
43+
44+
mat-chip-list {
45+
flex: 1;
46+
}

src/app/shared/dialogs/clip-assigning-dialog/clip-assigning-dialog.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ <h1 mat-dialog-title>Choose media for "{{ data.dialogTitle }}"</h1>
1919

2020
</app-clip-type>
2121
{{clip.name}}</figcaption>
22-
<img [alt]="clip.name" [src]="clip.path | replaceholder" class="mediaList__img"/>
22+
<img [alt]="clip.name" [src]="clip | mediaToUrl" class="mediaList__img"/>
2323
</figure>
2424

2525
<span *ngIf="clip.type === 1" class="mediaList__audioContainer">

src/app/shared/dialogs/media-edit/media-edit.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ <h3>Assigned Clips by Tags</h3>
210210
<!-- All others => AppClipType -->
211211
<gewd-auto-scale width="500" height="500"
212212
*ngSwitchDefault>
213-
<app-clip-preview [clip]="form.value">
213+
<app-clip-preview [clip]="form.value"
214+
[useOldPathEndpoint]="true">
214215

215216
</app-clip-preview>
216217
</gewd-auto-scale>

0 commit comments

Comments
 (0)