',
dragHtml: ' ',
image: "icons/video.svg",
resizable:true,//show select box resize handlers
properties: [{
name: "Video",
//child: "source",
key: "src",
htmlAttr: "src",
inputtype: VideoInput
},{
name: "Poster",
key: "poster",
htmlAttr: "poster",
inputtype: ImageInput
},{
name: "Width",
key: "width",
htmlAttr: "width",
inputtype: TextInput
}, {
name: "Height",
key: "height",
htmlAttr: "height",
inputtype: TextInput
},{
name: "Muted",
key: "muted",
htmlAttr: "muted",
inputtype: CheckboxInput
},{
name: "Loop",
key: "loop",
htmlAttr: "loop",
inputtype: CheckboxInput
},{
name: "Autoplay",
key: "autoplay",
htmlAttr: "autoplay",
inputtype: CheckboxInput
},{
name: "Plays inline",
key: "playsinline",
htmlAttr: "playsinline",
inputtype: CheckboxInput
},{
name: "Controls",
key: "controls",
htmlAttr: "controls",
inputtype: CheckboxInput
},{
name:"",
key: "autoplay_warning",
inline:false,
col:12,
inputtype: NoticeInput,
data: {
type:'warning',
title:'Autoplay',
text:'Most browsers allow auto play only if video is muted and plays inline'
}
}]
});
Vvveb.Components.extend("_base", "html/button", {
nodes: ["button"],
name: "Html Button",
image: "icons/button.svg",
html: 'Button ',
properties: [{
name: "Text",
key: "text",
htmlAttr: "innerHTML",
inputtype: TextInput
}, {
name: "Name",
key: "name",
htmlAttr: "name",
inputtype: TextInput
}, {
name: "Type",
key: "type",
htmlAttr: "type",
inputtype: SelectInput,
data: {
options: [{
value: "button",
text: "button"
}, {
value: "reset",
text: "reset"
}, {
value: "submit",
text: "submit"
}],
}
},{
name: "Autofocus",
key: "autofocus",
htmlAttr: "autofocus",
inputtype: CheckboxInput,
inline:true,
col:6,
},{
name: "Disabled",
key: "disabled",
htmlAttr: "disabled",
inputtype: CheckboxInput,
inline:true,
col:6,
}]
});
Vvveb.Components.extend("_base", "html/paragraph", {
nodes: ["p"],
name: "Paragraph",
image: "icons/paragraph.svg",
html: 'Lorem ipsum
',
properties: [{
name: "Text align",
key: "p-text-align",
htmlAttr: "class",
inline:false,
validValues: ["", "text-start", "text-center", "text-end"],
inputtype: RadioButtonInput,
data: {
extraclass:"btn-group-sm btn-group-fullwidth",
options: [{
value: "",
icon:"la la-times",
//text: "None",
title: "None",
checked:true,
}, {
value: "text-start",
//text: "Left",
title: "text-start",
icon:"la la-align-left",
checked:false,
}, {
value: "text-center",
//text: "Center",
title: "Center",
icon:"la la-align-center",
checked:false,
}, {
value: "text-end",
//text: "Right",
title: "Right",
icon:"la la-align-right",
checked:false,
}],
},
}]
});
Vvveb.Components.extend("_base", "html/blockquote", {
nodes: ["blockquote"],
name: "Blockquote",
image: "icons/blockquote.svg",
html: `
Today I shall be meeting with interference, ingratitude, insolence, disloyalty, ill-will, and selfishness all of them due to the offenders' ignorance of what is good or evil.
Marcus Aurelius
`,
properties: [{
name: "Cite",
key: "cite",
inline:false,
htmlAttr: "cite",
inputtype: TextInput,
}]
});
Vvveb.Components.extend("_base", "html/list", {
nodes: ["ul", "ol"],
name: "List",
image: "icons/list.svg",
html: `
Begin with the possible; begin with one step.
Never think of results, just do!
Patience is the mother of will.
Man must use what he has, not hope for what is not.
Only super-efforts count.
`,
properties: [{
name: "Type",
key: "type",
inputtype: SelectInput,
onChange: function(node, value) {
return changeNodeName(node, value);
},
init: function(node) {
return node.nodeName.toLowerCase()
},
data:{
options: [{
value: "ul",
text: "Unordered"
}, {
value: "ol",
text: "Ordered"
}]
},
},{
name: "Items",
key: "items",
inputtype: ListInput,
htmlAttr:"data-slides-per-view",
inline:true,
data: {
selector:"li",
container:"",
prefix:"Item ",
removeElement: true,
"newElement": `Do everything quickly and well. `
},
onChange: function(node, value, input, component, event) {
let element = node;
if (event.action) {
if (event.action == "add") {
//node.append(generateElements(`List item `)[0]);
//temporary solution to better update list
Vvveb.Components.render("html/list");
}
if (event.action == "remove") {
} else if (event.action == "select") {
}
}
return node;
},
}]
});
Vvveb.Components.extend("_base", "html/preformatted", {
nodes: ["pre"],
name: "Preformatted",
image: "icons/paragraph.svg",
html: `Today I shall be meeting with interference,
ingratitude, insolence, disloyalty, ill-will, and
selfishness all of them due to the offenders'
ignorance of what is good or evil.. `,
properties: [{
name: "Text",
key: "text",
inline:false,
htmlAttr: "innerHTML",
inputtype: TextareaInput,
data:{
rows:20,
}
}]
});
Vvveb.Components.extend("_base", "html/form", {
nodes: ["form"],
image: "icons/form.svg",
name: "Form",
html: ``,
properties: [/*{
name: "Style",
key: "style",
htmlAttr: "class",
validValues: ["", "form-search", "form-inline", "form-horizontal"],
inputtype: SelectInput,
data: {
options: [{
value: "",
text: "Default"
}, {
value: "form-search",
text: "Search"
}, {
value: "form-inline",
text: "Inline"
}, {
value: "form-horizontal",
text: "Horizontal"
}]
}
}, */{
name: "Action",
key: "action",
htmlAttr: "action",
inputtype: TextInput
}, {
name: "Method",
key: "method",
htmlAttr: "method",
inputtype: SelectInput,
data: {
options: [{
value: "post",
text: "Post"
}, {
value: "get",
text: "Get"
}]
}
}, {
name: "Encoding type",
key: "enctype",
htmlAttr: "enctype",
inputtype: SelectInput,
data: {
options: [{
value: "",
text: ""
}, {
value: "application/x-www-form-urlencoded",
text: "Url encoded (default)"
}, {
value: "multipart/form-data",
text: "Multipart (for file upload)"
}, {
value: "text/plain",
text: "Text plain"
}]
}
}]
});
Vvveb.Components.extend("_base", "html/tablerow", {
nodes: ["tr"],
image: "icons/table.svg",
name: "Table Row",
html: "Cell 1 Cell 2 Cell 3 ",
properties: [{
name: "Type",
key: "type",
htmlAttr: "class",
inputtype: SelectInput,
validValues: ["", "success", "danger", "warning", "active"],
data: {
options: [{
value: "",
text: "Default"
}, {
value: "success",
text: "Success"
}, {
value: "error",
text: "Error"
}, {
value: "warning",
text: "Warning"
}, {
value: "active",
text: "Active"
}]
}
}]
});
Vvveb.Components.extend("_base", "html/tablecell", {
nodes: ["td"],
image: "icons/table.svg",
name: "Table Cell",
html: "Cell "
});
Vvveb.Components.extend("_base", "html/tableheadercell", {
nodes: ["th"],
image: "icons/table.svg",
name: "Table Header Cell",
html: "Head "
});
Vvveb.Components.extend("_base", "html/tablebody", {
nodes: ["tbody"],
image: "icons/table.svg",
name: "Table Body",
html: "Table body "
});
Vvveb.Components.extend("_base", "html/tablefooter", {
nodes: ["tfooter"],
image: "icons/table.svg",
name: "Table Footer",
html: "Table footer "
});
Vvveb.Components.extend("_base", "html/tablehead", {
nodes: ["thead"],
image: "icons/table.svg",
name: "Table Head",
html: "Head 1 Head 2 Head 3 ",
properties: [{
name: "Type",
key: "type",
htmlAttr: "class",
inputtype: SelectInput,
validValues: ["", "success", "danger", "warning", "info"],
data: {
options: [{
value: "",
text: "Default"
}, {
value: "success",
text: "Success"
}, {
value: "anger",
text: "Error"
}, {
value: "warning",
text: "Warning"
}, {
value: "info",
text: "Info"
}]
}
}]
});
Vvveb.Components.extend("_base", "html/table", {
nodes: ["table"],
classes: ["table"],
image: "icons/table.svg",
name: "Table",
html: `
#
First
Last
Handle
1
Mark
Otto
@mdo
2
Jacob
Thornton
@fat
3
Larry the Bird
@twitter
`,
properties: [{
name: "Type",
key: "type",
htmlAttr: "class",
validValues: ["table-primary", "table-secondary", "table-success", "table-danger", "table-warning", "table-info", "table-light", "table-dark", "table-white"],
inputtype: SelectInput,
data: {
options: [{
value: "Default",
text: ""
}, {
value: "table-primary",
text: "Primary"
},{
value: "table-secondary",
text: "Secondary"
},{
value: "table-success",
text: "Success"
},{
value: "table-danger",
text: "Danger"
},{
value: "table-warning",
text: "Warning"
},{
value: "table-info",
text: "Info"
},{
value: "table-light",
text: "Light"
},{
value: "table-dark",
text: "Dark"
},{
value: "table-white",
text: "White"
}]
}
}, {
name: "Responsive",
key: "responsive",
htmlAttr: "class",
validValues: ["table-responsive"],
inputtype: ToggleInput,
data: {
on: "table-responsive",
off: ""
}
}, {
name: "Small",
key: "small",
htmlAttr: "class",
validValues: ["table-sm"],
inputtype: ToggleInput,
data: {
on: "table-sm",
off: ""
}
}, {
name: "Hover",
key: "hover",
htmlAttr: "class",
validValues: ["table-hover"],
inputtype: ToggleInput,
data: {
on: "table-hover",
off: ""
}
}, {
name: "Bordered",
key: "bordered",
htmlAttr: "class",
validValues: ["table-bordered"],
inputtype: ToggleInput,
data: {
on: "table-bordered",
off: ""
}
}, {
name: "Striped",
key: "striped",
htmlAttr: "class",
validValues: ["table-striped"],
inputtype: ToggleInput,
data: {
on: "table-striped",
off: ""
}
}, {
name: "Inverse",
key: "inverse",
htmlAttr: "class",
validValues: ["table-inverse"],
inputtype: ToggleInput,
data: {
on: "table-inverse",
off: ""
}
},
{
name: "Head options",
key: "head",
htmlAttr: "class",
child:"thead",
inputtype: SelectInput,
validValues: ["", "thead-dark", "thead-light"],
data: {
options: [{
value: "",
text: "None"
}, {
value: "thead-default",
text: "Default"
}, {
value: "thead-inverse",
text: "Inverse"
}]
}
}]
});
Vvveb.Components.extend("_base", "html/audio", {
nodes: ["audio"],
attributes: ["data-component-audio"],
name: "Audio",
image: "icons/audio.svg",
html: ` `,
properties: [{
name: "Src",
key: "src",
child:"audio",
htmlAttr: "src",
inputtype: LinkInput
}, {
key: "audio_options",
inputtype: SectionInput,
name:false,
data: {header:"Options"},
}, {
name: "Autoplay",
key: "autoplay",
htmlAttr: "autoplay",
child:"audio",
inputtype: CheckboxInput,
inline:true,
col:4,
/* }, {
name: "Controls",
key: "controls",
htmlAttr: "controls",
inputtype: CheckboxInput,
child:"audio",
inline:true,
col:4,
*/ }, {
name: "Loop",
key: "loop",
htmlAttr: "loop",
inputtype: CheckboxInput,
child:"audio",
inline:true,
col:4
}]
});
Vvveb.Components.extend("_base", "html/pdf", {
attributes: ["data-component-pdf"],
image: "icons/pdf.svg",
name: "Pdf embed",
html: ` `,
properties: [{
name: "Data",
key: "data",
htmlAttr: "data",
inputtype: TextInput
}]
});
Vvveb.Components.extend("_base", "html/embed", {
attributes: ["data-component-embed"],
image: "icons/embed.svg",
name: "Embed",
html: ` `,
properties: [{
name: "Data",
key: "data",
htmlAttr: "data",
inputtype: TextInput
}]
});
Vvveb.Components.extend("_base", "html/html", {
nodes: ["html"],
name: "Html Page",
image: "icons/posts.svg",
html: ``,
properties: [{
name: "Title",
key: "title",
htmlAttr: "innerHTML",
inputtype: TextInput,
child:"title",
}, {
name: "Meta description",
key: "description",
htmlAttr: "content",
inputtype: TextInput,
child:'meta[name=description]',
}, {
name: "Meta keywords",
key: "keywords",
htmlAttr: "content",
inputtype: TextInput,
child:'meta[name=keywords]',
}]
});
/*
Vvveb.ComponentsGroup['Base'] =
["html/heading", "html/image", "html/hr", "html/form", "html/textinput", "html/textareainput", "html/selectinput", "html/fileinput", "html/checkbox", "html/radiobutton", "html/link", "html/video", "html/button", "html/paragraph", "html/blockquote", "html/list", "html/table", "html/preformatted"];
*/
Vvveb.Components.extend("_base", "html/iframe", {
attributes: ["data-component-iframe"],
name: "Iframe",
image: "icons/file.svg",
html: '
',
properties: [{
name: "Src",
key: "src",
htmlAttr: "src",
child:"iframe",
inputtype: TextInput
}, {
name: "Width",
key: "width",
htmlAttr: "width",
child:"iframe",
inputtype: CssUnitInput
}, {
name: "Height",
key: "height",
htmlAttr: "height",
child:"iframe",
inputtype: CssUnitInput
}]
});