mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.2 KiB
42 lines
1.2 KiB
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
|
|
<!-- Load the editor sdk from the local folder or https://cloud.squidex.io/scripts/editor-sdk.js -->
|
|
<script src="editor-sdk.js"></script>
|
|
</head>
|
|
|
|
<body>
|
|
<textarea style="width: 100%; box-sizing: border-box; height: 40px;" name="content" id="editor"></textarea>
|
|
|
|
<script>
|
|
var element = document.getElementById('editor');
|
|
|
|
// When the field is instantiated it notifies the UI that it has been loaded.
|
|
//
|
|
// Furthermore it sends the current size to the parent.
|
|
var field = new SquidexFormField();
|
|
|
|
// Handle the value change event and set the text to the editor.
|
|
field.onValueChanged(function (value) {
|
|
element.value = value || '';
|
|
});
|
|
|
|
// Disable the editor when it should be disabled.
|
|
field.onDisabled(function (disabled) {
|
|
element.disabled = disabled;
|
|
});
|
|
|
|
field.onFormValueChanged(function(value) {
|
|
if (value.a && value.a.iv && value.b && value.b.iv) {
|
|
element.value = value.a.iv + value.b.iv;
|
|
|
|
field.valueChanged(element.value);
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
|
|
</html>
|