legacy mode list
This commit is contained in:
parent
937828dd91
commit
91227c128a
|
@ -19,10 +19,11 @@ router.use(minify({
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// TODO: Maybe move all regexes into one file? Idk
|
// TODO: Maybe move all regexes into one file? Idk
|
||||||
const legacy_re = /(Firefox\/[0-5]\d{0,1}|Mozilla\/[0-4]|MSIE \d{1,2}\.\d{1,2}|Windows (NT|9\d)|Linux i686|(198\d|199\d|200\d|201[0-6])|Opera|Dillo|Naenara|Navscape|Lynx[1-5]|QtWeb|Prism|Tencent|i(Phone|Pad|Pod)( OS [1-6]|))/g;
|
const legacy_re = /(Firefox\/[0-5]\d{0,1}|Mozilla\/[0-4]|MSIE \d{1,2}\.\d{1,2}|Windows (NT|9\d)|Linux i686|(198\d|199\d|200\d|201[0-6])|Dillo|Naenara|Navscape|Netscape|QtWeb|Prism|Tencent|i(Phone|Pad|Pod)( OS [1-5]|))/g;
|
||||||
|
|
||||||
router.use((req, res, next) => {
|
router.use((req, res, next) => {
|
||||||
req.legacymode = req.headers['user-agent'].match(legacy_re);
|
req.legacymode = req.headers['user-agent'].match(legacy_re);
|
||||||
|
// res.send(req.headers['user-agent']);return;
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,7 @@ html(style='overflow-y:auto' lang='en_US')
|
||||||
h1
|
h1
|
||||||
a(href='/') blek! Site
|
a(href='/') blek! Site
|
||||||
hr(class='flag_hr')
|
hr(class='flag_hr')
|
||||||
|
if (!req.legacymode)
|
||||||
ul
|
ul
|
||||||
each route, name in routes
|
each route, name in routes
|
||||||
if (route == 'hr')
|
if (route == 'hr')
|
||||||
|
@ -75,6 +76,15 @@ html(style='overflow-y:auto' lang='en_US')
|
||||||
| > #{name}
|
| > #{name}
|
||||||
else
|
else
|
||||||
a(href=route) #{name}
|
a(href=route) #{name}
|
||||||
|
else
|
||||||
|
p(style='font-size:7pt')
|
||||||
|
each route, name in routes
|
||||||
|
if (route != 'hr')
|
||||||
|
if (current_route == router)
|
||||||
|
| > #{name}
|
||||||
|
else
|
||||||
|
a(href=router)= name
|
||||||
|
br
|
||||||
|
|
||||||
hr
|
hr
|
||||||
p(class='nojs_hide') This site is also available in:
|
p(class='nojs_hide') This site is also available in:
|
||||||
|
|
Loading…
Reference in New Issue