From cd012e115b70a418af2eb1f43d896b83b27b1d11 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Fri, 11 Aug 2017 19:39:13 +0200 Subject: [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). --- static/select.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 static/select.js (limited to 'static/select.js') diff --git a/static/select.js b/static/select.js new file mode 100644 index 00000000..792b92de --- /dev/null +++ b/static/select.js @@ -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); \ No newline at end of file -- cgit v1.2.3