Created
August 24, 2023 11:31
-
-
Save bjoerntx/eaffae66dd62cc574f15565ebec66a73 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://localhost:7031/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://localhost:7031/api/TXWebSocket" | |
}); | |
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