TagSpaces is an offline, open source, document manager with tagging support
utlizig the new notification system adding notification method for successfull operations
uggrock47ccceab36fd
diff --git a/data/js/core.api.js b/data/js/core.api.jsindex c77dee2b3..eeea830ac 100644--- a/data/js/core.api.js+++ b/data/js/core.api.js@@ -460,6 +460,7 @@ define(function(require, exports, module) {exports.enableTopToolbar = tsCoreUI.enableTopToolbar;exports.disableTopToolbar = tsCoreUI.disableTopToolbar;exports.showAlertDialog = tsCoreUI.showAlertDialog;+ exports.showSuccessDialog = tsCoreUI.showSuccessDialog;exports.showConfirmDialog = tsCoreUI.showConfirmDialog;exports.showTagEditDialog = tsCoreUI.showTagEditDialog;exports.hideAllDropDownMenus = tsCoreUI.hideAllDropDownMenus;diff --git a/data/js/core.ui.js b/data/js/core.ui.jsindex 2bd9f6464..2f5146596 100644--- a/data/js/core.ui.js+++ b/data/js/core.ui.js@@ -26,6 +26,28 @@ define(function(require, exports, module) {var hideWaitingDialog = function(message, title) {$('#waitingDialog').modal('hide');};++ var showSuccessDialog = function(message) {+ if (!message) {+ return;+ }+ var n = noty({+ text: message,+ layout: 'bottomCenter',+ theme: 'relax',+ type: 'success',+ animation: {+ open: 'animated pulse',+ close: 'animated flipOutX',+ easing: 'swing',+ speed: 500+ },+ timeout: 4000,+ maxVisible: 5,+ closeWith: ['button', 'click'],+ });+ };+var showAlertDialog = function(message, title) {if (!title) {title = $.i18n.t('ns.dialogs:titleAlert');@@ -34,8 +56,19 @@ define(function(require, exports, module) {message = 'No Message to Display.';}var n = noty({- text: message,+ text: "<strong>" + title + "</strong><br>" + message,layout: 'bottomCenter',+ theme: 'relax',+ type: 'warning',+ animation: {+ open: 'animated pulse',+ close: 'animated flipOutX',+ easing: 'swing',+ speed: 500+ },+ timeout: 10000,+ maxVisible: 5,+ closeWith: ['button', 'click'],});/*var alertModal = $('#alertDialog');alertModal.find('h4').text(title);@@ -163,6 +196,9 @@ define(function(require, exports, module) {$('#formEditTag').validator();$('#formEditTag').submit(function(e) {e.preventDefault();+ if ($('#editTagButton').prop('disabled') === false) {+ $('#editTagButton').click();+ }});$('#formEditTag').on('invalid.bs.validator', function() {$('#editTagButton').prop('disabled', true);@@ -672,6 +708,8 @@ define(function(require, exports, module) {$('#openFileInNewWindow').hide();$('#openGooglePlay').hide();$('.cancelButton').hide();+ } else if (isCordovaiOS) {+ $('#fullscreenFile').parent().hide();} else if (isChrome) {$('#directoryMenuOpenDirectory').parent().hide();$('#fileMenuOpenDirectory').parent().hide();@@ -785,6 +823,7 @@ define(function(require, exports, module) {exports.hideWaitingDialog = hideWaitingDialog;exports.showWaitingDialog = showWaitingDialog;exports.showAlertDialog = showAlertDialog;+ exports.showSuccessDialog = showSuccessDialog;exports.showConfirmDialog = showConfirmDialog;exports.showFileRenameDialog = showFileRenameDialog;exports.showFileCreateDialog = showFileCreateDialog;diff --git a/data/js/postioapi.js b/data/js/postioapi.jsindex 081f23044..5baa74903 100644--- a/data/js/postioapi.js+++ b/data/js/postioapi.js@@ -19,11 +19,13 @@ define(function(require, exports, module) {};exports.createDirectory = function(dirPath) {+ TSCORE.showSuccessDialog("Directory created successfully.");TSCORE.navigateToDirectory(dirPath);TSCORE.hideWaitingDialog();};exports.copyFile = function(sourceFilePath, targetFilePath) {+ TSCORE.showSuccessDialog("Directory copied successfully.");var targetDirectory = TSCORE.TagUtils.extractContainingDirectoryPath(targetFilePath);if (targetDirectory === TSCORE.currentPath) {TSCORE.navigateToDirectory(TSCORE.currentPath);@@ -55,11 +57,11 @@ define(function(require, exports, module) {TSCORE.PerspectiveManager.updateFileUI(oldFilePath, newFilePath);}TSCORE.Meta.updateMetaData(oldFilePath, newFilePath);-- TSCORE.hideWaitingDialog(); //TSCORE.PerspectiveManager.clearSelectedFiles();+ TSCORE.hideWaitingDialog();};exports.renameDirectory = function(dirOldPath, dirNewPath) {+ TSCORE.showSuccessDialog("Directory renamed successfully.");TSCORE.navigateToDirectory(dirNewPath);TSCORE.hideLoadingAnimation();};@@ -70,14 +72,18 @@ define(function(require, exports, module) {};exports.saveBinaryFile = function(filePath) {+ TSCORE.showSuccessDialog("File saved successfully.");TSCORE.PerspectiveManager.refreshFileListContainer();};exports.saveTextFile = function(filePath, isNewFile) {TSCORE.PerspectiveManager.refreshFileListContainer();if (isNewFile) {+ TSCORE.showSuccessDialog("File created successfully.");// If file is new open it in edit modeTSCORE.FileOpener.openFile(filePath, true);+ } else {+ TSCORE.showSuccessDialog("File saved successfully.");}TSCORE.FileOpener.setFileChanged(false);};@@ -109,6 +115,7 @@ define(function(require, exports, module) {};exports.deleteElement = function(filePath) {+ TSCORE.showSuccessDialog("File deleted successfully.");TSCORE.removeFileModel(TSCORE.fileList, filePath);TSCORE.Meta.updateMetaData(filePath);TSCORE.PerspectiveManager.removeFileUI(filePath);@@ -119,12 +126,12 @@ define(function(require, exports, module) {};exports.deleteDirectory = function(dirPath) {+ TSCORE.showSuccessDialog("Directory deleted successfully.");TSCORE.navigateToDirectory(TSCORE.TagUtils.extractParentDirectoryPath(dirPath));TSCORE.hideLoadingAnimation();};exports.deleteDirectoryFailed = function(dirPath) {- console.log('Deleting of \'' + dirPath + '\' failed');TSCORE.showAlertDialog($.i18n.t('ns.dialogs:errorDeletingDirectoryAlert'));TSCORE.hideLoadingAnimation();};