mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
add gemtext links support
This commit is contained in:
parent
d8175ec04e
commit
2b1b2d8b1a
1 changed files with 36 additions and 0 deletions
|
|
@ -259,6 +259,42 @@ class Page
|
|||
0
|
||||
);
|
||||
|
||||
$this->content->connect(
|
||||
'activate-link',
|
||||
function ($label, $href)
|
||||
{
|
||||
$address = new \Yggverse\Net\Address(
|
||||
$href
|
||||
);
|
||||
|
||||
if ($address->isRelative())
|
||||
{
|
||||
$base = new \Yggverse\Net\Address(
|
||||
$this->address->get_text()
|
||||
);
|
||||
|
||||
if ($absolute = $address->getAbsolute($base))
|
||||
{
|
||||
$this->open(
|
||||
$absolute
|
||||
);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
throw new Exception(); // @TODO
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$this->open(
|
||||
$address->get()
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// Compose footer
|
||||
$this->footer = new \GtkBox(
|
||||
\GtkOrientation::HORIZONTAL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue