From 8d287a4eb3dc646bc5835f7d3f7b9decf0f127c5 Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Mon, 14 Nov 2016 12:25:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=BE=E5=A4=87=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Admin/Bootstrap.Admin.csproj | 1 + Bootstrap.Admin/Content/js/Longbow.Common.js | 21 +++++++++++++++++++ Bootstrap.Admin/DeviceTest.htm | 22 ++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 Bootstrap.Admin/DeviceTest.htm diff --git a/Bootstrap.Admin/Bootstrap.Admin.csproj b/Bootstrap.Admin/Bootstrap.Admin.csproj index 33fdce17..a2492804 100644 --- a/Bootstrap.Admin/Bootstrap.Admin.csproj +++ b/Bootstrap.Admin/Bootstrap.Admin.csproj @@ -181,6 +181,7 @@ + diff --git a/Bootstrap.Admin/Content/js/Longbow.Common.js b/Bootstrap.Admin/Content/js/Longbow.Common.js index 1b3b36c6..3e9d38fd 100644 --- a/Bootstrap.Admin/Content/js/Longbow.Common.js +++ b/Bootstrap.Admin/Content/js/Longbow.Common.js @@ -89,6 +89,27 @@ window.console = window.console || {}; console.log || (console.log = opera.postError); + // client + jQuery.browser = { + versions: function () { + var u = navigator.userAgent; + return { //移动终端浏览器版本信息 + trident: u.indexOf('Trident') > -1, //IE内核 + presto: u.indexOf('Presto') > -1, //opera内核 + webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核 + gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核 + mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端 + ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端 + android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器 + iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器 + iPod: u.indexOf('iPod') > -1, //是否为iPod或者QQHD浏览器 + iPad: u.indexOf('iPad') > -1, //是否iPad + webApp: u.indexOf('Safari') == -1 //是否web应该程序,没有头部与底部 + }; + }(), + language: (navigator.browserLanguage || navigator.language).toLowerCase() + } + $.fn.extend({ autoCenter: function () { var that = this; diff --git a/Bootstrap.Admin/DeviceTest.htm b/Bootstrap.Admin/DeviceTest.htm new file mode 100644 index 00000000..a7bde50d --- /dev/null +++ b/Bootstrap.Admin/DeviceTest.htm @@ -0,0 +1,22 @@ + + + + + + + + + + + +