Skip to content

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

Added support for getting the next and previous file in a perspective

uggrockc837f355b4e1
diff --git a/.project b/.project
index 34b1c17e1..5a734eb42 100644
--- a/.project
+++ b/.project
@@ -5,8 +5,14 @@
<projects>
</projects>
<buildSpec>
+ <buildCommand>
+ <name>com.aptana.ide.core.unifiedBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>com.aptana.projects.webnature</nature>
+ <nature>com.aptana.ruby.core.rubynature</nature>
</natures>
</projectDescription>
diff --git a/build.number b/build.number
index b14015491..f980f69f4 100644
--- a/build.number
+++ b/build.number
@@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
-#Fri Mar 29 14:40:39 CET 2013
-build.number=1289
+#Fri Apr 05 08:34:40 CEST 2013
+build.number=1290
diff --git a/data/ext/perspectiveBasic/extension.js b/data/ext/perspectiveBasic/extension.js
index 8fb2bfb6f..f49819b74 100644
--- a/data/ext/perspectiveBasic/extension.js
+++ b/data/ext/perspectiveBasic/extension.js
@@ -325,6 +325,16 @@ define(function(require, exports, module) {
$( "#"+exports.ID+"FilterBox").val(filter);
fileTable.fnFilter(filter);
}
+
+ exports.getNextFile = function getNextFile(filePath) {
+ var nextFilePath = undefined;
+ var data = fileTable._('tr', {"filter":"applied"});
+ console.debug("Next file: "+nextFilePath);
+ }
+
+ exports.getPrevFile = function getPrevFile(filePath) {
+ var data = fileTable.fnGetData();
+ }
exports.clearSelectedFiles = function() {
TSCORE.selectedFiles = [];
diff --git a/data/ext/perspectiveSearch/extension.js b/data/ext/perspectiveSearch/extension.js
index b24cf1f22..ef00aab79 100644
--- a/data/ext/perspectiveSearch/extension.js
+++ b/data/ext/perspectiveSearch/extension.js
@@ -278,6 +278,42 @@ define(function(require, exports, module) {
});
}
+ exports.getNextFile = function getNextFile(filePath) {
+ var nextFilePath = undefined;
+ var data = fileTable._('tr', {"filter":"applied"});
+ data.forEach(function(entry, index) {
+ if(entry[4] == filePath) {
+ var nextIndex = index+1;
+ if(nextIndex < data.length) {
+ nextFilePath = data[nextIndex][4];
+ } else {
+ nextFilePath = data[0][4];
+ }
+ }
+ console.log("Path: "+entry[4]);
+ });
+ console.debug("Next file: "+nextFilePath);
+ return nextFilePath;
+ }
+
+ exports.getPrevFile = function getPrevFile(filePath) {
+ var prevFilePath = undefined;
+ var data = fileTable._('tr', {"filter":"applied"});
+ data.forEach(function(entry, index) {
+ if(entry[4] == filePath) {
+ var prevIndex = index-1;
+ if(prevIndex >= 0) {
+ prevFilePath = data[prevIndex][4];
+ } else {
+ prevFilePath = data[data.length-1][4];
+ }
+ }
+ console.log("Path: "+entry[4]);
+ });
+ console.debug("Prev file: "+prevFilePath);
+ return prevFilePath;
+ }
+
var selectFile = function(tagButton, filePath) {
exports.clearSelectedFiles();
$(tagButton).parent().parent().toggleClass("ui-selected");
diff --git a/data/js/perspective.manager.js b/data/js/perspective.manager.js
index 3d3d7d6ee..7d2fbed39 100644
--- a/data/js/perspective.manager.js
+++ b/data/js/perspective.manager.js
@@ -46,7 +46,7 @@ exports.initViews = function initViews() {
for (var i=0; i < extensions.length; i++) {
if(extensions[i].enabled && (extensions[i].type == "view") ) {
- // TODO Some extension sucha ace editor are not working using paths like this "file:///C:/blabal/extension.js"
+ // TODO Some libraries such as ace editor are not working using paths like this "file:///C:/blabal/extension.js"
var extPath = TSCORE.Config.getExtensionPath()+"/"+extensions[i].id+"/"+"extension.js";
require([extPath], function(viewer) {
@@ -119,6 +119,30 @@ exports.updateIndexData = function updateIndexData(index) {
}
}
+exports.getNextFile = function getNextFile(filePath) {
+ for (var i=0; i < views.length; i++) {
+ if(views[i].ID == TSCORE.currentView) {
+ try {
+ return views[i].getNextFile(filePath);
+ } catch(e) {
+ console.debug("Error while executing 'getNextFile' on "+views[i].ID+" "+e);
+ }
+ }
+ }
+}
+
+exports.getPrevFile = function getPrevFile(filePath) {
+ for (var i=0; i < views.length; i++) {
+ if(views[i].ID == TSCORE.currentView) {
+ try {
+ return views[i].getPrevFile(filePath);
+ } catch(e) {
+ console.debug("Error while executing 'getPrevFile' on "+views[i].ID+" "+e);
+ }
+ }
+ }
+}
+
exports.updateTreeData = function updateTreeData(treeData) {
for (var i=0; i < views.length; i++) {
try {
@@ -187,11 +211,11 @@ exports.changeView = function changeView(viewType) {
for (var i=0; i < views.length; i++) {
if(views[i].ID == viewType) {
// Load the selected view
- try {
+ //try {
views[i].load();
- } catch(e) {
- console.error("Error while executing 'load' on "+views[i].ID+" "+e);
- }
+ //} catch(e) {
+ // console.error("Error while executing 'load' on "+views[i].ID+" "+e);
+ //}
$( "#"+views[i].ID+"Container" ).show();
$( "#"+views[i].ID+"Toolbar" ).show();
}
diff --git a/package.json b/package.json
index 6719803c9..b439af8fb 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "tagspaces",
"license": "AGPL 3.0",
"author": "Ugg Rock",
- "version": "1.3.1287",
+ "version": "1.3.1289",
"fullName": "TagSpaces",
"id": "jid1-FBaMKxTifTSahQ",
"description": "TagSpaces is a firefox addon, which allows you to browse your local file system and add tags to your files.",
diff --git a/update.rdf b/update.rdf
index 23e73b745..efc7b8849 100644
--- a/update.rdf
+++ b/update.rdf
@@ -7,13 +7,13 @@
<r:Seq>
<r:li>
<r:Description>
- <version>1.3.1287</version>
+ <version>1.3.1289</version>
<targetApplication>
<r:Description>
<id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</id>
<minVersion>16.0</minVersion>
<maxVersion>*</maxVersion>
- <updateLink>http://tagspaces.com/releases/1.3/tagspaces.1.3.1287.xpi</updateLink>
+ <updateLink>http://tagspaces.com/releases/1.3/tagspaces.1.3.1289.xpi</updateLink>
<updateInfoURL>http://tagspaces.com/releases/1.3/updateInfo.xml</updateInfoURL>
</r:Description>
</targetApplication>