You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
38 lines
1.1 KiB
// @ts-ignore
|
|
import * as alertify from "alertifyjs";
|
|
import { NotificationService } from "./NotificationService";
|
|
import log = require("loglevel");
|
|
import bootbox = require("bootbox");
|
|
export class AlertifyNotificationService implements NotificationService {
|
|
private readonly _alertify = alertify;
|
|
constructor() {
|
|
this._alertify.set("notifier", "position", "top-center");
|
|
}
|
|
success(message: string): void {
|
|
this._alertify.success(message);
|
|
}
|
|
error(message: string): void {
|
|
this._alertify.error(message);
|
|
}
|
|
errorWithDelay(message: string, delay: number): void {
|
|
const _delay = this._alertify.get("notifier", "delay");
|
|
this._alertify.set("notifier", "delay", delay);
|
|
this._alertify.error(message);
|
|
this._alertify.set("notifier", "delay", _delay);
|
|
}
|
|
warning(message: string): void {
|
|
this._alertify.warning(message);
|
|
}
|
|
message(message: string): void {
|
|
this._alertify.message(message);
|
|
}
|
|
passphrasePrompt(
|
|
cb: (result: string) => void
|
|
): void {
|
|
bootbox.prompt({
|
|
title: "Please enter the passphrase",
|
|
inputType: "password",
|
|
callback: cb
|
|
});
|
|
}
|
|
}
|