emojinput/index.html

32 lines
1009 B
HTML
Raw Permalink Normal View History

2022-02-04 17:01:04 +00:00
<!doctype HTML>
<html>
<head>
<title>elmoji</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div id="node"></div>
<script src="js/main.js"></script>
<script>
var app = Elm.Main.init({
node: document.getElementById('node')
});
app.ports.copy.subscribe(function(str) {
var el = document.createElement('textarea');
el.value = str;
el.setAttribute('readonly', '');
el.style = {position: 'absolute', left: '-9999px'};
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
2022-02-05 20:05:41 +00:00
window.webkit.messageHandlers.external.postMessage(str);
// window.external.invoke("test_one");
2022-02-04 17:01:04 +00:00
});
</script>
</body>
</html>