X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fnotification%2FNotificationHandlerModule.kt;h=3728620d7b87023991c8dc4b67ffb5bbac1bd515;hb=8281d81a4412af542753a4fc56b2c1a8c52000d4;hp=09cf0cb4e0f439edb44b0f069705752076d1a084;hpb=05ebea72f846cf147a51938b15e6f0cd93773f4e;p=Sone.git diff --git a/src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModule.kt b/src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModule.kt index 09cf0cb..3728620 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModule.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModule.kt @@ -43,6 +43,7 @@ class NotificationHandlerModule : AbstractModule() { bind().asSingleton() bind().asSingleton() bind().asSingleton() + bind().asSingleton() } @Provides @@ -87,6 +88,24 @@ class NotificationHandlerModule : AbstractModule() { fun getNewVersionNotification(loaders: Loaders) = TemplateNotification("new-version-notification", loaders.loadTemplate("/templates/notify/newVersionNotification.html")) + @Provides + @Singleton + @Named("imageInserting") + fun getImageInsertingNotification(loaders: Loaders) = + ListNotification("inserting-images-notification", "images", loaders.loadTemplate("/templates/notify/inserting-images-notification.html"), dismissable = true) + + @Provides + @Singleton + @Named("imageFailed") + fun getImageInsertingFailedNotification(loaders: Loaders) = + ListNotification("image-insert-failed-notification", "images", loaders.loadTemplate("/templates/notify/image-insert-failed-notification.html"), dismissable = true) + + @Provides + @Singleton + @Named("imageInserted") + fun getImageInsertedNotification(loaders: Loaders) = + ListNotification("inserted-images-notification", "images", loaders.loadTemplate("/templates/notify/inserted-images-notification.html"), dismissable = true) + private inline fun bind(): AnnotatedBindingBuilder = bind(T::class.java) private fun ScopedBindingBuilder.asSingleton() = `in`(Singleton::class.java)