mirror of https://github.com/Squidex/squidex.git
2 changed files with 68 additions and 0 deletions
@ -0,0 +1,40 @@ |
|||
<!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 notified the UI that it has been loaded. |
|||
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> |
|||
@ -0,0 +1,28 @@ |
|||
<!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: 100px;" name="content" id="editor"></textarea> |
|||
|
|||
<script> |
|||
var element = document.getElementById('editor'); |
|||
|
|||
// When the field is instantiated it notified the UI that it has been loaded. |
|||
var field = new SquidexFormField(); |
|||
|
|||
field.onInit(function (context) { |
|||
if (context) { |
|||
element.innerHTML = JSON.stringify(context, null, 2); |
|||
} |
|||
}); |
|||
</script> |
|||
</body> |
|||
|
|||
</html> |
|||
Loading…
Reference in new issue