package SGN::View::Mason::Commands;
use strict;
use vars qw($m $c);
HTML::Mason::Component::FileBased->new(
'code' => sub {
use utf8; local $SGN::View::Mason::Commands::m = $HTML::Mason::Commands::m;
HTML::Mason::Exception::Params->throw
    ( error =>
      "Odd number of parameters passed to component expecting name/value pairs"
    ) if @_ % 2;
my ( $image_id, $type, $id, $display_order );
{
    my %pos;
    for ( my $x = 0; $x < @_; $x += 2 )
    {
        $pos{ $_[$x] } = $x + 1;
    }

    foreach my $arg ( qw( image_id type id display_order ) )
    {
        HTML::Mason::Exception::Params->throw
            ( error => "no value sent for required parameter '$arg'" )
                unless exists $pos{$arg};
    }
#line 3 "/home/production/cxgn/sgn/mason/image/display_order.mas"
    $image_id = $_[ $pos{'image_id'} ];
#line 4 "/home/production/cxgn/sgn/mason/image/display_order.mas"
    $type = $_[ $pos{'type'} ];
#line 5 "/home/production/cxgn/sgn/mason/image/display_order.mas"
    $id = $_[ $pos{'id'} ];
#line 6 "/home/production/cxgn/sgn/mason/image/display_order.mas"
    $display_order = $_[ $pos{'display_order'} ];
}
$m->debug_hook( $m->current_comp->path ) if ( HTML::Mason::Compiler::IN_PERL_DB() );

#line 1 "/home/production/cxgn/sgn/mason/image/display_order.mas"
$m->print( '
' );
#line 8 "/home/production/cxgn/sgn/mason/image/display_order.mas"
$m->print( '
<center>
<h4>Change display order for image</h4>


Display order: <input id="display_order" value="' );
#line 13 "/home/production/cxgn/sgn/mason/image/display_order.mas"
$m->print(  $display_order  );
#line 13 "/home/production/cxgn/sgn/mason/image/display_order.mas"
$m->print( '" >

<br />
<button id="submit_display_order">change</button>

<script>
  jQuery(window).ready( function() {
  
  
     jQuery(\'#submit_display_order\').click( function() { 
        var display_order = jQuery(\'#display_order\').val();
        jQuery.ajax( { 
           url: \'/ajax/image/' );
#line 25 "/home/production/cxgn/sgn/mason/image/display_order.mas"
$m->print(  $image_id  );
#line 25 "/home/production/cxgn/sgn/mason/image/display_order.mas"
$m->print( '/' );
#line 25 "/home/production/cxgn/sgn/mason/image/display_order.mas"
$m->print(  $type  );
#line 25 "/home/production/cxgn/sgn/mason/image/display_order.mas"
$m->print( '/' );
#line 25 "/home/production/cxgn/sgn/mason/image/display_order.mas"
$m->print(  $id  );
#line 25 "/home/production/cxgn/sgn/mason/image/display_order.mas"
$m->print( '/display_order/\'+display_order,
           error: function(e) { alert(\'an error occurred\'); },
           success: function(r) {
             if (r.error) { alert(r.error); return; }
             alert(\'Successfully changed display_order\');
           }
        });
     });
  });

</script>
' );
;return;
},
'declared_args' => {
  '$display_order' => { default => undef },
  '$id' => { default => undef },
  '$image_id' => { default => undef },
  '$type' => { default => undef }
},
'load_time' => 1763186167,

)
;