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