2019-01-19 21:55:06 +01:00
|
|
|
import { Countdown } from 'app/shared/models/core/countdown';
|
2019-02-01 13:56:08 +01:00
|
|
|
import { BaseProjectableViewModel } from 'app/site/base/base-projectable-view-model';
|
2019-01-24 16:25:50 +01:00
|
|
|
import { ProjectorElementBuildDeskriptor } from 'app/site/base/projectable';
|
2019-02-01 13:56:08 +01:00
|
|
|
import { BaseViewModel } from 'app/site/base/base-view-model';
|
2019-01-24 16:25:50 +01:00
|
|
|
|
2019-02-01 13:56:08 +01:00
|
|
|
export class ViewCountdown extends BaseProjectableViewModel {
|
2019-02-12 09:25:56 +01:00
|
|
|
public static COLLECTIONSTRING = Countdown.COLLECTIONSTRING;
|
|
|
|
|
2019-01-24 16:25:50 +01:00
|
|
|
private _countdown: Countdown;
|
|
|
|
|
|
|
|
public get countdown(): Countdown {
|
2019-02-01 13:56:08 +01:00
|
|
|
return this._countdown;
|
2019-01-24 16:25:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public get id(): number {
|
2019-02-01 13:56:08 +01:00
|
|
|
return this.countdown.id;
|
2019-01-24 16:25:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public get description(): string {
|
2019-02-01 13:56:08 +01:00
|
|
|
return this.countdown.description;
|
2019-01-24 16:25:50 +01:00
|
|
|
}
|
|
|
|
|
2019-02-08 16:02:46 +01:00
|
|
|
/**
|
|
|
|
* This is set by the repository
|
|
|
|
*/
|
|
|
|
public getVerboseName;
|
|
|
|
|
2019-02-01 13:56:08 +01:00
|
|
|
public constructor(countdown: Countdown) {
|
2019-02-08 16:02:46 +01:00
|
|
|
super(Countdown.COLLECTIONSTRING);
|
2019-01-24 16:25:50 +01:00
|
|
|
this._countdown = countdown;
|
|
|
|
}
|
|
|
|
|
2019-02-08 16:02:46 +01:00
|
|
|
public getTitle = () => {
|
2019-01-24 16:25:50 +01:00
|
|
|
return this.description;
|
2019-02-08 16:02:46 +01:00
|
|
|
};
|
2019-01-24 16:25:50 +01:00
|
|
|
|
2019-02-01 13:56:08 +01:00
|
|
|
public updateDependencies(update: BaseViewModel): void {}
|
2019-01-24 16:25:50 +01:00
|
|
|
|
|
|
|
public getSlide(): ProjectorElementBuildDeskriptor {
|
|
|
|
return {
|
|
|
|
getBasicProjectorElement: () => ({
|
|
|
|
stable: true,
|
|
|
|
name: Countdown.COLLECTIONSTRING,
|
|
|
|
id: this.id,
|
|
|
|
getIdentifiers: () => ['name', 'id']
|
|
|
|
}),
|
|
|
|
slideOptions: [],
|
|
|
|
projectionDefaultName: 'countdowns',
|
|
|
|
getTitle: () => this.getTitle()
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|