diff --git a/core/src/main/java/com/themecleanflex/models/ButtonModel.java b/core/src/main/java/com/themecleanflex/models/ButtonModel.java new file mode 100644 index 00000000..d541c744 --- /dev/null +++ b/core/src/main/java/com/themecleanflex/models/ButtonModel.java @@ -0,0 +1,657 @@ +package com.themecleanflex.models; + +import com.peregrine.nodetypes.models.AbstractComponent; +import com.peregrine.nodetypes.models.IComponent; +import com.peregrine.nodetypes.models.Container; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.models.annotations.Default; +import org.apache.sling.models.annotations.DefaultInjectionStrategy; +import org.apache.sling.models.annotations.Exporter; +import org.apache.sling.models.annotations.Model; +import java.util.List; + +import javax.inject.Inject; +import javax.inject.Named; + + + +/* + //GEN[:DATA + { + "definitions": { + "Button": { + "type": "object", + "x-type": "component", + "properties": { + "submitfunction": { + "type": "string", + "x-source": "inject", + "x-form-label": "Javascript function to call on submit", + "x-form-hint": "Function must accept (model, formdata)", + "x-form-type": "text", + "x-form-group": "content", + "x-default": "" + }, + "submittext": { + "type": "string", + "x-source": "inject", + "x-form-label": "Submit Button Text", + "x-form-type": "text", + "x-form-group": "content", + "x-default": "Submit" + }, + "submitsize": { + "type": "string", + "x-source": "inject", + "x-form-label": "Submit button size", + "x-form-type": "materialselect", + "x-form-group": "style", + "x-default": "normal", + "properties": { + "section": { + "x-form-name": "normal", + "x-form-value": "normal" + }, + "small": { + "x-form-name": "small", + "x-form-value": "small" + }, + "large": { + "x-form-name": "large", + "x-form-value": "large" + }, + "full": { + "x-form-name": "full width", + "x-form-value": "full" + } + } + }, + "submitalignment": { + "type": "string", + "x-source": "inject", + "x-form-label": "Submit button alignment", + "x-form-type": "materialselect", + "x-form-group": "style", + "x-default": "start", + "properties": { + "start": { + "x-form-name": "start", + "x-form-value": "start" + }, + "center": { + "x-form-name": "center", + "x-form-value": "center" + }, + "end": { + "x-form-name": "end", + "x-form-value": "end" + } + } + }, + "successpage": { + "type": "string", + "x-source": "inject", + "x-form-type": "pathbrowser", + "x-form-label": "Submit Success Page", + "x-form-group": "content", + "x-form-browserRoot": "/content/themecleanflex/pages" + }, + "bgref": { + "x-form-type": "reference", + "type": "object", + "x-type": "component", + "properties": { + "anchorname": { + "type": "string", + "x-source": "inject", + "x-form-label": "Anchor Name", + "x-form-group": "advanced", + "x-form-type": "text" + }, + "extraclasses": { + "type": "string", + "x-source": "inject", + "x-form-label": "Additonal Classes", + "x-form-group": "advanced", + "x-form-type": "text" + }, + "htmlelement": { + "type": "string", + "x-form-group": "advanced", + "x-source": "inject", + "x-form-label": "Semantic Element", + "x-form-type": "materialselect", + "x-default": "section", + "properties": { + "section": { + "x-form-name": "section", + "x-form-value": "section" + }, + "article": { + "x-form-name": "article", + "x-form-value": "article" + }, + "main": { + "x-form-name": "main", + "x-form-value": "main" + }, + "div": { + "x-form-name": "div", + "x-form-value": "div" + }, + "header": { + "x-form-name": "header", + "x-form-value": "header" + }, + "nav": { + "x-form-name": "nav", + "x-form-value": "nav" + }, + "footer": { + "x-form-name": "footer", + "x-form-value": "footer" + } + } + }, + "colorscheme": { + "type": "string", + "x-source": "inject", + "x-form-label": "Block Color Scheme", + "x-form-type": "materialradio", + "x-form-group": "style", + "x-default": "", + "properties": { + "none": { + "x-form-name": "None", + "x-form-value": "" + }, + "light": { + "x-form-name": "Light", + "x-form-value": "light" + }, + "dark": { + "x-form-name": "Dark", + "x-form-value": "dark" + } + } + }, + "custombackground": { + "type": "string", + "x-source": "inject", + "x-form-label": "Custom Background", + "x-form-group": "style", + "x-form-type": "materialswitch", + "x-default": "false" + }, + "backgroundtype": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Type", + "x-form-group": "style", + "x-form-type": "materialradio", + "x-form-visible": "model.custombackground == 'true'", + "properties": { + "color": { + "x-form-name": "Color", + "x-form-value": "color" + }, + "gradient": { + "x-form-name": "Gradient", + "x-form-value": "gradient" + }, + "image": { + "x-form-name": "Image", + "x-form-value": "image" + }, + "video": { + "x-form-name": "Video", + "x-form-value": "video" + } + } + }, + "bgvideo": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Video", + "x-form-group": "style", + "x-form-type": "pathbrowser", + "x-form-visible": "model.backgroundtype == 'video' and model.custombackground == 'true'", + "x-default": "https://www.youtube.com/embed/Ju86mknumYM", + "x-form-browserRoot": "/content/themecleanflex/assets" + }, + "bgimage": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Image", + "x-form-type": "pathbrowser", + "x-form-group": "style", + "x-form-visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "x-form-browserRoot": "/content/themecleanflex/assets" + }, + "bgxposition": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background X Position", + "x-form-type": "materialrange", + "x-form-group": "style", + "x-form-min": 0, + "x-form-max": 100, + "x-form-visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "x-default": "50" + }, + "bgyposition": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Y Position", + "x-form-group": "style", + "x-form-type": "materialrange", + "x-form-min": 0, + "x-form-max": 100, + "x-form-visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "x-default": "50" + }, + "bgsize": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Size Style", + "x-form-type": "text", + "x-form-group": "style", + "x-default": "cover" + }, + "overlay": { + "type": "string", + "x-source": "inject", + "x-form-label": "Overlay", + "x-form-type": "materialswitch", + "x-form-group": "style", + "x-form-visible": "model.backgroundtype == 'image' and model.custombackground == 'true'" + }, + "overlaycolor": { + "type": "string", + "x-source": "inject", + "x-form-label": "Overlay Color", + "x-form-group": "style", + "x-form-type": "color", + "x-form-visible": "model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'", + "x-default": "#ffffff" + }, + "overlayopacity": { + "type": "string", + "x-source": "inject", + "x-form-label": "Overlay opacity", + "x-form-group": "style", + "x-form-type": "materialrange", + "x-form-min": 0, + "x-form-max": 100, + "x-form-visible": "model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'", + "x-default": "50" + }, + "bgcolor": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Color", + "x-form-group": "style", + "x-form-type": "color", + "x-form-visible": "(model.backgroundtype == 'color' or model.backgroundtype == 'gradient') and model.custombackground == 'true'", + "x-default": "#ffffff" + }, + "color2": { + "type": "string", + "x-source": "inject", + "x-form-label": "Color 2", + "x-form-group": "style", + "x-form-type": "color", + "x-form-visible": "model.backgroundtype == 'gradient' and model.custombackground == 'true'", + "x-default": "#c0c0c0" + }, + "blockwidth": { + "type": "string", + "x-source": "inject", + "x-form-label": "Block Width", + "x-form-type": "materialradio", + "x-form-group": "style", + "x-default": "default", + "properties": { + "default": { + "x-form-name": "Default", + "x-form-value": "default" + }, + "full": { + "x-form-name": "Full Width", + "x-form-value": "full" + }, + "article": { + "x-form-name": "Article Width", + "x-form-value": "article" + } + } + }, + "fullheight": { + "type": "string", + "x-source": "inject", + "x-form-label": "Full Height", + "x-form-type": "materialswitch", + "x-form-group": "style", + "x-default": "false" + }, + "toppadding": { + "type": "string", + "x-source": "inject", + "x-form-label": "Top Padding", + "x-form-type": "materialrange", + "x-form-min": 0, + "x-form-max": 300, + "x-form-group": "style", + "x-form-visible": "model.fullheight != 'true'" + }, + "bottompadding": { + "type": "string", + "x-source": "inject", + "x-form-label": "Bottom Padding", + "x-form-type": "materialrange", + "x-form-min": 0, + "x-form-max": 300, + "x-form-group": "style", + "x-form-visible": "model.fullheight != 'true'" + }, + "contentname": { + "type": "string", + "x-source": "inject", + "x-form-label": "Content Name", + "x-form-group": "advanced", + "x-form-type": "text" + } + } + } + } + } + }, + "name": "Button", + "componentPath": "themecleanflex/components/button", + "package": "com.themecleanflex.models", + "modelName": "Button", + "classNameParent": "AbstractComponent" +} +//GEN] +*/ + +//GEN[:DEF +@Model( + adaptables = Resource.class, + resourceType = "themecleanflex/components/button", + defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL, + adapters = IComponent.class +) +@Exporter( + name = "jackson", + extensions = "json" +) + +//GEN] +public class ButtonModel extends AbstractComponent { + + public ButtonModel(final Resource r) { super(r); } + + //GEN[:INJECT + /* {"type":"string","x-source":"inject","x-form-label":"Javascript function to call on submit","x-form-hint":"Function must accept (model, formdata)","x-form-type":"text","x-form-group":"content","x-default":""} */ + @Inject + @Default(values ="") + private String submitfunction; + + /* {"type":"string","x-source":"inject","x-form-label":"Submit Button Text","x-form-type":"text","x-form-group":"content","x-default":"Submit"} */ + @Inject + @Default(values ="Submit") + private String submittext; + + /* {"type":"string","x-source":"inject","x-form-label":"Submit button size","x-form-type":"materialselect","x-form-group":"style","x-default":"normal","properties":{"section":{"x-form-name":"normal","x-form-value":"normal"},"small":{"x-form-name":"small","x-form-value":"small"},"large":{"x-form-name":"large","x-form-value":"large"},"full":{"x-form-name":"full width","x-form-value":"full"}}} */ + @Inject + @Default(values ="normal") + private String submitsize; + + /* {"type":"string","x-source":"inject","x-form-label":"Submit button alignment","x-form-type":"materialselect","x-form-group":"style","x-default":"start","properties":{"start":{"x-form-name":"start","x-form-value":"start"},"center":{"x-form-name":"center","x-form-value":"center"},"end":{"x-form-name":"end","x-form-value":"end"}}} */ + @Inject + @Default(values ="start") + private String submitalignment; + + /* {"type":"string","x-source":"inject","x-form-type":"pathbrowser","x-form-label":"Submit Success Page","x-form-group":"content","x-form-browserRoot":"/content/themecleanflex/pages"} */ + @Inject + private String successpage; + + /* {"type":"string","x-source":"inject","x-form-label":"Anchor Name","x-form-group":"advanced","x-form-type":"text"} */ + @Inject + private String anchorname; + + /* {"type":"string","x-source":"inject","x-form-label":"Additonal Classes","x-form-group":"advanced","x-form-type":"text"} */ + @Inject + private String extraclasses; + + /* {"type":"string","x-form-group":"advanced","x-source":"inject","x-form-label":"Semantic Element","x-form-type":"materialselect","x-default":"section","properties":{"section":{"x-form-name":"section","x-form-value":"section"},"article":{"x-form-name":"article","x-form-value":"article"},"main":{"x-form-name":"main","x-form-value":"main"},"div":{"x-form-name":"div","x-form-value":"div"},"header":{"x-form-name":"header","x-form-value":"header"},"nav":{"x-form-name":"nav","x-form-value":"nav"},"footer":{"x-form-name":"footer","x-form-value":"footer"}}} */ + @Inject + @Default(values ="section") + private String htmlelement; + + /* {"type":"string","x-source":"inject","x-form-label":"Block Color Scheme","x-form-type":"materialradio","x-form-group":"style","x-default":"","properties":{"none":{"x-form-name":"None","x-form-value":""},"light":{"x-form-name":"Light","x-form-value":"light"},"dark":{"x-form-name":"Dark","x-form-value":"dark"}}} */ + @Inject + @Default(values ="") + private String colorscheme; + + /* {"type":"string","x-source":"inject","x-form-label":"Custom Background","x-form-group":"style","x-form-type":"materialswitch","x-default":"false"} */ + @Inject + @Default(values ="false") + private String custombackground; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Type","x-form-group":"style","x-form-type":"materialradio","x-form-visible":"model.custombackground == 'true'","properties":{"color":{"x-form-name":"Color","x-form-value":"color"},"gradient":{"x-form-name":"Gradient","x-form-value":"gradient"},"image":{"x-form-name":"Image","x-form-value":"image"},"video":{"x-form-name":"Video","x-form-value":"video"}}} */ + @Inject + private String backgroundtype; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Video","x-form-group":"style","x-form-type":"pathbrowser","x-form-visible":"model.backgroundtype == 'video' and model.custombackground == 'true'","x-default":"https://www.youtube.com/embed/Ju86mknumYM","x-form-browserRoot":"/content/themecleanflex/assets"} */ + @Inject + @Default(values ="https://www.youtube.com/embed/Ju86mknumYM") + private String bgvideo; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Image","x-form-type":"pathbrowser","x-form-group":"style","x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-form-browserRoot":"/content/themecleanflex/assets"} */ + @Inject + private String bgimage; + + /* {"type":"string","x-source":"inject","x-form-label":"Background X Position","x-form-type":"materialrange","x-form-group":"style","x-form-min":0,"x-form-max":100,"x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + @Inject + @Default(values ="50") + private String bgxposition; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Y Position","x-form-group":"style","x-form-type":"materialrange","x-form-min":0,"x-form-max":100,"x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + @Inject + @Default(values ="50") + private String bgyposition; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Size Style","x-form-type":"text","x-form-group":"style","x-default":"cover"} */ + @Inject + @Default(values ="cover") + private String bgsize; + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay","x-form-type":"materialswitch","x-form-group":"style","x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'"} */ + @Inject + private String overlay; + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay Color","x-form-group":"style","x-form-type":"color","x-form-visible":"model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"#ffffff"} */ + @Inject + @Default(values ="#ffffff") + private String overlaycolor; + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay opacity","x-form-group":"style","x-form-type":"materialrange","x-form-min":0,"x-form-max":100,"x-form-visible":"model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + @Inject + @Default(values ="50") + private String overlayopacity; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Color","x-form-group":"style","x-form-type":"color","x-form-visible":"(model.backgroundtype == 'color' or model.backgroundtype == 'gradient') and model.custombackground == 'true'","x-default":"#ffffff"} */ + @Inject + @Default(values ="#ffffff") + private String bgcolor; + + /* {"type":"string","x-source":"inject","x-form-label":"Color 2","x-form-group":"style","x-form-type":"color","x-form-visible":"model.backgroundtype == 'gradient' and model.custombackground == 'true'","x-default":"#c0c0c0"} */ + @Inject + @Default(values ="#c0c0c0") + private String color2; + + /* {"type":"string","x-source":"inject","x-form-label":"Block Width","x-form-type":"materialradio","x-form-group":"style","x-default":"default","properties":{"default":{"x-form-name":"Default","x-form-value":"default"},"full":{"x-form-name":"Full Width","x-form-value":"full"},"article":{"x-form-name":"Article Width","x-form-value":"article"}}} */ + @Inject + @Default(values ="default") + private String blockwidth; + + /* {"type":"string","x-source":"inject","x-form-label":"Full Height","x-form-type":"materialswitch","x-form-group":"style","x-default":"false"} */ + @Inject + @Default(values ="false") + private String fullheight; + + /* {"type":"string","x-source":"inject","x-form-label":"Top Padding","x-form-type":"materialrange","x-form-min":0,"x-form-max":300,"x-form-group":"style","x-form-visible":"model.fullheight != 'true'"} */ + @Inject + private String toppadding; + + /* {"type":"string","x-source":"inject","x-form-label":"Bottom Padding","x-form-type":"materialrange","x-form-min":0,"x-form-max":300,"x-form-group":"style","x-form-visible":"model.fullheight != 'true'"} */ + @Inject + private String bottompadding; + + /* {"type":"string","x-source":"inject","x-form-label":"Content Name","x-form-group":"advanced","x-form-type":"text"} */ + @Inject + private String contentname; + + +//GEN] + + //GEN[:GETTERS + /* {"type":"string","x-source":"inject","x-form-label":"Javascript function to call on submit","x-form-hint":"Function must accept (model, formdata)","x-form-type":"text","x-form-group":"content","x-default":""} */ + public String getSubmitfunction() { + return submitfunction; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Submit Button Text","x-form-type":"text","x-form-group":"content","x-default":"Submit"} */ + public String getSubmittext() { + return submittext; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Submit button size","x-form-type":"materialselect","x-form-group":"style","x-default":"normal","properties":{"section":{"x-form-name":"normal","x-form-value":"normal"},"small":{"x-form-name":"small","x-form-value":"small"},"large":{"x-form-name":"large","x-form-value":"large"},"full":{"x-form-name":"full width","x-form-value":"full"}}} */ + public String getSubmitsize() { + return submitsize; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Submit button alignment","x-form-type":"materialselect","x-form-group":"style","x-default":"start","properties":{"start":{"x-form-name":"start","x-form-value":"start"},"center":{"x-form-name":"center","x-form-value":"center"},"end":{"x-form-name":"end","x-form-value":"end"}}} */ + public String getSubmitalignment() { + return submitalignment; + } + + /* {"type":"string","x-source":"inject","x-form-type":"pathbrowser","x-form-label":"Submit Success Page","x-form-group":"content","x-form-browserRoot":"/content/themecleanflex/pages"} */ + public String getSuccesspage() { + return successpage; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Anchor Name","x-form-group":"advanced","x-form-type":"text"} */ + public String getAnchorname() { + return anchorname; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Additonal Classes","x-form-group":"advanced","x-form-type":"text"} */ + public String getExtraclasses() { + return extraclasses; + } + + /* {"type":"string","x-form-group":"advanced","x-source":"inject","x-form-label":"Semantic Element","x-form-type":"materialselect","x-default":"section","properties":{"section":{"x-form-name":"section","x-form-value":"section"},"article":{"x-form-name":"article","x-form-value":"article"},"main":{"x-form-name":"main","x-form-value":"main"},"div":{"x-form-name":"div","x-form-value":"div"},"header":{"x-form-name":"header","x-form-value":"header"},"nav":{"x-form-name":"nav","x-form-value":"nav"},"footer":{"x-form-name":"footer","x-form-value":"footer"}}} */ + public String getHtmlelement() { + return htmlelement; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Block Color Scheme","x-form-type":"materialradio","x-form-group":"style","x-default":"","properties":{"none":{"x-form-name":"None","x-form-value":""},"light":{"x-form-name":"Light","x-form-value":"light"},"dark":{"x-form-name":"Dark","x-form-value":"dark"}}} */ + public String getColorscheme() { + return colorscheme; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Custom Background","x-form-group":"style","x-form-type":"materialswitch","x-default":"false"} */ + public String getCustombackground() { + return custombackground; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Type","x-form-group":"style","x-form-type":"materialradio","x-form-visible":"model.custombackground == 'true'","properties":{"color":{"x-form-name":"Color","x-form-value":"color"},"gradient":{"x-form-name":"Gradient","x-form-value":"gradient"},"image":{"x-form-name":"Image","x-form-value":"image"},"video":{"x-form-name":"Video","x-form-value":"video"}}} */ + public String getBackgroundtype() { + return backgroundtype; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Video","x-form-group":"style","x-form-type":"pathbrowser","x-form-visible":"model.backgroundtype == 'video' and model.custombackground == 'true'","x-default":"https://www.youtube.com/embed/Ju86mknumYM","x-form-browserRoot":"/content/themecleanflex/assets"} */ + public String getBgvideo() { + return bgvideo; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Image","x-form-type":"pathbrowser","x-form-group":"style","x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-form-browserRoot":"/content/themecleanflex/assets"} */ + public String getBgimage() { + return bgimage; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background X Position","x-form-type":"materialrange","x-form-group":"style","x-form-min":0,"x-form-max":100,"x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + public String getBgxposition() { + return bgxposition; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Y Position","x-form-group":"style","x-form-type":"materialrange","x-form-min":0,"x-form-max":100,"x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + public String getBgyposition() { + return bgyposition; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Size Style","x-form-type":"text","x-form-group":"style","x-default":"cover"} */ + public String getBgsize() { + return bgsize; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay","x-form-type":"materialswitch","x-form-group":"style","x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'"} */ + public String getOverlay() { + return overlay; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay Color","x-form-group":"style","x-form-type":"color","x-form-visible":"model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"#ffffff"} */ + public String getOverlaycolor() { + return overlaycolor; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay opacity","x-form-group":"style","x-form-type":"materialrange","x-form-min":0,"x-form-max":100,"x-form-visible":"model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + public String getOverlayopacity() { + return overlayopacity; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Color","x-form-group":"style","x-form-type":"color","x-form-visible":"(model.backgroundtype == 'color' or model.backgroundtype == 'gradient') and model.custombackground == 'true'","x-default":"#ffffff"} */ + public String getBgcolor() { + return bgcolor; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Color 2","x-form-group":"style","x-form-type":"color","x-form-visible":"model.backgroundtype == 'gradient' and model.custombackground == 'true'","x-default":"#c0c0c0"} */ + public String getColor2() { + return color2; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Block Width","x-form-type":"materialradio","x-form-group":"style","x-default":"default","properties":{"default":{"x-form-name":"Default","x-form-value":"default"},"full":{"x-form-name":"Full Width","x-form-value":"full"},"article":{"x-form-name":"Article Width","x-form-value":"article"}}} */ + public String getBlockwidth() { + return blockwidth; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Full Height","x-form-type":"materialswitch","x-form-group":"style","x-default":"false"} */ + public String getFullheight() { + return fullheight; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Top Padding","x-form-type":"materialrange","x-form-min":0,"x-form-max":300,"x-form-group":"style","x-form-visible":"model.fullheight != 'true'"} */ + public String getToppadding() { + return toppadding; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Bottom Padding","x-form-type":"materialrange","x-form-min":0,"x-form-max":300,"x-form-group":"style","x-form-visible":"model.fullheight != 'true'"} */ + public String getBottompadding() { + return bottompadding; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Content Name","x-form-group":"advanced","x-form-type":"text"} */ + public String getContentname() { + return contentname; + } + + +//GEN] + + //GEN[:CUSTOMGETTERS + //GEN] + +} diff --git a/core/src/main/java/com/themecleanflex/models/PluginModel.java b/core/src/main/java/com/themecleanflex/models/PluginModel.java new file mode 100644 index 00000000..2eae03a0 --- /dev/null +++ b/core/src/main/java/com/themecleanflex/models/PluginModel.java @@ -0,0 +1,573 @@ +package com.themecleanflex.models; + +import com.peregrine.nodetypes.models.AbstractComponent; +import com.peregrine.nodetypes.models.IComponent; +import com.peregrine.nodetypes.models.Container; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.models.annotations.Default; +import org.apache.sling.models.annotations.DefaultInjectionStrategy; +import org.apache.sling.models.annotations.Exporter; +import org.apache.sling.models.annotations.Model; +import java.util.List; + +import javax.inject.Inject; +import javax.inject.Named; + + + +/* + //GEN[:DATA + { + "definitions": { + "Plugin": { + "type": "object", + "x-type": "component", + "properties": { + "mount": { + "type": "string", + "x-source": "inject", + "x-form-label": "Javascript function to call on component mount", + "x-form-hint": "Function must accept (el)", + "x-form-type": "text", + "x-form-group": "content", + "x-default": "" + }, + "unmount": { + "type": "string", + "x-source": "inject", + "x-form-label": "Javascript function to call on component unmount", + "x-form-hint": "Function must accept (el)", + "x-form-type": "text", + "x-form-group": "content", + "x-default": "" + }, + "bgref": { + "x-form-type": "reference", + "type": "object", + "x-type": "component", + "properties": { + "anchorname": { + "type": "string", + "x-source": "inject", + "x-form-label": "Anchor Name", + "x-form-group": "advanced", + "x-form-type": "text" + }, + "extraclasses": { + "type": "string", + "x-source": "inject", + "x-form-label": "Additonal Classes", + "x-form-group": "advanced", + "x-form-type": "text" + }, + "htmlelement": { + "type": "string", + "x-form-group": "advanced", + "x-source": "inject", + "x-form-label": "Semantic Element", + "x-form-type": "materialselect", + "x-default": "section", + "properties": { + "section": { + "x-form-name": "section", + "x-form-value": "section" + }, + "article": { + "x-form-name": "article", + "x-form-value": "article" + }, + "main": { + "x-form-name": "main", + "x-form-value": "main" + }, + "div": { + "x-form-name": "div", + "x-form-value": "div" + }, + "header": { + "x-form-name": "header", + "x-form-value": "header" + }, + "nav": { + "x-form-name": "nav", + "x-form-value": "nav" + }, + "footer": { + "x-form-name": "footer", + "x-form-value": "footer" + } + } + }, + "colorscheme": { + "type": "string", + "x-source": "inject", + "x-form-label": "Block Color Scheme", + "x-form-type": "materialradio", + "x-form-group": "style", + "x-default": "", + "properties": { + "none": { + "x-form-name": "None", + "x-form-value": "" + }, + "light": { + "x-form-name": "Light", + "x-form-value": "light" + }, + "dark": { + "x-form-name": "Dark", + "x-form-value": "dark" + } + } + }, + "custombackground": { + "type": "string", + "x-source": "inject", + "x-form-label": "Custom Background", + "x-form-group": "style", + "x-form-type": "materialswitch", + "x-default": "false" + }, + "backgroundtype": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Type", + "x-form-group": "style", + "x-form-type": "materialradio", + "x-form-visible": "model.custombackground == 'true'", + "properties": { + "color": { + "x-form-name": "Color", + "x-form-value": "color" + }, + "gradient": { + "x-form-name": "Gradient", + "x-form-value": "gradient" + }, + "image": { + "x-form-name": "Image", + "x-form-value": "image" + }, + "video": { + "x-form-name": "Video", + "x-form-value": "video" + } + } + }, + "bgvideo": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Video", + "x-form-group": "style", + "x-form-type": "pathbrowser", + "x-form-visible": "model.backgroundtype == 'video' and model.custombackground == 'true'", + "x-default": "https://www.youtube.com/embed/Ju86mknumYM", + "x-form-browserRoot": "/content/themecleanflex/assets" + }, + "bgimage": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Image", + "x-form-type": "pathbrowser", + "x-form-group": "style", + "x-form-visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "x-form-browserRoot": "/content/themecleanflex/assets" + }, + "bgxposition": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background X Position", + "x-form-type": "materialrange", + "x-form-group": "style", + "x-form-min": 0, + "x-form-max": 100, + "x-form-visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "x-default": "50" + }, + "bgyposition": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Y Position", + "x-form-group": "style", + "x-form-type": "materialrange", + "x-form-min": 0, + "x-form-max": 100, + "x-form-visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "x-default": "50" + }, + "bgsize": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Size Style", + "x-form-type": "text", + "x-form-group": "style", + "x-default": "cover" + }, + "overlay": { + "type": "string", + "x-source": "inject", + "x-form-label": "Overlay", + "x-form-type": "materialswitch", + "x-form-group": "style", + "x-form-visible": "model.backgroundtype == 'image' and model.custombackground == 'true'" + }, + "overlaycolor": { + "type": "string", + "x-source": "inject", + "x-form-label": "Overlay Color", + "x-form-group": "style", + "x-form-type": "color", + "x-form-visible": "model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'", + "x-default": "#ffffff" + }, + "overlayopacity": { + "type": "string", + "x-source": "inject", + "x-form-label": "Overlay opacity", + "x-form-group": "style", + "x-form-type": "materialrange", + "x-form-min": 0, + "x-form-max": 100, + "x-form-visible": "model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'", + "x-default": "50" + }, + "bgcolor": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Color", + "x-form-group": "style", + "x-form-type": "color", + "x-form-visible": "(model.backgroundtype == 'color' or model.backgroundtype == 'gradient') and model.custombackground == 'true'", + "x-default": "#ffffff" + }, + "color2": { + "type": "string", + "x-source": "inject", + "x-form-label": "Color 2", + "x-form-group": "style", + "x-form-type": "color", + "x-form-visible": "model.backgroundtype == 'gradient' and model.custombackground == 'true'", + "x-default": "#c0c0c0" + }, + "blockwidth": { + "type": "string", + "x-source": "inject", + "x-form-label": "Block Width", + "x-form-type": "materialradio", + "x-form-group": "style", + "x-default": "default", + "properties": { + "default": { + "x-form-name": "Default", + "x-form-value": "default" + }, + "full": { + "x-form-name": "Full Width", + "x-form-value": "full" + }, + "article": { + "x-form-name": "Article Width", + "x-form-value": "article" + } + } + }, + "fullheight": { + "type": "string", + "x-source": "inject", + "x-form-label": "Full Height", + "x-form-type": "materialswitch", + "x-form-group": "style", + "x-default": "false" + }, + "toppadding": { + "type": "string", + "x-source": "inject", + "x-form-label": "Top Padding", + "x-form-type": "materialrange", + "x-form-min": 0, + "x-form-max": 300, + "x-form-group": "style", + "x-form-visible": "model.fullheight != 'true'" + }, + "bottompadding": { + "type": "string", + "x-source": "inject", + "x-form-label": "Bottom Padding", + "x-form-type": "materialrange", + "x-form-min": 0, + "x-form-max": 300, + "x-form-group": "style", + "x-form-visible": "model.fullheight != 'true'" + }, + "contentname": { + "type": "string", + "x-source": "inject", + "x-form-label": "Content Name", + "x-form-group": "advanced", + "x-form-type": "text" + } + } + } + } + } + }, + "name": "Plugin", + "componentPath": "themecleanflex/components/plugin", + "package": "com.themecleanflex.models", + "modelName": "Plugin", + "classNameParent": "AbstractComponent" +} +//GEN] +*/ + +//GEN[:DEF +@Model( + adaptables = Resource.class, + resourceType = "themecleanflex/components/plugin", + defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL, + adapters = IComponent.class +) +@Exporter( + name = "jackson", + extensions = "json" +) + +//GEN] +public class PluginModel extends AbstractComponent { + + public PluginModel(final Resource r) { super(r); } + + //GEN[:INJECT + /* {"type":"string","x-source":"inject","x-form-label":"Javascript function to call on component mount","x-form-hint":"Function must accept (el)","x-form-type":"text","x-form-group":"content","x-default":""} */ + @Inject + @Default(values ="") + private String mount; + + /* {"type":"string","x-source":"inject","x-form-label":"Javascript function to call on component unmount","x-form-hint":"Function must accept (el)","x-form-type":"text","x-form-group":"content","x-default":""} */ + @Inject + @Default(values ="") + private String unmount; + + /* {"type":"string","x-source":"inject","x-form-label":"Anchor Name","x-form-group":"advanced","x-form-type":"text"} */ + @Inject + private String anchorname; + + /* {"type":"string","x-source":"inject","x-form-label":"Additonal Classes","x-form-group":"advanced","x-form-type":"text"} */ + @Inject + private String extraclasses; + + /* {"type":"string","x-form-group":"advanced","x-source":"inject","x-form-label":"Semantic Element","x-form-type":"materialselect","x-default":"section","properties":{"section":{"x-form-name":"section","x-form-value":"section"},"article":{"x-form-name":"article","x-form-value":"article"},"main":{"x-form-name":"main","x-form-value":"main"},"div":{"x-form-name":"div","x-form-value":"div"},"header":{"x-form-name":"header","x-form-value":"header"},"nav":{"x-form-name":"nav","x-form-value":"nav"},"footer":{"x-form-name":"footer","x-form-value":"footer"}}} */ + @Inject + @Default(values ="section") + private String htmlelement; + + /* {"type":"string","x-source":"inject","x-form-label":"Block Color Scheme","x-form-type":"materialradio","x-form-group":"style","x-default":"","properties":{"none":{"x-form-name":"None","x-form-value":""},"light":{"x-form-name":"Light","x-form-value":"light"},"dark":{"x-form-name":"Dark","x-form-value":"dark"}}} */ + @Inject + @Default(values ="") + private String colorscheme; + + /* {"type":"string","x-source":"inject","x-form-label":"Custom Background","x-form-group":"style","x-form-type":"materialswitch","x-default":"false"} */ + @Inject + @Default(values ="false") + private String custombackground; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Type","x-form-group":"style","x-form-type":"materialradio","x-form-visible":"model.custombackground == 'true'","properties":{"color":{"x-form-name":"Color","x-form-value":"color"},"gradient":{"x-form-name":"Gradient","x-form-value":"gradient"},"image":{"x-form-name":"Image","x-form-value":"image"},"video":{"x-form-name":"Video","x-form-value":"video"}}} */ + @Inject + private String backgroundtype; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Video","x-form-group":"style","x-form-type":"pathbrowser","x-form-visible":"model.backgroundtype == 'video' and model.custombackground == 'true'","x-default":"https://www.youtube.com/embed/Ju86mknumYM","x-form-browserRoot":"/content/themecleanflex/assets"} */ + @Inject + @Default(values ="https://www.youtube.com/embed/Ju86mknumYM") + private String bgvideo; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Image","x-form-type":"pathbrowser","x-form-group":"style","x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-form-browserRoot":"/content/themecleanflex/assets"} */ + @Inject + private String bgimage; + + /* {"type":"string","x-source":"inject","x-form-label":"Background X Position","x-form-type":"materialrange","x-form-group":"style","x-form-min":0,"x-form-max":100,"x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + @Inject + @Default(values ="50") + private String bgxposition; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Y Position","x-form-group":"style","x-form-type":"materialrange","x-form-min":0,"x-form-max":100,"x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + @Inject + @Default(values ="50") + private String bgyposition; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Size Style","x-form-type":"text","x-form-group":"style","x-default":"cover"} */ + @Inject + @Default(values ="cover") + private String bgsize; + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay","x-form-type":"materialswitch","x-form-group":"style","x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'"} */ + @Inject + private String overlay; + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay Color","x-form-group":"style","x-form-type":"color","x-form-visible":"model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"#ffffff"} */ + @Inject + @Default(values ="#ffffff") + private String overlaycolor; + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay opacity","x-form-group":"style","x-form-type":"materialrange","x-form-min":0,"x-form-max":100,"x-form-visible":"model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + @Inject + @Default(values ="50") + private String overlayopacity; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Color","x-form-group":"style","x-form-type":"color","x-form-visible":"(model.backgroundtype == 'color' or model.backgroundtype == 'gradient') and model.custombackground == 'true'","x-default":"#ffffff"} */ + @Inject + @Default(values ="#ffffff") + private String bgcolor; + + /* {"type":"string","x-source":"inject","x-form-label":"Color 2","x-form-group":"style","x-form-type":"color","x-form-visible":"model.backgroundtype == 'gradient' and model.custombackground == 'true'","x-default":"#c0c0c0"} */ + @Inject + @Default(values ="#c0c0c0") + private String color2; + + /* {"type":"string","x-source":"inject","x-form-label":"Block Width","x-form-type":"materialradio","x-form-group":"style","x-default":"default","properties":{"default":{"x-form-name":"Default","x-form-value":"default"},"full":{"x-form-name":"Full Width","x-form-value":"full"},"article":{"x-form-name":"Article Width","x-form-value":"article"}}} */ + @Inject + @Default(values ="default") + private String blockwidth; + + /* {"type":"string","x-source":"inject","x-form-label":"Full Height","x-form-type":"materialswitch","x-form-group":"style","x-default":"false"} */ + @Inject + @Default(values ="false") + private String fullheight; + + /* {"type":"string","x-source":"inject","x-form-label":"Top Padding","x-form-type":"materialrange","x-form-min":0,"x-form-max":300,"x-form-group":"style","x-form-visible":"model.fullheight != 'true'"} */ + @Inject + private String toppadding; + + /* {"type":"string","x-source":"inject","x-form-label":"Bottom Padding","x-form-type":"materialrange","x-form-min":0,"x-form-max":300,"x-form-group":"style","x-form-visible":"model.fullheight != 'true'"} */ + @Inject + private String bottompadding; + + /* {"type":"string","x-source":"inject","x-form-label":"Content Name","x-form-group":"advanced","x-form-type":"text"} */ + @Inject + private String contentname; + + +//GEN] + + //GEN[:GETTERS + /* {"type":"string","x-source":"inject","x-form-label":"Javascript function to call on component mount","x-form-hint":"Function must accept (el)","x-form-type":"text","x-form-group":"content","x-default":""} */ + public String getMount() { + return mount; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Javascript function to call on component unmount","x-form-hint":"Function must accept (el)","x-form-type":"text","x-form-group":"content","x-default":""} */ + public String getUnmount() { + return unmount; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Anchor Name","x-form-group":"advanced","x-form-type":"text"} */ + public String getAnchorname() { + return anchorname; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Additonal Classes","x-form-group":"advanced","x-form-type":"text"} */ + public String getExtraclasses() { + return extraclasses; + } + + /* {"type":"string","x-form-group":"advanced","x-source":"inject","x-form-label":"Semantic Element","x-form-type":"materialselect","x-default":"section","properties":{"section":{"x-form-name":"section","x-form-value":"section"},"article":{"x-form-name":"article","x-form-value":"article"},"main":{"x-form-name":"main","x-form-value":"main"},"div":{"x-form-name":"div","x-form-value":"div"},"header":{"x-form-name":"header","x-form-value":"header"},"nav":{"x-form-name":"nav","x-form-value":"nav"},"footer":{"x-form-name":"footer","x-form-value":"footer"}}} */ + public String getHtmlelement() { + return htmlelement; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Block Color Scheme","x-form-type":"materialradio","x-form-group":"style","x-default":"","properties":{"none":{"x-form-name":"None","x-form-value":""},"light":{"x-form-name":"Light","x-form-value":"light"},"dark":{"x-form-name":"Dark","x-form-value":"dark"}}} */ + public String getColorscheme() { + return colorscheme; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Custom Background","x-form-group":"style","x-form-type":"materialswitch","x-default":"false"} */ + public String getCustombackground() { + return custombackground; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Type","x-form-group":"style","x-form-type":"materialradio","x-form-visible":"model.custombackground == 'true'","properties":{"color":{"x-form-name":"Color","x-form-value":"color"},"gradient":{"x-form-name":"Gradient","x-form-value":"gradient"},"image":{"x-form-name":"Image","x-form-value":"image"},"video":{"x-form-name":"Video","x-form-value":"video"}}} */ + public String getBackgroundtype() { + return backgroundtype; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Video","x-form-group":"style","x-form-type":"pathbrowser","x-form-visible":"model.backgroundtype == 'video' and model.custombackground == 'true'","x-default":"https://www.youtube.com/embed/Ju86mknumYM","x-form-browserRoot":"/content/themecleanflex/assets"} */ + public String getBgvideo() { + return bgvideo; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Image","x-form-type":"pathbrowser","x-form-group":"style","x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-form-browserRoot":"/content/themecleanflex/assets"} */ + public String getBgimage() { + return bgimage; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background X Position","x-form-type":"materialrange","x-form-group":"style","x-form-min":0,"x-form-max":100,"x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + public String getBgxposition() { + return bgxposition; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Y Position","x-form-group":"style","x-form-type":"materialrange","x-form-min":0,"x-form-max":100,"x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + public String getBgyposition() { + return bgyposition; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Size Style","x-form-type":"text","x-form-group":"style","x-default":"cover"} */ + public String getBgsize() { + return bgsize; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay","x-form-type":"materialswitch","x-form-group":"style","x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'"} */ + public String getOverlay() { + return overlay; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay Color","x-form-group":"style","x-form-type":"color","x-form-visible":"model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"#ffffff"} */ + public String getOverlaycolor() { + return overlaycolor; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay opacity","x-form-group":"style","x-form-type":"materialrange","x-form-min":0,"x-form-max":100,"x-form-visible":"model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + public String getOverlayopacity() { + return overlayopacity; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Color","x-form-group":"style","x-form-type":"color","x-form-visible":"(model.backgroundtype == 'color' or model.backgroundtype == 'gradient') and model.custombackground == 'true'","x-default":"#ffffff"} */ + public String getBgcolor() { + return bgcolor; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Color 2","x-form-group":"style","x-form-type":"color","x-form-visible":"model.backgroundtype == 'gradient' and model.custombackground == 'true'","x-default":"#c0c0c0"} */ + public String getColor2() { + return color2; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Block Width","x-form-type":"materialradio","x-form-group":"style","x-default":"default","properties":{"default":{"x-form-name":"Default","x-form-value":"default"},"full":{"x-form-name":"Full Width","x-form-value":"full"},"article":{"x-form-name":"Article Width","x-form-value":"article"}}} */ + public String getBlockwidth() { + return blockwidth; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Full Height","x-form-type":"materialswitch","x-form-group":"style","x-default":"false"} */ + public String getFullheight() { + return fullheight; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Top Padding","x-form-type":"materialrange","x-form-min":0,"x-form-max":300,"x-form-group":"style","x-form-visible":"model.fullheight != 'true'"} */ + public String getToppadding() { + return toppadding; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Bottom Padding","x-form-type":"materialrange","x-form-min":0,"x-form-max":300,"x-form-group":"style","x-form-visible":"model.fullheight != 'true'"} */ + public String getBottompadding() { + return bottompadding; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Content Name","x-form-group":"advanced","x-form-type":"text"} */ + public String getContentname() { + return contentname; + } + + +//GEN] + + //GEN[:CUSTOMGETTERS + //GEN] + +} diff --git a/fragments/button/hatch.js b/fragments/button/hatch.js new file mode 100644 index 00000000..a63c624c --- /dev/null +++ b/fragments/button/hatch.js @@ -0,0 +1,10 @@ +module.exports = { + convert: function ($, f) { + f.wrap($, 'themecleanflex-components-block'); + f.bindAttribute($.parent(), 'model', 'model'); + + const submit = $.find('input').first(); + f.bindAttribute(submit, 'value', 'model.submittext'); + f.bindEvent(submit, 'click.prevent.stop', 'onClick'); + } + }; \ No newline at end of file diff --git a/fragments/button/model.json b/fragments/button/model.json new file mode 100644 index 00000000..bdc0b359 --- /dev/null +++ b/fragments/button/model.json @@ -0,0 +1,87 @@ +{ + "definitions": { + "Button": { + "type": "object", + "x-type": "component", + "properties": { + "submitfunction": { + "type": "string", + "x-source": "inject", + "x-form-label": "Javascript function to call on submit", + "x-form-hint": "Function must accept (model, formdata)", + "x-form-type": "text", + "x-form-group": "content", + "x-default": "" + }, + "submittext": { + "type": "string", + "x-source": "inject", + "x-form-label": "Submit Button Text", + "x-form-type": "text", + "x-form-group": "content", + "x-default": "Submit" + }, + "submitsize": { + "type": "string", + "x-source": "inject", + "x-form-label": "Submit button size", + "x-form-type": "materialselect", + "x-form-group": "style", + "x-default": "normal", + "properties":{ + "section": { + "x-form-name": "normal", + "x-form-value": "normal" + }, + "small": { + "x-form-name": "small", + "x-form-value": "small" + }, + "large": { + "x-form-name": "large", + "x-form-value": "large" + }, + "full": { + "x-form-name": "full width", + "x-form-value": "full" + } + } + }, + "submitalignment": { + "type": "string", + "x-source": "inject", + "x-form-label": "Submit button alignment", + "x-form-type": "materialselect", + "x-form-group": "style", + "x-default": "start", + "properties":{ + "start": { + "x-form-name": "start", + "x-form-value": "start" + }, + "center": { + "x-form-name": "center", + "x-form-value": "center" + }, + "end": { + "x-form-name": "end", + "x-form-value": "end" + } + } + }, + "successpage": { + "type": "string", + "x-source": "inject", + "x-form-type": "pathbrowser", + "x-form-label": "Submit Success Page", + "x-form-group": "content", + "x-form-browserRoot": "/content/themecleanflex/pages" + }, + "bgref": { + "$ref": "fragments/block/model.json#/definitions/Block", + "x-form-type": "reference" + } + } + } + } +} diff --git a/fragments/button/sample.json b/fragments/button/sample.json new file mode 100644 index 00000000..020295b6 --- /dev/null +++ b/fragments/button/sample.json @@ -0,0 +1,7 @@ +{ + "title": "Button", + "group": "", + "model": { + "text": "example" + } +} \ No newline at end of file diff --git a/fragments/button/template.html b/fragments/button/template.html new file mode 100644 index 00000000..295b842f --- /dev/null +++ b/fragments/button/template.html @@ -0,0 +1,3 @@ +
+ +
\ No newline at end of file diff --git a/fragments/button/template.vue b/fragments/button/template.vue new file mode 100644 index 00000000..5a91c36b --- /dev/null +++ b/fragments/button/template.vue @@ -0,0 +1,38 @@ + + + + diff --git a/fragments/plugin/hatch.js b/fragments/plugin/hatch.js new file mode 100644 index 00000000..b99a6496 --- /dev/null +++ b/fragments/plugin/hatch.js @@ -0,0 +1,9 @@ +module.exports = { + convert: function($, f) { + f.wrap($, 'themecleanflex-components-block'); + f.bindAttribute($.parent(), 'model', 'model'); + f.bindAttribute($, 'ref', '`target`'); + f.addElse($); + $.parent().prepend('
no functions defined for component
'); + } +} \ No newline at end of file diff --git a/fragments/plugin/model.json b/fragments/plugin/model.json new file mode 100644 index 00000000..92192de8 --- /dev/null +++ b/fragments/plugin/model.json @@ -0,0 +1,32 @@ +{ + "definitions": { + "Plugin": { + "type": "object", + "x-type": "component", + "properties": { + "mount": { + "type": "string", + "x-source": "inject", + "x-form-label": "Javascript function to call on component mount", + "x-form-hint": "Function must accept (el)", + "x-form-type": "text", + "x-form-group": "content", + "x-default": "" + }, + "unmount": { + "type": "string", + "x-source": "inject", + "x-form-label": "Javascript function to call on component unmount", + "x-form-hint": "Function must accept (el)", + "x-form-type": "text", + "x-form-group": "content", + "x-default": "" + }, + "bgref": { + "$ref": "fragments/block/model.json#/definitions/Block", + "x-form-type": "reference" + } + } + } + } +} diff --git a/fragments/plugin/sample.json b/fragments/plugin/sample.json new file mode 100644 index 00000000..813249bd --- /dev/null +++ b/fragments/plugin/sample.json @@ -0,0 +1,7 @@ +{ + "title": "Plugin", + "group": "", + "model": { + "text": "example" + } +} \ No newline at end of file diff --git a/fragments/plugin/template.html b/fragments/plugin/template.html new file mode 100644 index 00000000..281c6866 --- /dev/null +++ b/fragments/plugin/template.html @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/fragments/plugin/template.vue b/fragments/plugin/template.vue new file mode 100644 index 00000000..f1b6d50a --- /dev/null +++ b/fragments/plugin/template.vue @@ -0,0 +1,73 @@ + + + + diff --git a/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/button/.content.xml b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/button/.content.xml new file mode 100644 index 00000000..edc06097 --- /dev/null +++ b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/button/.content.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/button/dialog.json b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/button/dialog.json new file mode 100644 index 00000000..ee3dedd5 --- /dev/null +++ b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/button/dialog.json @@ -0,0 +1,356 @@ +{ + "groups": [ + { + "legend": "content", + "fields": [ + { + "type": "input", + "inputType": "text", + "placeholder": "submitfunction", + "label": "Javascript function to call on submit", + "model": "submitfunction", + "hint": "Function must accept (model, formdata)", + "x_form_group": "content" + }, + { + "type": "input", + "inputType": "text", + "placeholder": "submittext", + "label": "Submit Button Text", + "model": "submittext", + "x_form_group": "content" + }, + { + "type": "pathbrowser", + "browserRoot": "/content/themecleanflex/pages", + "placeholder": "successpage", + "label": "Submit Success Page", + "model": "successpage", + "x_form_group": "content" + } + ] + }, + { + "legend": "style", + "fields": [ + { + "type": "material-select", + "values": [ + { + "name": "normal", + "value": "normal" + }, + { + "name": "small", + "value": "small" + }, + { + "name": "large", + "value": "large" + }, + { + "name": "full width", + "value": "full" + } + ], + "placeholder": "submitsize", + "label": "Submit button size", + "model": "submitsize", + "x_form_group": "style" + }, + { + "type": "material-select", + "values": [ + { + "name": "start", + "value": "start" + }, + { + "name": "center", + "value": "center" + }, + { + "name": "end", + "value": "end" + } + ], + "placeholder": "submitalignment", + "label": "Submit button alignment", + "model": "submitalignment", + "x_form_group": "style" + }, + { + "type": "material-radios", + "values": [ + { + "name": "None", + "value": "" + }, + { + "name": "Light", + "value": "light" + }, + { + "name": "Dark", + "value": "dark" + } + ], + "placeholder": "colorscheme", + "label": "Block Color Scheme", + "model": "colorscheme", + "x_form_group": "style" + }, + { + "type": "materialswitch", + "textOn": "yes", + "textOff": "no", + "valueOn": "true", + "valueOff": "false", + "placeholder": "custombackground", + "label": "Custom Background", + "model": "custombackground", + "x_form_group": "style" + }, + { + "type": "material-radios", + "values": [ + { + "name": "Color", + "value": "color" + }, + { + "name": "Gradient", + "value": "gradient" + }, + { + "name": "Image", + "value": "image" + }, + { + "name": "Video", + "value": "video" + } + ], + "placeholder": "backgroundtype", + "label": "Background Type", + "model": "backgroundtype", + "visible": "model.custombackground == 'true'", + "x_form_group": "style" + }, + { + "type": "pathbrowser", + "browserRoot": "/content/themecleanflex/assets", + "placeholder": "bgvideo", + "label": "Background Video", + "model": "bgvideo", + "visible": "model.backgroundtype == 'video' and model.custombackground == 'true'", + "x_form_group": "style" + }, + { + "type": "pathbrowser", + "browserRoot": "/content/themecleanflex/assets", + "placeholder": "bgimage", + "label": "Background Image", + "model": "bgimage", + "visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "x_form_group": "style" + }, + { + "type": "material-range", + "placeholder": "bgxposition", + "label": "Background X Position", + "model": "bgxposition", + "visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "min": 0, + "max": 100, + "x_form_group": "style" + }, + { + "type": "material-range", + "placeholder": "bgyposition", + "label": "Background Y Position", + "model": "bgyposition", + "visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "min": 0, + "max": 100, + "x_form_group": "style" + }, + { + "type": "input", + "inputType": "text", + "placeholder": "bgsize", + "label": "Background Size Style", + "model": "bgsize", + "x_form_group": "style" + }, + { + "type": "materialswitch", + "textOn": "yes", + "textOff": "no", + "valueOn": "true", + "valueOff": "false", + "placeholder": "overlay", + "label": "Overlay", + "model": "overlay", + "visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "x_form_group": "style" + }, + { + "type": "input", + "inputType": "color", + "placeholder": "overlaycolor", + "label": "Overlay Color", + "model": "overlaycolor", + "visible": "model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'", + "x_form_group": "style" + }, + { + "type": "material-range", + "placeholder": "overlayopacity", + "label": "Overlay opacity", + "model": "overlayopacity", + "visible": "model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'", + "min": 0, + "max": 100, + "x_form_group": "style" + }, + { + "type": "input", + "inputType": "color", + "placeholder": "bgcolor", + "label": "Background Color", + "model": "bgcolor", + "visible": "(model.backgroundtype == 'color' or model.backgroundtype == 'gradient') and model.custombackground == 'true'", + "x_form_group": "style" + }, + { + "type": "input", + "inputType": "color", + "placeholder": "color2", + "label": "Color 2", + "model": "color2", + "visible": "model.backgroundtype == 'gradient' and model.custombackground == 'true'", + "x_form_group": "style" + }, + { + "type": "material-radios", + "values": [ + { + "name": "Default", + "value": "default" + }, + { + "name": "Full Width", + "value": "full" + }, + { + "name": "Article Width", + "value": "article" + } + ], + "placeholder": "blockwidth", + "label": "Block Width", + "model": "blockwidth", + "x_form_group": "style" + }, + { + "type": "materialswitch", + "textOn": "yes", + "textOff": "no", + "valueOn": "true", + "valueOff": "false", + "placeholder": "fullheight", + "label": "Full Height", + "model": "fullheight", + "x_form_group": "style" + }, + { + "type": "material-range", + "placeholder": "toppadding", + "label": "Top Padding", + "model": "toppadding", + "visible": "model.fullheight != 'true'", + "min": 0, + "max": 300, + "x_form_group": "style" + }, + { + "type": "material-range", + "placeholder": "bottompadding", + "label": "Bottom Padding", + "model": "bottompadding", + "visible": "model.fullheight != 'true'", + "min": 0, + "max": 300, + "x_form_group": "style" + } + ] + }, + { + "legend": "advanced", + "fields": [ + { + "type": "input", + "inputType": "text", + "placeholder": "anchorname", + "label": "Anchor Name", + "model": "anchorname", + "x_form_group": "advanced" + }, + { + "type": "input", + "inputType": "text", + "placeholder": "extraclasses", + "label": "Additonal Classes", + "model": "extraclasses", + "x_form_group": "advanced" + }, + { + "type": "material-select", + "values": [ + { + "name": "section", + "value": "section" + }, + { + "name": "article", + "value": "article" + }, + { + "name": "main", + "value": "main" + }, + { + "name": "div", + "value": "div" + }, + { + "name": "header", + "value": "header" + }, + { + "name": "nav", + "value": "nav" + }, + { + "name": "footer", + "value": "footer" + } + ], + "placeholder": "htmlelement", + "label": "Semantic Element", + "model": "htmlelement", + "x_form_group": "advanced" + }, + { + "type": "input", + "inputType": "text", + "placeholder": "contentname", + "label": "Content Name", + "model": "contentname", + "x_form_group": "advanced" + } + ] + } + ] +} \ No newline at end of file diff --git a/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/button/template.vue b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/button/template.vue new file mode 100644 index 00000000..5a91c36b --- /dev/null +++ b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/button/template.vue @@ -0,0 +1,38 @@ + + + + diff --git a/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/plugin/.content.xml b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/plugin/.content.xml new file mode 100644 index 00000000..d9dc825a --- /dev/null +++ b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/plugin/.content.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/plugin/dialog.json b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/plugin/dialog.json new file mode 100644 index 00000000..1aaad0f7 --- /dev/null +++ b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/plugin/dialog.json @@ -0,0 +1,303 @@ +{ + "groups": [ + { + "legend": "content", + "fields": [ + { + "type": "input", + "inputType": "text", + "placeholder": "mount", + "label": "Javascript function to call on component mount", + "model": "mount", + "hint": "Function must accept (el)", + "x_form_group": "content" + }, + { + "type": "input", + "inputType": "text", + "placeholder": "unmount", + "label": "Javascript function to call on component unmount", + "model": "unmount", + "hint": "Function must accept (el)", + "x_form_group": "content" + } + ] + }, + { + "legend": "advanced", + "fields": [ + { + "type": "input", + "inputType": "text", + "placeholder": "anchorname", + "label": "Anchor Name", + "model": "anchorname", + "x_form_group": "advanced" + }, + { + "type": "input", + "inputType": "text", + "placeholder": "extraclasses", + "label": "Additonal Classes", + "model": "extraclasses", + "x_form_group": "advanced" + }, + { + "type": "material-select", + "values": [ + { + "name": "section", + "value": "section" + }, + { + "name": "article", + "value": "article" + }, + { + "name": "main", + "value": "main" + }, + { + "name": "div", + "value": "div" + }, + { + "name": "header", + "value": "header" + }, + { + "name": "nav", + "value": "nav" + }, + { + "name": "footer", + "value": "footer" + } + ], + "placeholder": "htmlelement", + "label": "Semantic Element", + "model": "htmlelement", + "x_form_group": "advanced" + }, + { + "type": "input", + "inputType": "text", + "placeholder": "contentname", + "label": "Content Name", + "model": "contentname", + "x_form_group": "advanced" + } + ] + }, + { + "legend": "style", + "fields": [ + { + "type": "material-radios", + "values": [ + { + "name": "None", + "value": "" + }, + { + "name": "Light", + "value": "light" + }, + { + "name": "Dark", + "value": "dark" + } + ], + "placeholder": "colorscheme", + "label": "Block Color Scheme", + "model": "colorscheme", + "x_form_group": "style" + }, + { + "type": "materialswitch", + "textOn": "yes", + "textOff": "no", + "valueOn": "true", + "valueOff": "false", + "placeholder": "custombackground", + "label": "Custom Background", + "model": "custombackground", + "x_form_group": "style" + }, + { + "type": "material-radios", + "values": [ + { + "name": "Color", + "value": "color" + }, + { + "name": "Gradient", + "value": "gradient" + }, + { + "name": "Image", + "value": "image" + }, + { + "name": "Video", + "value": "video" + } + ], + "placeholder": "backgroundtype", + "label": "Background Type", + "model": "backgroundtype", + "visible": "model.custombackground == 'true'", + "x_form_group": "style" + }, + { + "type": "pathbrowser", + "browserRoot": "/content/themecleanflex/assets", + "placeholder": "bgvideo", + "label": "Background Video", + "model": "bgvideo", + "visible": "model.backgroundtype == 'video' and model.custombackground == 'true'", + "x_form_group": "style" + }, + { + "type": "pathbrowser", + "browserRoot": "/content/themecleanflex/assets", + "placeholder": "bgimage", + "label": "Background Image", + "model": "bgimage", + "visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "x_form_group": "style" + }, + { + "type": "material-range", + "placeholder": "bgxposition", + "label": "Background X Position", + "model": "bgxposition", + "visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "min": 0, + "max": 100, + "x_form_group": "style" + }, + { + "type": "material-range", + "placeholder": "bgyposition", + "label": "Background Y Position", + "model": "bgyposition", + "visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "min": 0, + "max": 100, + "x_form_group": "style" + }, + { + "type": "input", + "inputType": "text", + "placeholder": "bgsize", + "label": "Background Size Style", + "model": "bgsize", + "x_form_group": "style" + }, + { + "type": "materialswitch", + "textOn": "yes", + "textOff": "no", + "valueOn": "true", + "valueOff": "false", + "placeholder": "overlay", + "label": "Overlay", + "model": "overlay", + "visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "x_form_group": "style" + }, + { + "type": "input", + "inputType": "color", + "placeholder": "overlaycolor", + "label": "Overlay Color", + "model": "overlaycolor", + "visible": "model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'", + "x_form_group": "style" + }, + { + "type": "material-range", + "placeholder": "overlayopacity", + "label": "Overlay opacity", + "model": "overlayopacity", + "visible": "model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'", + "min": 0, + "max": 100, + "x_form_group": "style" + }, + { + "type": "input", + "inputType": "color", + "placeholder": "bgcolor", + "label": "Background Color", + "model": "bgcolor", + "visible": "(model.backgroundtype == 'color' or model.backgroundtype == 'gradient') and model.custombackground == 'true'", + "x_form_group": "style" + }, + { + "type": "input", + "inputType": "color", + "placeholder": "color2", + "label": "Color 2", + "model": "color2", + "visible": "model.backgroundtype == 'gradient' and model.custombackground == 'true'", + "x_form_group": "style" + }, + { + "type": "material-radios", + "values": [ + { + "name": "Default", + "value": "default" + }, + { + "name": "Full Width", + "value": "full" + }, + { + "name": "Article Width", + "value": "article" + } + ], + "placeholder": "blockwidth", + "label": "Block Width", + "model": "blockwidth", + "x_form_group": "style" + }, + { + "type": "materialswitch", + "textOn": "yes", + "textOff": "no", + "valueOn": "true", + "valueOff": "false", + "placeholder": "fullheight", + "label": "Full Height", + "model": "fullheight", + "x_form_group": "style" + }, + { + "type": "material-range", + "placeholder": "toppadding", + "label": "Top Padding", + "model": "toppadding", + "visible": "model.fullheight != 'true'", + "min": 0, + "max": 300, + "x_form_group": "style" + }, + { + "type": "material-range", + "placeholder": "bottompadding", + "label": "Bottom Padding", + "model": "bottompadding", + "visible": "model.fullheight != 'true'", + "min": 0, + "max": 300, + "x_form_group": "style" + } + ] + } + ] +} \ No newline at end of file diff --git a/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/plugin/template.vue b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/plugin/template.vue new file mode 100644 index 00000000..f1b6d50a --- /dev/null +++ b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/plugin/template.vue @@ -0,0 +1,73 @@ + + + +