… | |
… | |
1532 | my $load_node; $load_node = sub { |
1532 | my $load_node; $load_node = sub { |
1533 | my ($node, $para) = @_; |
1533 | my ($node, $para) = @_; |
1534 | |
1534 | |
1535 | $buttons->clear; |
1535 | $buttons->clear; |
1536 | |
1536 | |
|
|
1537 | $buttons->add (new CFPlus::UI::Button |
|
|
1538 | text => "⇤", |
|
|
1539 | tooltip => "back to the starting page", |
|
|
1540 | on_activate => sub { |
|
|
1541 | unshift @future, [$curnode, $viewer->current_paragraph] if $curnode; |
|
|
1542 | unshift @future, @history; |
|
|
1543 | @history = (); |
|
|
1544 | $load_node->(@{shift @future}); |
|
|
1545 | }, |
|
|
1546 | ); |
|
|
1547 | |
1537 | if (@history) { |
1548 | if (@history) { |
1538 | $buttons->add (new CFPlus::UI::Button |
1549 | $buttons->add (new CFPlus::UI::Button |
1539 | text => "⋘", |
1550 | text => "⋘", |
1540 | tooltip => "back to <i>" . (CFPlus::asxml CFPlus::Pod::full_path $history[-1]) . "</i>", |
1551 | tooltip => "back to <i>" . (CFPlus::asxml CFPlus::Pod::full_path $history[-1][0]) . "</i>", |
1541 | on_activate => sub { |
1552 | on_activate => sub { |
1542 | unshift @future, [$curnode, $viewer->current_paragraph] if $curnode; |
1553 | unshift @future, [$curnode, $viewer->current_paragraph] if $curnode; |
1543 | $load_node->(@{pop @history}); |
1554 | $load_node->(@{pop @history}); |
1544 | }, |
1555 | }, |
1545 | ); |
1556 | ); |
1546 | } |
1557 | } |
1547 | |
1558 | |
1548 | if (@future) { |
1559 | if (@future) { |
1549 | $buttons->add (new CFPlus::UI::Button |
1560 | $buttons->add (new CFPlus::UI::Button |
1550 | text => "⋙", |
1561 | text => "⋙", |
1551 | tooltip => "forward to <i>" . (CFPlus::asxml CFPlus::Pod::full_path $future[0]) . "</i>", |
1562 | tooltip => "forward to <i>" . (CFPlus::asxml CFPlus::Pod::full_path $future[0][0]) . "</i>", |
1552 | on_activate => sub { |
1563 | on_activate => sub { |
1553 | push @history, [$curnode, $viewer->current_paragraph]; |
1564 | push @history, [$curnode, $viewer->current_paragraph]; |
1554 | $load_node->(@{shift @future}); |
1565 | $load_node->(@{shift @future}); |
1555 | }, |
1566 | }, |
1556 | ); |
1567 | ); |
… | |
… | |
1587 | $CFPlus::Pod::goto_document = sub { |
1598 | $CFPlus::Pod::goto_document = sub { |
1588 | my (@path) = @_; |
1599 | my (@path) = @_; |
1589 | |
1600 | |
1590 | push @history, [$curnode, $viewer->current_paragraph] if $curnode; @future = (); |
1601 | push @history, [$curnode, $viewer->current_paragraph] if $curnode; @future = (); |
1591 | |
1602 | |
1592 | $load_node->(CFPlus::Pod::find @path); |
1603 | $load_node->((CFPlus::Pod::find @path)[0]); |
1593 | $win->show; |
1604 | $win->show; |
1594 | }; |
1605 | }; |
1595 | |
1606 | |
1596 | $win |
1607 | $win |
1597 | } |
1608 | } |