Skip to content

Commit

Permalink
fleshing out...
Browse files Browse the repository at this point in the history
  • Loading branch information
rambo committed Mar 23, 2013
1 parent 17669f3 commit d333aef
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion software/pc/animationbuilder/animationbuilder.html
Expand Up @@ -58,18 +58,40 @@ <h2>Generated code</h2>
this.state = 'running';
current_frame = 0;
num_frames = jQuery('#frames tbody tr').length;
create_preview_elements();
setTimeout(run_step, 1);
}

var create_preview_elements = function()
{
tbl = '<table><thead><tr>';
tbod = '<tr>';
for(i=0; i<8; i++)
{
if (jQuery('#led_'+i+'_enabled').filter(':checked').length)
{
lbl = jQuery('#lbl_led_'+i+'_enabled')
tbl += '<th>'+lbl.html()+'</th>';
tbod += '<td id="preview_led_'+i+'"> &nbsp; </td>';
}
}
tbl += '</tr></thead><tbody></tbody></table>';
jQuery('#preview').append(tbl);
jQuery('#preview table tbody').append(tbod);
}

this.stop = function()
{
this.state = 'stopped';
current_frame = 0;
// Remove the preview elements
jQuery('#preview').children().remove();
}

var run_step = function()
{
console.log('run_step called');

}
};
animation = new animation_class();
Expand Down Expand Up @@ -154,7 +176,7 @@ <h2>Generated code</h2>
});
</script>
<style type="text/css">
#frames td, #frames th
#frames td, #frames th, #preview table td, #preview table th
{
border: 1px solid black;
}
Expand All @@ -166,6 +188,11 @@ <h2>Generated code</h2>
{
width: 6em;
}
#preview table td
{
width: 75px;
height: 75px;
}
</style>
</body>
</html>

0 comments on commit d333aef

Please sign in to comment.