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
|
||||
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) => {
|
||||
req.legacymode = req.headers['user-agent'].match(legacy_re);
|
||||
// res.send(req.headers['user-agent']);return;
|
||||
next();
|
||||
});
|
||||
|
||||
|
|
|
@ -65,16 +65,26 @@ html(style='overflow-y:auto' lang='en_US')
|
|||
h1
|
||||
a(href='/') blek! Site
|
||||
hr(class='flag_hr')
|
||||
ul
|
||||
each route, name in routes
|
||||
if (route == 'hr')
|
||||
li <hr/>
|
||||
else
|
||||
li(style='padding-left:4px')
|
||||
if current_route == route
|
||||
if (!req.legacymode)
|
||||
ul
|
||||
each route, name in routes
|
||||
if (route == 'hr')
|
||||
li <hr/>
|
||||
else
|
||||
li(style='padding-left:4px')
|
||||
if current_route == route
|
||||
| > #{name}
|
||||
else
|
||||
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=route) #{name}
|
||||
a(href=router)= name
|
||||
br
|
||||
|
||||
hr
|
||||
p(class='nojs_hide') This site is also available in:
|
||||
|
|
Loading…
Reference in New Issue