Class HtmlImportShim
java.lang.Object
org.nustaq.kontraktor.webapp.javascript.HtmlImportShim
Created by ruedi on 16/07/15.
inline all html imports of given file recursively (incl. adaption of pathes)
optionally also minify javascript code on the fly.
also inlines css files
similar to polymer's vulcanize.
by specifying 'no-inline=true' on a script tag one can exclude specific script tags
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected KUrlcomputeAssetPath(KUrl containingFileUrl, String href) inline(boolean inline) voidinlineScripts(KUrl containingFileUrl, HashSet<KUrl> visited, List<Runnable> changes, org.jsoup.nodes.Element doc) voidinlineScripts(KUrl containingFileUrl, HashSet<KUrl> visited, List<Runnable> changes, org.jsoup.select.Elements scripts) jsPostProcessors(List<JSPostProcessor> jsPostProcessors) locateResource(KUrl urlPath) static voidminify(boolean minify) voidsetJSPostProcessors(List<JSPostProcessor> JSPostProcessors) voidsetLocator(HtmlImportShim.ResourceLocator locator) org.jsoup.nodes.ElementshimImports(String htmlFile) org.jsoup.nodes.ElementshimImports(KUrl containingFileUrl, HashSet<KUrl> visited, List<List<org.jsoup.nodes.Node>> bodyContent) voidshimLink(KUrl containingFileUrl, HashSet<KUrl> visited, List<List<org.jsoup.nodes.Node>> bodyContent, List<Runnable> changes, org.jsoup.nodes.Element link) stripComments(boolean stripComments) voidstripComments(org.jsoup.nodes.Document doc)
-
Constructor Details
-
HtmlImportShim
-
HtmlImportShim
-
-
Method Details
-
inline
-
jsPostProcessors
-
setJSPostProcessors
-
locateResource
-
setLocator
-
shimImports
- Throws:
IOException
-
computeAssetPath
-
shimImports
public org.jsoup.nodes.Element shimImports(KUrl containingFileUrl, HashSet<KUrl> visited, List<List<org.jsoup.nodes.Node>> bodyContent) throws IOException - Throws:
IOException
-
shimLink
public void shimLink(KUrl containingFileUrl, HashSet<KUrl> visited, List<List<org.jsoup.nodes.Node>> bodyContent, List<Runnable> changes, org.jsoup.nodes.Element link) throws IOException - Throws:
IOException
-
inlineScripts
public void inlineScripts(KUrl containingFileUrl, HashSet<KUrl> visited, List<Runnable> changes, org.jsoup.nodes.Element doc) throws IOException - Throws:
IOException
-
inlineScripts
public void inlineScripts(KUrl containingFileUrl, HashSet<KUrl> visited, List<Runnable> changes, org.jsoup.select.Elements scripts) throws IOException - Throws:
IOException
-
stripComments
public void stripComments(org.jsoup.nodes.Document doc) -
getBaseUrl
-
stripComments
-
minify
-
main
- Throws:
IOException
-