Skip to content

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

redesigning the UI of the perspective

uggrocke22a55b68e08
diff --git a/data/ext/perspectiveGrid/extension.css b/data/ext/perspectiveGrid/extension.css
index b0dff5edf..542b6e353 100644
--- a/data/ext/perspectiveGrid/extension.css
+++ b/data/ext/perspectiveGrid/extension.css
@@ -1,14 +1,35 @@
+.tileContainer {
+ display: flex;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+
+ flex-wrap: wrap;
+}
+
.fileTile {
- margin: 3px;
+ margin: 5px;
padding: 1px 1px 1px 3px;
- float: left;
border: 1px solid #D4D4D4;
text-align: left;
- width: 180px;
- height: 100px;
+ height: 150px;
+ max-width: 300px;
overflow: hidden;
position:relative;
background-color: white;
+ background-repeat: no-repeat;
+ background-size: cover;
+ background-position: center;
+ box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
+
+ flex: 1 1 200px;
+ -webkit-flex: 1 1 200px;
+ -ms-flex: 1 1 200px;
+}
+
+@media (max-width: 768px) {
+ .fileTile {
+ max-width: 500px;
+ }
}
.fileTile button:hover {
@@ -16,39 +37,49 @@
}
.titleInFileTile {
- font-size: 13px;
+ font-size: 14px;
line-height: 120%;
color: #333333;
+ background-color: rgba(220,220,220,0.7);
z-index: 99;
position: absolute;
- left: 5px;
- top: 5px;
+ left: 0px;
+ bottom: 0px;
+ width: 100%;
+ height: 50px;
+ padding: 5px;
}
.tagsInFileTile {
position: absolute;
z-index: 100;
- left: 5px;
+ left: 2px;
top: 35px;
+ max-height: 48px;
+ overflow: hidden;
}
.fileTileSelector {
+ border-radius: 3px;
position:absolute;
- bottom:0;
+ top:0;
left:0;
z-index: 101;
+ background-color: rgba(220,220,220,0.7);
+ margin: 5px;
+ padding: 2px 4px 2px 4px;
+}
+
+.fileTileSelector:hover, .fileTileSelector:active, .fileTileSelector:focus {
+ border-radius: 3px;
+ background-color: rgba(220,220,220,0.7);
}
.fileExtTile {
- position:absolute;
- bottom:0;
- right:0;
- -webkit-border-radius: 0 !important;
border-radius: 0 !important;
- background: #999 ;
text-align: center;
padding: 1px;
- color: white ;
+ color: black ;
z-index: 99;
text-transform:uppercase;
}
@@ -71,13 +102,3 @@
vertical-align: text-top;
border: 0px lightgray solid;
}
-
-.thumbImgTile {
- max-width: 100px;
- max-height: 100px;
- position:absolute;
- bottom:0;
- right:0;
- border: 0 lightgray solid;
- z-index: 1;
-}
\ No newline at end of file
diff --git a/data/ext/perspectiveGrid/perspectiveUI.js b/data/ext/perspectiveGrid/perspectiveUI.js
index 61e9d9f76..f87ae8145 100644
--- a/data/ext/perspectiveGrid/perspectiveUI.js
+++ b/data/ext/perspectiveGrid/perspectiveUI.js
@@ -13,8 +13,6 @@ define(function(require, exports, module) {
var MONTH = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
- var PREVIEW_TAGS_CNT = 5;
-
var supportedFileTypeThumnailing = [
"jpg", "jpeg", "png", "gif", "pdf", "svg", "webp", "bmp",
"zip", "epub", "docx", "pptx", "pptm", "potx", "potm",
@@ -58,26 +56,15 @@ define(function(require, exports, module) {
}
var fileTileTmpl = Handlebars.compile(
- '<li title="{{filepath}}" filepath="{{filepath}}" class="fileTile">' +
- '<p class="titleInFileTile">{{title}}</p><span class="tagsInFileTile">' +
- '{{#each tags}}' +
- '<button class="btn btn-sm tagButton fileTagsTile" tag="{{tag}}" filepath="{{filepath}}" style="{{style}}">{{tag}} <span class="caret"></span></button>' +
- '{{/each}}' +
- '</span><span class="fileExtTile">{{fileext}}</span>' +
- '<button class="btn btn-link fileTileSelector" filepath="{{filepath}}"><i class="fa {{selected}} fa-lg"></i></button>' +
- '</p></li>'
- );
-
- var fileTileTmbTmpl = Handlebars.compile(
- '<div title="{{filepath}}" filepath="{{filepath}}" class="fileTile">' +
- '<span><img class="thumbImgTile" filepath="{{tmbpath}}" style="max-width: 200px; max-height: 200px;" src="{{thumbPath}}"></span>' +
- '<p class="titleInFileTile">{{title}}</p><span class="tagsInFileTile">' +
+ '<div title="{{filepath}}" filepath="{{filepath}}" class="fileTile" style="background-image: url(\'{{thumbPath}}\')">' +
+ '<button class="btn btn-link fileTileSelector" filepath="{{filepath}}"><i class="fa {{selected}} fa-lg"></i> <span class="fileExtTile">{{fileext}}</span></button>' +
+ '<div class="tagsInFileTile">' +
'{{#each tags}}' +
'<button class="btn btn-sm tagButton fileTagsTile" tag="{{tag}}" filepath="{{filepath}}" style="{{style}}">{{tag}} <span class="caret"></span></button>' +
'{{/each}}' +
- '</span><span class="fileExtTile">{{fileext}}</span>' +
- '<button class="btn btn-link fileTileSelector" filepath="{{filepath}}"><i class="fa {{selected}} fa-lg"></i></button>' +
- '</p></div>'
+ '</div>'+
+ '<div class="titleInFileTile">{{title}}</div>' +
+ '</div>'
);
var mainLayoutTemplate = Handlebars.compile(
@@ -86,20 +73,21 @@ define(function(require, exports, module) {
'<div class="accordion-group disableTextSelection" style="width: 100%; border: 0px #aaa solid;">' +
'<div class="accordion-heading btn-group" style="width:100%; margin: 0px; border-bottom: solid 1px #eee; background-color: #ddd;">' +
'<button class="btn btn-link groupTitle" data-toggle="collapse" data-target="#{{../id}}SortingButtons{{@index}}">' +
- '<i class="fa fa-minus-square" i="">&nbsp;</i>' +
+ '<i class="fa fa-minus-square">&nbsp;</i>' +
'</button>' +
'<span class="btn btn-link groupTitle" id="{{../id}}HeaderTitle{{@index}}" style="margin-left: 0px; padding-left: 0px;"></span>' +
'</div>' +
'<div class="accordion-body collapse in" id="{{../id}}SortingButtons{{@index}}" style="margin: 0px 0px 0px 3px; border: 0px;">' +
- '<div class="accordion-inner" id="{{../id}}GroupContent{{@index}}" style="padding: 2px; border: 0px;"></div>' +
+ '<div class="accordion-inner tileContainer" id="{{../id}}GroupContent{{@index}}"></div>' +
'</div>' +
'</div>' +
+ '{{else}}' +
+ '<p style="margin: 5px;">No files found</p>' +
'{{/each}}' +
'</div>'
);
ExtUI.prototype.createFileTile = function(title, filePath, fileExt, fileTags, isSelected, metaObj) {
- //TODO minimize platform specific calls
var tmbPath;
if (isCordova || isWeb) {
tmbPath = filePath;
@@ -121,14 +109,7 @@ define(function(require, exports, module) {
var tagString = "" + fileTags;
var tags = tagString.split(",");
- var tagCounter = 0;
- if (tags.length > PREVIEW_TAGS_CNT) {
- tagCounter = PREVIEW_TAGS_CNT + 1;
- tags[PREVIEW_TAGS_CNT] = "...";
- } else {
- tagCounter = tags.length;
- }
- for (var i = 0; i < tagCounter; i++) {
+ for (var i = 0; i < tags.length; i++) {
context.tags.push({
tag: tags[i],
filepath: filePath,
@@ -147,11 +128,7 @@ define(function(require, exports, module) {
});
}
- if (supportedFileTypeThumnailing.indexOf(fileExt) >= 0) {
- return fileTileTmbTmpl(context);
- } else {
- return fileTileTmpl(context);
- }
+ return fileTileTmpl(context);
};
ExtUI.prototype.initFileGroupingMenu = function() {
diff --git a/data/ext/perspectiveGrid/toolbar.html b/data/ext/perspectiveGrid/toolbar.html
index 85ba22285..ca59b489c 100644
--- a/data/ext/perspectiveGrid/toolbar.html
+++ b/data/ext/perspectiveGrid/toolbar.html
@@ -6,7 +6,6 @@
<li class="dropdown-header">
<button class="close">&times;</button>&nbsp;
</li>
- <li class="divider"></li>
<li><a id="{{id}}CreateHTMLFileButton">
<i class="fa fa-file-image-o fa-lg fa-fw"></i>&nbsp;<span data-i18n="ns.perspectiveList:createHTMLFile"></span>
</a></li>
@@ -16,9 +15,9 @@
<li><a id="{{id}}CreateTXTFileButton">
<i class="fa fa-file-text-o fa-lg fa-fw"></i>&nbsp;<span data-i18n="ns.perspectiveList:createTXTFile"></span>
</a></li>
- <li><a id="{{id}}CreateFileButton">
+ <!--li><a id="{{id}}CreateFileButton">
<i class="fa fa-file-o fa-lg fa-fw"></i>&nbsp;<span data-i18n="ns.perspectiveList:showNewFileDialog"></span>
- </a></li>
+ </a></li-->
<li><a id="{{id}}AddFileButton">
<i class="fa fa-plus-circle fa-lg fa-fw"></i>&nbsp;<span data-i18n="ns.perspectiveList:showAddFileDialog"></span>
</a></li>
@@ -52,6 +51,9 @@
<h4 class="modal-title" data-i18n="ns.perspectiveList:moreOperations"></h4>
</div>
<div class="modal-body">
+ <button class="btn btn-link" type="button" id="{{id}}CreateFileButton">
+ <i class="fa fa-file-o fa-lg"></i> <span data-i18n="ns.perspectiveList:showNewFileDialog"></span>
+ </button>
<button class="btn btn-link" type="button" title="Group" id="{{id}}GroupingButton" data-toggle="dropdown">
<i class="fa fa-group fa-lg"></i> Group Files<span class="caret"></span>
</button>