Skip to content

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

exchaning openLinkExternally with IO.openFile

uggrock1f3d52574e2e
diff --git a/data/js/core.api.js b/data/js/core.api.js
index bd0fd772d..5fa59a6fe 100644
--- a/data/js/core.api.js
+++ b/data/js/core.api.js
@@ -506,7 +506,6 @@ define(function(require, exports, module) {
// Proxying functions from tsCoreUI
// TODO use TSCORE.UI instead
exports.clearSearchFilter = tsCoreUI.clearSearchFilter;
- exports.openLinkExternally = tsCoreUI.openLinkExternally;
exports.enableTopToolbar = tsCoreUI.enableTopToolbar;
exports.disableTopToolbar = tsCoreUI.disableTopToolbar;
exports.showAlertDialog = tsCoreUI.showAlertDialog;
diff --git a/data/js/core.ui.js b/data/js/core.ui.js
index bc66de4b9..d9c16b187 100644
--- a/data/js/core.ui.js
+++ b/data/js/core.ui.js
@@ -648,51 +648,51 @@ define(function(require, exports, module) {
$contactUsContent.on('click', '#openHints', showWelcomeDialog);
$contactUsContent.on('click', '#openUservoice', function(e) {
e.preventDefault();
- openLinkExternally($(this).attr('href'));
+ TSCORE.IO.openFile($(this).attr('href'));
});
$contactUsContent.on('click', '#openGooglePlay', function(e) {
e.preventDefault();
- openLinkExternally($(this).attr('href'));
+ TSCORE.IO.openFile($(this).attr('href'));
});
$contactUsContent.on('click', '#openAppleAppStore', function(e) {
e.preventDefault();
- openLinkExternally($(this).attr('href'));
+ TSCORE.IO.openFile($(this).attr('href'));
});
$contactUsContent.on('click', '#openWhatsnew', function(e) {
e.preventDefault();
- openLinkExternally($(this).attr('href'));
+ TSCORE.IO.openFile($(this).attr('href'));
});
$contactUsContent.on('click', '#openGitHubIssues', function(e) {
e.preventDefault();
- openLinkExternally($(this).attr('href'));
+ TSCORE.IO.openFile($(this).attr('href'));
});
$contactUsContent.on('click', '#helpUsTranslate', function(e) {
e.preventDefault();
- openLinkExternally($(this).attr('href'));
+ TSCORE.IO.openFile($(this).attr('href'));
});
$contactUsContent.on('click', '#openTwitter', function(e) {
e.preventDefault();
- openLinkExternally($(this).attr('href'));
+ TSCORE.IO.openFile($(this).attr('href'));
});
$contactUsContent.on('click', '#openTwitter2', function(e) {
e.preventDefault();
- openLinkExternally($(this).attr('href'));
+ TSCORE.IO.openFile($(this).attr('href'));
});
$contactUsContent.on('click', '#openGooglePlus', function(e) {
e.preventDefault();
- openLinkExternally($(this).attr('href'));
+ TSCORE.IO.openFile($(this).attr('href'));
});
$contactUsContent.on('click', '#openFacebook', function(e) {
e.preventDefault();
- openLinkExternally($(this).attr('href'));
+ TSCORE.IO.openFile($(this).attr('href'));
});
$contactUsContent.on('click', '#openSupportUs', function(e) {
e.preventDefault();
- openLinkExternally($(this).attr('href'));
+ TSCORE.IO.openFile($(this).attr('href'));
});
$('#newVersionMenu').on('click', '.whatsNewLink', function(e) {
e.preventDefault();
- openLinkExternally($(this).attr('href'));
+ TSCORE.IO.openFile($(this).attr('href'));
});
// Search UI
@@ -767,82 +767,6 @@ define(function(require, exports, module) {
});
};
- function updateQuery() {
- var query = "";
- if(!$('#searchRecursive').is(':checked')) {
- query = "| "
- }
-
- var searchTerms = $('#searchTerms').val();
- if(searchTerms.length > 0 ) {
- searchTerms = searchTerms.split(" ");
- searchTerms.forEach(function(term) {
- if(term.length > 1) {
- query = query + " " + term;
- }
- })
- }
-
- var tags = $('#searchTags').val();
- if(tags.length > 0 ) {
- tags = tags.split(" ");
- tags.forEach(function(tag) {
- if(tag.length > 1) {
- query = query + " +" + tag;
- }
- })
- }
-
- var fileType = $('#searchFileType').val();
- if(fileType.length > 0) {
- query = query + " " + fileType;
- }
-
- console.log();
- $('#searchBox').val(query);
- }
-
- function showSearchOptions() {
- $('#searchRecursive').prop('checked', true);
- $('#searchTerms').val("");
- $('#searchTags').val("");
- $('#searchFileType').val("");
-
- var leftPosition = $(".col2").position().left + $(".col2").width();
- leftPosition = leftPosition - ($("#searchOptions").width() + 2);
- $("#searchOptions").css({left: leftPosition});
- $("#searchOptions").show();
- }
-
- function startSearch() {
- $('#searchOptions').hide();
- TSCORE.PerspectiveManager.redrawCurrentPerspective();
- }
-
- function cancelSearch() {
- clearSearchFilter();
- // Restoring initial dir listing without subdirectories
- TSCORE.IO.listDirectoryPromise(TSCORE.currentPath).then(
- function(entries) {
- TSPOSTIO.listDirectory(entries);
- }
- ).catch(function(err) {
- TSPOSTIO.errorOpeningPath(TSCORE.currentPath);
- console.warn("Error listing directory" + err);
- });
- }
-
- function showSearchArea() {
- $('#showSearchButton').hide();
- $('#searchToolbar').show();
- $('#searchBox').focus();
- }
-
- // Handle external links
- function openLinkExternally(url) {
- TSCORE.IO.openFile(url);
- }
-
function clearSearchFilter() {
$('#searchToolbar').hide();
$('#showSearchButton').show();
@@ -1006,7 +930,6 @@ define(function(require, exports, module) {
exports.showContextMenu = showContextMenu;
exports.initUI = initUI;
exports.clearSearchFilter = clearSearchFilter;
- exports.openLinkExternally = openLinkExternally;
exports.enableTopToolbar = enableTopToolbar;
exports.disableTopToolbar = disableTopToolbar;
exports.hideWaitingDialog = hideWaitingDialog;
diff --git a/data/js/ext.api.js b/data/js/ext.api.js
index bf9664023..4cf3b2761 100644
--- a/data/js/ext.api.js
+++ b/data/js/ext.api.js
@@ -28,7 +28,7 @@ define(function(require, exports, module) {
uri.indexOf("https://") === 0 ||
uri.indexOf("file://") === 0
) {
- TSCORE.openLinkExternally(uri);
+ TSCORE.IO.openFile(uri);
} else {
console.log("Not supported URL format: " + uri);
}
diff --git a/data/js/search.ui.js b/data/js/search.ui.js
index bf0dc96fe..f7f88fd1b 100644
--- a/data/js/search.ui.js
+++ b/data/js/search.ui.js
@@ -152,11 +152,6 @@ define(function(require, exports, module) {
$('#searchBox').focus();
}
- // Handle external links
- function openLinkExternally(url) {
- TSCORE.IO.openFile(url);
- }
-
function clearSearchFilter() {
$('#searchToolbar').hide();
$('#showSearchButton').show();