feat(platform): mobileweb platform

platform.is(‘mobileweb’)
This commit is contained in:
Adam Bradley
2016-01-02 23:02:49 -06:00
parent caa850295c
commit 35bab07d0e
3 changed files with 13 additions and 17 deletions

View File

@ -17,6 +17,7 @@ class E2EApp {
console.log('core', platform.is('core')); console.log('core', platform.is('core'));
console.log('cordova', platform.is('cordova')); console.log('cordova', platform.is('cordova'));
console.log('mobile', platform.is('mobile')); console.log('mobile', platform.is('mobile'));
console.log('mobileweb', platform.is('mobileweb'));
console.log('ipad', platform.is('ipad')); console.log('ipad', platform.is('ipad'));
console.log('iphone', platform.is('iphone')); console.log('iphone', platform.is('iphone'));
console.log('phablet', platform.is('phablet')); console.log('phablet', platform.is('phablet'));
@ -28,6 +29,8 @@ class E2EApp {
platform.ready().then(() => { platform.ready().then(() => {
console.log('platform.ready'); console.log('platform.ready');
}); });
this.platforms = platform.platforms();
} }
openModal() { openModal() {

View File

@ -12,6 +12,9 @@
<p> <p>
<button (click)="openModalCustomAnimation()">Modal: Custom Animation</button> <button (click)="openModalCustomAnimation()">Modal: Custom Animation</button>
</p> </p>
<p>
{{platforms | json}}
</p>
</ion-content> </ion-content>
<ion-overlay></ion-overlay> <ion-overlay></ion-overlay>

View File

@ -315,7 +315,6 @@ export class Platform {
/** /**
* @private * @private
* @param {TODO} platformConfig TODO
*/ */
static register(platformConfig) { static register(platformConfig) {
platformRegistry[platformConfig.name] = platformConfig; platformRegistry[platformConfig.name] = platformConfig;
@ -330,21 +329,20 @@ export class Platform {
/** /**
* @private * @private
* @param {TODO} platformName TODO
* @returns {string} TODO
*/ */
static get(platformName) { static get(platformName) {
return platformRegistry[platformName] || {}; return platformRegistry[platformName] || {};
} }
/**
* @private
*/
static setDefault(platformName) { static setDefault(platformName) {
platformDefault = platformName; platformDefault = platformName;
} }
/** /**
* @private * @private
* @param {TODO} queryValue TODO
* @returns {boolean} TODO
*/ */
testQuery(queryValue, queryTestValue) { testQuery(queryValue, queryTestValue) {
let valueSplit = queryValue.toLowerCase().split(';'); let valueSplit = queryValue.toLowerCase().split(';');
@ -353,8 +351,6 @@ export class Platform {
/** /**
* @private * @private
* @param {TODO} userAgentExpression TODO
* @returns {boolean} TODO
*/ */
testUserAgent(userAgentExpression) { testUserAgent(userAgentExpression) {
let rgx = new RegExp(userAgentExpression, 'i'); let rgx = new RegExp(userAgentExpression, 'i');
@ -363,8 +359,6 @@ export class Platform {
/** /**
* @private * @private
* @param {TODO} navigatorPlatformExpression TODO
* @returns {boolean} TODO
*/ */
testNavigatorPlatform(navigatorPlatformExpression) { testNavigatorPlatform(navigatorPlatformExpression) {
let rgx = new RegExp(navigatorPlatformExpression, 'i'); let rgx = new RegExp(navigatorPlatformExpression, 'i');
@ -373,8 +367,6 @@ export class Platform {
/** /**
* @private * @private
* @param {TODO} userAgentExpression TODO
* @returns {Object} TODO
*/ */
matchUserAgentVersion(userAgentExpression) { matchUserAgentVersion(userAgentExpression) {
if (this._ua && userAgentExpression) { if (this._ua && userAgentExpression) {
@ -390,9 +382,6 @@ export class Platform {
/** /**
* @private * @private
* @param {TODO} queryValue TODO
* @param {TODO} userAgentExpression TODO
* @returns {boolean} TODO
*/ */
isPlatform(queryTestValue, userAgentExpression) { isPlatform(queryTestValue, userAgentExpression) {
if (!userAgentExpression) { if (!userAgentExpression) {
@ -409,7 +398,6 @@ export class Platform {
/** /**
* @private * @private
* @param {TODO} config TODO
*/ */
load(platformOverride) { load(platformOverride) {
let rootPlatformNode = null; let rootPlatformNode = null;
@ -494,12 +482,14 @@ export class Platform {
platformNode = platformNode.child(); platformNode = platformNode.child();
} }
} }
if (this._platforms.indexOf('mobile') > -1 && this._platforms.indexOf('cordova') === -1) {
this._platforms.push('mobileweb');
}
} }
/** /**
* @private * @private
* @param {TODO} platformName TODO
* @returns {TODO} TODO
*/ */
matchPlatform(platformName) { matchPlatform(platformName) {
// build a PlatformNode and assign config data to it // build a PlatformNode and assign config data to it