Skip to content

Commit

Permalink
hard transitions work
Browse files Browse the repository at this point in the history
  • Loading branch information
rambo committed Mar 23, 2013
1 parent 8256f64 commit 13e3363
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions software/pc/animationbuilder/animationbuilder.html
Expand Up @@ -53,9 +53,10 @@ <h2>Generated code</h2>

this.start = function()
{
console.log('animation_class::start called');
if (this.state != 'stopped')
{
console.log('Already started');
console.log('Already running!');
return;
}
this.state = 'running';
Expand All @@ -66,6 +67,7 @@ <h2>Generated code</h2>

var create_preview_elements = function()
{
console.log('animation_class::create_preview_elements called');
tbl = '<table><thead><tr>';
tbod = '<tr>';
for(i=0; i<8; i++)
Expand All @@ -84,6 +86,7 @@ <h2>Generated code</h2>

this.stop = function()
{
console.log('animation_class::stop called');
this.state = 'stopped';
clearTimeout(timer);
current_frame = 0;
Expand All @@ -93,7 +96,7 @@ <h2>Generated code</h2>

var run_step = function()
{
console.log('run_step called, current_frame='+current_frame);
console.log('animation_class::run_step called, current_frame='+current_frame);
if (this.state == 'stopped')
{
console.log('state is stopped, returning via stop');
Expand Down Expand Up @@ -172,7 +175,7 @@ <h2>Generated code</h2>
}
});
// Row remove callback (TODO: before this we should probably make sure only the last row has the input)
jQuery('button.deleterow').click(function(){
jQuery(jQuery('#frames tbody tr').get(rows)).find('button.deleterow').click(function(){
me = jQuery(this);
me.parents('tr').remove();
// Re-enable LED selectors when we have no frames
Expand All @@ -185,24 +188,23 @@ <h2>Generated code</h2>
jQuery('#previewbutton').hide();
}
});
//
jQuery('#previewbutton').click(function(e){
e.preventDefault();
me = jQuery(this);
console.log('previewbutton clicked, animation.state=' + animation.state);
if (animation.state == 'stopped')
{
me.html('Stop preview');
animation.start();
}
else
{
me.html('Preview');
animation.stop();
}
return false;
});

});

jQuery('#previewbutton').click(function(e){
e.preventDefault();
me = jQuery(this);
console.log('previewbutton clicked, animation.state=' + animation.state);
if (animation.state == 'stopped')
{
me.html('Stop preview');
animation.start();
}
else
{
me.html('Preview');
animation.stop();
}
return false;
});
});
</script>
Expand Down

0 comments on commit 13e3363

Please sign in to comment.