Skip to content

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

added send to functionality for all file types in android

Ilian9beaa3d64585
diff --git a/data/cordova/cordova.api.js b/data/cordova/cordova.api.js
index 2e52eff73..602a4847b 100644
--- a/data/cordova/cordova.api.js
+++ b/data/cordova/cordova.api.js
@@ -421,6 +421,11 @@ define(function (require, exports, module) {
window.plugins.fileOpener.open(filePath);
//window.open(filePath,"_blank", "location=no");
};
+
+ var sendFile = function(filePath) {
+ console.log("Sending file: "+filePath);
+ window.plugins.fileOpener.send(filePath);
+ };
var openExtensionsDirectory = function() {
TSCORE.showAlertDialog("Open extensions directory functionality not supported on Android!");
@@ -466,6 +471,7 @@ define(function (require, exports, module) {
exports.selectDirectory = selectDirectory;
exports.openDirectory = openDirectory;
exports.openFile = openFile;
+ exports.sendFile = sendFile;
exports.selectFile = selectFile;
exports.openExtensionsDirectory = openExtensionsDirectory;
exports.checkAccessFileURLAllowed = checkAccessFileURLAllowed;
diff --git a/data/index.html b/data/index.html
index c637cfe46..47661b2f9 100644
--- a/data/index.html
+++ b/data/index.html
@@ -228,6 +228,7 @@ can be found in the LICENSE file.
<li><a id="deleteFile"><i class="fa fa-trash-o"></i>&nbsp;<span data-i18n="app.?;">Delete</span></a></li>
<li class="divider"></li>
<li><a id="openNatively"><i class="fa fa-external-link-square"></i>&nbsp;<span data-i18n="app.?;">Open Natively</span></a></li>
+ <!--li><a id="sendTo"><i class="fa fa-external-link-square"></i>&nbsp;<span data-i18n="app.?;">Send to</span></a></li-->
<li><a id="openDirectory"><i class="fa fa-folder-open"></i>&nbsp;<span data-i18n="app.?;">Open Containing Folder</span></a></li>
<li class="divider"></li>
<li><a id="openProperties"><i class="fa fa-briefcase"></i>&nbsp;<span data-i18n="app.?;">Properties</span></a></li>
@@ -569,6 +570,7 @@ can be found in the LICENSE file.
<li class="divider"></li>
<li><a id="fileMenuOpenFile" title=""><i class="fa fa-share"></i> Open File</a></li>
<li><a id="fileMenuOpenNatively" title=""><i class="fa fa-share"></i> Open File Natively</a></li>
+ <li><a id="fileMenuSendTo" title=""><i class="fa fa-fighter-jet"></i> Send To</a></li>
<li><a id="fileMenuAddTag" title="Tag current file"><i class="fa fa-tag"></i> Add Tags</a></li>
<li><a id="fileMenuRenameFile" title=""><i class="fa fa-pencil"></i> Rename File</a></li>
<li><a id="fileMenuDeleteFile" title=""><i class="fa fa-trash-o"></i> Delete File</a></li>
diff --git a/data/js/core.ui.js b/data/js/core.ui.js
index edfe584f7..a3c502a0f 100644
--- a/data/js/core.ui.js
+++ b/data/js/core.ui.js
@@ -302,6 +302,11 @@ define(function(require, exports, module) {
.click( function() {
TSCORE.IO.openFile(TSCORE.selectedFiles[0]);
});
+
+ $( "#fileMenuSendTo" )
+ .click( function() {
+ TSCORE.IO.sendFile(TSCORE.selectedFiles[0]);
+ });
$( "#fileMenuOpenDirectory" ).click( function() {
TSCORE.IO.openDirectory(TSCORE.currentPath);
@@ -488,7 +493,7 @@ define(function(require, exports, module) {
.prop('disabled', false);
}
- function platformTuning() {
+ function platformTuning() {
if(isCordova) {
$("#startNewInstanceBack").hide();
$("#directoryMenuOpenDirectory").parent().hide();
@@ -497,18 +502,15 @@ define(function(require, exports, module) {
$("#openDirectory").parent().hide();
$("#advancedSettings").hide();
$("#openFileInNewWindow").hide();
- }
- if(isChrome) {
+ } else if(isChrome) {
$("#directoryMenuOpenDirectory").parent().hide();
$("#fileMenuOpenDirectory").parent().hide();
$("#openDirectory").parent().hide();
//$("#openFileInNewWindow").hide();
$("#openNatively").hide();
- }
- if(isFirefox) {
+ } else if(isFirefox) {
$("#openNatively").hide();
- }
- if(isNode) {
+ } else if(isNode) {
$("#fullscreenFile").hide();
$("#openFileInNewWindow").hide();
@@ -529,6 +531,11 @@ define(function(require, exports, module) {
nwwin.maximize();
}
}
+
+ // Disable send to feature on all platforms except android cordova
+ if(!isCordova) {
+ $("#fileMenuSendTo").hide();
+ }
if(isOSX) {
$("body").addClass("osx");
}