From 96312c9654f5071b681dcac664c7550953369b9a Mon Sep 17 00:00:00 2001 From: benweet Date: Wed, 17 Jul 2013 01:13:00 +0100 Subject: [PATCH] Prepare deployment --- cache.manifest | 2 +- js/main-min.js | 36 +++++++++++++++++++----------------- js/mediaImporter.js | 4 ++-- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/cache.manifest b/cache.manifest index 07d25a01..7031550b 100644 --- a/cache.manifest +++ b/cache.manifest @@ -1,5 +1,5 @@ CACHE MANIFEST -# Wed 10 Jul 2013 23:44:48 IST +# Wed 17 Jul 2013 01:13:00 IST CACHE: index.html diff --git a/js/main-min.js b/js/main-min.js index a94aa90a..51cbcc21 100644 --- a/js/main-min.js +++ b/js/main-min.js @@ -5052,22 +5052,24 @@ define("config", function() {}), define("settings", [ "underscore", "config" ], n.stopPropagation(), n.preventDefault(); var i = (n.dataTransfer || n.target).files; e("#modal-import-harddrive-markdown, #modal-import-harddrive-html").modal("hide"), - t.each(i, function(e) { - var t = new FileReader(); - t.onload = function(e) { - return function(t) { - var n = t.target.result; - if (n.match(/\uFFFD/)) return d.onError(e.name + " is a binary file."), void 0; - if (n = p ? p(n) : n, void 0 === n) return d.onError(e.name + " is not a valid HTML file."), - void 0; - var i = e.name, o = i.lastIndexOf("."); - i = -1 !== o ? i.substring(0, o) : i; - var r = u.createFile(i, n); - u.selectFile(r); - }; - }(e); - var n = e.slice(0, IMPORT_FILE_MAX_CONTENT_SIZE); - t.readAsText(n); + t.each(i, function(t) { + if (!e(n.target).is("#wmd-input") || !t.name.match(/.(jpe?g|png|gif)$/)) { + var i = new FileReader(); + i.onload = function(e) { + return function(t) { + var n = t.target.result; + if (n.match(/\uFFFD/)) return d.onError(e.name + " is a binary file."), void 0; + if (n = p ? p(n) : n, void 0 === n) return d.onError(e.name + " is not a valid HTML file."), + void 0; + var i = e.name, o = i.lastIndexOf("."); + i = -1 !== o ? i.substring(0, o) : i; + var r = u.createFile(i, n); + u.selectFile(r); + }; + }(t); + var o = t.slice(0, IMPORT_FILE_MAX_CONTENT_SIZE); + i.readAsText(o); + } }); } function s(e) { @@ -15294,9 +15296,9 @@ function(e) { }).compact().object().value(); return i.onReady(function() { function n(n) { - n.stopPropagation(), n.preventDefault(); var o = (n.dataTransfer || n.target).files, s = t.first(o); if (s.name.match(/.(jpe?g|png|gif)$/)) { + n.stopPropagation(), n.preventDefault(); var a = new FileReader(); a.onload = function() { return function(t) { diff --git a/js/mediaImporter.js b/js/mediaImporter.js index 03b718bb..365852fb 100644 --- a/js/mediaImporter.js +++ b/js/mediaImporter.js @@ -36,11 +36,11 @@ define([ }); function handleImgImport(evt) { - evt.stopPropagation(); - evt.preventDefault(); var files = (evt.dataTransfer || evt.target).files; var file = _.first(files); if(file.name.match(/.(jpe?g|png|gif)$/)) { + evt.stopPropagation(); + evt.preventDefault(); var reader = new FileReader(); reader.onload = (function(importedFile) { return function(e) {