Add some logging for file import/paste

print-window-tiddler
Jermolene 2014-11-08 08:37:08 +00:00
rodzic ae756ddff0
commit 853f5fd064
2 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -1699,7 +1699,8 @@ $tw.boot.startup = function(options) {
themesEnvVar: "TIDDLYWIKI_THEME_PATH", themesEnvVar: "TIDDLYWIKI_THEME_PATH",
languagesEnvVar: "TIDDLYWIKI_LANGUAGE_PATH", languagesEnvVar: "TIDDLYWIKI_LANGUAGE_PATH",
editionsEnvVar: "TIDDLYWIKI_EDITION_PATH" editionsEnvVar: "TIDDLYWIKI_EDITION_PATH"
} },
log: {} // Log flags
}); });
if(!$tw.boot.tasks.readBrowserTiddlers) { if(!$tw.boot.tasks.readBrowserTiddlers) {
// For writable tiddler files, a hashmap of title to {filepath:,type:,hasMetaFile:} // For writable tiddler files, a hashmap of title to {filepath:,type:,hasMetaFile:}

Wyświetl plik

@ -1101,6 +1101,10 @@ exports.readFile = function(file,callback) {
// Figure out if we're reading a binary file // Figure out if we're reading a binary file
var contentTypeInfo = $tw.config.contentTypeInfo[type], var contentTypeInfo = $tw.config.contentTypeInfo[type],
isBinary = contentTypeInfo ? contentTypeInfo.encoding === "base64" : false; 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 // Create the FileReader
var reader = new FileReader(); var reader = new FileReader();
// Onload // Onload