Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add bb10 support #90

Merged
merged 2 commits into from

2 participants

Shawn Jansepar Ryan Daw
Shawn Jansepar
Owner

No description provided.

Ryan Daw rrjamie merged commit 9a0702a into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 31, 2013
  1. Shawn Jansepar
  2. Shawn Jansepar

    Adding x-bb10 in enhance.js

    jansepar authored
This page is out of date. Refresh to see the latest.
4 api/enhance.js
View
@@ -1,6 +1,6 @@
// Polyfills the `orientationchange` event.
// Exposes Touch, OS, HD and Orientation properties on `Mobify.config`.
-// x-desktop, x-ios, x-android, x-blackberry, x-webos, x-nokia
+// x-desktop, x-ios, x-android, x-blackberry, x-webos, x-nokia, x-bb10
// x-notouch, x-touch
// x-landscape, x-portrait
// x-sd, x-hd x-hd15 x-hd20
@@ -20,7 +20,7 @@ var $test = $('<div>', {id: 'mc-test'})
, touch = 'ontouchend' in document
// OS: ios, android, nokia, blackberry, webos, desktop
- , osMatch = /(ip(od|ad|hone)|android|nokia|blackberry|webos)/gi.exec(navigator.userAgent)
+ , osMatch = /(ip(od|ad|hone)|android|nokia|blackberry|webos|bb10)/gi.exec(navigator.userAgent)
, os = (osMatch && (osMatch[2] ? 'ios' : osMatch[1].toLowerCase())) || 'desktop'
, tablet = /ipad|android(?!.*mobile)/i.test(navigator.userAgent)
2  www/docs/index.md
View
@@ -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) {
2  www/docs/template-reference.md
View
@@ -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);
Something went wrong with that request. Please try again.