aboutsummaryrefslogtreecommitdiff
path: root/static/select.js
diff options
context:
space:
mode:
authorGravatar logmanoriginal <logmanoriginal@users.noreply.github.com> 2017-08-11 19:39:13 +0200
committerGravatar logmanoriginal <logmanoriginal@users.noreply.github.com> 2017-08-11 19:39:16 +0200
commitcd012e115b70a418af2eb1f43d896b83b27b1d11 (patch)
treebbe374995976b1b95326b36c480641bfbfe21bca /static/select.js
parentdf9e3968dc679c8a96f0f6799d5908270cd85de5 (diff)
downloadrss-bridge-cd012e115b70a418af2eb1f43d896b83b27b1d11.tar.gz
rss-bridge-cd012e115b70a418af2eb1f43d896b83b27b1d11.tar.zst
rss-bridge-cd012e115b70a418af2eb1f43d896b83b27b1d11.zip
[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).
Diffstat (limited to '')
-rw-r--r--static/select.js10
1 files changed, 10 insertions, 0 deletions
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