Created
October 23, 2017 21:55
-
-
Save bjoerntx/d89f0052306428d0d3d77f2835087211 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
@using TXTextControl.Web | |
@using TXTextControl.Web.MVC | |
@Html.TXTextControl().TextControl(settings => | |
{ | |
settings.Dock = DockStyle.Window; | |
}).Render() | |
<script> | |
window.onload = function () { | |
function receiveMessage(e) { | |
if (e.origin !== "http://localhost:3053") | |
return; | |
var message = JSON.parse(e.data); | |
if (message.txtextcontrol == null) | |
return; | |
switch (message.txtextcontrol.method) { | |
case "loadDocument": { | |
var encoded = btoa(message.txtextcontrol.parameter); | |
TXTextControl.loadSelection(TXTextControl.StreamType.HTMLFormat, encoded); | |
} | |
} | |
} | |
window.addEventListener('message', receiveMessage); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment