X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;h=0b25ccd81841e26fe60f5b0e5660c9bc19ea6b08;hb=6940f7d3df4f6164bfc69a9393a0f5796627b880;hp=b9faa863355e59ffcf4ca749170eab0997b86508;hpb=50df1b89ec5ffdda556713c18e5e67365b84b41a;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index b9faa86..0b25ccd 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -260,7 +260,7 @@ public class WebInterface implements SessionProvider { private final ElementLoader elementLoader; private final LinkedElementRenderFilter linkedElementRenderFilter; private final TimeTextConverter timeTextConverter = new TimeTextConverter(); - private final L10nFilter l10nFilter = new L10nFilter(this); + private final L10nFilter l10nFilter; /** The “new Sone” notification. */ private final ListNotification newSoneNotification; @@ -320,6 +320,7 @@ public class WebInterface implements SessionProvider { this.elementLoader = elementLoader; formPassword = sonePlugin.pluginRespirator().getToadletContainer().getFormPassword(); soneTextParser = new SoneTextParser(getCore(), getCore()); + l10nFilter = new L10nFilter(getL10n()); templateContextFactory = new TemplateContextFactory(); templateContextFactory.addAccessor(Object.class, new ReflectionAccessor()); @@ -337,7 +338,7 @@ public class WebInterface implements SessionProvider { templateContextFactory.addFilter("html", new HtmlFilter()); templateContextFactory.addFilter("replace", new ReplaceFilter()); templateContextFactory.addFilter("store", new StoreFilter()); - templateContextFactory.addFilter("l10n", new L10nFilter(this)); + templateContextFactory.addFilter("l10n", l10nFilter); templateContextFactory.addFilter("substring", new SubstringFilter()); templateContextFactory.addFilter("xml", new XmlFilter()); templateContextFactory.addFilter("change", new RequestChangeFilter()); @@ -346,14 +347,14 @@ public class WebInterface implements SessionProvider { templateContextFactory.addFilter("js", new JavascriptFilter()); templateContextFactory.addFilter("parse", parserFilter = new ParserFilter(getCore(), soneTextParser)); templateContextFactory.addFilter("shorten", shortenFilter = new ShortenFilter()); - templateContextFactory.addFilter("render", renderFilter = new RenderFilter(getCore(), templateContextFactory)); + templateContextFactory.addFilter("render", renderFilter = new RenderFilter(getCore(), soneTextParser, new HtmlFilter())); templateContextFactory.addFilter("linked-elements", new LinkedElementsFilter(elementLoader)); templateContextFactory.addFilter("render-linked-element", linkedElementRenderFilter = new LinkedElementRenderFilter(templateContextFactory)); templateContextFactory.addFilter("reparse", new ReparseFilter()); templateContextFactory.addFilter("unknown", new UnknownDateFilter(getL10n(), "View.Sone.Text.UnknownDate")); templateContextFactory.addFilter("format", new FormatFilter()); templateContextFactory.addFilter("sort", new CollectionSortFilter()); - templateContextFactory.addFilter("image-link", new ImageLinkFilter(getCore(), templateContextFactory)); + templateContextFactory.addFilter("image-link", new ImageLinkFilter(getCore())); templateContextFactory.addFilter("replyGroup", new ReplyGroupFilter()); templateContextFactory.addFilter("in", new ContainsFilter()); templateContextFactory.addFilter("unique", new UniqueElementFilter()); @@ -753,7 +754,7 @@ public class WebInterface implements SessionProvider { pageToadlets.add(pageToadletFactory.createPageToadlet(new LogoutPage(emptyTemplate, this), "Logout")); pageToadlets.add(pageToadletFactory.createPageToadlet(new OptionsPage(optionsTemplate, this), "Options")); pageToadlets.add(pageToadletFactory.createPageToadlet(new RescuePage(rescueTemplate, this), "Rescue")); - pageToadlets.add(pageToadletFactory.createPageToadlet(new AboutPage(aboutTemplate, this, new PluginVersion(SonePlugin.getPluginVersion()), new PluginYear(SonePlugin.getYear()), new PluginHomepage(SonePlugin.getHomepage())), "About")); + pageToadlets.add(pageToadletFactory.createPageToadlet(new AboutPage(aboutTemplate, this, new PluginVersion(SonePlugin.getPluginVersion()), new PluginYear(sonePlugin.getYear()), new PluginHomepage(sonePlugin.getHomepage())), "About")); pageToadlets.add(pageToadletFactory.createPageToadlet(new SoneTemplatePage("noPermission.html", this, noPermissionTemplate, "Page.NoPermission.Title"))); pageToadlets.add(pageToadletFactory.createPageToadlet(new SoneTemplatePage("emptyImageTitle.html", this, emptyImageTitleTemplate, "Page.EmptyImageTitle.Title"))); pageToadlets.add(pageToadletFactory.createPageToadlet(new SoneTemplatePage("emptyAlbumTitle.html", this, emptyAlbumTitleTemplate, "Page.EmptyAlbumTitle.Title")));