mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-01-08 19:45:08 +00:00
(@fuse/service/platform) Added comments to the service file
This commit is contained in:
parent
ea9efc3dc2
commit
1bf4c48cdc
|
@ -13,36 +13,43 @@ export class FusePlatformService
|
||||||
*/
|
*/
|
||||||
constructor(private _platform: Platform)
|
constructor(private _platform: Platform)
|
||||||
{
|
{
|
||||||
|
// If the platform is not a browser, return immediately
|
||||||
if ( !this._platform.isBrowser )
|
if ( !this._platform.isBrowser )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Windows
|
||||||
if ( navigator.userAgent.includes('Win') )
|
if ( navigator.userAgent.includes('Win') )
|
||||||
{
|
{
|
||||||
this.osName = 'os-windows';
|
this.osName = 'os-windows';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mac OS
|
||||||
if ( navigator.userAgent.includes('Mac') )
|
if ( navigator.userAgent.includes('Mac') )
|
||||||
{
|
{
|
||||||
this.osName = 'os-mac';
|
this.osName = 'os-mac';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Unix
|
||||||
if ( navigator.userAgent.includes('X11') )
|
if ( navigator.userAgent.includes('X11') )
|
||||||
{
|
{
|
||||||
this.osName = 'os-unix';
|
this.osName = 'os-unix';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Linux
|
||||||
if ( navigator.userAgent.includes('Linux') )
|
if ( navigator.userAgent.includes('Linux') )
|
||||||
{
|
{
|
||||||
this.osName = 'os-linux';
|
this.osName = 'os-linux';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// iOS
|
||||||
if ( this._platform.IOS )
|
if ( this._platform.IOS )
|
||||||
{
|
{
|
||||||
this.osName = 'os-ios';
|
this.osName = 'os-ios';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Android
|
||||||
if ( this._platform.ANDROID )
|
if ( this._platform.ANDROID )
|
||||||
{
|
{
|
||||||
this.osName = 'os-android';
|
this.osName = 'os-android';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user