-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wechat is support appstore link now, no need to show wechat redirect …
…page anymore
- Loading branch information
1 parent
4d2c558
commit ea3d3fd
Showing
3 changed files
with
58 additions
and
56 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,71 @@ | ||
<html> | ||
|
||
<head> | ||
<title>[[.Name]] install</title> | ||
<meta http-equiv="Content-Type" content="text/HTML; charset=utf-8"> | ||
<meta content="target-densitydpi=device-dpi,width=640" name="viewport" id="viewport"> | ||
<link rel="shortcut icon" type="image/png" href="/-/res/favicon.png" /> | ||
<script type="text/javascript" src="/-/res/js/ua-parser.min.js"></script> | ||
<script type="text/javascript"> | ||
<title>[[.Name]] install</title> | ||
<meta http-equiv="Content-Type" content="text/HTML; charset=utf-8"> | ||
<meta content="target-densitydpi=device-dpi,width=640" name="viewport" id="viewport"> | ||
<link rel="shortcut icon" type="image/png" href="/-/res/favicon.png" /> | ||
<script type="text/javascript" src="/-/res/js/ua-parser.min.js"></script> | ||
<script type="text/javascript"> | ||
function showById(name) { | ||
document.getElementById(name).style.display = 'block'; | ||
document.getElementById(name).style.display = 'block'; | ||
} | ||
|
||
function checkBrowerAndDownload() { | ||
var parser = new UAParser(); | ||
var os_info = parser.getOS(); | ||
console.log(os_info) | ||
var parser = new UAParser(); | ||
var os_info = parser.getOS(); | ||
console.log(os_info) | ||
|
||
if (navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == "micromessenger") { | ||
showById('wechat'); | ||
return; | ||
} | ||
var plistLink = "[[.PlistLink]]"; | ||
var ipaInstallLink = 'itms-services://?action=download-manifest&url=' + plistLink; | ||
var plistLink = "[[.PlistLink]]"; | ||
var ipaInstallLink = 'itms-services://?action=download-manifest&url=' + plistLink; | ||
document.getElementById('itms-link').href = ipaInstallLink; | ||
|
||
document.getElementById('itms-link').href = ipaInstallLink; | ||
|
||
if (os_info.name == 'Android') { | ||
return; | ||
} else if (os_info.name == 'iOS') { | ||
showById('safari'); | ||
|
||
location.href = ipaInstallLink; | ||
return; | ||
} else { | ||
showById('browser'); | ||
return; | ||
} | ||
// wechat is support AppStore link now. | ||
if (navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == "micromessenger") { | ||
showById('safari'); | ||
location.href = ipaInstallLink; | ||
return; | ||
} else if (os_info.name == 'Android') { | ||
showById("android"); | ||
return; | ||
} else if (os_info.name == 'iOS') { | ||
showById('safari'); | ||
location.href = ipaInstallLink; | ||
return; | ||
} else { | ||
showById('browser'); | ||
return; | ||
} | ||
} | ||
</script> | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<style> | ||
<style> | ||
#wechat { | ||
position: relative; | ||
width: 640px; | ||
margin: 0 auto; | ||
background: #fff; | ||
overflow: hidden; | ||
min-height: 777px; | ||
position: relative; | ||
width: 640px; | ||
margin: 0 auto; | ||
background: #fff; | ||
overflow: hidden; | ||
min-height: 777px; | ||
} | ||
</style> | ||
<div id="wechat" style="display: none"> | ||
<img style='width: 100%;position: relative;' src='/-/res/imgs/wx.png' /> | ||
</div> | ||
<div id="browser" style="display: none"> | ||
This is IPA install page, you should open this link with your iPhone. | ||
</div> | ||
<div id="safari" style="display: none"> | ||
If install not started soon, click <a id="itms-link" href="#">here</a> | ||
</div> | ||
<div id="android" style="display: none"> | ||
This is IPA install page, not for android. | ||
</div> | ||
<script type="text/javascript"> | ||
</style> | ||
<div id="wechat" style="display: none"> | ||
<img style='width: 100%;position: relative;' src='/-/res/imgs/wx.png' /> | ||
</div> | ||
<div id="browser" style="display: none"> | ||
This is IPA install page, you should open this link with your iPhone. | ||
</div> | ||
<div id="safari" style="display: none"> | ||
If install not started soon, click <a id="itms-link" href="#">here</a> | ||
</div> | ||
<div id="android" style="display: none"> | ||
This is IPA install page, not for android. | ||
</div> | ||
<script type="text/javascript"> | ||
checkBrowerAndDownload(); | ||
</script> | ||
</script> | ||
</body> | ||
|
||
</html> | ||
</html> |
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