Преглед на файлове

Add Safari + Android warning

Danilo Bargen преди 7 години
родител
ревизия
baea97d0ca
променени са 7 файла, в които са добавени 45 реда и са изтрити 11 реда
  1. 4 2
      public/i18n/de.json
  2. 4 2
      public/i18n/en.json
  3. 3 0
      public/img/safari.svg
  4. 5 0
      src/partials/welcome.html
  5. 8 7
      src/partials/welcome.ts
  6. 3 0
      src/sass/base/_typography.scss
  7. 18 0
      src/sass/sections/_welcome.scss

+ 4 - 2
public/i18n/de.json

@@ -4,7 +4,6 @@
     },
     "welcome": {
         "ABORT": "Abbrechen",
-        "BROWSER_NOT_SUPPORTED_DETAILS": "Bitte verwenden Sie die aktuelle Version von <a href='https:\/\/www.google.com\/chrome\/browser\/desktop\/' target='_blank' rel='noopener noreferrer'>Google Chrome<\/a>, <a href='https:\/\/www.mozilla.org\/' target='_blank' rel='noopener noreferrer'>Mozilla Firefox<\/a>, <a href='https:\/\/www.opera.com\/' target='_blank' rel='noopener noreferrer'>Opera</a> oder <a href='https:\/\/www.apple.com\/safari\/' target='_blank' rel='noopener noreferrer'>Safari</a>, um den Webclient ohne Einschr\u00e4nkungen zu nutzen.",
         "CONTINUE_ANYWAY": "Trotzdem fortfahren",
         "PLEASE_SCAN": "Scannen Sie den QR-Code mit Ihrer Threema-App",
         "PLEASE_UNLOCK": "Verbindung wiederaufbauen",
@@ -22,6 +21,8 @@
         "FORGET_SESSION": "gespeicherte Sitzung löschen",
         "BTN_RECONNECT": "Verbindung aufbauen",
         "BROWSER_NOT_SUPPORTED": "Dieser Browser wird nicht unterst\u00fctzt",
+        "BROWSER_NOT_SUPPORTED_DETAILS": "Bitte verwenden Sie die aktuelle Version von <a href='https:\/\/www.google.com\/chrome\/browser\/desktop\/' target='_blank' rel='noopener noreferrer'>Google Chrome<\/a>, <a href='https:\/\/www.mozilla.org\/' target='_blank' rel='noopener noreferrer'>Mozilla Firefox<\/a>, <a href='https:\/\/www.opera.com\/' target='_blank' rel='noopener noreferrer'>Opera</a> oder <a href='https:\/\/www.apple.com\/safari\/' target='_blank' rel='noopener noreferrer'>Safari</a>, um den Webclient ohne Einschr\u00e4nkungen zu nutzen.",
+        "SAFARI": "Safari ist nur kompatibel mit Threema Web für iOS. Android-Nutzer verwenden bitte einen anderen Browser.",
         "ANDROID_IOS_ONLY": "Kompatibel mit Threema für Android und iOS.",
         "CONNECTING": "Verbindung wird aufgebaut",
         "WAITING_FOR_PUSH": "Threema-App wird<br>aufgeweckt …",
@@ -79,7 +80,8 @@
         "ARE_YOU_SURE": "Sind Sie sicher?",
         "SAVE": "Speichern",
         "DONE": "Fertig",
-        "MODIFY": "Ändern"
+        "MODIFY": "Ändern",
+        "NOTE": "Hinweis:"
     },
     "messenger": {
         "VERIFICATION_LEVEL": "Vertrauensstufe",

+ 4 - 2
public/i18n/en.json

@@ -4,7 +4,6 @@
     },
     "welcome": {
         "ABORT": "Abort",
-        "BROWSER_NOT_SUPPORTED_DETAILS": "Please use the latest version of <a href='https:\/\/www.google.com\/chrome\/browser\/desktop\/' target='_blank' rel='noopener noreferrer'>Google Chrome<\/a>, <a href='https:\/\/www.mozilla.org\/' target='_blank' rel='noopener noreferrer'>Mozilla Firefox<\/a>, <a href='https:\/\/www.opera.com\/' target='_blank' rel='noopener noreferrer'>Opera</a> or <a href='https:\/\/www.apple.com\/safari\/' target='_blank' rel='noopener noreferrer'>Safari</a>, otherwise the web client might not work properly.",
         "CONTINUE_ANYWAY": "Continue anyway",
         "PLEASE_SCAN": "Scan this QR code with your Threema app",
         "PLEASE_UNLOCK": "Reconnecting session",
@@ -22,6 +21,8 @@
         "FORGET_SESSION": "forget this session",
         "BTN_RECONNECT": "Reconnect",
         "BROWSER_NOT_SUPPORTED": "This browser is not supported",
+        "BROWSER_NOT_SUPPORTED_DETAILS": "Please use the latest version of <a href='https:\/\/www.google.com\/chrome\/browser\/desktop\/' target='_blank' rel='noopener noreferrer'>Google Chrome<\/a>, <a href='https:\/\/www.mozilla.org\/' target='_blank' rel='noopener noreferrer'>Mozilla Firefox<\/a>, <a href='https:\/\/www.opera.com\/' target='_blank' rel='noopener noreferrer'>Opera</a> or <a href='https:\/\/www.apple.com\/safari\/' target='_blank' rel='noopener noreferrer'>Safari</a>, otherwise the web client might not work properly.",
+        "SAFARI": "Safari is only compatible with Threema Web for iOS.<br>If you are using Android, please use another browser.",
         "ANDROID_IOS_ONLY": "Compatible with Threema for Android and iOS.",
         "CONNECTING": "Connecting",
         "WAITING_FOR_PUSH": "Waiting for<br>app wakeup …",
@@ -79,7 +80,8 @@
         "ARE_YOU_SURE": "Are you sure?",
         "SAVE": "Save",
         "DONE": "Done",
-        "MODIFY": "Modify"
+        "MODIFY": "Modify",
+        "NOTE": "Note:"
     },
     "messenger": {
         "VERIFICATION_LEVEL": "Verification level",

Файловите разлики са ограничени, защото са твърде много
+ 3 - 0
public/img/safari.svg


+ 5 - 0
src/partials/welcome.html

@@ -1,6 +1,11 @@
 <div id="welcome">
     <div class="center-block text-center welcome">
         <div ng-if="(ctrl.state === 'connecting' || ctrl.state === 'waiting') && ctrl.mode === 'scan'" class="scan">
+            <div class="ios-only-warning" ng-if="ctrl.browser.safari">
+                <img src="img/safari.svg" alt="Safari">
+                <p><strong translate>common.NOTE</strong> <span translate>welcome.SAFARI</span></p>
+            </div>
+
             <p class="instructions" translate>welcome.PLEASE_SCAN</p>
             <qrcode version="{{ ctrl.qrCode.version }}"
                     id="connecting-code"

+ 8 - 7
src/partials/welcome.ts

@@ -76,6 +76,7 @@ class WelcomeController {
     private qrCode;
     private password: string = '';
     private pleaseUpdateAppMsg: string = null;
+    private browser: threema.BrowserInfo;
 
     public static $inject = [
         '$scope', '$state', '$stateParams', '$timeout', '$interval', '$log', '$window', '$mdDialog', '$translate',
@@ -112,28 +113,28 @@ class WelcomeController {
         this.config = config;
 
         // Determine whether browser warning should be shown
-        const browser = browserService.getBrowser();
-        const version = browser.version;
-        $log.debug('Detected browser:', browser.textInfo);
+        this.browser = browserService.getBrowser();
+        const version = this.browser.version;
+        $log.debug('Detected browser:', this.browser.textInfo);
         if (version === undefined) {
             $log.warn('Could not determine browser version');
             this.showBrowserWarning();
-        } else if (browser.chrome === true) {
+        } else if (this.browser.chrome === true) {
             if (version < minVersions.CHROME) {
                 $log.warn('Chrome is too old (' + version + ' < ' + minVersions.CHROME + ')');
                 this.showBrowserWarning();
             }
-        } else if (browser.firefox === true) {
+        } else if (this.browser.firefox === true) {
             if (version < minVersions.FF) {
                 $log.warn('Firefox is too old (' + version + ' < ' + minVersions.FF + ')');
                 this.showBrowserWarning();
             }
-        } else if (browser.opera === true) {
+        } else if (this.browser.opera === true) {
             if (version < minVersions.OPERA) {
                 $log.warn('Opera is too old (' + version + ' < ' + minVersions.OPERA + ')');
                 this.showBrowserWarning();
             }
-        } else if (browser.safari === true) {
+        } else if (this.browser.safari === true) {
             if (version < minVersions.SAFARI) {
                 $log.warn('Safari is too old (' + version + ' < ' + minVersions.SAFARI + ')');
                 this.showBrowserWarning();

+ 3 - 0
src/sass/base/_typography.scss

@@ -16,6 +16,9 @@ em {
     font-style: italic;
 }
 
+strong {
+    font-weight: bold;
+}
 
 .text-bold {
     font-weight: bold;

+ 18 - 0
src/sass/sections/_welcome.scss

@@ -25,6 +25,24 @@
     }
 
     .scan {
+        .ios-only-warning {
+            display: flex;
+            flex-direction: horizontal;
+            padding: 8px;
+            background-color: $status-warning;
+            margin-bottom: 16px;
+            p {
+                font-size: 0.8em;
+                letter-spacing: -0.2px;
+                line-height: 1.4em;
+                text-align: left;
+            }
+            img {
+                margin-right: 8px;
+                width: 32px;
+            }
+        }
+
         .password-entry {
             margin-top: 16px;
         }

Някои файлове не бяха показани, защото твърде много файлове са промени