TagSpaces is an offline, open source, document manager with tagging support
fixing issue with loading files on startup
Ilian Sapundshiev77d21d903539
diff --git a/data/js/core.api.js b/data/js/core.api.jsindex ab616e48f..b4968f3e4 100644--- a/data/js/core.api.js+++ b/data/js/core.api.js@@ -159,10 +159,6 @@ define(function(require, exports, module) {initKeyBindings();tsIOApi.checkAccessFileURLAllowed ? tsIOApi.checkAccessFileURLAllowed() : true;- if (isNode || isChrome || isElectron || isWeb) {- // Handle command line argument in node-webkit- tsIOApi.handleStartParameters(); // Handle minimizing to the tray in node-webkit- }console.log('Document ready finished. Layout initialized');checkForNewVersion();});diff --git a/data/js/fileopener.js b/data/js/fileopener.jsindex d74cb71c8..a0cf892ff 100644--- a/data/js/fileopener.js+++ b/data/js/fileopener.js@@ -1,4 +1,4 @@-/* Copyright (c) 2012-2016 The TagSpaces Authors. All rights reserved.+/* Copyright (c) 2012-2017 The TagSpaces Authors. All rights reserved.* Use of this source code is governed by a AGPL3 license that* can be found in the LICENSE file. */@@ -336,19 +336,11 @@ define(function(require, exports, module) {}function openFileOnStartup(filePath) {- //TSCORE.Config.setLastOpenedLocation(undefined);+ console.log("Opening file from command line: " + filePath);// quick and dirty solution, should use flag laterTSCORE.toggleFullWidth();TSCORE.FileOpener.openFile(filePath);-- /*var parentFolderPath = TSCORE.TagUtils.extractContainingDirectoryPath(filePath);- TSCORE.IO.listDirectoryPromise(parentFolderPath).then(function(entries) {- TSPOSTIO.listDirectory(entries);- }).catch(function(err) {- TSPOSTIO.errorOpeningPath();- });*/-}function openFile(filePath, editMode) {diff --git a/data/js/perspective.manager.js b/data/js/perspective.manager.jsindex b76bfa8ab..0d4ad9cc0 100644--- a/data/js/perspective.manager.js+++ b/data/js/perspective.manager.js@@ -51,19 +51,30 @@ define(function(require, exports, module) {}return Promise.all(promises).then(function() {+ TSCORE.IO.checkAccessFileURLAllowed ? TSCORE.IO.checkAccessFileURLAllowed() : true;+initPerspectiveSwitcher();// Opening last saved location by the start of the applicationvar lastLocation = TSCORE.Config.getLastOpenedLocation();if (TSCORE.Config.getUseDefaultLocation()) {lastLocation = TSCORE.Config.getDefaultLocation();}- if (lastLocation && lastLocation.length >= 1) {++ var startupFilePath = TSCORE.Utils.getURLParameter("open");+ if (startupFilePath && startupFilePath.length) {+ startupFilePath = decodeURIComponent(startupFilePath);++ /*var parentFolderPath = TSCORE.TagUtils.extractContainingDirectoryPath(startupFilePath);+ TSCORE.IO.listDirectoryPromise(parentFolderPath).then(function(entries) {+ TSPOSTIO.listDirectory(entries);+ })*/+ TSCORE.FileOpener.openFileOnStartup(startupFilePath);+ } else if (lastLocation && lastLocation.length >= 1) {TSCORE.openLocation(lastLocation);- TSCORE.IO.checkAccessFileURLAllowed ? TSCORE.IO.checkAccessFileURLAllowed() : true;- var evt = TSCORE.createDocumentEvent("initApp");- TSCORE.fireDocumentEvent(evt);- $("#viewContainers").removeClass("appBackgroundTile");}++ TSCORE.fireDocumentEvent(TSCORE.createDocumentEvent("initApp"));+ $("#viewContainers").removeClass("appBackgroundTile");$('#loading').hide();if (isNode || isElectron) {TSCORE.IO.showMainWindow();