Created
September 15, 2023 07:58
-
-
Save bjoerntx/c3a33199638222ca1e1e9e11755e2700 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>TX Text Control Document Editor from JS</title> | |
<script | |
src="https://backend.textcontrol.com/api/TXWebSocket/GetResource?name=tx-document-editor.min.js"> | |
</script> | |
<style> | |
#txDocumentEditor { | |
height: 800px; | |
width: 800px; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="txDocumentEditor"></div> | |
<script type="module"> | |
TXTextControl.init({ | |
containerID: "txDocumentEditor", | |
webSocketURL: "wss://backend.textcontrol.com/api/TXWebSocket?access-token=your_trial_token" | |
}); | |
var documentString = "Hey - it compiles! <strong>Ship it!</strong>"; | |
TXTextControl.addEventListener("textControlLoaded", function () { | |
TXTextControl.loadDocument(TXTextControl.StreamType.HTMLFormat, btoa(documentString)); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment