mirror of https://github.com/Squidex/squidex.git
committed by
GitHub
1 changed files with 49 additions and 0 deletions
@ -0,0 +1,49 @@ |
|||||
|
<!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> |
||||
|
|
||||
|
<style> |
||||
|
textarea { |
||||
|
box-sizing: border-box; |
||||
|
border: 0; |
||||
|
border-radius: 0; |
||||
|
resize: none; |
||||
|
overflow: hidden; |
||||
|
width: 100%; |
||||
|
} |
||||
|
</style> |
||||
|
</head> |
||||
|
|
||||
|
<body> |
||||
|
<script> |
||||
|
function grow(element) { |
||||
|
element.style.height = "5px"; |
||||
|
element.style.height = (element.scrollHeight)+"px"; |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<textarea oninput="grow(this)" name="content" id="editor"></textarea> |
||||
|
|
||||
|
<script> |
||||
|
var element = document.getElementById('editor'); |
||||
|
|
||||
|
// When the plugin is instantiated it notifies the UI that it has been loaded. |
||||
|
// |
||||
|
// Furthermore it sends the current size to the parent. |
||||
|
var plugin = new SquidexPlugin(); |
||||
|
|
||||
|
// The content is only available when it is used as a sidebar plugin for single content items. |
||||
|
plugin.onContentChanged(function (content) { |
||||
|
element.innerHTML = JSON.stringify(content, null, 2); |
||||
|
|
||||
|
grow(element); |
||||
|
}); |
||||
|
</script> |
||||
|
</body> |
||||
|
|
||||
|
</html> |
||||
Loading…
Reference in new issue