mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-28 14:04:45 -04:00
Refactor browser check.
This commit is contained in:
parent
8d3611e30c
commit
0a843a0b1f
5 changed files with 38 additions and 30 deletions
|
@ -2,10 +2,9 @@ block init
|
|||
|
||||
<?php header('Content-type: text/html;charset=utf-8'); ?>
|
||||
doctype html
|
||||
<!--[if lt IE 10]><html class='no-js no-browser' lang='en'><![endif]-->
|
||||
<!--[if gt IE 9]><!--><html class='no-js browser' lang='en'><!--<![endif]-->
|
||||
html(class='no-js', lang='en')
|
||||
|
||||
head
|
||||
head
|
||||
meta(charset='utf-8')
|
||||
meta(http-equiv='x-ua-compatible', content='ie=edge')
|
||||
title #{title}
|
||||
|
@ -17,7 +16,7 @@ head
|
|||
script(src!='<?= $public_href; ?>js/scripts.js', data-module='#{module}')
|
||||
<?= $x_head_tags; ?>
|
||||
|
||||
body#root(class='#{module}')
|
||||
body#root(class='#{module}')
|
||||
|
||||
div#fallback-hints
|
||||
span.noJsMsg Works best with JavaScript enabled!
|
||||
|
@ -25,5 +24,3 @@ body#root(class='#{module}')
|
|||
span.backlink #[a(href='#{pkg.homepage}', title='#{pkg.name} v#{pkg.version} - #{pkg.description}') powered by #{pkg.name}]
|
||||
|
||||
block body
|
||||
|
||||
</html>
|
||||
|
|
|
@ -88,6 +88,7 @@
|
|||
}
|
||||
|
||||
.noJsMsg, .noBrowserMsg {
|
||||
display: none;
|
||||
margin: 0 16px;
|
||||
color: @col-error;
|
||||
}
|
||||
|
@ -104,10 +105,10 @@ html.no-js, html.no-browser {
|
|||
}
|
||||
}
|
||||
|
||||
html.js .noJsMsg {
|
||||
display: none;
|
||||
html.no-js .noJsMsg {
|
||||
display: inline !important;
|
||||
}
|
||||
|
||||
html.browser .noBrowserMsg {
|
||||
display: none;
|
||||
html.no-browser .noBrowserMsg {
|
||||
display: inline !important;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#sidebar {
|
||||
display: none;
|
||||
overflow: auto;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
flex: 0 0 auto;
|
||||
order: 0;
|
||||
background: @col-back-panel;
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
modulejs.define('boot', ['$', 'core/server'], function ($, server) {
|
||||
|
||||
if ($('html').hasClass('no-browser')) {
|
||||
return;
|
||||
}
|
||||
|
||||
var module = $('script[data-module]').data('module');
|
||||
var data = {action: 'get', setup: true, options: true, types: true};
|
||||
|
||||
|
|
|
@ -1,3 +1,14 @@
|
|||
(function () {
|
||||
|
||||
if (function () {
|
||||
var div = document.createElement('div');
|
||||
div.innerHTML = '<!--[if lt IE 10]><br><![endif]-->';
|
||||
return div.getElementsByTagName('br').length;
|
||||
}()) {
|
||||
document.documentElement.className = 'js no-browser';
|
||||
return;
|
||||
}
|
||||
|
||||
// @include "lib/modernizr-*.js"
|
||||
// @include "lib/jquery-*.js"
|
||||
// @include "lib/jquery.*.js"
|
||||
|
@ -20,3 +31,5 @@
|
|||
|
||||
modulejs.require('boot');
|
||||
}());
|
||||
|
||||
}());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue