Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
K
kpp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alexandr Veselov
kpp
Commits
b1424790
Commit
b1424790
authored
Feb 02, 2019
by
Nikolay Gromov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Инлайновый JS в head: добавил детектирование браузера
parent
8e2fb5c1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
5 deletions
+14
-5
.eslintignore
.eslintignore
+1
-0
gulpfile.js
gulpfile.js
+1
-1
head-script.js
src/js/head-script.js
+8
-0
layout-block-lib.pug
src/pug/layout-block-lib.pug
+2
-2
layout.pug
src/pug/layout.pug
+2
-2
No files found.
.eslintignore
0 → 100644
View file @
b1424790
src/js/head-script.js
gulpfile.js
View file @
b1424790
...
...
@@ -62,7 +62,7 @@ let pugOption = {
let
prettyOption
=
{
indent_size
:
2
,
indent_char
:
' '
,
unformatted
:
[
'code'
,
'em'
,
'strong'
,
'span'
,
'i'
,
'b'
,
'br'
],
unformatted
:
[
'code'
,
'em'
,
'strong'
,
'span'
,
'i'
,
'b'
,
'br'
,
'script'
],
content_unformatted
:
[],
};
...
...
src/js/head-script.js
0 → 100644
View file @
b1424790
document
.
documentElement
.
className
=
document
.
documentElement
.
className
.
replace
(
'no-js'
,
'js'
);
function
cth
(
c
){
document
.
documentElement
.
classList
.
add
(
c
)}
'ontouchstart'
in
window
?
cth
(
'touch'
):
cth
(
'no-touch'
);
if
(
typeof
InstallTrigger
!==
'undefined'
)
cth
(
'firefox'
);
if
(
/constructor/i
.
test
(
window
.
HTMLElement
)
||
(
function
(
p
){
return
p
.
toString
()
===
"[object SafariRemoteNotification]"
})(
!
window
[
'safari'
]
||
(
typeof
safari
!==
'undefined'
&&
safari
.
pushNotification
)))
cth
(
'safari'
);
if
(
/*@cc_on!@*/
false
||!!
document
.
documentMode
)
cth
(
'ie'
);
if
(
!
(
/*@cc_on!@*/
false
||!!
document
.
documentMode
)
&&!!
window
.
StyleMedia
)
cth
(
'edge'
);
if
(
!!
window
.
chrome
&&
(
!!
window
.
chrome
.
webstore
||!!
window
.
chrome
.
runtime
))
cth
(
'chrome'
);
src/pug/layout-block-lib.pug
View file @
b1424790
...
...
@@ -31,8 +31,8 @@ html(class='no-js page', lang='ru')
block head
link(rel='stylesheet', href='css/style.css')
link(rel='stylesheet', href='css/blocks-library.css')
script
.
document.querySelector('html').classList.replace('no-js', 'js');'ontouchstart' in window ? document.querySelector('html').classList.add('touch') : document.querySelector('html').classList.add('no-touch');
script
include ../js/head-script.js
body
noscript У вас отключен JavaScript. Это пугает.
...
...
src/pug/layout.pug
View file @
b1424790
...
...
@@ -30,8 +30,8 @@ html(class='no-js page', lang='ru')
block head
link(rel='stylesheet', href='css/style.css')
script
.
document.querySelector('html').classList.replace('no-js', 'js');'ontouchstart' in window ? document.querySelector('html').classList.add('touch') : document.querySelector('html').classList.add('no-touch');
script
include ../js/head-script.js
body
noscript У вас отключен JavaScript. Это пугает.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment