增加对猎豹浏览器判断,如果是猎豹浏览器则不显示安装按钮

This commit is contained in:
iFish 2014-09-09 11:00:45 +08:00
parent 37bdc69200
commit 9309930125

View File

@ -138,13 +138,12 @@
}); });
}; };
exports.showNonExtensionInstall = function () { exports.showNonExtensionInstall = function () {
$.showModalDialog("您需要安装<u>猎豹浏览器</u>和<u>最新版12306订票助手扩展</u>才可以使用极速版订票。请安装后刷新此页面 :-)", { var isLb = navigator.userAgent.indexOf("LBBROWSER") != -1;
image: "/images/cat.png", var btns = [
buttons: [
{ {
text: "安装猎豹浏览器", text: "安装猎豹浏览器",
type: "primary", type: "primary",
callback: function () { callback: function() {
window.open("http://dl.liebao.cn/coop/KSBrowser_12306.exe"); window.open("http://dl.liebao.cn/coop/KSBrowser_12306.exe");
return false; return false;
} }
@ -152,7 +151,7 @@
{ {
text: "安装扩展", text: "安装扩展",
type: "primary", type: "primary",
callback: function () { callback: function() {
window.open("http://12306.fishlee.net/crx"); window.open("http://12306.fishlee.net/crx");
return false; return false;
} }
@ -160,12 +159,18 @@
{ {
text: "刷新", text: "刷新",
type: "default", type: "default",
callback: function () { callback: function() {
self.location.reload(); self.location.reload();
return false; return false;
} }
} }
], ];
if (isLb)
btns.unshift(0);
$.showModalDialog("您需要安装" + (isLb ? "" : "<u>猎豹浏览器</u>和") + "<u>最新版12306订票助手扩展</u>才可以使用极速版订票。请安装后刷新此页面 :-)", {
image: "/images/cat.png",
buttons: btns,
closeOnAction: false closeOnAction: false
}); });
}; };