-
Notifications
You must be signed in to change notification settings - Fork 615
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
334 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...nts/image-picker/index.en-US.md.2f1c88.js → ...nts/image-picker/index.en-US.md.2d8dfc.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Ant Design Mobile | A Mobile Design Specification</title> | ||
<link | ||
rel="icon" | ||
href="https://zos.alipayobjects.com/rmsportal/wIjMDnsrDoPPcIV.png?x-oss-process=image/resize,h_32" | ||
type="image/x-icon" | ||
/> | ||
|
||
<link rel="stylesheet" type="text/css" href="/index-1.css" /> | ||
<link rel="stylesheet" type="text/css" href="/index-2.css" /> | ||
|
||
<link rel="stylesheet" href="/index.css"> | ||
<script src="https://polyfill.alicdn.com/polyfill.min.js?features=default,es2015,Intl"></script> | ||
|
||
<script> | ||
|
||
|
||
(function() { | ||
function checkIfMobile() { | ||
var ua = window.navigator.userAgent.toLowerCase(); | ||
if (ua.indexOf('android') !== -1 || ua.indexOf('iphone') !== -1) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
function checkIfCn() { | ||
return window.navigator.language.toLowerCase() === 'zh-cn'; // wtf safari is 'zh-CN', while chrome and other is 'zh-CN' | ||
} | ||
if (checkIfMobile()) { | ||
var url = location.port | ||
? 'http://127.0.0.1:8002/' | ||
: window.location.origin + '/'; | ||
if (checkIfCn()) { | ||
url = url + '?lang=zh-CN'; | ||
} else { | ||
url = url + '?lang=en-US'; | ||
} | ||
return (location.href = url); | ||
} | ||
function isLocalStorageNameSupported() { | ||
const testKey = 'test'; | ||
const storage = window.localStorage; | ||
try { | ||
storage.setItem(testKey, '1'); | ||
storage.removeItem(testKey); | ||
return true; | ||
} catch (error) { | ||
return false; | ||
} | ||
} | ||
// 优先级提高到所有静态资源的前面,语言不对,加载其他静态资源没意义 | ||
var pathname = location.pathname; | ||
function isZhCN(pathname) { | ||
return /-cn\/?$/.test(pathname); | ||
} | ||
function getLocalizedPathname(path, zhCN) { | ||
var pathname = path.startsWith('/') ? path : '/' + path; | ||
if (!zhCN) { | ||
// to enUS | ||
return /\/?index-cn/.test(pathname) | ||
? '/' | ||
: pathname.replace('-cn', ''); | ||
} else if (pathname === '/') { | ||
return '/index-cn'; | ||
} else if (pathname.endsWith('/')) { | ||
return pathname.replace(/\/$/, '-cn/'); | ||
} | ||
return pathname + '-cn'; | ||
} | ||
// 首页无视链接里面的语言设置 https://github.com/ant-design/ant-design/issues/4552 | ||
if ( | ||
isLocalStorageNameSupported() && | ||
(pathname === '/' || pathname === '/index-cn') | ||
) { | ||
var lang = | ||
(window.localStorage && localStorage.getItem('locale')) || | ||
(window.navigator.language.toLowerCase() === 'zh-cn' | ||
? 'zh-CN' | ||
: 'en-US'); | ||
if ((lang === 'zh-CN') !== isZhCN(pathname)) { | ||
location.pathname = getLocalizedPathname( | ||
pathname, | ||
lang === 'zh-CN' | ||
); | ||
} | ||
} | ||
document.documentElement.className += isZhCN(pathname) | ||
? 'zh-cn' | ||
: 'en-us'; | ||
})(); | ||
</script> | ||
<!-- Global Site Tag (gtag.js) - Google Analytics --> | ||
<!-- Global site tag (gtag.js) - Google Analytics --> | ||
<script | ||
async | ||
src="https://www.googletagmanager.com/gtag/js?id=UA-72788897-9" | ||
></script> | ||
<script> | ||
if (!location.port) { | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag() { | ||
dataLayer.push(arguments); | ||
} | ||
gtag('js', new Date()); | ||
gtag('config', 'UA-72788897-9'); | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<div id="react-content"></div> | ||
|
||
<!-- <script src="/common.js"></script> --> | ||
<script src="/index.js"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.