Browse files

Adding bb10 support to detectors

  • Loading branch information...
1 parent ef7136f commit b1affffbf3943a7c48794400c8e84d62b448c223 @jansepar jansepar committed Jan 31, 2013
Showing with 2 additions and 2 deletions.
  1. +1 −1 www/docs/index.md
  2. +1 −1 www/docs/template-reference.md
View
2 www/docs/index.md
@@ -32,7 +32,7 @@ website you want to adapt:
window.Mobify = {points: [+new Date], tagVersion: [1, 0]};
- var isMobile = /ip(hone|od|ad)|android|blackberry.*applewebkit/i.test(navigator.userAgent);
+ var isMobile = /ip(hone|od|ad)|android|blackberry.*applewebkit|bb1\d.*mobile/i.test(navigator.userAgent);
var optedOut = /mobify-path=($|;)/.test(document.cookie);
if (!isMobile || optedOut) {
View
2 www/docs/template-reference.md
@@ -410,7 +410,7 @@ But with a "Back to Mobile" button, you don't want it to show up on your desktop
So the best thing to do here is to conditionally insert this element into your desktop site based on the device, like this:
<script type="text/javascript">
- if (/ip(hone|od)|android.*(mobile)|blackberry.*applewebkit/i.test(navigator.userAgent)) {
+ if (/ip(hone|od)|android.*(mobile)|blackberry.*applewebkit|bb1\d.*mobile/i.test(navigator.userAgent)) {
var backToMobile = document.createElement("div");
backToMobile.innerHTML = '<a href="#" onclick="document.cookie=\'mobify-path=;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/\';location.reload()">Mobile Site</a>';
document.getElementById("**ELEMENT_TO_APPEND_TO**").appendChild(backToMobile);

0 comments on commit b1affff

Please sign in to comment.