Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

page: Fix x-ua-compatible support #1057

Merged
merged 1 commit into from
Jun 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions common.blocks/page/page.bemhtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ block('page')(
elem : 'head',
content : [
{ tag : 'meta', attrs : { charset : 'utf-8' } },
ctx.uaCompatible === false? '' : {
tag : 'meta',
attrs : {
'http-equiv' : 'X-UA-Compatible',
content : ctx.uaCompatible || 'IE=edge'
}
},
{ tag : 'title', content : ctx.title },
{ block : 'ua', attrs : { nonce : ctx.nonce } },
ctx.head,
Expand Down
7 changes: 7 additions & 0 deletions common.blocks/page/page.bh.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ module.exports = function(bh) {
elem : 'head',
content : [
{ tag : 'meta', attrs : { charset : 'utf-8' } },
json.uaCompatible === false? '' : {
tag : 'meta',
attrs : {
'http-equiv' : 'X-UA-Compatible',
content : json.uaCompatible || 'IE=edge'
}
},
{ tag : 'title', content : json.title },
{ block : 'ua', attrs : { nonce : json.nonce } },
json.head,
Expand Down
2 changes: 1 addition & 1 deletion common.blocks/page/page.tmpl-specs/00-empty.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html class="ua_js_no">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<title></title>
<script>
(function(e,c){e[c]=e[c].replace(/(ua_js_)no/g,"$1yes");})(document.documentElement,"className");
Expand Down
2 changes: 1 addition & 1 deletion common.blocks/page/page.tmpl-specs/10-simple.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html class="ua_js_no">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<title>Простой пример html/head/body-обвязки страницы</title>
<script>
(function(e,c){e[c]=e[c].replace(/(ua_js_)no/g,"$1yes");})(document.documentElement,"className");
Expand Down
2 changes: 1 addition & 1 deletion common.blocks/page/page.tmpl-specs/20-style.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html class="ua_js_no">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<title></title>
<script>
(function(e,c){e[c]=e[c].replace(/(ua_js_)no/g,"$1yes");})(document.documentElement,"className");
Expand Down
2 changes: 1 addition & 1 deletion common.blocks/page/page.tmpl-specs/25-styles.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html class="ua_js_no">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<title></title>
<script>
(function(e,c){e[c]=e[c].replace(/(ua_js_)no/g,"$1yes");})(document.documentElement,"className");
Expand Down
2 changes: 1 addition & 1 deletion common.blocks/page/page.tmpl-specs/30-scripts.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html class="ua_js_no">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<title></title>
<script>
(function(e,c){e[c]=e[c].replace(/(ua_js_)no/g,"$1yes");})(document.documentElement,"className");
Expand Down
2 changes: 1 addition & 1 deletion common.blocks/page/page.tmpl-specs/40-nonce.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html class="ua_js_no">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta charset="utf-8"/>
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
<title></title>
<script nonce="123">
(function(e,c){e[c]=e[c].replace(/(ua_js_)no/g,"$1yes");})(document.documentElement,"className");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
({
block : 'page',
title : 'Remove x-ua-compatible',
uaCompatible : false
})
11 changes: 11 additions & 0 deletions common.blocks/page/page.tmpl-specs/60-x-ua-compatible.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE HTML>
<html class="ua_js_no">
<head>
<meta charset="utf-8"/>
<title>Remove x-ua-compatible</title>
<script>
(function(e,c){e[c]=e[c].replace(/(ua_js_)no/g,"$1yes");})(document.documentElement,"className");
</script>
</head>
<body class="page"></body>
</html>
18 changes: 0 additions & 18 deletions desktop.blocks/page/page.bemhtml

This file was deleted.

18 changes: 0 additions & 18 deletions desktop.blocks/page/page.bh.js

This file was deleted.

2 changes: 1 addition & 1 deletion desktop.blocks/page/page.tmpl-specs/50-conditions.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html class="ua_js_no">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<title>Пример подключения es5-shims для IE</title>
<script>
(function(e,c){e[c]=e[c].replace(/(ua_js_)no/g,"$1yes");})(document.documentElement,"className");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!DOCTYPE HTML>
<html class="ua_js_no">
<head>
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
<meta charset="utf-8"/>
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
<title>page__conditional-comments</title>
<script>(function(e,c){e[c]=e[c].replace(/(ua_js_)no/g,"$1yes");})(document.documentElement,"className");</script>
<!--[if lte IE 8]><link rel="stylesheet" href="_60-conditional-comment.ie.css"/><![endif]-->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
({
block : 'page',
title : 'X-UA-Compatible',
uaCompatible : 'IE=EmulateIE8'
})
12 changes: 12 additions & 0 deletions desktop.blocks/page/page.tmpl-specs/70-custom-x-ua-compatible.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<html class="ua_js_no">
<head>
<meta charset="utf-8"/>
<meta content="IE=EmulateIE8" http-equiv="X-UA-Compatible"/>
<title>X-UA-Compatible</title>
<script>
(function(e,c){e[c]=e[c].replace(/(ua_js_)no/g,"$1yes");})(document.documentElement,"className");
</script>
</head>
<body class="page"></body>
</html>
1 change: 1 addition & 0 deletions touch.blocks/page/page.tmpl-specs/00-empty.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html class="ua_js_no">
<head>
<meta charset="utf-8"/>
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
<title></title>
<script>
(function(e,c){e[c]=e[c].replace(/(ua_js_)no/g,"$1yes");})(document.documentElement,"className");
Expand Down
1 change: 1 addition & 0 deletions touch.blocks/page/page.tmpl-specs/10-simple.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html class="ua_js_no">
<head>
<meta charset="utf-8"/>
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
<title>Простой пример html/head/body-обвязки страницы</title>
<script>
(function(e,c){e[c]=e[c].replace(/(ua_js_)no/g,"$1yes");})(document.documentElement,"className");
Expand Down
1 change: 1 addition & 0 deletions touch.blocks/page/page.tmpl-specs/20-style.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html class="ua_js_no">
<head>
<meta charset="utf-8"/>
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
<title></title>
<script>
(function(e,c){e[c]=e[c].replace(/(ua_js_)no/g,"$1yes");})(document.documentElement,"className");
Expand Down
1 change: 1 addition & 0 deletions touch.blocks/page/page.tmpl-specs/25-styles.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html class="ua_js_no">
<head>
<meta charset="utf-8"/>
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
<title></title>
<script>
(function(e,c){e[c]=e[c].replace(/(ua_js_)no/g,"$1yes");})(document.documentElement,"className");
Expand Down
1 change: 1 addition & 0 deletions touch.blocks/page/page.tmpl-specs/30-scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html class="ua_js_no">
<head>
<meta charset="utf-8"/>
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
<title></title>
<script>
(function(e,c){e[c]=e[c].replace(/(ua_js_)no/g,"$1yes");})(document.documentElement,"className");
Expand Down
1 change: 1 addition & 0 deletions touch.blocks/page/page.tmpl-specs/40-nonce.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html class="ua_js_no">
<head>
<meta charset="utf-8"/>
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
<title></title>
<script nonce="123">
(function(e,c){e[c]=e[c].replace(/(ua_js_)no/g,"$1yes");})(document.documentElement,"className");
Expand Down
14 changes: 14 additions & 0 deletions touch.blocks/page/page.tmpl-specs/60-x-ua-compatible.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html class="ua_js_no">
<head>
<meta charset="utf-8"/>
<title>Remove x-ua-compatible</title>
<script>
(function(e,c){e[c]=e[c].replace(/(ua_js_)no/g,"$1yes");})(document.documentElement,"className");
</script>
<meta name="viewport" content="width=device-width,maximum-scale=1,initial-scale=1,user-scalable=0"/>
<meta name="format-detection" content="telephone=no"/>
<link name="apple-mobile-web-app-capable" content="yes"/>
</head>
<body class="page ua i-bem" data-bem="{&quot;ua&quot;:{}}"></body>
</html>