gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-ops-www] branch master updated (ef0140d -> 5eed576)


From: gnunet
Subject: [taler-taler-ops-www] branch master updated (ef0140d -> 5eed576)
Date: Sun, 31 Mar 2024 16:11:55 +0200

This is an automated email from the git hooks/post-receive script.

nora-grothoff pushed a change to branch master
in repository taler-ops-www.

    from ef0140d  vendor platform detection
     new 00c8cdc  locale
     new 5eed576  proper OOP and platform detection and alldat

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 locale/de/LC_MESSAGES/messages.po |   4 +-
 locale/en/LC_MESSAGES/messages.po |   4 +-
 locale/fr/LC_MESSAGES/messages.po |   4 +-
 locale/messages.pot               |   6 +-
 static/js/vendored/ua.ts          | 231 +++++++++++++++++++++-----------------
 5 files changed, 134 insertions(+), 115 deletions(-)

diff --git a/locale/de/LC_MESSAGES/messages.po 
b/locale/de/LC_MESSAGES/messages.po
index 991d898..38391e3 100644
--- a/locale/de/LC_MESSAGES/messages.po
+++ b/locale/de/LC_MESSAGES/messages.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PROJECT VERSION\n"
 "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2024-03-31 15:02+0200\n"
+"POT-Creation-Date: 2024-03-31 15:58+0200\n"
 "PO-Revision-Date: 2024-02-24 20:06+0000\n"
 "Last-Translator: Stefan Kügel <skuegel@web.de>\n"
 "Language-Team: German <https://weblate.taler.net/projects/taler-ops/website/";
@@ -227,7 +227,7 @@ msgid ""
 "automatically exchange any eCHF that are about to expire for new eCHF with "
 "an extended validity period. However, if your wallet is offline for an "
 "extended period of time, it may be unable to do so. Ensure your wallet is "
-"regularly online to avoid loosing money due to expiration!"
+"regularly online to avoid losing money due to expiration!"
 msgstr ""
 
 #: template/index.html.j2:5 template/index.html.j2:9 template/index.html.j2:27
diff --git a/locale/en/LC_MESSAGES/messages.po 
b/locale/en/LC_MESSAGES/messages.po
index 451fbc5..55591d2 100644
--- a/locale/en/LC_MESSAGES/messages.po
+++ b/locale/en/LC_MESSAGES/messages.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PROJECT VERSION\n"
 "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2024-03-31 15:02+0200\n"
+"POT-Creation-Date: 2024-03-31 15:58+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -206,7 +206,7 @@ msgid ""
 "automatically exchange any eCHF that are about to expire for new eCHF with "
 "an extended validity period. However, if your wallet is offline for an "
 "extended period of time, it may be unable to do so. Ensure your wallet is "
-"regularly online to avoid loosing money due to expiration!"
+"regularly online to avoid losing money due to expiration!"
 msgstr ""
 
 #: template/index.html.j2:5 template/index.html.j2:9 template/index.html.j2:27
diff --git a/locale/fr/LC_MESSAGES/messages.po 
b/locale/fr/LC_MESSAGES/messages.po
index f0f54af..3b52420 100644
--- a/locale/fr/LC_MESSAGES/messages.po
+++ b/locale/fr/LC_MESSAGES/messages.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PROJECT VERSION\n"
 "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2024-03-31 15:02+0200\n"
+"POT-Creation-Date: 2024-03-31 15:58+0200\n"
 "PO-Revision-Date: 2024-02-12 18:13+0000\n"
 "Last-Translator: Stefan Kügel <skuegel@web.de>\n"
 "Language-Team: French <https://weblate.taler.net/projects/taler-ops/website/";
@@ -220,7 +220,7 @@ msgid ""
 "automatically exchange any eCHF that are about to expire for new eCHF with "
 "an extended validity period. However, if your wallet is offline for an "
 "extended period of time, it may be unable to do so. Ensure your wallet is "
-"regularly online to avoid loosing money due to expiration!"
+"regularly online to avoid losing money due to expiration!"
 msgstr ""
 
 #: template/index.html.j2:5 template/index.html.j2:9 template/index.html.j2:27
diff --git a/locale/messages.pot b/locale/messages.pot
index 89dcd35..01e7644 100644
--- a/locale/messages.pot
+++ b/locale/messages.pot
@@ -8,14 +8,14 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PROJECT VERSION\n"
 "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2024-03-31 15:04+0200\n"
+"POT-Creation-Date: 2024-03-31 15:58+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=utf-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 2.10.3\n"
+"Generated-By: Babel 2.14.0\n"
 
 #: common/base.j2:24 common/base.j2:28
 msgid "Taler Operations AG, Biel, Switzerland"
@@ -207,7 +207,7 @@ msgid ""
 "automatically exchange any eCHF that are about to expire for new eCHF "
 "with an extended validity period. However, if your wallet is offline for "
 "an extended period of time, it may be unable to do so. Ensure your wallet"
-" is regularly online to avoid loosing money due to expiration!"
+" is regularly online to avoid losing money due to expiration!"
 msgstr ""
 
 #: template/index.html.j2:5 template/index.html.j2:9 template/index.html.j2:27
