27 lines
753 B
HTML
27 lines
753 B
HTML
![]() |
<script src="Layout.js"></script>
|
||
|
|
||
|
<style>
|
||
|
textarea {
|
||
|
height: 200px;
|
||
|
width: 800px;
|
||
|
border: 1px solid black;
|
||
|
font-size: 12px;
|
||
|
font-family: monospace;
|
||
|
}
|
||
|
</style>
|
||
|
|
||
|
<h1>layoutCode</h1>
|
||
|
<textarea id="layout_code" onclick="this.select()"></textarea>
|
||
|
<script>
|
||
|
document.getElementById('layout_code').value = computeLayout.layoutNode.toString()
|
||
|
.replace(/\.children\.length/g, '.children_count')
|
||
|
.replace(/layout\[dim/g, 'layout.dimensions[dim')
|
||
|
.replace(/layout\[pos/g, 'layout.position[pos')
|
||
|
.replace(/layout\[leading/g, 'layout.position[leading')
|
||
|
.replace(/style\[dim/g, 'style.dimensions[dim')
|
||
|
.replace(/node\./g, 'node->')
|
||
|
.replace(/child\./g, 'child->')
|
||
|
.replace(/var\/\*([^\/]+)\*\//g, '$1')
|
||
|
.replace(/\n /g, '\n');
|
||
|
</script>
|