Skip to content

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

native trash functionality

Borislav Sapundzhiev97a9356cb61c
diff --git a/data/electron/electron.api.js b/data/electron/electron.api.js
index 69c32f58d..475c8db99 100644
--- a/data/electron/electron.api.js
+++ b/data/electron/electron.api.js
@@ -4,9 +4,8 @@
const fs = require('fs-extra'); // jshint ignore:line
const pathUtils = require('path'); // jshint ignore:line
-const trash = require('trash'); // jshint ignore:line
-
const electron = require('electron');
+
/**
* A implementation of the IOAPI for the nw.js platform
* @class NWJS
@@ -183,6 +182,14 @@ define(function(require, exports, module) {
//gui.Window.get().focus();
}
+ function trash(files) {
+ return new Promise(function(resolve, reject){
+ files.forEach(function(fullPath) {
+ electron.shell.moveItemToTrash(fullPath);
+ });
+ resolve(true);
+ });
+ }
// IOAPI
/**
* Checks if new version is available
diff --git a/data/electron/package.json b/data/electron/package.json
index 9905fc4ff..378842d4a 100644
--- a/data/electron/package.json
+++ b/data/electron/package.json
@@ -1,13 +1,12 @@
{
- "name": "tagspaces",
- "version": "0.1.1",
- "main": "main.js",
- "description" : "tagspaces electron",
- "scripts" : {
- "start": "electron ."
- },
- "dependencies": {
- "fs-extra": "~0.24.0",
- "trash": "~3.4.1"
- }
+ "name": "tagspaces",
+ "version": "0.1.1",
+ "main": "main.js",
+ "description" : "tagspaces electron",
+ "scripts" : {
+ "start": "electron ."
+ },
+ "dependencies": {
+ "fs-extra": "~0.24.0"
+ }
}
diff --git a/data/loader.js b/data/loader.js
index 000304307..127f38d63 100644
--- a/data/loader.js
+++ b/data/loader.js
@@ -72,7 +72,6 @@ var isWin = navigator.appVersion.indexOf("Win")!==-1;
} else if (isWeb){
IO_JS = "web/web.api";
} else if (isElectron) {
- isChrome = false;
IO_JS = "electron/electron.api"
}