Browse Source

implement status code 11 route

PHP-GTK3
yggverse 4 months ago
parent
commit
dca454cf50
  1. 4
      src/Entity/Browser/Container/Tab/Page/Content.php
  2. 16
      src/Entity/Browser/Container/Tab/Page/Response.php

4
src/Entity/Browser/Container/Tab/Page/Content.php

@ -190,6 +190,7 @@ class Content
switch ($response->getCode()) switch ($response->getCode())
{ {
case 10: // response expected case 10: // response expected
case 11: // sensitive input
$this->page->title->setValue( $this->page->title->setValue(
$address->getHost(), $address->getHost(),
@ -202,7 +203,8 @@ class Content
); );
$this->page->response->show( $this->page->response->show(
$response->getMeta() // pass to placeholder $response->getMeta(), // placeholder
boolval(10 === $response->getCode()) // input visibility
); );
break; break;

16
src/Entity/Browser/Container/Tab/Page/Response.php

@ -80,16 +80,24 @@ class Response
} }
public function show( public function show(
?string $placeholder = null ?string $placeholder = null,
?bool $visible = null
): void ): void
{ {
if ($placeholder) if (!is_null($placeholder))
{ {
$this->query->setPlaceholder( $this->query->setPlaceholder(
$placeholder $placeholder
); );
} }
if (!is_null($visible))
{
$this->query->setVisible(
$visible
);
}
$this->gtk->show(); $this->gtk->show();
} }
@ -99,6 +107,10 @@ class Response
null null
); );
$this->query->setVisible(
null
);
$this->gtk->hide(); $this->gtk->hide();
} }

Loading…
Cancel
Save