Free javascript Hosting


customtool.js

Uploaded on Jan 07 2022 01:32 by armando.gutierrez

unlayer.registerTool({
name: 'Questions',
label: 'Question',
icon: 'fa-question',
supportedDisplayModes: ['web', 'email'],
options: {
colors: {
title: 'Colors',
options: {
label: 'Text Color',
defaultValue: '#000',
widget: 'color_picker',
},
},
questions: {
products: {
name: 'question',
label: 'Question list',
widget: 'dropdown',
},
},
},
values: {},
renderer: {
Viewer: unlayer.createViewer({
render(values) {
return `<div><span>${values.data.value}</span></div>`;
},
}),
exporters: {
web(values) {
return `<div><span>${values.data.value}</span></div>`;
},
email(values) {
return `<div><span>${values.data.value}</span></div>`;
},
},
},
tools: {
'custom#questions': {
properties: {
questions: {
editor: {
data: {
options: [
{ label: 'Question 1', value: '#1' },
{ label: 'Question 2', value: '#2' },
{ label: 'Question 3', value: '#3' },
{ label: 'Question 4', value: '#4' },
],
},
},
},
},
},
},
});

Back to list