From 91cc36514306e827c126ceed6c17486c85f5544c Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 12 Apr 2016 22:55:26 -0700 Subject: reverse the logic of the jsenabled setting so that sessions without js are performance penalised instead of regular sessions. --- mod/nojs.php | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 mod/nojs.php (limited to 'mod/nojs.php') diff --git a/mod/nojs.php b/mod/nojs.php new file mode 100644 index 000000000..3d894d13e --- /dev/null +++ b/mod/nojs.php @@ -0,0 +1,9 @@ + Date: Wed, 13 Apr 2016 16:31:06 -0700 Subject: refactor the js detection into a checkjs class which is only enabled on demand (currently only the channel and display pages). Will probably require a bit more work to hide/disable the cover photo when js is disabled. Have not actually tested without js to discover any other potential page issues. Have only confirmed that the detection class works and redirects to set a jsdisabled cookie and reload the page with that cookie+variable set if called from the channel page. --- mod/nojs.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mod/nojs.php') diff --git a/mod/nojs.php b/mod/nojs.php index 3d894d13e..c6e04a72b 100644 --- a/mod/nojs.php +++ b/mod/nojs.php @@ -4,6 +4,7 @@ function nojs_init(&$a) { setcookie('jsdisabled', 1, 0); $p = $_GET['query']; - goaway(z_root() . (($p) ? '/' . $p : '')); + $hasq = strpos($p,'?'); + goaway(z_root() . (($p) ? '/' . $p : '') . (($hasq) ? '' : '?f=' ) . '&jsdisabled=1'); } \ No newline at end of file -- cgit v1.2.3