Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async openDeckActions($event: UIEvent) {
if (!$event || !$event.detail) {
return;
}
const popover: HTMLIonPopoverElement = await popoverController.create({
component: 'app-more-actions',
event: $event,
mode: 'ios'
});
popover.onDidDismiss().then(async (detail: OverlayEventDetail) => {
if (detail && detail.data) {
if (detail.data.action === MoreAction.FULLSCREEN) {
await this.toggleFullScreenMode();
} else if (detail.data.action === MoreAction.JUMP_TO) {
await this.openSlideNavigate();
} else if (detail.data.action === MoreAction.REMOTE) {
await this.openRemoteControl();
} else if (detail.data.action === MoreAction.SHARE) {
this.openShare.emit();
} else if (detail.data.action === MoreAction.PUBLISH) {
async openSettings(ev: Event) {
console.log(ev);
const popover = await popoverCtrl.create({
component: 'app-settings',
event: ev,
cssClass: 'settingsPopover',
showBackdrop: navigator.userAgent.includes('iPad') === false && window.matchMedia("(min-width: 1200px)").matches ? false : true
});
await popover.present();
}
async openSettings(ev: Event) {
console.log(ev);
const popover = await popoverCtrl.create({
component: 'app-settings',
event: ev,
cssClass: 'settingsPopover',
showBackdrop: navigator.userAgent.includes('iPad') === false && window.matchMedia("(min-width: 1200px)").matches ? false : true
});
await popover.present();
}
async openShareOptions($event: UIEvent) {
if (!$event || !$event.detail) {
return;
}
const popover: HTMLIonPopoverElement = await popoverController.create({
component: 'app-more-share-options',
event: $event,
mode: 'ios'
});
popover.onDidDismiss().then(async (detail: OverlayEventDetail) => {
if (detail && detail.data) {
if (detail.data.action === MoreAction.SHARE) {
this.openShare.emit();
} else if (detail.data.action === MoreAction.PUBLISH) {
this.actionPublish.emit();
}
}
});
await popover.present();
async turnAI(ev) {
if (window.matchMedia("(min-width: 1200px)").matches) {
const popover = await popoverCtrl.create({
component: 'ai-popover',
event: ev,
cssClass: "aiPopover",
showBackdrop: navigator.userAgent.includes('iPad') === false && window.matchMedia("(min-width: 1200px)").matches ? false : true
})
await popover.present();
}
else {
const modal = await modalCtrl.create({
component: 'ai-popover',
showBackdrop: navigator.userAgent.includes('iPad') === false && window.matchMedia("(min-width: 1200px)").matches ? false : true
});
await modal.present();
}
private async openGetHelp() {
const popover: HTMLIonPopoverElement = await popoverController.create({
component: 'app-get-help',
mode: 'ios',
cssClass: 'info'
});
await popover.present();
}
async openLoginPop(ev: Event) {
const popover = await popoverCtrl.create({
component: 'login-pop',
event: ev,
showBackdrop: window.matchMedia("(min-width: 1200px)").matches ? false : true
});
await popover.present();
}
private async openFullscreenInfo() {
const infoDisplayedOnce: boolean = await get('deckdeckgo_display_fullscreen_info');
if (infoDisplayedOnce) {
return;
}
const popover: HTMLIonPopoverElement = await popoverController.create({
component: 'app-fullscreen-info',
mode: 'ios',
cssClass: 'info'
});
popover.onDidDismiss().then(async (_detail: OverlayEventDetail) => {
await set('deckdeckgo_display_fullscreen_info', true);
});
await popover.present();
}
create(options: PopoverOptions) {
return _popoverController.create({
...options,
delegate,
});
}
};