Skip to content

TagSpaces is an offline, open source, document manager with tagging support

cleaning up

uggrockb5df095518ac
diff --git a/data/js/directories.ui.js b/data/js/directories.ui.js
index 55d775725..5ad3abeed 100644
--- a/data/js/directories.ui.js
+++ b/data/js/directories.ui.js
@@ -526,12 +526,15 @@ define(function(require, exports, module) {
dirPath: dir4ContextMenu
}), function() {
TSCORE.IO.deleteDirectoryPromise(dir4ContextMenu).then(function() {
- TSPOSTIO.deleteDirectory(dir4ContextMenu);
+ TSCORE.showSuccessDialog("Directory deleted successfully.");
+ TSCORE.navigateToDirectory(TSCORE.TagUtils.extractParentDirectoryPath(dir4ContextMenu));
+ TSCORE.hideLoadingAnimation();
},
function(error) {
TSCORE.hideLoadingAnimation();
console.error("Deleting directory " + dir4ContextMenu + " failed " + error);
- TSPOSTIO.deleteDirectoryFailed(dir4ContextMenu);
+ TSCORE.showAlertDialog($.i18n.t('ns.dialogs:errorDeletingDirectoryAlert'));
+ TSCORE.hideLoadingAnimation();
}
);
});
@@ -729,7 +732,9 @@ define(function(require, exports, module) {
// TODO validate folder name
var dirPath = $('#createNewDirectoryButton').attr('path') + TSCORE.dirSeparator + $('#newDirectoryName').val();
TSCORE.IO.createDirectoryPromise(dirPath).then(function() {
- TSPOSTIO.createDirectory(dirPath);
+ TSCORE.showSuccessDialog("Directory created successfully.");
+ TSCORE.navigateToDirectory(dirPath);
+ TSCORE.hideWaitingDialog();
}, function(error) {
TSCORE.hideLoadingAnimation();
console.error("Creating directory " + dirPath + " failed" + error);
@@ -780,8 +785,9 @@ define(function(require, exports, module) {
var newDirPath = $('#directoryNewName').val();
TSCORE.IO.renameDirectoryPromise(dirPath, newDirPath)
.then(function(newDirName) {
- TSCORE.hideWaitingDialog();
- TSPOSTIO.renameDirectory(dirPath, newDirName);
+ TSCORE.showSuccessDialog("Directory renamed successfully.");
+ TSCORE.navigateToDirectory(newDirName);
+ TSCORE.hideLoadingAnimation();
}, function(err) {
TSCORE.hideWaitingDialog();
TSCORE.showAlertDialog(err);
diff --git a/data/js/postioapi.js b/data/js/postioapi.js
index 2a8c5a8fc..9e55792e3 100644
--- a/data/js/postioapi.js
+++ b/data/js/postioapi.js
@@ -1,10 +1,10 @@
-/* Copyright (c) 2012-2015 The TagSpaces Authors. All rights reserved.
+/* Copyright (c) 2012-2016 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. */
+
define(function(require, exports, module) {
'use strict';
- // Activating browser specific exports modul
console.log('Loading postioapi.js ...');
var TSCORE = require('tscore');
@@ -13,12 +13,6 @@ define(function(require, exports, module) {
TSCORE.hideWaitingDialog();
};
- exports.createDirectory = function(dirPath) {
- TSCORE.showSuccessDialog("Directory created successfully.");
- TSCORE.navigateToDirectory(dirPath);
- TSCORE.hideWaitingDialog();
- };
-
exports.copyFile = function(sourceFilePath, targetFilePath) {
TSCORE.showSuccessDialog("File copied successfully.");
var targetDirectory = TSCORE.TagUtils.extractContainingDirectoryPath(targetFilePath);
@@ -58,12 +52,6 @@ define(function(require, exports, module) {
TSCORE.hideWaitingDialog();
};
- exports.renameDirectory = function(dirOldPath, dirNewPath) {
- TSCORE.showSuccessDialog("Directory renamed successfully.");
- TSCORE.navigateToDirectory(dirNewPath);
- TSCORE.hideLoadingAnimation();
- };
-
exports.loadTextFile = function(content) {
TSCORE.FileOpener.updateEditorContent(content);
TSCORE.hideLoadingAnimation();
@@ -117,17 +105,6 @@ define(function(require, exports, module) {
TSCORE.hideLoadingAnimation();
};
- exports.deleteDirectory = function(dirPath) {
- TSCORE.showSuccessDialog("Directory deleted successfully.");
- TSCORE.navigateToDirectory(TSCORE.TagUtils.extractParentDirectoryPath(dirPath));
- TSCORE.hideLoadingAnimation();
- };
-
- exports.deleteDirectoryFailed = function(dirPath) {
- TSCORE.showAlertDialog($.i18n.t('ns.dialogs:errorDeletingDirectoryAlert'));
- TSCORE.hideLoadingAnimation();
- };
-
exports.checkNewVersion = function(data) {
TSCORE.updateNewVersionData(data);
};
@@ -144,14 +121,4 @@ define(function(require, exports, module) {
$('#moveCopyDirectoryPath').val(dirPath);
};
- exports.openDirectory = function(dirPath) {};
-
- exports.selectFile = function() {
- console.log('File selected: ' + $(this).val());
- };
-
- exports.getFileProperties = function(fileProperties) {
- console.log('File properties: ' + JSON.stringify(fileProperties));
- TSCORE.FileOpener.setFileProperties(fileProperties);
- };
});