[index] Show bridge options when loading with URL fragment

Loading the page with an URL fragement (#bridge-*) should result in
the bridge showing all parameters by default. Unfortunately this is
not possible using PHP, which is why a new JavaScript function is
needed (select.js)

That way, when returning from a bridge ('back to rss-bridge') will
keep the selected bridge active (only works for HTML format).
This commit is contained in:
logmanoriginal 2017-08-11 19:39:13 +02:00
parent df9e3968dc
commit cd012e115b
2 changed files with 11 additions and 0 deletions

View file

@ -213,6 +213,7 @@ $formats = Format::searchInformation();
<title>RSS-Bridge</title>
<link href="static/style.css" rel="stylesheet">
<script src="static/search.js"></script>
<script src="static/select.js"></script>
<noscript>
<style>
.searchbar {

10
static/select.js Normal file
View file

@ -0,0 +1,10 @@
function select(){
var fragment = window.location.hash.substr(1);
var bridge = document.getElementById(fragment);
if(bridge !== null) {
bridge.getElementsByClassName('showmore-box')[0].checked = true;
}
}
document.addEventListener('DOMContentLoaded', select);