From 853f5fd06402b16e271e8f119ef380de485aeff2 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sat, 8 Nov 2014 08:37:08 +0000 Subject: [PATCH] Add some logging for file import/paste --- boot/boot.js | 3 ++- core/modules/wiki.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/boot/boot.js b/boot/boot.js index 81a67f5c2..51f9b32ac 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -1699,7 +1699,8 @@ $tw.boot.startup = function(options) { themesEnvVar: "TIDDLYWIKI_THEME_PATH", languagesEnvVar: "TIDDLYWIKI_LANGUAGE_PATH", editionsEnvVar: "TIDDLYWIKI_EDITION_PATH" - } + }, + log: {} // Log flags }); if(!$tw.boot.tasks.readBrowserTiddlers) { // For writable tiddler files, a hashmap of title to {filepath:,type:,hasMetaFile:} diff --git a/core/modules/wiki.js b/core/modules/wiki.js index bc0d4ee83..80144605b 100755 --- a/core/modules/wiki.js +++ b/core/modules/wiki.js @@ -1101,6 +1101,10 @@ exports.readFile = function(file,callback) { // Figure out if we're reading a binary file var contentTypeInfo = $tw.config.contentTypeInfo[type], isBinary = contentTypeInfo ? contentTypeInfo.encoding === "base64" : false; + // Log some debugging information + if($tw.log.FILES) { + console.log("Importing file '" + file.name + "', type: '" + type + "', isBinary: " + isBinary); + } // Create the FileReader var reader = new FileReader(); // Onload