This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class StringRenderer { | |
private static final String RENDER_FUNCTION_NAME = "render"; | |
private final Resource resourceBundle; | |
private final ScriptingEngine engine; | |
public StringRenderer(Resource resourceBundle, ScriptingEngine engine) { | |
this.resourceBundle = resourceBundle; | |
this.engine = engine; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> | |
<style> | |
.navbar + .container { | |
margin-top: 2rem; | |
} | |
</style> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Solution based on https://stackoverflow.com/questions/50295703/create-custom-elements-v1-in-es5-not-es6 | |
(defn define-element! [name on-connect] | |
(let [my-el (fn [] (this-as this (.construct js/Reflect js/HTMLElement #js [] (.-constructor this)))) | |
_ (set! (.. my-el -prototype) (.create js/Object (.-prototype js/HTMLElement))) | |
_ (set! (.. my-el -prototype -constructor) my-el) | |
_ (.setPrototypeOf js/Object my-el js/HTMLElement) | |
_ (set! (.. my-el -prototype -connectedCallback) on-connect)] | |
(.define js/customElements name my-el))) | |
(define-element! :my-element #(.log js/console "hi!")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Responsive Nav</title> | |
<style> | |
:root { | |
--space-xs: 0.25rem; | |
--space-sm: 0.5rem; | |
--space-md: 0.75rem; | |
--space-lg: 1.25rem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package my.lovely.pkg; | |
import org.complate.core.ComplateRenderer; | |
import org.complate.core.ComplateSource; | |
import org.complate.graal.GraalComplateRenderer; | |
import org.complate.spring.mvc.ComplateViewResolver; | |
import org.complate.spring.source.ResourceComplateSource; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; |