Skip to content

Commit e75efbc

Browse files
committed
Persist "show example code" state
1 parent e785189 commit e75efbc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

web/regex_demo.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@
366366
my $i=1;
367367
my $hash = '#' . $jq->param( { regex=>$regex, flags=>$flags,
368368
( length $precode ? (pre=>$precode) : () ),
369+
( $samplecode_ta->is(':visible') ? (showsampcode=>1) : () ),
369370
map { "samp".$i++ => $_ } @samps } );
370371
my $baseurl = js('window.location')->{href} =~ s/#.*\z//r;
371372
$thisurl_ta->text( $baseurl . $hash );
@@ -389,6 +390,11 @@
389390
$ta_regex->text($res{regex});
390391
$ta_regex->height($ta_regex->[0]->{scrollHeight});
391392
$ta_flags->text($res{flags});
393+
if ($res{showsampcode}) {
394+
$samplecode_ta->show;
395+
$codecopy->show;
396+
$sampcodebtn->text('Hide Example Perl Code');
397+
}
392398
if (exists $res{pre}) {
393399
$precode_ta->text($res{pre});
394400
$precode_ta->show;
@@ -400,6 +406,7 @@
400406
newsamp($res{"samp$i"});
401407
}
402408
}
409+
update();
403410
}
404411
else { js('window.location')->{hash}='' }
405412
}

0 commit comments

Comments
 (0)