Skip to content

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

updating jsdoc

uggrock962caac509c5
diff --git a/data/chromium/chrome.api.js b/data/chromium/chrome.api.js
index 26b4d4a5e..03b6d2ed9 100644
--- a/data/chromium/chrome.api.js
+++ b/data/chromium/chrome.api.js
@@ -3,6 +3,11 @@
* can be found in the LICENSE file. */
/* global define, isWin */
+/**
+ * A implementation of the IOAPI for the Chrome/Chromium extensions platform
+ * @class ChromeExtension
+ * @memberof IOAPI
+ */
define(function(require, exports, module) {
"use strict";
@@ -71,7 +76,7 @@ define(function(require, exports, module) {
* Checks if new version is available
* @name checkNewVersion
* @method
- * @memberof IOAPI.Chrome
+ * @memberof IOAPI.ChromeExtension
*/
function checkNewVersion() {
console.log("Checking for new version...");
@@ -92,7 +97,7 @@ define(function(require, exports, module) {
* Creates recursively a tree structure for a given directory path
* @name createDirectoryTree
* @method
- * @memberof IOAPI.Chrome
+ * @memberof IOAPI.ChromeExtension
* @param {string} dirPath - the full path of the directory for which the tree will be generated
*/
function createDirectoryTree(dirPath) {
@@ -106,7 +111,7 @@ define(function(require, exports, module) {
* Creates a list with containing the files and the sub directories of a given directory
* @name listDirectoryPromise
* @method
- * @memberof IOAPI.Chrome
+ * @memberof IOAPI.ChromeExtension
* @param {string} dirPath - the full path of the directory for which the tree will be generated
* @returns {Promise.<Success, Error>}
*/
@@ -166,7 +171,7 @@ define(function(require, exports, module) {
* Finds out the properties of a file or directory such last modification date or file size
* @name getPropertiesPromise
* @method
- * @memberof IOAPI.Chrome
+ * @memberof IOAPI.ChromeExtension
* @param {string} filePath - full path to the file or the directory, which will be analysed
* @returns {Promise.<Success, Error>}
*/
@@ -185,7 +190,7 @@ define(function(require, exports, module) {
* Load the content of a text file
* @name loadTextFilePromise
* @method
- * @memberof IOAPI.Chrome
+ * @memberof IOAPI.ChromeExtension
* @param {string} filePath - the full path of the file which will be loaded
* @returns {Promise.<Success, Error>}
*/
@@ -198,7 +203,7 @@ define(function(require, exports, module) {
* Gets the content of file, useful for binary files
* @name getFileContentPromise
* @method
- * @memberof IOAPI.Chrome
+ * @memberof IOAPI.ChromeExtension
* @param {string} fullPath - the full path of the file which will be loaded
* @param {string} type - the type of the XHR response, defaul is *arraybuffer*
* @returns {Promise.<Success, Error>}
@@ -231,7 +236,7 @@ define(function(require, exports, module) {
* Persists a given content(binary supported) to a specified filepath
* @name saveFilePromise
* @method
- * @memberof IOAPI.Chrome
+ * @memberof IOAPI.ChromeExtension
* @param {string} filePath - the full path of the file which should be saved
* @param {string} content - content that will be saved
* @param {boolean} overwrite - if true existing file path will be overwritten
@@ -252,10 +257,10 @@ define(function(require, exports, module) {
}
/**
- * Creates a directory
+ * Not supported on this platform
* @name createDirectoryPromise
* @method
- * @memberof IOAPI.Chrome
+ * @memberof IOAPI.ChromeExtension
* @param {string} dirPath - the full path of the folder which will be created
* @returns {Promise.<Success, Error>}
*/
@@ -266,10 +271,10 @@ define(function(require, exports, module) {
}
/**
- * Rename a directory
+ * Not supported on this platform
* @name renameDirectoryPromise
* @method
- * @memberof IOAPI.Chrome
+ * @memberof IOAPI.ChromeExtension
* @returns {Promise.<Success, Error>}
*/
function renameDirectoryPromise() {
@@ -279,10 +284,10 @@ define(function(require, exports, module) {
}
/**
- * Renames a given file
+ * Not supported on this platform
* @name renameFilePromise
* @method
- * @memberof IOAPI.Chrome
+ * @memberof IOAPI.ChromeExtension
* @returns {Promise.<Success, Error>}
*/
function renameFilePromise() {
@@ -292,10 +297,10 @@ define(function(require, exports, module) {
}
/**
- * Copies a given file to a specified location
+ * Not supported on this platform
* @name copyFilePromise
* @method
- * @memberof IOAPI.Chrome
+ * @memberof IOAPI.ChromeExtension
* @returns {Promise.<Success, Error>}
*/
function copyFilePromise() {
@@ -305,10 +310,10 @@ define(function(require, exports, module) {
}
/**
- * Delete a specified file
+ * Not supported on this platform
* @name deleteFilePromise
* @method
- * @memberof IOAPI.Chrome
+ * @memberof IOAPI.ChromeExtension
* @returns {Promise.<Success, Error>}
*/
function deleteFilePromise() {
@@ -318,10 +323,10 @@ define(function(require, exports, module) {
}
/**
- * Delete a specified directory, the directory should be empty, if the trash can functionality is not enabled
+ * Not supported on this platform
* @name deleteDirectoryPromise
* @method
- * @memberof IOAPI.Chrome
+ * @memberof IOAPI.ChromeExtension
* @returns {Promise.<Success, Error>}
*/
function deleteDirectoryPromise() {
@@ -334,7 +339,7 @@ define(function(require, exports, module) {
* Selects a directory with the help of a directory chooser
* @name selectDirectory
* @method
- * @memberof IOAPI.Chrome
+ * @memberof IOAPI.ChromeExtension
*/
function selectDirectory() {
console.log("Select directory!");
@@ -346,10 +351,10 @@ define(function(require, exports, module) {
}
/**
- * Selects a file with the help of a file chooser
+ * Not supported on this platform
* @name selectFile
* @method
- * @memberof IOAPI.Chrome
+ * @memberof IOAPI.ChromeExtension
*/
function selectFile() {
// TODO
@@ -357,10 +362,10 @@ define(function(require, exports, module) {
}
/**
- * Opens a directory in the operating system's default file manager
+ * Not supported on this platform
* @name openDirectory
* @method
- * @memberof IOAPI.Chrome
+ * @memberof IOAPI.ChromeExtension
* @param {string} dirPath - the full path of the directory which will be opened
*/
function openDirectory(dirPath) {
@@ -369,10 +374,10 @@ define(function(require, exports, module) {
}
/**
- * Opens a file with the operating system's default program for the type of the file
+ * Not supported on this platform
* @name openFile
* @method
- * @memberof IOAPI.Chrome
+ * @memberof IOAPI.ChromeExtension
* @param {string} filePath - the full path of the file which will be opened
*/
function openFile(filePath) {
diff --git a/data/cordova/cordova.api.js b/data/cordova/cordova.api.js
index 291465304..f51e6f16b 100644
--- a/data/cordova/cordova.api.js
+++ b/data/cordova/cordova.api.js
@@ -5,6 +5,11 @@
//cordova ios handleOpenURL is global
var handleOpenURL; // jshint ignore:line
+/**
+ * A implementation of the IOAPI for the Chrome/Chromium extensions platform
+ * @class Cordova
+ * @memberof IOAPI
+ */
define(function(require, exports, module) {
"use strict";
diff --git a/data/mozilla/firefoxos.api.js b/data/mozilla/firefoxos.api.js
deleted file mode 100644
index a8f7182f5..000000000
--- a/data/mozilla/firefoxos.api.js
+++ /dev/null
@@ -1,221 +0,0 @@
-/* Copyright (c) 2012-2015 The TagSpaces Authors. All rights reserved.
- * Use of this source code is governed by a AGPL3 license that
- * can be found in the LICENSE file. */
-define(function(require, exports, module) {
- "use strict";
-
- // Activating browser specific exports modul
- console.log("Loading firefoxos.js..");
-
- var TSCORE = require("tscore");
- var TSPOSTIO = require("tspostioapi");
-
- /* var directoryExist = function(dirPath) {
- console.log("Checks if a directory exist: "+dirPath);
- //TSPOSTIO.
- }; */
-
- var createDirectoryIndex = function(dirPath) {
- console.log("Creating index for directory: " + dirPath);
- TSCORE.showLoadingAnimation();
-
- var directoryIndex = [];
- TSPOSTIO.createDirectoryIndex(directoryIndex);
- };
-
- var createDirectoryTree = function(dirPath) {
- console.log("Creating directory index for: " + dirPath);
- TSCORE.showLoadingAnimation();
-
- var directoyTree = [];
- //console.log(JSON.stringify(directoyTree));
- TSPOSTIO.createDirectoryTree(directoyTree);
- };
-
- var createDirectory = function(dirPath) {
- console.log("Creating directory: " + dirPath);
- TSCORE.showLoadingAnimation();
-
- TSPOSTIO.createDirectory(dirPath);
-
- };
-
- var renameFile = function(filePath, newFilePath) {
- console.log("Renaming file: " + filePath + " to " + newFilePath);
- TSCORE.showLoadingAnimation();
-
- TSPOSTIO.renameFile(filePath, newFilePath);
- };
-
- var loadTextFile = function(filePath) {
- console.log("Loading file: " + filePath);
- TSCORE.showLoadingAnimation();
-
- TSPOSTIO.loadTextFile(content);
- };
-
- var saveTextFile = function(filePath, content, overWrite) {
- console.log("Saving file: " + filePath);
- TSCORE.showLoadingAnimation();
-
- // Handling the UTF8 support for text files
- var UTF8_BOM = "\ufeff";
-
- if (content.indexOf(UTF8_BOM) === 0) {
- // already has a UTF8 bom
- } else {
- content = UTF8_BOM + content;
- }
-
- var isNewFile = !pathUtils.existsSync(filePath);
-
- TSPOSTIO.saveTextFile(filePath, isNewFile);
- };
-
- /*
- http://rominirani.com/2013/08/16/firefox-os-tutorial-episode-9-device-storage/
- listContents('sdcard');
- listContents('videos');
- listContents('music');
- listContents('pictures');
-
- */
- function listContents(storagename) {
- //Clear up the list first
- var files = navigator.getDeviceStorage(storagename);
- var cursor = files.enumerate();
- console.log("Listing storage!");
- cursor.onsuccess = function() {
- console.log("Listing storage success!");
- var file = this.result;
- if (file !== null) {
- //var imageElement = $('<img height="100" width="75">');
- //imageElement.attr('src', window.URL.createObjectURL(file));
- //$("<p>" + file.name + "," + file.lastModifiedDate + "," + file.type + "," + file.size + "</p>").appendTo('#results');
- //imageElement.appendTo("#results");
- console.log("file: " + file.name + "," + file.lastModifiedDate + "," + file.type + "," + file.size);
- this.done = false;
- } else {
- this.done = true;
- }
- if (!this.done) {
- this.continue();
- }
- };
- cursor.onerror = function(e) {
- console.log("Listing storage failed! " + e);
- };
- }
-
- listContents('sdcard');
-
- var listDirectory = function(dirPath) {
- console.log("Listing directory: " + dirPath);
- TSCORE.showLoadingAnimation();
-
- TSPOSTIO.errorOpeningPath();
-
- var anotatedDirList = [],
- dirList = []; // remove
- for (var i = 0; i < dirList.length; i++) {
- var path = dirPath + TSCORE.dirSeparator + dirList[i];
- var stats = fs.statSync(path);
- //console.log('stats: ' + JSON.stringify(stats));
- anotatedDirList.push({
- "name": dirList[i],
- "isFile": !stats.isDirectory(),
- "size": stats.size,
- "lmdt": stats.mtime,
- "path": path
- });
- }
- TSPOSTIO.listDirectory(anotatedDirList);
-
- };
-
- var deleteElement = function(path) {
- console.log("Deleting: " + path);
- TSCORE.showLoadingAnimation();
-
- TSPOSTIO.deleteElement(path);
-
- };
-
- var checkAccessFileURLAllowed = function() {
- console.log("checkAccessFileURLAllowed function not relevant for node..");
- };
-
- var checkNewVersion = function() {
- console.log("Checking for new version...");
- var cVer = TSCORE.Config.DefaultSettings.appVersion + "." + TSCORE.Config.DefaultSettings.appBuild;
- $.ajax({
- url: 'http://tagspaces.org/releases/version.json?nVer=' + cVer,
- type: 'GET',
- })
- .done(function(data) {
- TSPOSTIO.checkNewVersion(data);
- })
- .fail(function(data) {
- console.log("AJAX failed " + data);
- });
- };
-
- var selectDirectory = function() {
-
- };
-
- var openDirectory = function(dirPath) {
-
- };
-
- var openFile = function(filePath) {
-
- };
-
- var selectFile = function() {};
-
- /* stats for file:
- dev: 2114,
- ino: 48064969,
- mode: 33188,
- nlink: 1,
- uid: 85,
- gid: 100,
- rdev: 0,
- size: 527,
- blksize: 4096,
- blocks: 8,
- atime: Mon, 10 Oct 2011 23:24:11 GMT,
- mtime: Mon, 10 Oct 2011 23:24:11 GMT,
- ctime: Mon, 10 Oct 2011 23:24:11 GMT
- */
- var getFileProperties = function(filePath) {
- var fileProperties = {};
- /* var stats = fs.statSync(filePath);
- if (stats.isFile()) {
- fileProperties.path = filePath;
- fileProperties.size = stats.size;
- fileProperties.lmdt = stats.mtime;
- TSPOSTIO.getFileProperties(fileProperties);
- } else {
- console.warn("Error getting file properties. "+filePath+" is directory");
- }*/
- };
-
- exports.createDirectory = createDirectory;
- exports.renameFile = renameFile;
- exports.loadTextFile = loadTextFile;
- exports.saveTextFile = saveTextFile;
- exports.listDirectory = listDirectory;
- exports.deleteElement = deleteElement;
- exports.createDirectoryIndex = createDirectoryIndex;
- exports.createDirectoryTree = createDirectoryTree;
- exports.selectDirectory = selectDirectory;
- exports.openDirectory = openDirectory;
- exports.openFile = openFile;
- exports.selectFile = selectFile;
- exports.checkAccessFileURLAllowed = checkAccessFileURLAllowed;
- exports.checkNewVersion = checkNewVersion;
- exports.getFileProperties = getFileProperties;
-
-});
diff --git a/data/mozilla/mozilla.api.js b/data/mozilla/mozilla.api.js
index b4321d43a..00576cd78 100644
--- a/data/mozilla/mozilla.api.js
+++ b/data/mozilla/mozilla.api.js
@@ -3,6 +3,11 @@
* can be found in the LICENSE file. */
/* global define */
+/**
+ * A implementation of the IOAPI for the Chrome/Chromium extensions platform
+ * @class FirefoxAddon
+ * @memberof IOAPI
+ */
define(function(require, exports, module) {
"use strict";
@@ -114,7 +119,7 @@ define(function(require, exports, module) {
* Checks if new version is available
* @name checkNewVersion
* @method
- * @memberof IOAPI.Mozilla
+ * @memberof IOAPI.FirefoxAddon
*/
function checkNewVersion() {
console.log("Checking for new version...");
@@ -131,7 +136,7 @@ define(function(require, exports, module) {
* Creates a list with containing the files and the sub directories of a given directory
* @name listDirectoryPromise
* @method
- * @memberof IOAPI.Mozilla
+ * @memberof IOAPI.FirefoxAddon
* @param {string} dirPath - the directory path which is listed
* @returns {Promise.<Success, Error>}
*/
@@ -167,7 +172,7 @@ define(function(require, exports, module) {
* Finds out the properties of a file or directory such last modification date or file size
* @name getPropertiesPromise
* @method
- * @memberof IOAPI.Mozilla
+ * @memberof IOAPI.FirefoxAddon
* @param {string} filePath - full path to the file or the directory, which will be analysed
* @returns {Promise.<Success, Error>}
*/
@@ -203,7 +208,7 @@ define(function(require, exports, module) {
* Creates recursively a tree structure for a given directory path
* @name createDirectoryTree
* @method
- * @memberof IOAPI.Mozilla
+ * @memberof IOAPI.FirefoxAddon
* @param {string} dirPath - the full path of the directory for which the tree will be generated
*/
function createDirectoryTree(dirPath) {
@@ -222,7 +227,7 @@ define(function(require, exports, module) {
* Load the content of a text file
* @name loadTextFilePromise
* @method
- * @memberof IOAPI.Mozilla
+ * @memberof IOAPI.FirefoxAddon
* @param {string} filePath - the full path of the file which will be loaded
* @returns {Promise.<Success, Error>}
*/
@@ -235,7 +240,7 @@ define(function(require, exports, module) {
* Gets the content of file, useful for binary files
* @name getFileContentPromise
* @method
- * @memberof IOAPI.Mozilla
+ * @memberof IOAPI.FirefoxAddon
* @param {string} fullPath - the full path of the file which will be loaded
* @param {string} type - the type of the XHR response, defaul is *arraybuffer*
* @returns {Promise.<Success, Error>}
@@ -280,7 +285,7 @@ define(function(require, exports, module) {
* Persists a given content(binary supported) to a specified filepath
* @name saveFilePromise
* @method
- * @memberof IOAPI.Mozilla
+ * @memberof IOAPI.FirefoxAddon
* @param {string} filePath - the full path of the file which should be saved
* @param {string} content - content that will be saved
* @param {boolean} overWrite - if true existing file path will be overwritten
@@ -318,7 +323,7 @@ define(function(require, exports, module) {
* Persists a given binary content to a specified filepath
* @name saveBinaryFilePromise
* @method
- * @memberof IOAPI.Mozilla
+ * @memberof IOAPI.FirefoxAddon
* @param {string} filePath - the full path of the file which will be saved
* @param {string} content - content that will be saved
* @param {string} overWrite - if true existing file path will be overwritten
@@ -356,7 +361,7 @@ define(function(require, exports, module) {
* Creates a directory
* @name createDirectory
* @method
- * @memberof IOAPI.Mozilla
+ * @memberof IOAPI.FirefoxAddon
* @param {string} dirPath - the full path of the folder which will be created
* @param {string} silentMode - //TODO
*/
@@ -374,7 +379,7 @@ define(function(require, exports, module) {
* Creates a directory
* @name createDirectoryPromise
* @method
- * @memberof IOAPI.Mozilla
+ * @memberof IOAPI.FirefoxAddon
* @param {string} dirPath - the full path of the folder which will be created
* @returns {Promise.<Success, Error>}
*/
@@ -408,7 +413,7 @@ define(function(require, exports, module) {
* Copies a given file to a specified location
* @name copyFilePromise
* @method
- * @memberof IOAPI.Mozilla
+ * @memberof IOAPI.FirefoxAddon
* @param {string} filePath - the full path of a file which will be copied
* @param {string} newFilePath - the full path destination of the copied file
* @returns {Promise.<Success, Error>}
@@ -443,7 +448,7 @@ define(function(require, exports, module) {
* Renames a given file
* @name renameFilePromise
* @method
- * @memberof IOAPI.Mozilla
+ * @memberof IOAPI.FirefoxAddon
* @param {string} filePath - the full path of the file which will be renamed
* @param {string} newPath - the desired full path after the file rename
* @returns {Promise.<Success, Error>}
@@ -480,7 +485,7 @@ define(function(require, exports, module) {
* Rename a directory
* @name renameDirectoryPromise
* @method
- * @memberof IOAPI.Mozilla
+ * @memberof IOAPI.FirefoxAddon
* @param {string} path - the full path of the directory which will be renamed
* @returns {Promise.<Success, Error>}
*/
@@ -495,7 +500,7 @@ define(function(require, exports, module) {
* Delete a specified file
* @name deleteFilePromise
* @method
- * @memberof IOAPI.Mozilla
+ * @memberof IOAPI.FirefoxAddon
* @param {string} path - the full path of the file which will be deleted
* @returns {Promise.<Success, Error>}
*/
@@ -530,7 +535,7 @@ define(function(require, exports, module) {
* Delete a specified directory, the directory should be empty, if the trash can functionality is not enabled
* @name deleteDirectoryPromise
* @method
- * @memberof IOAPI.Mozilla
+ * @memberof IOAPI.FirefoxAddon
* @param {string} path - the full path of the directory which will be deleted
* @returns {Promise.<Success, Error>}
*/
@@ -545,7 +550,7 @@ define(function(require, exports, module) {
* Selects a directory with the help of a directory chooser
* @name selectDirectory
* @method
- * @memberof IOAPI.Mozilla
+ * @memberof IOAPI.FirefoxAddon
*/
function selectDirectory() {
console.log("Selecting directory...");
@@ -561,7 +566,7 @@ define(function(require, exports, module) {
* Selects a file with the help of a file chooser
* @name selectFile
* @method
- * @memberof IOAPI.Mozilla
+ * @memberof IOAPI.FirefoxAddon
*/
function selectFile() {
console.log("Selecting file...");
@@ -578,7 +583,7 @@ define(function(require, exports, module) {
* Opens a directory in the operating system's default file manager
* @name openDirectory
* @method
- * @memberof IOAPI.Mozilla
+ * @memberof IOAPI.FirefoxAddon
* @param {string} dirPath - the full path of the directory which will be opened
*/
function openDirectory(dirPath) {
@@ -597,7 +602,7 @@ define(function(require, exports, module) {
* Opens a file with the operating system's default program for the type of the file
* @name openFile
* @method
- * @memberof IOAPI.Mozilla
+ * @memberof IOAPI.FirefoxAddon
* @param {string} filePath - the full path of the file which will be opened
*/
function openFile(filePath) {
diff --git a/data/web/web.api.js b/data/web/web.api.js
index fe48a9837..0e7141b7e 100644
--- a/data/web/web.api.js
+++ b/data/web/web.api.js
@@ -1,6 +1,12 @@
/* Copyright (c) 2012-2013 The TagSpaces Authors. All rights reserved.
* Use of this source code is governed by a AGPL3 license that
* can be found in the LICENSE file. */
+
+/**
+ * A implementation of the IOAPI for the Chrome/Chromium extensions platform
+ * @class WebDAV
+ * @memberof IOAPI
+ */
define(function(require, exports, module) {
"use strict";
diff --git a/jsdoc.conf.json b/jsdoc.conf.json
index 5806f8562..feaa82cae 100644
--- a/jsdoc.conf.json
+++ b/jsdoc.conf.json
@@ -6,13 +6,20 @@
"source": {
"include": [
"data/js",
- "data/node-webkit"
+ "data/node-webkit",
+ "data/chromium",
+ "data/mozilla",
+ "data/cordova",
+ "data/web"
],
"exclude": [
"data/testfiles",
"data/libs/",
"data/ext/",
- "data/mozilla/",
+ "data/mozilla/ioutils.js",
+ "data/mozilla/listen.js",
+ "data/mozilla/toolbarbutton.js",
+ "data/mozilla/unload+.js",
"data/node-webkit/node_modules/",
"data/pro/node_modules/",
"data/web/webdavlib/",