jqwidgets-scripts-custom
Version:
jQWidgets is an advanced jQuery, Angular 7, Vue, React, ASP .NET MVC, Custom Elements and HTML5 UI framework.
60 lines (55 loc) • 2.62 kB
JavaScript
import React from 'react';
import ReactDOM from 'react-dom';
import JqxEditor from '../../../jqwidgets-react/react_jqxeditor.js';
class App extends React.Component {
render() {
let tools = 'bold italic underline | font size | left center right | outdent indent';
let createCommand = (name) => {
switch (name) {
case 'font':
return {
init: (widget) => {
widget.jqxDropDownList({
source: [
{ label: 'Arial', value: 'Arial, Helvetica, sans-serif' },
{ label: 'Comic Sans MS', value: '"Comic Sans MS", cursive, sans-serif' },
{ label: 'Courier New', value: '"Courier New", Courier, monospace' },
{ label: 'Georgia', value: 'Georgia,serif' }]
});
}
}
case 'size':
return {
init: (widget) => {
widget.jqxDropDownList({
source: [
{ label: '8pt', value: 'xx-small' },
{ label: '12pt', value: 'small' },
{ label: '18pt', value: 'large' },
{ label: '36pt', value: 'xx-large' }
]
});
}
}
}
};
return (
<JqxEditor width={800} height={400} tools={tools} createCommand={createCommand}>
<b>jqxEditor</b> is a HTML text editor designed to simplify web content creation. You can use it as a replacement of your Textarea or you can create it from a DIV element.
<br />
<br />
Features include:
<br />
<ul>
<li>Text formatting</li>
<li>Text alignment</li>
<li>Hyperlink dialog</li>
<li>Image dialog</li>
<li>Bulleted list</li>
<li>Numbered list</li>
</ul>
</JqxEditor>
)
}
}
ReactDOM.render(<App />, document.getElementById('app'));