Skip to content

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

File path selection fixed for chrome

uggrock32540bacce05
diff --git a/data/ext/perspectiveDefault/perspectiveUI.js b/data/ext/perspectiveDefault/perspectiveUI.js
index b70fe6ad4..828243321 100644
--- a/data/ext/perspectiveDefault/perspectiveUI.js
+++ b/data/ext/perspectiveDefault/perspectiveUI.js
@@ -45,7 +45,7 @@ console.debug("Loading UI for perspectiveDefault");
title: fileName,
class: "thumbImg",
filepath: 'file:///'+filePath,
- src: ""
+ style: "width: 0px; height: 0px"
})).html();
thumbHTML = thumbHTML + " ";
}
@@ -226,6 +226,10 @@ console.debug("Loading UI for perspectiveDefault");
ExtUI.prototype.reInitTableWithData = function(fileList) {
$('#'+this.extensionID+"FileTable_wrapper").hide();
+ // handle thumbnail activation
+ this.showThumbs = false;
+ $( "#"+this.extensionID+"ShowTmbButton" ).prop('checked', false).button("refresh");
+
// Clearing the old data
this.fileTable.fnClearTable();
this.fileTable.fnAddData( fileList );
@@ -233,41 +237,41 @@ console.debug("Loading UI for perspectiveDefault");
var self = this;
this.fileTable.$('tr')
- .droppable({
- accept: ".tagButton",
- hoverClass: "activeRow",
- drop: function( event, ui ) {
- var tagName = ui.draggable.attr("tag");
-
- var targetFilePath = self.fileTable.fnGetData( this )[TC_FILEPATH];
-
- // preventing self drag of tags
- var targetTags = TSCORE.TagUtils.extractTags(targetFilePath);
- for (var i = 0; i < targetTags.length; i++) {
- if (targetTags[i] === tagName) {
- return true;
- }
- }
-
- console.log("Tagging file: "+tagName+" to "+targetFilePath);
-
- $(this).toggleClass("ui-selected");
+ .droppable({
+ accept: ".tagButton",
+ hoverClass: "activeRow",
+ drop: function( event, ui ) {
+ var tagName = ui.draggable.attr("tag");
+
+ var targetFilePath = self.fileTable.fnGetData( this )[TC_FILEPATH];
- TSCORE.ViewManager.clearSelectedFiles();
+ // preventing self drag of tags
+ var targetTags = TSCORE.TagUtils.extractTags(targetFilePath);
+ for (var i = 0; i < targetTags.length; i++) {
+ if (targetTags[i] === tagName) {
+ return true;
+ }
+ }
+
+ console.log("Tagging file: "+tagName+" to "+targetFilePath);
- TSCORE.selectedFiles.push(targetFilePath);
-
- TSCORE.TagUtils.addTag(TSCORE.selectedFiles, [tagName]);
-
- self.handleElementActivation();
- }
- })
- .dblclick( function() {
- console.debug("Opening file...");
- var rowData = self.fileTable.fnGetData( this );
-
- TSCORE.FileOpener.openFile(rowData[TC_FILEPATH]);
- } );
+ $(this).toggleClass("ui-selected");
+
+ TSCORE.ViewManager.clearSelectedFiles();
+
+ TSCORE.selectedFiles.push(targetFilePath);
+
+ TSCORE.TagUtils.addTag(TSCORE.selectedFiles, [tagName]);
+
+ self.handleElementActivation();
+ }
+ })
+ .dblclick( function() {
+ console.debug("Opening file...");
+ var rowData = self.fileTable.fnGetData( this );
+
+ TSCORE.FileOpener.openFile(rowData[TC_FILEPATH]);
+ } );
this.fileTable.$('.fileTitleButton')
.draggable({
@@ -291,10 +295,20 @@ console.debug("Loading UI for perspectiveDefault");
} )
.dropdown( 'attach' , '#extensionMenu' );
- this.fileTable.$('.thumbImg').dblclick( function() {
- console.debug("Opening file...");
- TSCORE.FileOpener.openFile($(this).attr("filepath"));
- } );
+ this.fileTable.$('.thumbImg')
+ .dblclick( function() {
+ console.debug("Opening file...");
+ TSCORE.FileOpener.openFile($(this).attr("filepath"));
+ } );
+
+ this.fileTable.$('.fileTitle')
+ .editInPlace({
+ callback: function(unused, newTitle) {
+ TSCORE.TagUtils.changeTitle($(this).parent().children(0).attr("filepath"),newTitle);
+ },
+ show_buttons: false,
+ callback_skip_dom_reset: true
+ });
this.fileTable.$('.tagButton')
.draggable({
@@ -353,13 +367,16 @@ console.debug("Loading UI for perspectiveDefault");
ExtUI.prototype.toggleThumbnails = function() {
if(this.showThumbs) {
+ this.currentTmbSize = 0;
$( "#"+this.extensionID+"IncreaseThumbsButton" ).button( "disable" );
$.each(this.fileTable.$('.thumbImg'), function() {
+ $(this).attr('style', "width: 0px; height: 0px");
$(this).attr('src',"");
});
} else {
$( "#"+this.extensionID+"IncreaseThumbsButton" ).button( "enable" );
$.each(this.fileTable.$('.thumbImg'), function() {
+ $(this).attr('style', "");
$(this).attr('src',$(this).attr('filepath'));
});
}
@@ -439,8 +456,7 @@ console.debug("Loading UI for perspectiveDefault");
})
.click(function() {
self.toggleFileDetails();
- })
- .prop('checked', false);
+ });
$( "#"+this.extensionID+"ShowTagsButton" ).button({
text: false,
diff --git a/data/index.html b/data/index.html
index 24d38e577..691367e1f 100644
--- a/data/index.html
+++ b/data/index.html
@@ -9,7 +9,8 @@
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" type="image/x-icon" href="icons/icon16.png">
<title>TagSpaces</title>
- <link rel="stylesheet" type="text/css" href="libs/jqueryui/custom-theme/jquery-ui-1.9.2.custom.css">
+ <!--link rel="stylesheet" type="text/css" href="libs/jqueryui/custom-theme/jquery-ui-1.10.2.custom.css"-->
+ <link rel="stylesheet" type="text/css" href="libs/jqueryui/custom-theme-bootstrap/jquery-ui-1.10.0.custom.css">
<link rel="stylesheet" type="text/css" href="libs/jquerylayout/layout-default-latest.css">
<link rel="stylesheet" type="text/css" href="libs/jsoneditor/jsoneditor.css">
<link rel="stylesheet" type="text/css" href="libs/datatables/css/jquery.dataTables.css">
@@ -55,7 +56,7 @@
<span id="fileTags"></span>
</p>
<p>
- <input id="selectedFilePath" onClick="this.select();" READONLY style="width: 100%; height:25px; border: 0px; background-color: transparent;" ></input>
+ <input id="selectedFilePath" READONLY style="width: 100%; height:25px; border: 0px; background-color: transparent;" ></input>
</p>
</div>
<div class="east-center" id="content" style="padding: 0; height: 100%">
diff --git a/data/js/fileopener.js b/data/js/fileopener.js
index ef75c80a1..491e21d3f 100644
--- a/data/js/fileopener.js
+++ b/data/js/fileopener.js
@@ -168,6 +168,10 @@ define(function(require, exports, module) {
// Clear filetoolbox
$( "#filetoolbox" ).empty();
+
+ $( "#selectedFilePath" ).click(function() {
+ this.select();
+ });
addEditButton("#filetoolbox", filePath);