rss-bridge/templates/frontpage.html.php
sysadminstory 7591b10219
[Core] New feature : User Interface to "Detect" Feed from an URL (#3436)
* [Core] New feature : User Interface to "Detect" Feed from an URL

Detect Action has been expanded to support returning a Feed in a JSON
format instead of a Redirect. Existing usage of the Detect action will
keep working as usual.

Frontpage template has now a section to display the Feed detection
result, and a button to start the Feed Detection.

A new JS file contains the necessary JS (Ajax and Event management) to
fill the Feed Detection section.

* Coding policy fixes

* [Core] New feature : User Interface to "Detect" Feed from an URL

- Switch from old school XMLHttpRequest to fetch
- Enhance UX of search results
- Revert to it's original content
- Switch to a new Action : FindfeedAction.php
- Switch to template literals instead of string concatenation
- FindFeed action could retrun multiple feeds
- Results are sent with an absolute URL
- Switch to Json::encode() helper function

* [Core] New feature : User Interface to "Detect" Feed from an URL

- Move specific JS code to rss-bridge.js
- Change HTML tag for the button to have a consistant style with th rest
  of the page

* [Core] New feature : User Interface to "Detect" Feed from an URL

- If no context is sent, assume there is only one unnamed context
- Find parameter name in global and currect context

* fix

* remove typo

---------

Co-authored-by: Dag <me@dvikan.no>
2023-08-22 20:44:36 +02:00

65 lines
1.8 KiB
PHP

<script src="static/rss-bridge.js"></script>
<script>
document.addEventListener('DOMContentLoaded', rssbridge_toggle_bridge);
document.addEventListener('DOMContentLoaded', rssbridge_list_search);
document.addEventListener('DOMContentLoaded', rssbridge_feed_finder);
</script>
<section class="searchbar">
<h3>Search</h3>
<input
type="text"
name="searchfield"
id="searchfield"
placeholder="Insert URL or bridge name"
onchange="rssbridge_list_search()"
onkeyup="rssbridge_list_search()"
value=""
>
<button
type="button"
id="findfeed"
name="findfeed"
/>Find Feed from URL</button>
<section id="findfeedresults">
</section>
</section>
<?= raw($bridges) ?>
<section class="footer">
<a href="https://github.com/rss-bridge/rss-bridge">RSS-Bridge ~ Public Domain</a><br>
<p class="version"><?= e(Configuration::getVersion()) ?></p>
<?= $active_bridges ?>/<?= $total_bridges ?> active bridges.<br>
<?php if ($active_bridges !== $total_bridges): ?>
<?php if ($show_inactive): ?>
<a href="?show_inactive=0">
<button class="small">Hide inactive bridges</button>
</a>
<br>
<?php else: ?>
<a href="?show_inactive=1">
<button class="small">Show inactive bridges</button>
</a>
<br>
<?php endif; ?>
<?php endif; ?>
<br>
<?php if ($admin_email): ?>
<div>
Email: <a href="mailto:<?= e($admin_email) ?>"><?= e($admin_email) ?></a>
</div>
<?php endif; ?>
<?php if ($admin_telegram): ?>
<div>
Telegram: <a href="<?= e($admin_telegram) ?>"><?= e($admin_telegram) ?></a>
</div>
<?php endif; ?>
</section>