From 51a3fd69845795b99aa7e74e9fbcf4412341d428 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Thu, 12 Feb 2015 00:39:23 +0300 Subject: [PATCH] Improved doc download --- app/js/app.js | 22 +--------------------- app/js/lib/ng_utils.js | 1 - app/js/services.js | 2 +- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/app/js/app.js b/app/js/app.js index 78414b97..ecd81694 100644 --- a/app/js/app.js +++ b/app/js/app.js @@ -27,28 +27,8 @@ angular.module('myApp', [ ]). config(['$locationProvider', '$routeProvider', '$compileProvider', 'StorageProvider', function($locationProvider, $routeProvider, $compileProvider, StorageProvider) { - // var icons = {}, reverseIcons = {}, i, j, hex, name, dataItem, row, column, totalColumns; - - // for (j = 0; j < Config.EmojiCategories.length; j++) { - // totalColumns = Config.EmojiCategorySpritesheetDimens[j][1]; - // for (i = 0; i < Config.EmojiCategories[j].length; i++) { - // dataItem = Config.Emoji[Config.EmojiCategories[j][i]]; - // name = dataItem[1][0]; - // row = Math.floor(i / totalColumns); - // column = (i % totalColumns); - // icons[':' + name + ':'] = [j, row, column, ':'+name+':']; - // reverseIcons[name] = dataItem[0]; - // } - // } - - // $.emojiarea.spritesheetPath = 'img/emojisprite_!.png'; - // $.emojiarea.spritesheetDimens = Config.EmojiCategorySpritesheetDimens; - // $.emojiarea.iconSize = 20; - // $.emojiarea.icons = icons; - // $.emojiarea.reverseIcons = reverseIcons; - $compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|file|blob|filesystem|chrome-extension|app):|data:image\//); - $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|file|mailto|blob|filesystem|chrome-extension|app):|data:image\//); + $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|file|mailto|blob|filesystem|chrome-extension|app):|data:/); if (Config.Modes.test) { StorageProvider.setPrefix('t_'); diff --git a/app/js/lib/ng_utils.js b/app/js/lib/ng_utils.js index fb54d8e0..34e72745 100644 --- a/app/js/lib/ng_utils.js +++ b/app/js/lib/ng_utils.js @@ -275,7 +275,6 @@ angular.module('izhukov.utils', []) } catch (e) { console.error('Download click error', e); try { - console.error('Download click error', e); anchor[0].click(); } catch (e) { window.open(url, '_blank'); diff --git a/app/js/services.js b/app/js/services.js index c3d66bbb..062e0f80 100644 --- a/app/js/services.js +++ b/app/js/services.js @@ -2911,7 +2911,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) historyDoc.progress = {enabled: !historyDoc.downloaded, percent: 1, total: doc.size}; var downloadPromise = MtpApiFileManager.downloadFile(doc.dc_id, inputFileLocation, doc.size, { - mime: doc.mime_type, + mime: doc.mime_type || 'application/octet-stream', toFileEntry: toFileEntry });