summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/tpl/dokuwiki/css/mobile.css14
-rw-r--r--lib/tpl/dokuwiki/images/button-html5.pngbin0 -> 354 bytes
-rw-r--r--lib/tpl/dokuwiki/images/button-xhtml.pngbin321 -> 0 bytes
-rw-r--r--lib/tpl/dokuwiki/main.php1
-rw-r--r--lib/tpl/dokuwiki/script.js25
-rw-r--r--lib/tpl/dokuwiki/tpl_footer.php4
6 files changed, 32 insertions, 12 deletions
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 <anika@selfthinker.org>
*/
+/* 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/images/button-html5.png b/lib/tpl/dokuwiki/images/button-html5.png
new file mode 100644
index 000000000..5885a331b
--- /dev/null
+++ b/lib/tpl/dokuwiki/images/button-html5.png
Binary files 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
--- a/lib/tpl/dokuwiki/images/button-xhtml.png
+++ /dev/null
Binary files differ
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');
</div></div><!-- /site -->
<div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
+ <div id="screen__mode" class="no"></div><?php /* helper to detect CSS media query in script.js */ ?></div>
<!--[if ( lte IE 7 | IE 8 ) ]></div><![endif]-->
</body>
</html>
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);
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="<?php echo tpl_basedir(); ?>images/button-donate.gif" width="80" height="15" alt="Donate" /></a>
<a href="http://www.php.net" title="Powered by PHP" <?php echo $target?>><img
src="<?php echo tpl_basedir(); ?>images/button-php.gif" width="80" height="15" alt="Powered by PHP" /></a>
- <a href="http://validator.w3.org/check/referer" title="Valid XHTML 1.0" <?php echo $target?>><img
- src="<?php echo tpl_basedir(); ?>images/button-xhtml.png" width="80" height="15" alt="Valid XHTML 1.0" /></a>
+ <a href="http://validator.w3.org/check/referer" title="Valid HTML5" <?php echo $target?>><img
+ src="<?php echo tpl_basedir(); ?>images/button-html5.png" width="80" height="15" alt="Valid HTML5" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3" title="Valid CSS" <?php echo $target?>><img
src="<?php echo tpl_basedir(); ?>images/button-css.png" width="80" height="15" alt="Valid CSS" /></a>
<a href="http://dokuwiki.org/" title="Driven by DokuWiki" <?php echo $target?>><img