<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package Webmin::JavascriptButton;
use Webmin::Input;
use WebminCore;
@ISA = ( "Webmin::Input" );

=head2 new Webmin::JavascriptButton(label, script, [disabled])
Create a button that runs some Javascript when clicked
=cut
sub new
{
if (defined(&amp;Webmin::Theme::JavascriptButton::new) &amp;&amp;
    caller() !~ /Webmin::Theme::JavascriptButton/) {
        return new Webmin::Theme::JavascriptButton(@_[1..$#_]);
        }
my ($self, $value, $script, $disabled) = @_;
$self = { };
bless($self);
$self-&gt;set_value($value);
$self-&gt;set_script($script);
$self-&gt;set_disabled($disabled) if ($disabled);
return $self;
}

=head2 html()
Returns the HTML for this text input
=cut
sub html
{
my ($self) = @_;
return "&lt;input type=button value=\"".&amp;quote_escape($self-&gt;get_value())."\" ".
       "onClick=\"".$self-&gt;get_script()."\"&gt;";
}

sub set_script
{
my ($self, $script) = @_;
$self-&gt;{'script'} = $script;
}

sub get_script
{
my ($self) = @_;
return $self-&gt;{'script'};
}

1;

</pre></body></html>