Skip to content

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

redesigning search, statusbar and noty messages

uggrockb557e2e2c802
diff --git a/data/assets/general.css b/data/assets/general.css
index 9b04a5803..09d12a5f8 100644
--- a/data/assets/general.css
+++ b/data/assets/general.css
@@ -96,7 +96,7 @@ html, body {
margin-top: 12px;
font-size: 14px;
font-size: 12px;
- text-align: right;
+ text-align: center;
}
#iframeViewer {
@@ -184,17 +184,33 @@ li hr {
min-height: 50px;
}
+#clearFilterButton {
+ padding-left: 8px;
+ padding-right: 10px;
+}
+
+#searchButton {
+ padding-left: 10px;
+ padding-right: 10px;
+}
+
#searchToolbar {
+ border-radius: 4px;
width: 250px;
- background-color: #f2f2f2;
+ background-color: #DBDBDB;
display: none;
+ margin-left: 4px;
+ margin-right: 4px;
+ margin-bottom: 4px;
+ z-index: 1;
+ box-shadow: -20px 0px 28px -7px rgba(244, 244, 244, 1);
}
#searchBox {
- margin-top: 8px;
+ margin-top: 4px;
border: 0;
background-color: transparent;
- border-bottom: 2px solid gray;
+ border-bottom: 0;
font-size: 14px;
min-width: 30px;
width: 100%;
diff --git a/data/index.html b/data/index.html
index 1cc33eef6..cb21f021e 100644
--- a/data/index.html
+++ b/data/index.html
@@ -204,6 +204,7 @@
<div class="bounce3"></div>
</div>
</div>
+ <div id="statusBar" class="noWrap"></div>
</div>
<div id="mainTopMenu" class="input-group">
<button type="button" id="perspectiveSwitcherButton" class="btn btn-link dropdown-toggle"
@@ -216,13 +217,13 @@
<div class="flexLayout">
<div class="flexMaxWidth flexLayout" style="min-width: 100px;">
<div class="flexLayout" id="alternativeNavigator" style="min-width: 100px;"></div>
- <div id="statusBar" class="noWrap flexMaxWidth"></div>
+ <div class="flexMaxWidth"></div>
<div id="searchToolbar">
<div class="flexLayout">
<button class="btn btn-link" data-i18n="[title]ns.common:clearFilterTooltip" id="clearFilterButton">
<i class="fa fa-lg fa-eraser"></i>
</button>
- <input class="flexMaxWidth" id="searchBox" data-i18n="[placeholder]ns.common:searchPlaceholder" type="text" rel="popover">
+ <input class="flexMaxWidth" id="searchBox" data-i18n="[placeholder]ns.common:searchPlaceholder" type="text">
<button class="btn btn-link" data-i18n="[title]ns.common:searchPlaceholder" id="searchButton">
<i class="fa fa-lg fa-search"></i>
</button>
@@ -850,15 +851,21 @@
</ul>
</div>
-<div id="searchOptions">
- <div>
- <span class="dropdown-header" data-i18n="ns.common:searchOptions" style="text-align: left;">Search Options</span>
- <i class="fa fa-exclamation-circle"></i>&nbsp;<span data-i18n="ns.common:includeSubfoldersInSearch"></span><br>
- <i class="fa fa-exclamation-circle"></i>&nbsp;<span data-i18n="ns.common:excludeTermFromSearch"></span><br>
- <i class="fa fa-exclamation-circle"></i>&nbsp;<span data-i18n="ns.common:includeTagInSearch"></span><br>
- <i class="fa fa-exclamation-circle"></i>&nbsp;<span data-i18n="ns.common:excludeTagInSearch"></span><br>
- <i class="fa fa-exclamation-circle"></i>&nbsp;<span data-i18n="ns.common:andedSearch"></span><br>
- <i class="fa fa-exclamation-circle"></i>&nbsp;<span data-i18n="ns.common:searchInFilenameOnly"></span><br>
+<div id="searchOptions" class="dropdown clearfix" style="position: absolute; top: 80px; right: 5px; width: 400px;">
+ <div class="dropdown-menu" style="display:block;position:static;">
+ <li class="dropdown-header">
+ <button class="close">&times;</button>
+ <span data-i18n="ns.common:searchOptions">Search Options</span>
+ </li>
+ <div style="padding: 10px;">
+ <i class="fa fa-exclamation-circle"></i>&nbsp;<span data-i18n="ns.common:includeSubfoldersInSearch"></span><br>
+ <i class="fa fa-exclamation-circle"></i>&nbsp;<span data-i18n="ns.common:excludeTermFromSearch"></span><br>
+ <i class="fa fa-exclamation-circle"></i>&nbsp;<span data-i18n="ns.common:includeTagInSearch"></span><br>
+ <i class="fa fa-exclamation-circle"></i>&nbsp;<span data-i18n="ns.common:excludeTagInSearch"></span><br>
+ <i class="fa fa-exclamation-circle"></i>&nbsp;<span data-i18n="ns.common:andedSearch"></span><br>
+ <i class="fa fa-exclamation-circle"></i>&nbsp;<span data-i18n="ns.common:searchInFilenameOnly"></span><br>
+ <!--button class="btn btn-primary" data-dismiss="modal" aria-hidden="true"><i class="fa fa-check fa-lg"></i></button-->
+ </div>
</div>
</div>
diff --git a/data/js/core.api.js b/data/js/core.api.js
index 844a3a0e3..331146047 100644
--- a/data/js/core.api.js
+++ b/data/js/core.api.js
@@ -218,14 +218,17 @@ define(function(require, exports, module) {
}
var $loadingAnimation = $('#loadingAnimation');
+ var $statusBar = $('#statusBar');
function showLoadingAnimation() {
+ $statusBar.hide();
$loadingAnimation.show();
}
function hideLoadingAnimation() {
setTimeout(function() {
$loadingAnimation.hide();
+ $statusBar.show();
}, 500);
}
@@ -307,6 +310,8 @@ define(function(require, exports, module) {
var oneColumn = fullWidth < 660;
var twoColumn = fullWidth >= 660 && fullWidth < 1024;
+ $("#searchOptions").hide();
+
showPerspectiveMenu();
tsCoreUI.hideAllDropDownMenus();
diff --git a/data/js/core.ui.js b/data/js/core.ui.js
index 470abed7f..4e63690cb 100644
--- a/data/js/core.ui.js
+++ b/data/js/core.ui.js
@@ -36,12 +36,13 @@ define(function(require, exports, module) {
}
var n = noty({
text: message,
+ //dismissQueue: false,
layout: 'bottomCenter',
theme: 'relax',
type: 'success',
animation: {
- open: 'animated pulse',
- close: 'animated flipOutX',
+ open: 'animated fadeIn',
+ close: 'animated fadeOut',
easing: 'swing',
speed: 500
},
@@ -64,8 +65,8 @@ define(function(require, exports, module) {
theme: 'relax',
type: 'warning',
animation: {
- open: 'animated pulse',
- close: 'animated flipOutX',
+ open: 'animated fadeIn',
+ close: 'animated fadeOut',
easing: 'swing',
speed: 500
},
@@ -599,8 +600,13 @@ define(function(require, exports, module) {
// Search UI
$('#searchToolbar').on('click', '#closeSearchOptionButton', function() {
- $('#searchBox').popover('hide');
+ $('#searchOptions').hide();
});
+
+ $('#searchOptions').on('click', '.close', function() {
+ $('#searchOptions').hide();
+ });
+
$('#searchToolbar').on('click', '#includeSubfoldersOption', function() {
var searchQuery = $('#searchBox').val();
if (searchQuery.indexOf('?') === 0) {
@@ -611,27 +617,23 @@ define(function(require, exports, module) {
$('#searchBox').val('?' + searchQuery);
}
});
- $('#searchBox').on('show.bs.popover', function() {
+
+ /*$('#searchBox').on('show.bs.popover', function() {
var searchQuery = $('#searchBox').val();
if (searchQuery.indexOf('?') === 0) {
$('#includeSubfoldersOption i').removeClass('fa-toggle-off').addClass('fa-toggle-on');
} else {
$('#includeSubfoldersOption i').removeClass('fa-toggle-on').addClass('fa-toggle-off');
}
- });
- $('#searchBox').on('shown.bs.popover', function() {
- $('.popover').i18n();
- });
+ });*/
+
$('#searchBox').prop('disabled', true)
- /*.focus(function() {
- $("#searchOptions").show();
- })*/
- .popover({
- html: true,
- placement: 'bottom',
- trigger: 'focus',
- content: $('#searchOptions').html()
- }).keyup(function(e) {
+ .focus(function() {
+ if(!TSCORE.FileOpener.isFileOpened()) {
+ $("#searchOptions").show();
+ }
+ })
+ .keyup(function(e) {
// On enter fire the search
if (e.keyCode === 13) {
$('#clearFilterButton').addClass('filterOn');
@@ -654,21 +656,24 @@ define(function(require, exports, module) {
TSCORE.PerspectiveManager.redrawCurrentPerspective();
}
});
+
$('#showSearchButton').on('click', function() {
TSCORE.showSearchArea();
});
+
$('#searchButton').prop('disabled', true).click(function(evt) {
evt.preventDefault();
$('#clearFilterButton').addClass('filterOn');
$('#searchOptions').hide();
TSCORE.PerspectiveManager.redrawCurrentPerspective();
- $('#searchBox').popover('hide');
});
+
$('#clearFilterButton').prop('disabled', true).click(function(e) {
e.preventDefault();
cancelSearch();
});
// Search UI END
+
$('#perspectiveSwitcherButton').prop('disabled', true);
var $contactUsContent = $('#contactUsContent');
$contactUsContent.on('click', '#openHints', showWelcomeDialog);
@@ -728,7 +733,7 @@ define(function(require, exports, module) {
function cancelSearch() {
clearSearchFilter();
- $('#searchBox').popover('hide');
+ //$('#searchBox').popover('hide');
$('#searchToolbar').hide();
$('#showSearchButton').show();
// Restoring initial dir listing without subdirectories
@@ -744,11 +749,10 @@ define(function(require, exports, module) {
}
function showSearchArea() {
- $('#searchToolbar').show();
- //.addClass('animated bounceIn');
- $('#showSearchButton').hide();
- $('#searchBox').focus();
- }
+ $('#searchToolbar').show();
+ $('#showSearchButton').hide();
+ $('#searchBox').focus();
+ }
// Handle external links
function openLinkExternally(url) {
diff --git a/data/js/ioutils.js b/data/js/ioutils.js
index 6935ee307..f95d4dfa5 100644
--- a/data/js/ioutils.js
+++ b/data/js/ioutils.js
@@ -8,6 +8,9 @@ define(function(require, exports, module) {
var TSCORE = require('tscore');
var TSPOSTIO = require('tspostioapi');
+ var MAXSEARCHRESULTS = 1000;
+ var stopDirectoryWalking = false;
+ var searchResultsCounter = 0;
function walkDirectory(path, options, fileCallback, dirCallback) {
return TSCORE.IO.listDirectoryPromise(path, true).then(function(entries) {
@@ -26,7 +29,7 @@ define(function(require, exports, module) {
if (dirCallback) {
return dirCallback(entry);
}
- if (options.recursive) {
+ if (options.recursive) { // && !stopDirectoryWalking &&
return walkDirectory(entry.path, options, fileCallback, dirCallback);
} else {
return entry;
@@ -107,6 +110,8 @@ define(function(require, exports, module) {
});
}
+ exports.stopDirectoryWalking = stopDirectoryWalking;
+ exports.MAXSEARCHRESULTS = MAXSEARCHRESULTS;
exports.walkDirectory = walkDirectory;
exports.listSubDirectories = listSubDirectories;