Skip to content
This repository has been archived by the owner on Aug 5, 2020. It is now read-only.

Commit

Permalink
Adding bb10 support to detectors
Browse files Browse the repository at this point in the history
  • Loading branch information
jansepar committed Jan 31, 2013
1 parent ef7136f commit b1affff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion www/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion www/docs/template-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b1affff

Please sign in to comment.