ADAM CLICK

This commit is contained in:
Max Lynch
2015-06-03 16:05:35 -05:00
parent 8519b8b223
commit 5590adb1e5
3 changed files with 623 additions and 2 deletions

View File

@ -1,5 +1,5 @@
import * as util from '../util/util';
import {Tap} from '../util/tap';
let registry = {};
let defaultPlatform;
@ -61,6 +61,10 @@ class PlatformController {
return null;
}
is(name) {
return activePlatform.name === name;
}
_applyBodyClasses() {
if(!activePlatform) {
return;
@ -68,6 +72,10 @@ class PlatformController {
document.body.classList.add('platform-' + activePlatform.name);
}
run() {
activePlatform && activePlatform.run();
}
}
export let Platform = new PlatformController((util.getQuerystring('ionicplatform')).toLowerCase(), window.navigator.userAgent);
@ -81,6 +89,9 @@ Platform.register({
return platformQuerystring == 'android';
}
return /android/i.test(userAgent);
},
run() {
}
});
@ -91,6 +102,9 @@ Platform.register({
return platformQuerystring == 'ios';
}
return /ipad|iphone|ipod/i.test(userAgent);
},
run() {
//Tap.run();
}
});
@ -99,4 +113,6 @@ Platform.setDefault({
name: 'ios'
});
Platform.set( Platform.get('ios') );//Platform.detect() );
Platform.set( Platform.getPlatform('ios') );//Platform.detect() );
Platform.run();