Browse Source

Merge pull request #698 from threema-ch/npm-updates

Dependency updates
Danilo Bargen 6 năm trước cách đây
mục cha
commit
2898663c6b

+ 0 - 21
.licenses/angular-qrcode

@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Monospaced
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.

+ 0 - 19
.licenses/angularjs-scroll-glue

@@ -1,19 +0,0 @@
-Copyright (C) 2013 Luegg
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-of the Software, and to permit persons to whom the Software is furnished to do
-so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.

+ 160 - 35
LICENSE-3RD-PARTY.txt

@@ -119,6 +119,21 @@ THE SOFTWARE.
 
 
 
+----------
+License for angularjs-scroll-glue
+----------
+
+Copyright (C) 2013 Luegg
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+
+
 ----------
 License for angular-material
 ----------
@@ -148,13 +163,42 @@ THE SOFTWARE.
 
 
 
+----------
+License for angular-messages
+----------
+
+The MIT License (MIT)
+
+Copyright (c) 2016 Angular
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+
+
+
 ----------
 License for angular-qrcode
 ----------
 
 The MIT License (MIT)
 
-Copyright (c) 2014 Monospaced
+Copyright (c) 2017 Monospaced
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
@@ -294,39 +338,41 @@ THE SOFTWARE.
 
 
 ----------
-License for angularjs-scroll-glue
+License for autolinker
 ----------
 