diff --git a/static/js/vendored/ua.ts b/static/js/vendored/ua.ts
index e26b919..45ca33d 100644
--- a/static/js/vendored/ua.ts
+++ b/static/js/vendored/ua.ts
@@ -1,189 +1,208 @@
-// Venodred Platform Detection
+// Venodred Platform Detection using Enums & Proper OOP
 // Upstream: https://github.com/leondejong/platform-detection
 
+export enum Browser {
+  Chrome = 'chrome',
+  Chromium = 'chrome',
+  Firefox = 'firefox',
+  Opera = 'opera',
+  Edge = 'edge',
+  Safari = 'safari',
+  IE = 'explorer',
+  Unknown = '',
+}
+export enum OS {
+  Android = 'android',
+  iOS = 'ios',
+  Linux = 'linux',
+  Darwin = 'darwin',
+  Win32 = 'win32',
+  Unknown = '',
+}
+export enum Device {
+  Desktop = 'desktop',
+  Tablet = 'tablet',
+  Mobile = 'mobile',
+  Unknown = '',
+}
+
 export default class Platform {
-  public static readonly desktop: string = 'desktop';
-  public static readonly tablet: string = 'tablet';
-  public static readonly mobile: string = 'mobile';
+  public static readonly Device = Device;
+  public static readonly OS = OS;
+  public static readonly Browser = Browser;
 
-  public static readonly android: string = 'android';
-  public static readonly ios: string = 'ios';
-  public static readonly linux: string = 'linux';
-  public static readonly osx: string = 'osx';
-  public static readonly windows: string = 'windows';
+  public device = Device.Desktop;
+  public os = OS.Android;
+  public browser = Browser.Firefox;
 
-  public static readonly chrome: string = 'chrome';
-  public static readonly firefox: string = 'firefox';
-  public static readonly opera: string = 'opera';
-  public static readonly edge: string = 'edge';
-  public static readonly safari: string = 'safari';
-  public static readonly explorer: string = 'explorer';
+  public constructor(public userAgent = navigator.userAgent) {
+    this.update(userAgent);
+  }
 
-  public static device: string = Platform.mobile;
-  public static os: string = Platform.android;
-  public static browser: string = Platform.firefox;
+  public update(userAgent = navigator.userAgent) {
+    this.userAgent = userAgent;
 
-  public static initialize(): void {
-    Platform.setDevice();
-    Platform.setOs();
-    Platform.setBrowser();
+    this.setDevice();
+    this.setOS();
+    this.setBrowser();
+  }
 
-    if (Platform.device) document.body.classList.add(Platform.device);
-    if (Platform.os) document.body.classList.add(Platform.os);
-    if (Platform.browser) document.body.classList.add(Platform.browser);
+  /** Adds OS, Device and Browser classes to the body */
+  public addClasses() {
+    if (this.device) document.body.classList.add(this.device);
+    if (this.os) document.body.classList.add(this.os);
+    if (this.browser) document.body.classList.add(this.browser);
   }
 
-  public static compareDevice(device: string): boolean {
-    return Platform.device === device;
+  public compareDevice(device: string): boolean {
+    return this.device === device;
   }
 
-  public static compareOs(os: string): boolean {
-    return Platform.os === os;
+  public compareOs(os: string): boolean {
+    return this.os === os;
   }
 
-  public static compareBrowser(browser: string): boolean {
-    return Platform.browser === browser;
+  public compareBrowser(browser: string): boolean {
+    return this.browser === browser;
   }
 
-  public static isDesktop(): boolean {
-    return Platform.compareDevice(Platform.desktop);
+  public isDesktop(): boolean {
+    return this.compareDevice(Device.Desktop);
   }
 
-  public static isTablet(): boolean {
-    return Platform.compareDevice(Platform.tablet);
+  public isTablet(): boolean {
+    return this.compareDevice(Device.Tablet);
   }
 
-  public static isMobile(): boolean {
-    return Platform.compareDevice(Platform.mobile);
+  public isMobile(): boolean {
+    return this.compareDevice(Device.Mobile);
   }
 
-  public static detectDesktop(): boolean {
-    return !Platform.detectMobile() && !Platform.detectTablet();
+  public detectDesktop(): boolean {
+    return !this.detectMobile() && !this.detectTablet();
   }
 
-  public static detectTablet(): boolean {
-    return /tablet|ipad/i.test(navigator.userAgent);
+  public detectTablet(): boolean {
+    return /tablet|ipad/i.test(this.userAgent);
   }
 
-  public static detectMobile(): boolean {
-    return /mobile|iphone|ipod|android|windows *phone/i.test(
-      navigator.userAgent,
-    );
+  public detectMobile(): boolean {
+    return /mobile|iphone|ipod|android|windows *phone/i.test(this.userAgent);
   }
 
-  public static detectAndroid(): boolean {
-    return /android/i.test(navigator.userAgent);
+  public detectAndroid(): boolean {
+    return /android/i.test(this.userAgent);
   }
 
-  public static detectIos(): boolean {
-    return /ipad|iphone|ipod/i.test(navigator.userAgent);
+  public detectIOS(): boolean {
+    return /ipad|iphone|ipod/i.test(this.userAgent);
   }
 
-  public static detectLinux(): boolean {
-    return /linux/i.test(navigator.userAgent);
+  public detectLinux(): boolean {
+    return /linux/i.test(this.userAgent);
   }
 
-  public static detectOsx(): boolean {
-    return /macintosh|os *x/i.test(navigator.userAgent);
+  public detectDarwin(): boolean {
+    return /macintosh|os *x/i.test(this.userAgent);
   }
 
-  public static detectWindows(): boolean {
-    return /windows|win64|win32/i.test(navigator.userAgent);
+  public detectWin32(): boolean {
+    return /windows|win64|win32/i.test(this.userAgent);
   }
 
-  public static detectChrome(): boolean {
+  public detectChrome(): boolean {
     return (
-      /chrome/i.test(navigator.userAgent) &&
-      !Platform.detectOpera() &&
-      !Platform.detectEdge()
+      /chrome/i.test(this.userAgent) &&
+      !this.detectOpera() &&
+      !this.detectEdge()
     );
   }
 
-  public static detectFirefox(): boolean {
-    return /firefox/i.test(navigator.userAgent);
+  public detectFirefox(): boolean {
+    return /firefox/i.test(this.userAgent);
   }
 
-  public static detectOpera(): boolean {
-    return /opr/i.test(navigator.userAgent);
+  public detectOpera(): boolean {
+    return /opr/i.test(this.userAgent);
   }
 
-  public static detectEdge(): boolean {
-    return /edge/i.test(navigator.userAgent);
+  public detectEdge(): boolean {
+    return /edge/i.test(this.userAgent);
   }
 
-  public static detectSafari(): boolean {
+  public detectSafari(): boolean {
     return (
-      /safari/i.test(navigator.userAgent) &&
-      !Platform.detectChrome() &&
-      !Platform.detectOpera() &&
-      !Platform.detectEdge()
+      /safari/i.test(this.userAgent) &&
+      !this.detectChrome() &&
+      !this.detectOpera() &&
+      !this.detectEdge()
     );
   }
 
-  public static detectExplorer(): boolean {
-    return /msie|trident/i.test(navigator.userAgent);
+  public detectExplorer(): boolean {
+    return /msie|trident/i.test(this.userAgent);
   }
 
-  public static setDevice(): void {
+  public setDevice(): void {
     switch (true) {
-      case Platform.detectTablet():
-        Platform.device = Platform.tablet;
+      case this.detectTablet():
+        this.device = Device.Tablet;
         break;
-      case Platform.detectMobile():
-        Platform.device = Platform.mobile;
+      case this.detectMobile():
+        this.device = Device.Mobile;
         break;
-      case Platform.detectDesktop():
-        Platform.device = Platform.desktop;
+      case this.detectDesktop():
+        this.device = Device.Desktop;
         break;
       default:
-        Platform.device = '';
+        this.device = Device.Unknown;
     }
   }
 
-  public static setOs(): void {
+  public setOS(): void {
     switch (true) {
-      case Platform.detectAndroid():
-        Platform.os = Platform.android;
+      case this.detectAndroid():
+        this.os = OS.Android;
         break;
-      case Platform.detectIos():
-        Platform.os = Platform.ios;
+      case this.detectIOS():
+        this.os = OS.iOS;
         break;
-      case Platform.detectLinux():
-        Platform.os = Platform.linux;
+      case this.detectLinux():
+        this.os = OS.Linux;
         break;
-      case Platform.detectOsx():
-        Platform.os = Platform.osx;
+      case this.detectDarwin():
+        this.os = OS.Darwin;
         break;
-      case Platform.detectWindows():
-        Platform.os = Platform.windows;
+      case this.detectWin32():
+        this.os = OS.Win32;
         break;
       default:
-        Platform.os = '';
+        this.os = OS.Unknown;
     }
   }
 
-  public static setBrowser(): void {
+  public setBrowser(): void {
     switch (true) {
-      case Platform.detectChrome():
-        Platform.browser = Platform.chrome;
+      case this.detectChrome():
+        this.browser = Browser.Chromium;
         break;
-      case Platform.detectFirefox():
-        Platform.browser = Platform.firefox;
+      case this.detectFirefox():
+        this.browser = Browser.Firefox;
         break;
-      case Platform.detectOpera():
-        Platform.browser = Platform.opera;
+      case this.detectOpera():
+        this.browser = Browser.Opera;
         break;
-      case Platform.detectEdge():
-        Platform.browser = Platform.edge;
+      case this.detectEdge():
+        this.browser = Browser.Edge;
         break;
-      case Platform.detectSafari():
-        Platform.browser = Platform.safari;
+      case this.detectSafari():
+        this.browser = Browser.Safari;
         break;
-      case Platform.detectExplorer():
-        Platform.browser = Platform.explorer;
+      case this.detectExplorer():
+        this.browser = Browser.IE;
         break;
       default:
-        Platform.browser = '';
+        this.browser = Browser.Unknown;
     }
   }
 }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]