OpenSlides/client/src/app/site/projector/models/view-countdown.ts

71 lines
1.9 KiB
TypeScript
Raw Normal View History

import { Countdown } from 'app/shared/models/core/countdown';
import { BaseProjectableViewModel } from 'app/site/base/base-projectable-view-model';
import { ProjectorElementBuildDeskriptor } from 'app/site/base/projectable';
import { BaseViewModel } from 'app/site/base/base-view-model';
export class ViewCountdown extends BaseProjectableViewModel {
2019-02-12 09:25:56 +01:00
public static COLLECTIONSTRING = Countdown.COLLECTIONSTRING;
private _countdown: Countdown;
public get countdown(): Countdown {
return this._countdown;
}
public get id(): number {
return this.countdown.id;
}
2019-02-14 16:02:18 +01:00
public get running(): boolean {
return this.countdown.running;
}
public get default_time(): number {
return this.countdown.default_time;
}
public get countdown_time(): number {
return this.countdown.countdown_time;
}
public get description(): string {
return this.countdown.description;
}
2019-02-08 16:02:46 +01:00
/**
* This is set by the repository
*/
public getVerboseName;
public constructor(countdown: Countdown) {
2019-02-08 16:02:46 +01:00
super(Countdown.COLLECTIONSTRING);
this._countdown = countdown;
}
2019-02-08 16:02:46 +01:00
public getTitle = () => {
return this.description;
2019-02-08 16:02:46 +01:00
};
public updateDependencies(update: BaseViewModel): void {}
public getSlide(): ProjectorElementBuildDeskriptor {
return {
2019-02-14 16:02:18 +01:00
getBasicProjectorElement: options => ({
stable: true,
name: Countdown.COLLECTIONSTRING,
id: this.id,
getIdentifiers: () => ['name', 'id']
}),
2019-02-14 16:02:18 +01:00
slideOptions: [
{
key: 'fullscreen',
displayName: 'Fullscreen',
default: false
}
],
projectionDefaultName: 'countdowns',
2019-02-15 12:17:08 +01:00
getDialogTitle: () => this.getTitle()
};
}
}