-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
33 lines (32 loc) · 950 Bytes
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<html>
<head>
<title>Test</title>
</head>
<body>
<div id="testcontainer"></div>
<style>.gutter { width:100px } </style>
<script type="module">
import Myopie from 'https://www.unpkg.com/myopie.js/myopie.min.js';
function render( data ) {
return "<div><input type='text' name='testText' value='" + data.content.string + "'></div>";
}
const myopie = new Myopie( "#testcontainer", render, [ ['input[name="testText"]', 'content/string']] );
myopie.set( 'content/string', 'foo' );
setTimeout( () => {
console.log( 'Timeout 1');
myopie.set( 'content/string', 'bar' );
myopie.set( 'content/string', 'foobar' );
}, 3000 );
console.log( myopie.get( 'content/string' ) );
setTimeout( () => {
console.log( 'Timeout 2');
console.log( myopie.get( 'content/string' ) );
myopie.set( 'content/string', 'foobarfoo' );
}, 4000 );
setTimeout( () => {
console.log( 'Timeout 3');
console.log( myopie.get( 'content/string' ) );
}, 15000 );
</script>
</body>
</html>