autogen c version of text from js

This commit is contained in:
Christopher Chedeau
2014-04-28 13:06:00 -07:00
parent e9550a6116
commit 0708b5eb75
4 changed files with 43 additions and 18 deletions

View File

@@ -15,6 +15,8 @@ textarea {
<script>
document.getElementById('layout_code').value = computeLayout.toString()
.replace(/\.children\.length/g, '.children_count')
.replace(/\.width/g, '.dimensions[CSS_WIDTH]')
.replace(/\.height/g, '.dimensions[CSS_HEIGHT]')
.replace(/layout\[dim/g, 'layout.dimensions[dim')
.replace(/layout\[pos/g, 'layout.position[pos')
.replace(/layout\[leading/g, 'layout.position[leading')
@@ -24,7 +26,9 @@ document.getElementById('layout_code').value = computeLayout.toString()
.replace(/child\./g, 'child->')
.replace(/var\/\*([^\/]+)\*\//g, '$1')
.replace(/ === /g, ' == ')
.replace(/\n /g, '\n');
.replace(/\n /g, '\n')
.replace(/\/[*]!([^*]+)[*]\//g, '$1')
.split('\n').slice(1).join('\n');
</script>
<h1>Tests</h1>