-Copyright (C) 2013 Luegg
+The MIT License (MIT)
 
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-of the Software, and to permit persons to whom the Software is furnished to do
-so, subject to the following conditions:
+Copyright (c) 2014 Gregory Jacobs (http://greg-jacobs.com)
 
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
 
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
 
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
 
 ----------
-License for autolinker
+License for babel
 ----------
 
-The MIT License (MIT)
+MIT License
 
-Copyright (c) 2014 Gregory Jacobs (http://greg-jacobs.com)
+Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the
@@ -349,22 +395,44 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
 
+
 ----------
-License for babel-es6-polyfill
+License for babel-polyfill
 ----------
 
-Copyright by https://github.com/JasonBerry, MIT License
+MIT License
+
+Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
 
 
 ----------
-License for babel-preset-es2015
+License for babel-preset-env
 ----------
 
 MIT License
 
-Copyright (c) 2014-2017 Sebastian McKenzie <sebmck@gmail.com>
+Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the
@@ -558,6 +626,15 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 
 
 
+----------
+License for EmojiOne Artwork
+----------
+
+EmojiOne free license: https://www.emojione.com/developers/free-license
+
+
+
+
 ----------
 License for EmojiOne JS
 ----------
@@ -585,15 +662,6 @@ SOFTWARE.
 
 
 
-----------
-License for EmojiOne Artwork
-----------
-
-EmojiOne free license: https://www.emojione.com/developers/free-license
-
-
-
-
 ----------
 License for file-saver
 ----------
@@ -728,13 +796,69 @@ SOFTWARE.
 
 
 
+----------
+License for saltyrtc-task-relayed-data
+----------
+
+The MIT License (MIT)
+
+Copyright (c) 2018 Threema GmbH
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+
+
+
 ----------
 License for saltyrtc-task-webrtc
 ----------
 
 The MIT License (MIT)
 
-Copyright (c) 2016-2017 Threema GmbH
+Copyright (c) 2016-2018 Threema GmbH
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+
+
+
+----------
+License for sdp
+----------
+
+Copyright (c) 2017 Philipp Hancke
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
@@ -876,6 +1000,7 @@ License for webrtc-adapter
 ----------
 
 Copyright (c) 2014, The WebRTC project authors. All rights reserved.
+Copyright (c) 2018, The adapter.js project authors. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are

+ 10 - 0
dist/babelify-config.js

@@ -0,0 +1,10 @@
+const babelifyConfig = {
+    presets: [
+        ['@babel/preset-env', {
+            'useBuiltIns': 'entry',
+        }],
+    ],
+    extensions: '.ts',
+}
+
+module.exports = babelifyConfig;

+ 60 - 0
dist/browserify.js

@@ -0,0 +1,60 @@
+/**
+ * Bundle the application.
+ */
+
+// Parse argument
+const requiredTargets = 'Must be one of "app", "tests:unit" or "tests:ui".';
+const target = process.argv[2];
+if (target === undefined) {
+    console.error('Missing target. ' + requiredTargets);
+    process.exit(1);
+}
+
+// Import libs
+const fs = require('fs');
+const browserify = require('browserify');
+const babelifyConfig = require('./babelify-config.js');
+
+// Choose target entry point
+let b;
+switch (target) {
+    case 'app':
+        b = browserify('./src/app.ts');
+        break;
+    case 'test:unit':
+        b = browserify('./tests/ts/main.ts');
+        break;
+    case 'test:ui':
+        b = browserify('./tests/ui/main.ts');
+        break;
+    default:
+        console.error(`Invalid target: ${target}. ${requiredTargets}`);
+        process.exit(2);
+        return;
+}
+
+// Convert TypeScript
+b.plugin('tsify');
+
+// Babelify
+b.transform('babelify', babelifyConfig);
+
+// Add header comment
+if (target === 'app') {
+    b.plugin('browserify-header', {
+        'file': 'header.js',
+    })
+}
+
+// Generate bundle
+switch (target) {
+    case 'app':
+        b.bundle().pipe(fs.createWriteStream('dist/app.js'));
+        break;
+    case 'test:unit':
+        b.bundle().pipe(fs.createWriteStream('dist/ts-tests.js'));
+        break;
+    case 'test:ui':
+        b.bundle().pipe(fs.createWriteStream('dist/ui-tests.js'));
+        break;
+}

+ 20 - 0
dist/devserver.js

@@ -0,0 +1,20 @@
+/**
+ * Run the devserver.
+ *
+ * IMPORTANT: Configuration should match `dist/browserify.js`!
+ */
+
+const budo = require('budo')
+const babelify = require('babelify')
+const babelifyConfig = require('./babelify-config.js');
+
+budo(null, {
+    dir: ['public', '.', 'src'],
+    live: true,
+    stream: process.stdout,
+    port: 9966,
+    debug: true,
+    browserify: {
+        transform: [babelify, babelifyConfig]
+    },
+});

+ 0 - 2
dist/package.sh

@@ -53,7 +53,6 @@ targets=(
     angular-animate/angular-animate.min.js
     angular-sanitize/angular-sanitize.min.js
     angular-route/angular-route.min.js
-    babel-es6-polyfill/browser-polyfill.min.js
     msgpack-lite/dist/msgpack.min.js
     tweetnacl/nacl-fast.min.js
     @saltyrtc/chunked-dc/dist/chunked-dc.es5.js
@@ -70,7 +69,6 @@ targets=(
     angular-material/angular-material.min.css
     croppie/croppie.min.js
     croppie/croppie.css
-    autolinker/dist/Autolinker.min.js
     @uirouter/angularjs/release/angular-ui-router.min.js
     messageformat/messageformat.min.js
     angular-translate/dist/angular-translate.min.js

+ 9 - 5
gather-licenses.sh

@@ -7,28 +7,32 @@ LICENSE_FILES=(
     'angular-animate' 'node_modules/angular-animate/LICENSE.md'
     'angular-aria' 'node_modules/angular-aria/LICENSE.md'
     'angular-inview' 'public/libs/angular-inview/LICENSE'
+    'angularjs-scroll-glue' 'node_modules/angularjs-scroll-glue/src/LICENSE'
     'angular-material' 'node_modules/angular-material/LICENSE'
-    'angular-qrcode' '.licenses/angular-qrcode'
+    'angular-messages' 'node_modules/angular-messages/LICENSE.md'
+    'angular-qrcode' 'node_modules/angular-qrcode/LICENCE.txt'
     'angular-route' 'node_modules/angular-route/LICENSE.md'
     'angular-sanitize' 'node_modules/angular-sanitize/LICENSE.md'
     'angular-translate' 'node_modules/angular-translate/LICENSE'
     'angular-ui-router' 'node_modules/@uirouter/angularjs/LICENSE'
-    'angularjs-scroll-glue' '.licenses/angularjs-scroll-glue'
     'autolinker' 'node_modules/autolinker/LICENSE'
-    'babel-es6-polyfill' '.licenses/babel-es6-polyfill'
-    'babel-preset-es2015' '.licenses/babel-preset-es2015'
+    'babel' 'node_modules/@babel/core/LICENSE'
+    'babel-polyfill' 'node_modules/@babel/polyfill/LICENSE'
+    'babel-preset-env' 'node_modules/@babel/preset-env/LICENSE'
     'babelify' 'node_modules/babelify/LICENSE'
     'browserify' 'node_modules/browserify/LICENSE'
     'browserify-header' '.licenses/browserify-header'
     'croppie' 'node_modules/croppie/LICENSE'
-    'EmojiOne JS' '.licenses/emojione-js'
     'EmojiOne Artwork' '.licenses/emojione-artwork'
+    'EmojiOne JS' '.licenses/emojione-js'
     'file-saver' 'node_modules/file-saver/LICENSE.md'
     'messageformat' 'node_modules/messageformat/LICENSE'
     'msgpack-lite' 'node_modules/msgpack-lite/LICENSE'
     'node-sass' 'node_modules/node-sass/LICENSE'
     'saltyrtc-client' 'node_modules/@saltyrtc/client/LICENSE.md'
+    'saltyrtc-task-relayed-data' 'node_modules/@saltyrtc/task-relayed-data/LICENSE.md'
     'saltyrtc-task-webrtc' 'node_modules/@saltyrtc/task-webrtc/LICENSE.md'
+    'sdp' 'node_modules/sdp/LICENSE'
     'ts-events' 'node_modules/ts-events/LICENSE'
     'tsify' '.licenses/tsify'
     'tweetnacl' 'node_modules/tweetnacl/LICENSE'

+ 0 - 2
index.html

@@ -102,7 +102,6 @@
 
     <!-- Polyfills -->
     <script src="node_modules/webrtc-adapter/out/adapter_no_edge.js?v=[[VERSION]]"></script>
-    <script src="node_modules/babel-es6-polyfill/browser-polyfill.min.js?v=[[VERSION]]"></script>
 
     <!-- Various libraries -->
     <script src="node_modules/qrcode-generator/qrcode.js?v=[[VERSION]]"></script>
@@ -129,7 +128,6 @@
     <script src="node_modules/@saltyrtc/task-webrtc/dist/saltyrtc-task-webrtc.es5.js?v=[[VERSION]]"></script>
     <script src="node_modules/@saltyrtc/task-relayed-data/dist/saltyrtc-task-relayed-data.es5.js?v=[[VERSION]]"></script>
     <script src="node_modules/croppie/croppie.min.js?v=[[VERSION]]"></script>
-    <script src="node_modules/autolinker/dist/Autolinker.min.js?v=[[VERSION]]"></script>
 
     <!-- App -->
     <script src="dist/app.js?v=[[VERSION]]"></script>

+ 0 - 2
karma.conf.js

@@ -10,8 +10,6 @@ module.exports = function(config) {
             'node_modules/angular-animate/angular-animate.min.js',
             'node_modules/angular-material/angular-material.min.js',
             'node_modules/@saltyrtc/chunked-dc/dist/chunked-dc.es5.js',
-            'node_modules/autolinker/dist/Autolinker.min.js',
-            'node_modules/regenerator-runtime/runtime.js',
             'dist/app.js',
             'dist/ts-tests.js',
             'tests/filters.js',

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1276 - 1458
package-lock.json


+ 43 - 42
package.json

@@ -4,17 +4,17 @@
   "description": "Threema Webclient",
   "scripts": {
     "build": "npm run build:js && npm run build:css",
-    "build:js": "browserify -p tsify src/app.ts -t [ babelify --presets [ es2015 ] --extensions .ts ] -p [ browserify-header --file header.js ] -o dist/app.js",
+    "build:js": "node dist/browserify.js app",
     "build:css": "node-sass -o public/css/ --output-style compressed src/sass/",
     "build:css:watch": "node-sass -w -r --source-map true --source-map-embed true -o public/css/ --output-style compressed src/sass/",
     "build:tests": "echo -e 'NOTE: Use either \"npm build:unittests\" or \"npm build:uitests\"\n' && exit 1",
-    "build:unittests": "browserify -p tsify tests/ts/main.ts -t [ babelify --presets [ es2015 ] --extensions .ts ] -o dist/ts-tests.js",
-    "build:uitests": "npm run build:css && browserify -p tsify tests/ui/main.ts -t [ babelify --presets [ es2015 ] --extensions .ts ] -o dist/ui-tests.js",
+    "build:unittests": "node dist/browserify.js test:unit",
+    "build:uitests": "npm run build:css && node dist/browserify.js test:ui",
     "dist": "npm run build && echo \"\" && node dist/build-package.js",
     "serve:live": "echo 'NOTE: serve:live command has been renamed to devserver'",
-    "devserver": "npm run build:css && concurrently --kill-others --names \"css,server\" -p name \"npm run build:css:watch\" \"budo src/app.ts:dist/app.js -d public -d . -d src --live -- -d -p tsify -t [ babelify --presets [ es2015 ] --extensions .ts ]\"",
+    "devserver": "npm run build:css && concurrently --kill-others --names \"css,server\" -p name \"npm run build:css:watch\" \"node dist/devserver.js\"",
     "testserver": "budo -d public -d . -d src -p 7777",
-    "test": "echo -e 'NOTE: Use either \"npm test:unit\" or \"npm test:ui\"\n' && exit 1",
+    "test": "echo -e 'NOTE: Use either \"npm run test:unit\" or \"npm run test:ui\"\n' && exit 1",
     "test:unit": "npm run build:unittests && karma start --single-run --log-level=debug --colors",
     "test:ui": "npm run build:uitests && bash tests/ui/run.sh",
     "lint": "tslint -c tslint.json --project tsconfig.json --exclude \"**/src/config.ts\"",
@@ -31,64 +31,65 @@
   "private": true,
   "homepage": "https://threema.ch/",
   "dependencies": {
-    "@saltyrtc/client": "^0.13.1",
+    "@babel/core": "^7.2.2",
+    "@babel/polyfill": "^7.2.5",
+    "@babel/preset-env": "^7.2.3",
+    "@saltyrtc/client": "^0.13.2",
     "@saltyrtc/task-relayed-data": "^0.3.1",
     "@saltyrtc/task-webrtc": "^0.13.0",
-    "@types/angular": "^1.6.50",
-    "@types/angular-material": "^1.1.59",
+    "@types/angular": "^1.6.53",
+    "@types/angular-material": "^1.1.62",
     "@types/angular-sanitize": "^1.3.7",
     "@types/angular-translate": "^2.16.0",
-    "@types/file-saver": "^1.3.0",
-    "@types/jquery": "^3.3.6",
+    "@types/file-saver": "^2.0.0",
+    "@types/jquery": "^3.3.29",
     "@types/msgpack-lite": "^0.1.6",
-    "@types/webrtc": "0.0.23",
+    "@types/webrtc": "0.0.24",
     "@uirouter/angularjs": "^1.0.20",
-    "angular": "^1.7.3",
-    "angular-animate": "^1.7.3",
-    "angular-aria": "^1.7.3",
-    "angular-material": "=1.1.10",
-    "angular-messages": "^1.7.3",
+    "angular": "^1.7.5",
+    "angular-animate": "^1.7.5",
+    "angular-aria": "^1.7.5",
+    "angular-material": "=1.1.11",
+    "angular-messages": "^1.7.5",
     "angular-qrcode": "~7.2",
-    "angular-route": "^1.7.3",
-    "angular-sanitize": "^1.7.3",
+    "angular-route": "^1.7.5",
+    "angular-sanitize": "^1.7.5",
     "angular-translate": "~2.18",
-    "angularjs-scroll-glue": "~2.1.0",
-    "autolinker": "~1.6.2",
-    "babel-es6-polyfill": "~1.1.0",
-    "babel-preset-es2015": "^6.24.1",
-    "babelify": "~7.3.0",
-    "browserify": "~16",
-    "browserify-header": "^0.9.4",
+    "angularjs-scroll-glue": "~2.2.0",
+    "autolinker": "~2.2.1",
+    "babelify": "~10.0.0",
+    "browserify": "^16.2.3",
+    "browserify-header": "^1.0.0",
     "croppie": "~2.6.0",
-    "file-saver": "2.0.0-rc.3",
-    "messageformat": "^2.0.4",
+    "file-saver": "2.0.0",
+    "messageformat": "^2.0.5",
     "msgpack-lite": "~0.1.26",
-    "node-sass": "^4.9.3",
-    "sdp": "~2.7.0",
+    "node-sass": "^4.11.0",
+    "sdp": "~2.9.0",
     "ts-events": "^3.1.5",
-    "tsify": "~4.0.0",
+    "tsify": "^4.0.1",
     "tweetnacl": "^1.0.0",
-    "typescript": "^2.9.2",
-    "webrtc-adapter": "^6.3.2"
+    "typescript": "^3.2.2",
+    "webrtc-adapter": "^7.1.1"
   },
   "devDependencies": {
     "@types/chai": "^4.1.7",
-    "@types/jasmine": "^2.8.8",
-    "@types/selenium-webdriver": "^3.0.13",
-    "angular-mocks": "^1.7.3",
-    "budo": "^11",
+    "@types/jasmine": "^3.3.5",
+    "@types/selenium-webdriver": "^3.0.14",
+    "angular-mocks": "^1.7.5",
+    "budo": "^11.5.0",
     "chai": "^4.2.0",
-    "concurrently": "~3.3.0",
+    "concurrently": "~4.1.0",
     "geckodriver": "^1.14.1",
-    "jasmine": "^3.2.0",
-    "jasmine-core": "^3.2.1",
-    "karma": "^2.0.5",
+    "jasmine": "^3.3.1",
+    "jasmine-core": "^3.3.0",
+    "karma": "^3.1.4",
     "karma-chrome-launcher": "^2.2.0",
     "karma-firefox-launcher": "^1.1.0",
-    "karma-jasmine": "^1.1.2",
+    "karma-jasmine": "^2.0.1",
     "selenium-webdriver": "^4.0.0-alpha.1",
     "term-color": "^1.0.1",
     "ts-node": "^7.0.1",
-    "tslint": "~5.10"
+    "tslint": "~5.12"
   }
 }

+ 2 - 0
src/app.ts

@@ -17,6 +17,8 @@
  * along with Threema Web. If not, see <http://www.gnu.org/licenses/>.
  */
 
+import 'regenerator-runtime/runtime';
+
 import {AsyncEvent} from 'ts-events';
 
 import './components';

+ 6 - 4
src/directives/avatar_editor.ts

@@ -100,14 +100,16 @@ export default [
                 function fetchFileContent(file: File): Promise<ArrayBuffer> {
                     return new Promise((resolve, reject) => {
                         const reader = new FileReader();
-                        reader.onload = function(ev: FileReaderProgressEvent) {
-                            resolve(ev.target.result);
+                        reader.onload = function(ev: ProgressEvent) {
+                            // The result will be an ArrayBuffer because we call
+                            // the `FileReader.readAsArrayBuffer` method.
+                            resolve(this.result as ArrayBuffer);
                         };
-                        reader.onerror = function(ev: FileReaderProgressEvent) {
+                        reader.onerror = function(ev: ProgressEvent) {
                             // set a null object
                             reject(ev);
                         };
-                        reader.onprogress = function(ev: FileReaderProgressEvent) {
+                        reader.onprogress = function(ev: ProgressEvent) {
                             if (ev.lengthComputable) {
                                 // TODO implement progress?
                                 // let progress = ((data.loaded / data.total) * 100);

+ 11 - 8
src/directives/compose_area.ts

@@ -311,14 +311,14 @@ export default [
                         for (let n = 0; n < fileCounter; n++) {
                             const reader = new FileReader();
                             const file = fileList.item(n);
-                            reader.onload = function(ev: FileReaderProgressEvent) {
-                                next(file, ev.target.result, ev);
+                            reader.onload = function(ev: ProgressEvent) {
+                                next(file, this.result as ArrayBuffer, ev);
                             };
-                            reader.onerror = function(ev: FileReaderProgressEvent) {
+                            reader.onerror = function(ev: ProgressEvent) {
                                 // set a null object
                                 next(file, null, ev);
                             };
-                            reader.onprogress = function(ev: FileReaderProgressEvent) {
+                            reader.onprogress = function(ev: ProgressEvent) {
                                 if (ev.lengthComputable) {
                                     const progress = ((ev.loaded / ev.total) * 100);
                                     scope.onUploading(true, progress, 100 / fileCounter * n);
@@ -393,8 +393,8 @@ export default [
 
                         // Convert blob to arraybuffer
                         const reader = new FileReader();
-                        reader.onload = function(progressEvent: FileReaderProgressEvent) {
-                            const buffer: ArrayBuffer = this.result;
+                        reader.onload = function(progressEvent: ProgressEvent) {
+                            const buffer: ArrayBuffer = this.result as ArrayBuffer;
 
                             // Construct file name
                             let fileName: string;
@@ -642,10 +642,13 @@ export default [
                     }
 
                     if (browserService.getBrowser().isFirefox(false)) {
-                        // disable object resizing is the only way to disable resizing of
+                        // Disabling object resizing is the only way to disable resizing of
                         // emoji (contenteditable must be true, otherwise the emoji can not
                         // be removed with backspace (in FF))
-                        document.execCommand('enableObjectResizing', false, false);
+                        //
+                        // Note: This is not required anymore for FF63+ (but
+                        // please test before removing it to make sure).
+                        (document.execCommand as any)('enableObjectResizing', false, false);
                     }
                 }
 

+ 5 - 5
src/directives/drag_file.ts

@@ -43,7 +43,7 @@ export default [
                 function fetchFileListContents(fileList: FileList): Promise<Map<File, ArrayBuffer>> {
                     return new Promise((resolve) => {
                         const buffers = new Map<File, ArrayBuffer>();
-                        const next = (file: File, res: ArrayBuffer | null, error?: FileReaderProgressEvent) => {
+                        const next = (file: File, res: ArrayBuffer | null, error?: ProgressEvent) => {
                             buffers.set(file, res);
                             if (buffers.size >= fileList.length) {
                                 resolve(buffers);
@@ -56,14 +56,14 @@ export default [
                         for (let n = 0; n < fileList.length; n++) {
                             const reader = new FileReader();
                             const file = fileList.item(n);
-                            reader.onload = function(ev: FileReaderProgressEvent) {
-                                next(file, ev.target.result);
+                            reader.onload = function(ev: ProgressEvent) {
+                                next(file, this.result as ArrayBuffer);
                             };
-                            reader.onerror = function(ev: FileReaderProgressEvent) {
+                            reader.onerror = function(ev: ProgressEvent) {
                                 // set a null object
                                 next(file, null, ev);
                             };
-                            reader.onprogress = function(ev: FileReaderProgressEvent) {
+                            reader.onprogress = function(ev: ProgressEvent) {
                                 if (ev.lengthComputable) {
                                     const progress = ((ev.loaded / ev.total) * 100);
                                     scope.onUploading(true, progress, 100 / fileList.length * n);

+ 4 - 0
src/filters.ts

@@ -15,6 +15,8 @@
  * along with Threema Web. If not, see <http://www.gnu.org/licenses/>.
  */
 
+import Autolinker from 'autolinker';
+
 import {bufferToUrl, escapeRegExp, filter, hasValue, logAdapter} from './helpers';
 import {markify} from './markup_parser';
 import {MimeService} from './services/mime';
@@ -76,6 +78,8 @@ angular.module('3ema.filters', [])
         newWindow: true,
         // Don't strip protocol prefix
         stripPrefix: false,
+        // Don't strip trailing slashes
+        stripTrailingSlash: false,
         // Don't truncate links
         truncate: 99999,
         // Add class name to linked links

+ 8 - 3
src/services/webclient.ts

@@ -26,7 +26,10 @@ import {
     arraysAreEqual, copyDeep, hasFeature, hasValue, hexToU8a,
     msgpackVisualizer, randomString, stringToUtf8a, u8aToHex,
 } from '../helpers';
-import {isContactReceiver, isDistributionListReceiver, isGroupReceiver, isValidReceiverType} from '../typeguards';
+import {
+    isContactReceiver, isDistributionListReceiver,
+    isGroupReceiver, isValidReceiverType,
+} from '../typeguards';
 import {BatteryStatusService} from './battery';
 import {BrowserService} from './browser';
 import {TrustedKeyStoreService} from './keystore';
@@ -1210,7 +1213,8 @@ export class WebClientService {
             // There's at least one TURN server with TCP transport in the list
             for (const server of this.config.ICE_SERVERS) {
                 // Remove TLS entries
-                server.urls = server.urls.filter((url) => !url.startsWith('turns:'));
+                const urls = Array.isArray(server.urls) ? server.urls : [server.urls];
+                server.urls = urls.filter((url) => !url.startsWith('turns:'));
             }
         } else {
             this.$log.debug(this.logTag, 'No fallback TURN TCP server present, keeping TURNS server');
@@ -1229,7 +1233,8 @@ export class WebClientService {
         if (allUrls.some((url) => url.includes('ds-turn.threema.ch'))) {
             for (const server of this.config.ICE_SERVERS) {
                 // Replace dual stack entries
-                server.urls = server.urls.map((url) => {
+                const urls = Array.isArray(server.urls) ? server.urls : [server.urls];
+                server.urls = urls.map((url) => {
                     return url.replace('ds-turn.threema.ch', 'turn.threema.ch');
                 });
             }

+ 0 - 47
src/types/autolinker.d.ts

@@ -1,47 +0,0 @@
-// Type definitions for autolinker v0.24.0
-// Project: https://github.com/gregjacobs/Autolinker.js
-// Definitions by: Leon Yu <https://github.com/leonyu>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-declare namespace __Autolinker {
-  interface ConfigOptions {
-    className?: string;
-    email?: boolean;
-    hashtag?: boolean | string;
-    newWindow?: boolean;
-    phone?: boolean;
-    replaceFn?: (match: any) => string;
-    stripPrefix?: boolean;
-    stripTrailingSlash?: boolean;
-    truncate?: number | { length?: number; location?: string; };
-    mention?: 'twitter' | 'instagram' | false;
-    decodePercentEncoding?: boolean;
-    urls?: boolean | { schemeMatches: boolean; wwwMatches: boolean; tldMatches: boolean; };
-  }
-
-  interface Autolinker {
-    getTagBuilder(): any;
-    /**
-     * Automatically links URLs, Email addresses, Phone numbers, Twitter handles, and Hashtags found in the given chunk of HTML. Does not link URLs found within HTML tags.
-     */
-    link(textOrHtml: string): string;
-    /**
-     * Parses the input textOrHtml looking for URLs, email addresses, phone numbers, username handles, and hashtags (depending on the configuration of the Autolinker instance), and returns an array of Autolinker.match.Match objects describing those matches.
-     */
-    parse(textOrHtml: string): any[];
-  }
-
-  interface Static {
-    new(cfg?: ConfigOptions): Autolinker;
-    /**
-     * Automatically links URLs, Email addresses, Phone Numbers, Twitter handles, and Hashtags found in the given chunk of HTML. Does not link URLs found within HTML tags.
-     */
-    link(textOrHtml: string, options?: ConfigOptions): string
-  }
-}
-
-declare var Autolinker: __Autolinker.Static;
-
-declare module "autolinker" {
-  export = Autolinker;
-}

+ 1 - 1
tests/filters.js

@@ -258,7 +258,7 @@ describe('Filters', function() {
 
         it('links http urls', () => {
             expect(process('hello https://threema.ch/!'))
-                .toEqual('hello <a href="https://threema.ch/" class="autolinked autolinked-url" target="_blank" rel="noopener noreferrer">https://threema.ch</a>!');
+                .toEqual('hello <a href="https://threema.ch/" class="autolinked autolinked-url" target="_blank" rel="noopener noreferrer">https://threema.ch/</a>!');
         });
 
         it('links e-mails', () => {

+ 0 - 3
tests/testsuite.html

@@ -7,8 +7,6 @@
 
         <link rel="stylesheet" href="../node_modules/jasmine-core/lib/jasmine-core/jasmine.css">
 
-        <script src="../node_modules/regenerator-runtime/runtime.js"></script>
-
         <script src="../node_modules/jasmine-core/lib/jasmine-core/jasmine.js"></script>
         <script src="../node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js"></script>
         <script src="../node_modules/jasmine-core/lib/jasmine-core/boot.js"></script>
@@ -19,7 +17,6 @@
         <script src="../node_modules/angular-material/angular-material.min.js"></script>
         <script src="../node_modules/angular-animate/angular-animate.min.js"></script>
         <script src="../node_modules/angular-aria/angular-aria.min.js"></script>
-        <script src="../node_modules/autolinker/dist/Autolinker.min.js"></script>
 
         <script src="../node_modules/@saltyrtc/chunked-dc/dist/chunked-dc.es5.js"></script>
 

+ 2 - 0
tests/ts/main.ts

@@ -20,6 +20,8 @@
 // tslint:disable:no-reference
 /// <reference path="../../src/threema.d.ts" />
 
+import '@babel/polyfill';
+
 import './containers';
 import './crypto_helpers';
 import './helpers';

+ 2 - 0
tests/ui/main.ts

@@ -3,6 +3,8 @@
  *
  * This file is part of Threema Web.
  */
+import '@babel/polyfill';
+
 import {init as initComposeArea} from './compose_area';
 
 // Expose global functions

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác