mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
feat(platform): mobileweb platform
platform.is(‘mobileweb’)
This commit is contained in:
@ -17,6 +17,7 @@ class E2EApp {
|
||||
console.log('core', platform.is('core'));
|
||||
console.log('cordova', platform.is('cordova'));
|
||||
console.log('mobile', platform.is('mobile'));
|
||||
console.log('mobileweb', platform.is('mobileweb'));
|
||||
console.log('ipad', platform.is('ipad'));
|
||||
console.log('iphone', platform.is('iphone'));
|
||||
console.log('phablet', platform.is('phablet'));
|
||||
@ -28,6 +29,8 @@ class E2EApp {
|
||||
platform.ready().then(() => {
|
||||
console.log('platform.ready');
|
||||
});
|
||||
|
||||
this.platforms = platform.platforms();
|
||||
}
|
||||
|
||||
openModal() {
|
||||
|
@ -12,6 +12,9 @@
|
||||
<p>
|
||||
<button (click)="openModalCustomAnimation()">Modal: Custom Animation</button>
|
||||
</p>
|
||||
<p>
|
||||
{{platforms | json}}
|
||||
</p>
|
||||
</ion-content>
|
||||
|
||||
<ion-overlay></ion-overlay>
|
||||
|
@ -315,7 +315,6 @@ export class Platform {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {TODO} platformConfig TODO
|
||||
*/
|
||||
static register(platformConfig) {
|
||||
platformRegistry[platformConfig.name] = platformConfig;
|
||||
@ -330,21 +329,20 @@ export class Platform {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {TODO} platformName TODO
|
||||
* @returns {string} TODO
|
||||
*/
|
||||
static get(platformName) {
|
||||
return platformRegistry[platformName] || {};
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
static setDefault(platformName) {
|
||||
platformDefault = platformName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {TODO} queryValue TODO
|
||||
* @returns {boolean} TODO
|
||||
*/
|
||||
testQuery(queryValue, queryTestValue) {
|
||||
let valueSplit = queryValue.toLowerCase().split(';');
|
||||
@ -353,8 +351,6 @@ export class Platform {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {TODO} userAgentExpression TODO
|
||||
* @returns {boolean} TODO
|
||||
*/
|
||||
testUserAgent(userAgentExpression) {
|
||||
let rgx = new RegExp(userAgentExpression, 'i');
|
||||
@ -363,8 +359,6 @@ export class Platform {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {TODO} navigatorPlatformExpression TODO
|
||||
* @returns {boolean} TODO
|
||||
*/
|
||||
testNavigatorPlatform(navigatorPlatformExpression) {
|
||||
let rgx = new RegExp(navigatorPlatformExpression, 'i');
|
||||
@ -373,8 +367,6 @@ export class Platform {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {TODO} userAgentExpression TODO
|
||||
* @returns {Object} TODO
|
||||
*/
|
||||
matchUserAgentVersion(userAgentExpression) {
|
||||
if (this._ua && userAgentExpression) {
|
||||
@ -390,9 +382,6 @@ export class Platform {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {TODO} queryValue TODO
|
||||
* @param {TODO} userAgentExpression TODO
|
||||
* @returns {boolean} TODO
|
||||
*/
|
||||
isPlatform(queryTestValue, userAgentExpression) {
|
||||
if (!userAgentExpression) {
|
||||
@ -409,7 +398,6 @@ export class Platform {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {TODO} config TODO
|
||||
*/
|
||||
load(platformOverride) {
|
||||
let rootPlatformNode = null;
|
||||
@ -494,12 +482,14 @@ export class Platform {
|
||||
platformNode = platformNode.child();
|
||||
}
|
||||
}
|
||||
|
||||
if (this._platforms.indexOf('mobile') > -1 && this._platforms.indexOf('cordova') === -1) {
|
||||
this._platforms.push('mobileweb');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {TODO} platformName TODO
|
||||
* @returns {TODO} TODO
|
||||
*/
|
||||
matchPlatform(platformName) {
|
||||
// build a PlatformNode and assign config data to it
|
||||
|
Reference in New Issue
Block a user