aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/front.js
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2017-12-20 01:06:27 +0100
committerMarius Halden <marius.h@lden.org>2017-12-20 01:06:27 +0100
commit8b10c8b8d787e680bb085e2a7543dac50fd39742 (patch)
tree391efde6de4944e350cc0dafbd4e1efb0613e9c3 /web/js/front.js
parenteef35397ccf8242cdc65dc666db2958b1ee35440 (diff)
parent7e15bd3db202363db4bab8fa7c9f462eabe28fce (diff)
Merge tag 'v2.3' into fiksgatami-dev
Diffstat (limited to 'web/js/front.js')
-rw-r--r--web/js/front.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/web/js/front.js b/web/js/front.js
new file mode 100644
index 000000000..8471972d4
--- /dev/null
+++ b/web/js/front.js
@@ -0,0 +1,18 @@
+document.getElementById('pc').focus();
+
+(function(){
+ var around_forms = document.querySelectorAll('form[action*="around"]');
+ for (var i=0; i<around_forms.length; i++) {
+ var form = around_forms[i];
+ var el = document.createElement('input');
+ el.type = 'hidden';
+ el.name = 'js';
+ el.value = 1;
+ form.insertBefore(el, form.firstChild);
+ }
+ var around_links = document.querySelectorAll('a[href*="around"]');
+ for (i=0; i<around_links.length; i++) {
+ var link = around_links[i];
+ link.href = link.href + (link.href.indexOf('?') > -1 ? '&js=1' : '?js=1');
+ }
+})();