32 lines
1009 B
HTML
32 lines
1009 B
HTML
<!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);
|
|
|
|
window.webkit.messageHandlers.external.postMessage(str);
|
|
// window.external.invoke("test_one");
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|