diff options
author | Nullptrderef <nullptrderef@proton.me> | 2024-03-31 16:29:03 +0200 |
---|---|---|
committer | Nullptrderef <nullptrderef@proton.me> | 2024-03-31 16:29:03 +0200 |
commit | 8bfe7ef0f929e3447e9981f8cec1163963199a17 (patch) | |
tree | 4ddd1e4e427425bf8b5d891ce77f80fa8d79c35e | |
parent | f68a64bc013e8a8001afb412c632bf74c4c95863 (diff) | |
download | taler-ops-www-8bfe7ef0f929e3447e9981f8cec1163963199a17.tar.gz taler-ops-www-8bfe7ef0f929e3447e9981f8cec1163963199a17.tar.bz2 taler-ops-www-8bfe7ef0f929e3447e9981f8cec1163963199a17.zip |
make fns protected
-rw-r--r-- | static/js/vendored/ua.ts | 42 |
1 files changed, 15 insertions, 27 deletions
diff --git a/static/js/vendored/ua.ts b/static/js/vendored/ua.ts index f743110..18ee218 100644 --- a/static/js/vendored/ua.ts +++ b/static/js/vendored/ua.ts @@ -109,50 +109,38 @@ export default class Platform { if (this.browser) document.body.classList.add(this.browser); } - public get desktop(): boolean { - return this.device === Device.Desktop; - } - - public get tablet(): boolean { - return this.device === Device.Tablet; - } - - public get mobile(): boolean { - return this.device === Device.Mobile; - } - /** Checks if the user is on desktop (true if not mobile and not tablet) */ - public isDesktop(): boolean { + protected isDesktop(): boolean { return !this.isMobile() && !this.isTablet(); } /** Checks if the user is on a tablet or not */ - public isTablet(): boolean { + protected isTablet(): boolean { return /tablet|ipad/i.test(this.userAgent); } /** Checks if the user is on a list of known phones */ - public isMobile(): boolean { + protected isMobile(): boolean { return /mobile|iphone|ipod|android|windows *phone/i.test(this.userAgent); } /** Checks if the user is on android */ - public isAndroid(): boolean { + protected isAndroid(): boolean { return /android/i.test(this.userAgent); } /** Checks if the user is on iOS */ - public isIOS(): boolean { + protected isIOS(): boolean { return /ipad|iphone|ipod/i.test(this.userAgent); } /** Checks if the user is on Linux */ - public isLinux(): boolean { + protected isLinux(): boolean { return /linux/i.test(this.userAgent); } /** Checks if the user is on Macos/MacOS */ - public isMacOS(): boolean { + protected isMacOS(): boolean { return /macintosh|os *x/i.test(this.userAgent); } @@ -160,36 +148,36 @@ export default class Platform { * Checks if the user is on a Windows User-Agent * Note: Name is misleading; Windows refers to itself as Win32 on x64 aswell. */ - public isWin32(): boolean { + protected isWin32(): boolean { return /windows|win64|win32/i.test(this.userAgent); } /** Checks if we're chrome/chromium based */ - public isChromiumBased(): boolean { + protected isChromiumBased(): boolean { return /chrome|chromium/i.test(this.userAgent); } /** Checks if we're chrome/chromium but not a fork thereof */ - public isChrome(): boolean { + protected isChrome(): boolean { return this.isChromiumBased() && !this.isOpera() && !this.isEdge(); } /** Checks if we're on firefox */ - public isFirefox(): boolean { + protected isFirefox(): boolean { return /firefox/i.test(this.userAgent); } /** Checks if we're on opera */ - public isOpera(): boolean { + protected isOpera(): boolean { return /opr/i.test(this.userAgent); } /** Chceks if we're on Edge */ - public isEdge(): boolean { + protected isEdge(): boolean { return /edge/i.test(this.userAgent); } /** Checks if we're on Safari */ - public isSafari(): boolean { + protected isSafari(): boolean { return ( /safari/i.test(this.userAgent) && !this.isChrome() && @@ -199,7 +187,7 @@ export default class Platform { } /** Checks if we're on IE/pre-chromium Edge */ - public isIE(): boolean { + protected isIE(): boolean { return /msie|trident/i.test(this.userAgent); } } |