From 07834a7c661d05ab5c707e1c428421c87af565bf Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Tue, 25 Sep 2012 19:47:10 +0100 Subject: de-couple mobile JS from widths to actual media query equivalent (fixes FS#2623) --- lib/tpl/dokuwiki/css/mobile.css | 14 ++++++++++++++ lib/tpl/dokuwiki/main.php | 1 + lib/tpl/dokuwiki/script.js | 25 +++++++++++++++---------- 3 files changed, 30 insertions(+), 10 deletions(-) (limited to 'lib') diff --git a/lib/tpl/dokuwiki/css/mobile.css b/lib/tpl/dokuwiki/css/mobile.css index 6e07f23ec..cc61ab06c 100644 --- a/lib/tpl/dokuwiki/css/mobile.css +++ b/lib/tpl/dokuwiki/css/mobile.css @@ -5,10 +5,20 @@ * @author Anika Henke */ +/* for detecting media queries in JavaScript (see script.js): */ +#screen__mode { + position: relative; + z-index: 0; +} + /* up to 979px screen widths ********************************************************************/ @media only screen and (max-width: 979px) { +#screen__mode { + z-index: 1; /* for detecting media queries in JavaScript (see script.js) */ +} + /* structure */ #dokuwiki__aside { width: 100%; @@ -107,6 +117,10 @@ ********************************************************************/ @media only screen and (max-width: 480px) { +#screen__mode { + z-index: 2; /* for detecting media queries in JavaScript (see script.js) */ +} + body { font-size: 100%; } diff --git a/lib/tpl/dokuwiki/main.php b/lib/tpl/dokuwiki/main.php index 2406a206b..6b1e95d62 100644 --- a/lib/tpl/dokuwiki/main.php +++ b/lib/tpl/dokuwiki/main.php @@ -91,6 +91,7 @@ $showSidebar = $hasSidebar && ($ACT=='show');
+
diff --git a/lib/tpl/dokuwiki/script.js b/lib/tpl/dokuwiki/script.js index d858bda89..3ed8dbabe 100644 --- a/lib/tpl/dokuwiki/script.js +++ b/lib/tpl/dokuwiki/script.js @@ -12,18 +12,23 @@ var device_classes = 'desktop mobile tablet phone'; function tpl_dokuwiki_mobile(){ + // the z-index in mobile.css is (mis-)used purely for detecting the screen mode here + var screen_mode = jQuery('#screen__mode').css('z-index'); + // determine our device pattern // TODO: consider moving into dokuwiki core - var w = document.body.clientWidth; - if (w > 979) { - if (device_class == 'desktop') return; - device_class = 'desktop'; - } else if (w > 480) { - if (device_class.match(/tablet/)) return; - device_class = 'mobile tablet'; - } else { - if (device_class.match(/phone/)) return; - device_class = 'mobile phone'; + switch (screen_mode) { + case '1': + if (device_class.match(/tablet/)) return; + device_class = 'mobile tablet'; + break; + case '2': + if (device_class.match(/phone/)) return; + device_class = 'mobile phone'; + break; + default: + if (device_class == 'desktop') return; + device_class = 'desktop'; } jQuery('html').removeClass(device_classes).addClass(device_class); -- cgit v1.2.3 From 20391a36885910a616110df30f3ce30f8d23639d Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Tue, 25 Sep 2012 20:25:54 +0100 Subject: removed html dependency from media query detection JS in new template --- lib/tpl/dokuwiki/css/mobile.css | 15 +++++---------- lib/tpl/dokuwiki/main.php | 1 - lib/tpl/dokuwiki/script.js | 6 +++--- 3 files changed, 8 insertions(+), 14 deletions(-) (limited to 'lib') diff --git a/lib/tpl/dokuwiki/css/mobile.css b/lib/tpl/dokuwiki/css/mobile.css index cc61ab06c..ea32fb11d 100644 --- a/lib/tpl/dokuwiki/css/mobile.css +++ b/lib/tpl/dokuwiki/css/mobile.css @@ -5,18 +5,16 @@ * @author Anika Henke */ -/* for detecting media queries in JavaScript (see script.js): */ -#screen__mode { - position: relative; - z-index: 0; +body { + min-height: 0; /* for detecting media queries in JavaScript (see script.js): */ } /* up to 979px screen widths ********************************************************************/ @media only screen and (max-width: 979px) { -#screen__mode { - z-index: 1; /* for detecting media queries in JavaScript (see script.js) */ +body { + min-height: 1px; /* for detecting media queries in JavaScript (see script.js) */ } /* structure */ @@ -117,12 +115,9 @@ ********************************************************************/ @media only screen and (max-width: 480px) { -#screen__mode { - z-index: 2; /* for detecting media queries in JavaScript (see script.js) */ -} - body { font-size: 100%; + min-height: 2px; /* for detecting media queries in JavaScript (see script.js) */ } /*____________ structure ____________*/ diff --git a/lib/tpl/dokuwiki/main.php b/lib/tpl/dokuwiki/main.php index 6b1e95d62..2406a206b 100644 --- a/lib/tpl/dokuwiki/main.php +++ b/lib/tpl/dokuwiki/main.php @@ -91,7 +91,6 @@ $showSidebar = $hasSidebar && ($ACT=='show');
-
diff --git a/lib/tpl/dokuwiki/script.js b/lib/tpl/dokuwiki/script.js index 3ed8dbabe..ec6e5285e 100644 --- a/lib/tpl/dokuwiki/script.js +++ b/lib/tpl/dokuwiki/script.js @@ -13,16 +13,16 @@ var device_classes = 'desktop mobile tablet phone'; function tpl_dokuwiki_mobile(){ // the z-index in mobile.css is (mis-)used purely for detecting the screen mode here - var screen_mode = jQuery('#screen__mode').css('z-index'); + var screen_mode = jQuery('body').css('min-height'); // determine our device pattern // TODO: consider moving into dokuwiki core switch (screen_mode) { - case '1': + case '1px': if (device_class.match(/tablet/)) return; device_class = 'mobile tablet'; break; - case '2': + case '2px': if (device_class.match(/phone/)) return; device_class = 'mobile phone'; break; -- cgit v1.2.3 From 86ca15261461b6c74f66407e7ac6992baa097d0d Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Wed, 26 Sep 2012 09:22:02 +0100 Subject: Revert "removed html dependency from media query detection JS in new template" ... because it made the solution less transparent, more error prone and even more like a hack than it already was This reverts commit 20391a36885910a616110df30f3ce30f8d23639d. --- lib/tpl/dokuwiki/css/mobile.css | 15 ++++++++++----- lib/tpl/dokuwiki/main.php | 1 + lib/tpl/dokuwiki/script.js | 6 +++--- 3 files changed, 14 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/tpl/dokuwiki/css/mobile.css b/lib/tpl/dokuwiki/css/mobile.css index ea32fb11d..cc61ab06c 100644 --- a/lib/tpl/dokuwiki/css/mobile.css +++ b/lib/tpl/dokuwiki/css/mobile.css @@ -5,16 +5,18 @@ * @author Anika Henke */ -body { - min-height: 0; /* for detecting media queries in JavaScript (see script.js): */ +/* for detecting media queries in JavaScript (see script.js): */ +#screen__mode { + position: relative; + z-index: 0; } /* up to 979px screen widths ********************************************************************/ @media only screen and (max-width: 979px) { -body { - min-height: 1px; /* for detecting media queries in JavaScript (see script.js) */ +#screen__mode { + z-index: 1; /* for detecting media queries in JavaScript (see script.js) */ } /* structure */ @@ -115,9 +117,12 @@ body { ********************************************************************/ @media only screen and (max-width: 480px) { +#screen__mode { + z-index: 2; /* for detecting media queries in JavaScript (see script.js) */ +} + body { font-size: 100%; - min-height: 2px; /* for detecting media queries in JavaScript (see script.js) */ } /*____________ structure ____________*/ diff --git a/lib/tpl/dokuwiki/main.php b/lib/tpl/dokuwiki/main.php index 2406a206b..6b1e95d62 100644 --- a/lib/tpl/dokuwiki/main.php +++ b/lib/tpl/dokuwiki/main.php @@ -91,6 +91,7 @@ $showSidebar = $hasSidebar && ($ACT=='show');
+
diff --git a/lib/tpl/dokuwiki/script.js b/lib/tpl/dokuwiki/script.js index ec6e5285e..3ed8dbabe 100644 --- a/lib/tpl/dokuwiki/script.js +++ b/lib/tpl/dokuwiki/script.js @@ -13,16 +13,16 @@ var device_classes = 'desktop mobile tablet phone'; function tpl_dokuwiki_mobile(){ // the z-index in mobile.css is (mis-)used purely for detecting the screen mode here - var screen_mode = jQuery('body').css('min-height'); + var screen_mode = jQuery('#screen__mode').css('z-index'); // determine our device pattern // TODO: consider moving into dokuwiki core switch (screen_mode) { - case '1px': + case '1': if (device_class.match(/tablet/)) return; device_class = 'mobile tablet'; break; - case '2px': + case '2': if (device_class.match(/phone/)) return; device_class = 'mobile phone'; break; -- cgit v1.2.3 From 89a539f258c3cc00e6ed028bf3e0534f072b35bd Mon Sep 17 00:00:00 2001 From: Nick Reilingh Date: Sun, 30 Sep 2012 18:23:45 -0400 Subject: Changed XHTML validator icon to HTML5 (FS#2619) --- lib/tpl/dokuwiki/images/button-html5.png | Bin 0 -> 354 bytes lib/tpl/dokuwiki/images/button-xhtml.png | Bin 321 -> 0 bytes lib/tpl/dokuwiki/tpl_footer.php | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 lib/tpl/dokuwiki/images/button-html5.png delete mode 100644 lib/tpl/dokuwiki/images/button-xhtml.png (limited to 'lib') diff --git a/lib/tpl/dokuwiki/images/button-html5.png b/lib/tpl/dokuwiki/images/button-html5.png new file mode 100644 index 000000000..5885a331b Binary files /dev/null and b/lib/tpl/dokuwiki/images/button-html5.png differ diff --git a/lib/tpl/dokuwiki/images/button-xhtml.png b/lib/tpl/dokuwiki/images/button-xhtml.png deleted file mode 100644 index ec686442c..000000000 Binary files a/lib/tpl/dokuwiki/images/button-xhtml.png and /dev/null differ diff --git a/lib/tpl/dokuwiki/tpl_footer.php b/lib/tpl/dokuwiki/tpl_footer.php index 3a2e3d121..b7dc9c631 100644 --- a/lib/tpl/dokuwiki/tpl_footer.php +++ b/lib/tpl/dokuwiki/tpl_footer.php @@ -20,8 +20,8 @@ if (!defined('DOKU_INC')) die(); src="images/button-donate.gif" width="80" height="15" alt="Donate" /> >Powered by PHP - >Valid XHTML 1.0 + >Valid HTML5 >Valid CSS >