♻️ Move constants out of the class
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 9 Mar 2019 16:50:07 +0000 (17:50 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 9 Mar 2019 16:50:07 +0000 (17:50 +0100)
src/main/kotlin/net/pterodactylus/sone/template/LinkedElementRenderFilter.kt

index 4536c04..1ecc0dd 100644 (file)
@@ -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<String, Any?>?) =
                        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()