From: David ‘Bombe’ Roden Date: Sat, 9 Mar 2019 16:50:07 +0000 (+0100) Subject: ♻️ Move constants out of the class X-Git-Tag: v79^2~78 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=7b1d9fb2dfd7859118d48d347becd08b88521586;p=Sone.git ♻️ Move constants out of the class --- diff --git a/src/main/kotlin/net/pterodactylus/sone/template/LinkedElementRenderFilter.kt b/src/main/kotlin/net/pterodactylus/sone/template/LinkedElementRenderFilter.kt index 4536c04..1ecc0dd 100644 --- a/src/main/kotlin/net/pterodactylus/sone/template/LinkedElementRenderFilter.kt +++ b/src/main/kotlin/net/pterodactylus/sone/template/LinkedElementRenderFilter.kt @@ -13,12 +13,6 @@ import javax.inject.Inject */ class LinkedElementRenderFilter @Inject constructor(private val templateContextFactory: TemplateContextFactory): Filter { - companion object { - private val loadedImageTemplate = """<%include linked/image.html>""".asTemplate() - private val loadedHtmlPageTemplate = """<%include linked/html-page.html>""".asTemplate() - private val notLoadedImageTemplate = """<%include linked/notLoaded.html>""".asTemplate() - } - override fun format(templateContext: TemplateContext?, data: Any?, parameters: Map?) = when { data is LinkedElement && data.loading -> renderNotLoadedLinkedElement(data) @@ -51,3 +45,7 @@ class LinkedElementRenderFilter @Inject constructor(private val templateContextF }.toString() } + +private val loadedImageTemplate = """<%include linked/image.html>""".asTemplate() +private val loadedHtmlPageTemplate = """<%include linked/html-page.html>""".asTemplate() +private val notLoadedImageTemplate = """<%include linked/notLoaded.html>""".asTemplate()