From 9a0b61e4afed94727679eee966afb76e1add2beb Mon Sep 17 00:00:00 2001 From: redmatrix 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. --- Zotlabs/Web/CheckJS.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Zotlabs/Web/CheckJS.php (limited to 'Zotlabs/Web') diff --git a/Zotlabs/Web/CheckJS.php b/Zotlabs/Web/CheckJS.php new file mode 100644 index 000000000..3ad5fc1ed --- /dev/null +++ b/Zotlabs/Web/CheckJS.php @@ -0,0 +1,36 @@ +jsdisabled = 1; + if(intval($_COOKIE['jsdisabled'])) + $this->jsdisabled = 1; + + if(! $this->jsdisabled) { + $page = urlencode(\App::$query_string); + + if($test) { + \App::$page['htmlhead'] .= "\r\n" . '' . "\r\n"; + } + else { + \App::$page['htmlhead'] .= "\r\n" . '' . "\r\n"; + } + } + + } + + function disabled() { + return self::$jsdisabled; + } + + +} + + -- cgit v1.2.3