Skip to content

Commit

Permalink
Allow deep link to extension configuration (FreshRSS#5449)
Browse files Browse the repository at this point in the history
* Allow deep link to extension configuration
Full screen

* Support slider

* Add aside_configure
Fix FreshRSS#5449 (comment)
  • Loading branch information
Alkarex authored and math-GH committed Jul 4, 2023
1 parent 6ec544e commit f9b401f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/Controllers/extensionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected function getAvailableExtensionList(): array {
public function configureAction(): void {
if (Minz_Request::paramBoolean('ajax')) {
$this->view->_layout(null);
} else {
} elseif (Minz_Request::paramBoolean('slider')) {
$this->indexAction();
$this->view->_path('extension/index.phtml');
}
Expand Down
9 changes: 7 additions & 2 deletions app/views/helpers/extension/configure.phtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php /** @var FreshRSS_View $this */ ?>
<?php
/** @var FreshRSS_View $this */
if (!Minz_Request::paramBoolean('ajax')) {
$this->partial('aside_configure');
}
?>
<div class="post">
<h2>
<?= $this->extension->getName() ?> (<?= $this->extension->getVersion() ?>) —
Expand All @@ -11,7 +16,7 @@
<form id="form-extension" method="post">
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
<div class="form-group form-actions">
<div class="group-controls">
<div class="group-controls">
<button class="btn btn-attention confirm" form="form-extension" formaction="<?= _url('extension', 'remove', 'e', urlencode($this->extension->getName())) ?>"><?= _t('gen.action.remove') ?></button>
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions p/scripts/extra.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ function open_slider_listener(ev) {
slider.classList.add('active');
slider.scrollTop = 0;
slider_content.innerHTML = this.response.body.innerHTML;
slider_content.querySelectorAll('form').forEach(function (f) {
f.insertAdjacentHTML('afterbegin', '<input type="hidden" name="slider" value="1" />');
});
context.ajax_loading = false;
slider.dispatchEvent(freshrssSliderLoadEvent);
};
Expand Down

0 comments on commit f9b401f

Please sign in to comment.