Skip to content

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

implementing openFile functionality

uggrock31e462234d03
diff --git a/data/chromium/chrome.api.js b/data/chromium/chrome.api.js
index b50f9b20e..186751d5c 100644
--- a/data/chromium/chrome.api.js
+++ b/data/chromium/chrome.api.js
@@ -346,7 +346,7 @@ define(function(require, exports, module) {
* @memberof IOAPI.ChromeExtension
*/
function selectFile() {
- // TODO
+
TSCORE.showAlertDialog("Select file not implemented!");
}
@@ -358,20 +358,19 @@ define(function(require, exports, module) {
* @param {string} dirPath - the full path of the directory which will be opened
*/
function openDirectory(dirPath) {
- // TODO
+
TSCORE.showAlertDialog($.i18n.t("ns.dialogs:openContainingDirectoryAlert"));
}
/**
- * Not supported on this platform
+ * Opens a given file url in a new tab or window
* @name openFile
* @method
* @memberof IOAPI.ChromeExtension
- * @param {string} filePath - the full path of the file which will be opened
+ * @param {string} url - the url of file which will be opened in new window or tab
*/
- function openFile(filePath) {
- // TODO
- TSCORE.showAlertDialog($.i18n.t("ns.dialogs:openFileNativelyAlert"));
+ function openFile(url) {
+ window.open(url, '_blank');
}
// Platform specific calls