Selaa lähdekoodia

Upgrade FileSaver.js (#612)

Danilo Bargen 6 vuotta sitten
vanhempi
commit
0a6b47131f

+ 0 - 1
dist/package.sh

@@ -55,7 +55,6 @@ targets=(
     babel-es6-polyfill/browser-polyfill.min.js
     msgpack-lite/dist/msgpack.min.js
     tweetnacl/nacl-fast.min.js
-    file-saver/FileSaver.min.js
     @saltyrtc/chunked-dc/dist/chunked-dc.es5.js
     @saltyrtc/client/dist/saltyrtc-client.es5.js
     @saltyrtc/task-webrtc/dist/saltyrtc-task-webrtc.es5.js

+ 0 - 1
index.html

@@ -123,7 +123,6 @@
     <!-- Other -->
     <script src="node_modules/msgpack-lite/dist/msgpack.min.js?v=[[VERSION]]"></script>
     <script src="node_modules/tweetnacl/nacl-fast.min.js?v=[[VERSION]]"></script>
-    <script src="node_modules/file-saver/FileSaver.min.js?v=[[VERSION]]"></script>
     <script src="node_modules/@saltyrtc/chunked-dc/dist/chunked-dc.es5.js?v=[[VERSION]]"></script>
     <script src="node_modules/@saltyrtc/client/dist/saltyrtc-client.es5.js?v=[[VERSION]]"></script>
     <script src="node_modules/@saltyrtc/task-webrtc/dist/saltyrtc-task-webrtc.es5.js?v=[[VERSION]]"></script>

+ 7 - 7
package-lock.json

@@ -56,10 +56,10 @@
         "@types/angular": "*"
       }
     },
-    "@types/filesaver": {
-      "version": "0.0.30",
-      "resolved": "https://registry.npmjs.org/@types/filesaver/-/filesaver-0.0.30.tgz",
-      "integrity": "sha1-cUiW9WpI9ki/DFAnPHcaNfNYACc="
+    "@types/file-saver": {
+      "version": "1.3.1",
+      "resolved": "https://registry.npmjs.org/@types/file-saver/-/file-saver-1.3.1.tgz",
+      "integrity": "sha512-A+lNc0nnhtX3iTLEYd/DisKTZdNKTf1bN0aSfQD/fG8bQ6SfUe5u8Fm2ab8qQHaMY5GVZumAXLnYptwX+mmQgg=="
     },
     "@types/jasmine": {
       "version": "2.8.8",
@@ -3224,9 +3224,9 @@
       "optional": true
     },
     "file-saver": {
-      "version": "1.3.8",
-      "resolved": "https://registry.npmjs.org/file-saver/-/file-saver-1.3.8.tgz",
-      "integrity": "sha512-spKHSBQIxxS81N/O21WmuXA2F6wppUCsutpzenOeZzOCCJ5gEfcbqJP983IrpLXzYmXnMUa6J03SubcNPdKrlg=="
+      "version": "2.0.0-rc.3",
+      "resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.0-rc.3.tgz",
+      "integrity": "sha512-LZ89x9kYxsAbJFoeLFiD5dRQnGoppXn3NLmPuULYyiKeAcEHQ8TTUwzGAEWT1VjoNGCapP3z+OG2qrwPoas80Q=="
     },
     "file-uri-to-path": {
       "version": "1.0.0",

+ 2 - 2
package.json

@@ -33,7 +33,7 @@
     "@types/angular-material": "^1.1.59",
     "@types/angular-sanitize": "^1.3.7",
     "@types/angular-translate": "^2.16.0",
-    "@types/filesaver": "~0.0.30",
+    "@types/file-saver": "^1.3.0",
     "@types/jquery": "^3.3.6",
     "@types/msgpack-lite": "^0.1.6",
     "@types/webrtc": "0.0.23",
@@ -55,7 +55,7 @@
     "browserify": "~16",
     "browserify-header": "^0.9.4",
     "croppie": "~2.6.0",
-    "file-saver": "^1.3.8",
+    "file-saver": "2.0.0-rc.3",
     "messageformat": "^2.0.4",
     "msgpack-lite": "~0.1.26",
     "node-sass": "^4.9.3",

+ 2 - 0
src/directives/mediabox.ts

@@ -15,6 +15,8 @@
  * along with Threema Web. If not, see <http://www.gnu.org/licenses/>.
  */
 
+import {saveAs} from 'file-saver';
+
 import {MediaboxService} from '../services/mediabox';
 
 export default [

+ 2 - 0
src/directives/message.ts

@@ -17,6 +17,8 @@
 
 // tslint:disable:max-line-length
 
+import {saveAs} from 'file-saver';
+
 import {getSenderIdentity} from '../helpers/messages';
 import {MessageService} from '../services/message';
 import {ReceiverService} from '../services/receiver';

+ 2 - 0
src/directives/message_media.ts

@@ -15,6 +15,8 @@
  * along with Threema Web. If not, see <http://www.gnu.org/licenses/>.
  */
 
+import {saveAs} from 'file-saver';
+
 import {bufferToUrl, hasValue, logAdapter} from '../helpers';
 import {MediaboxService} from '../services/mediabox';
 import {MessageService} from '../services/message';

+ 1 - 1
src/services/message.ts

@@ -46,7 +46,7 @@ export class MessageService {
         this.receiverService = receiverService;
     }
 
-    public getAccess(message: threema.Message, receiver: threema.Receiver): MessageAccess  {
+    public getAccess(message: threema.Message, receiver: threema.Receiver): MessageAccess {
         const access = new MessageAccess();
 
         if (message !== undefined) {