Update jquery.couch docstrings. Fix few typos. References to CouchBase docs were broken anyway.
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/3097e8cd Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/3097e8cd Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/3097e8cd Branch: refs/heads/1744-single-config-file Commit: 3097e8cdd53cff91c4401863a6197c5d4ce9dd86 Parents: fffc790 Author: Alexander Shorin <[email protected]> Authored: Sun Dec 8 18:36:59 2013 +0400 Committer: Alexander Shorin <[email protected]> Committed: Sun Dec 8 18:36:59 2013 +0400 ---------------------------------------------------------------------- share/www/script/jquery.couch.js | 174 +++++++++++++++------------------- 1 file changed, 78 insertions(+), 96 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/3097e8cd/share/www/script/jquery.couch.js ---------------------------------------------------------------------- diff --git a/share/www/script/jquery.couch.js b/share/www/script/jquery.couch.js index 6abac2c..b7e36f9 100644 --- a/share/www/script/jquery.couch.js +++ b/share/www/script/jquery.couch.js @@ -64,9 +64,8 @@ * You can obtain a list of active tasks by using the /_active_tasks URL. * The result is a JSON array of the currently running tasks, with each task * being described with a single object. - * @see <a href="http://techzone.couchbase.com/sites/default/files/uploads/ - * all/documentation/couchbase-api-misc.html#couchbase-api-misc_active-task - * s_get">docs for /_active_tasks</a> + * @see <a href="http://docs.couchdb.org/en/latest/api/server/common.html# + * active-tasks">docs for /_active_tasks</a> * @param {ajaxSettings} options <a href="http://api.jquery.com/jQuery.ajax * /#jQuery-ajax-settings">jQuery ajax settings</a> */ @@ -80,9 +79,8 @@ /** * Returns a list of all the databases in the CouchDB instance - * @see <a href="http://techzone.couchbase.com/sites/default/files/uploads/ - * all/documentation/couchbase-api-misc.html#couchbase-api-misc_active-task - * s_get">docs for /_all_dbs</a> + * @see <a href="http://docs.couchdb.org/en/latest/api/server/common.html + * #all-dbs">docs for /_all_dbs</a> * @param {ajaxSettings} options <a href="http://api.jquery.com/jQuery.ajax * /#jQuery-ajax-settings">jQuery ajax settings</a> */ @@ -99,9 +97,8 @@ * parameter the entire config is returned, you can be more specific by * passing the section and option parameters, if you specify a value that * value will be stored in the configuration. - * @see <a href="http://techzone.couchbase.com/sites/default/files/uploads/ - * all/documentation/couchbase-api-config.html#couchbase-api-config_config - * -section-key_put">docs for /_config</a> + * @see <a href="http://docs.couchdb.org/en/latest/api/server + * /configuration.html#config-section-key">docs for /_config</a> * @param {ajaxSettings} options * <a href="http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings"> * jQuery ajax settings</a> @@ -118,7 +115,7 @@ } } if (value === null) { - req.type = "DELETE"; + req.type = "DELETE"; } else if (value !== undefined) { req.type = "PUT"; req.data = toJSON(value); @@ -130,9 +127,11 @@ "An error occurred retrieving/updating the server configuration" ); }, - + /** * Returns the session information for the currently logged in user. + * @see <a href="http://docs.couchdb.org/en/latest/api/server/authn.html + * #get--_session">docs for GET /_session</a> * @param {ajaxSettings} options * <a href="http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings"> * jQuery ajax settings</a> @@ -180,7 +179,7 @@ * <a href="http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings"> * jQuery ajax settings</a> */ - signup: function(user_doc, password, options) { + signup: function(user_doc, password, options) { options = options || {}; user_doc.password = password; user_doc.roles = user_doc.roles || []; @@ -196,6 +195,8 @@ /** * Authenticate against CouchDB, the <code>options</code> parameter is *expected to have <code>name</code> and <code>password</code> fields. + * @see <a href="http://docs.couchdb.org/en/latest/api/server/authn.html + * #post--_session">docs for POST /_session</a> * @param {ajaxSettings} options * <a href="http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings"> * jQuery ajax settings</a> @@ -224,6 +225,8 @@ /** * Delete your current CouchDB user session + * @see <a href="http://docs.couchdb.org/en/latest/api/server/authn.html + * #delete--_session">docs for DELETE /_session</a> * @param {ajaxSettings} options * <a href="http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings"> * jQuery ajax settings</a> @@ -278,16 +281,15 @@ return true; } } - }; + } return /** @lends $.couch.db */{ name: name, uri: this.urlPrefix + "/" + encodeURIComponent(name) + "/", /** * Request compaction of the specified database. - * @see <a href="http://techzone.couchbase.com/sites/default/files/ - * uploads/all/documentation/couchbase-api-db.html#couchbase-api-db_ - * db-compact_post">docs for /db/_compact</a> + * @see <a href="http://docs.couchdb.org/en/latest/api/database + * /compact.html#db-compact">docs for /db/_compact</a> * @param {ajaxSettings} options * <a href="http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings"> * jQuery ajax settings</a> @@ -305,9 +307,8 @@ /** * Cleans up the cached view output on disk for a given view. - * @see <a href="http://techzone.couchbase.com/sites/default/files/ - * uploads/all/documentation/couchbase-api-db.html#couchbase-api-db - * _db-view-cleanup_post">docs for /db/_compact</a> + * @see <a href="http://docs.couchdb.org/en/latest/api/database + * /compact.html#db-view-cleanup">docs for /db/_view_cleanup</a> * @param {ajaxSettings} options <a href="http://api.jquery.com/ * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a> */ @@ -327,9 +328,9 @@ * document. You can use this in place of the full database compaction * if you know a specific set of view indexes have been affected by a * recent database change. - * @see <a href="http://techzone.couchbase.com/sites/default/files/upl - * oads/all/documentation/couchbase-api-db.html#couchbase-api-db_db- - * compact-design-doc_post">docs for /db/_compact/design-doc</a> + * @see <a href="http://docs.couchdb.org/en/latest/api/database + * /compact.html#db-compact-design-doc"> + * docs for /db/_compact/design-doc</a> * @param {String} groupname Name of design-doc to compact * @param {ajaxSettings} options <a href="http://api.jquery.com/ * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a> @@ -347,9 +348,8 @@ /** * Create a new database - * @see <a href="http://techzone.couchbase.com/sites/default/files/ - * uploads/all/documentation/couchbase-api-db.html#couchbase-api-db_ - * db_put">docs for PUT /db/</a> + * @see <a href="http://docs.couchdb.org/en/latest/api/database + * /common.html#put--db">docs for PUT /db/</a> * @param {ajaxSettings} options <a href="http://api.jquery.com/ * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a> */ @@ -367,9 +367,8 @@ /** * Deletes the specified database, and all the documents and * attachments contained within it. - * @see <a href="http://techzone.couchbase.com/sites/default/files/ - * uploads/all/documentation/couchbase-api-db.html#couchbase-api-db_ - * db_delete">docs for DELETE /db/</a> + * @see <a href="http://docs.couchdb.org/en/latest/api/database + * /common.html#delete--db">docs for DELETE /db/</a> * @param {ajaxSettings} options <a href="http://api.jquery.com/ * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a> */ @@ -383,9 +382,8 @@ /** * Gets information about the specified database. - * @see <a href="http://techzone.couchbase.com/sites/default/files/ - * uploads/all/documentation/couchbase-api-db.html#couchbase-api-db - * _db_get">docs for GET /db/</a> + * @see <a href="http://docs.couchdb.org/en/latest/api/database + * /common.html#get--db">docs for GET /db/</a> * @param {ajaxSettings} options <a href="http://api.jquery.com/ * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a> */ @@ -417,9 +415,8 @@ promise = /** @lends $.couch.db.changes */ { /** * Add a listener callback - * @see <a href="http://techzone.couchbase.com/sites/default/ - * files/uploads/all/documentation/couchbase-api-db.html#couch - * base-api-db_db-changes_get">docs for /db/_changes</a> + * @see <a href="http://docs.couchdb.org/en/latest/api/database + * /changes.html#db-changes">docs for /db/_changes</a> * @param {Function} fun Callback function to run when * notified of changes. */ @@ -438,7 +435,7 @@ $.each(listeners, function() { this(resp); }); - }; + } // when there is a change, call any listeners, then check for // another change options.success = function(resp) { @@ -447,7 +444,7 @@ since = resp.last_seq; triggerListeners(resp); getChangesSince(); - }; + } }; options.error = function() { if (active) { @@ -486,9 +483,8 @@ * fetch by passing the <code>keys</code> field in the * <code>options</code> * parameter. - * @see <a href="http://techzone.couchbase.com/sites/default/files/ - * uploads/all/documentation/couchbase-api-db.html#couchbase-api-db_ - * db-all-docs_get">docs for /db/all_docs/</a> + * @see <a href="http://docs.couchdb.org/en/latest/api/database + * /bulk-api.html#db-all-docs">docs for /db/all_docs/</a> * @param {ajaxSettings} options <a href="http://api.jquery.com/ * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a> */ @@ -560,9 +556,8 @@ /** * Returns the specified doc from the specified db. - * @see <a href="http://techzone.couchbase.com/sites/default/files/ - * uploads/all/documentation/couchbase-api-dbdoc.html#couchbase-api- - * dbdoc_db-doc_get">docs for GET /db/doc</a> + * @see <a href="http://docs.couchdb.org/en/latest/api/document + * /common.html#get--db-docid">docs for GET /db/doc</a> * @param {String} docId id of document to fetch * @param {ajaxSettings} options <a href="http://api.jquery.com/ * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a> @@ -605,9 +600,8 @@ * field, then the document will be created with the specified document * ID. If the _id field is not specified, a new unique ID will be * generated. - * @see <a href="http://techzone.couchbase.com/sites/default/files/ - * uploads/all/documentation/couchbase-api-dbdoc.html#couchbase-api- - * dbdoc_db_post">docs for GET /db/doc</a> + * @see <a href="http://docs.couchdb.org/en/latest/api/document + * /common.html#put--db-docid">docs for PUT /db/doc</a> * @param {String} doc document to save * @param {ajaxSettings} options <a href="http://api.jquery.com/ * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a> @@ -656,9 +650,8 @@ /** * Save a list of documents - * @see <a href="http://techzone.couchbase.com/sites/default/files/ - * uploads/all/documentation/couchbase-api-db.html#couchbase-api-db_ - * db-bulk-docs_post">docs for /db/_bulk_docs</a> + * @see <a href="http://docs.couchdb.org/en/latest/api/database + * /bulk-api.html#db-bulk-docs">docs for /db/_bulk_docs</a> * @param {Object[]} docs List of documents to save * @param {ajaxSettings} options <a href="http://api.jquery.com/ * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a> @@ -680,9 +673,8 @@ * Deletes the specified document from the database. You must supply * the current (latest) revision and <code>id</code> of the document * to delete eg <code>removeDoc({_id:"mydoc", _rev: "1-2345"})</code> - * @see <a href="http://techzone.couchbase.com/sites/default/files/ - * uploads/all/documentation/couchbase-api-dbdoc.html#couchbase-api - * -dbdoc_db-doc_delete">docs for DELETE /db/doc</a> + * @see <a href="http://docs.couchdb.org/en/latest/api/document + * /common.html#delete--db-docid">docs for DELETE /db/doc</a> * @param {Object} doc Document to delete * @param {ajaxSettings} options <a href="http://api.jquery.com/ * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a> @@ -701,9 +693,8 @@ /** * Remove a set of documents - * @see <a href="http://techzone.couchbase.com/sites/default/files/ - * uploads/all/documentation/couchbase-api-db.html#couchbase-api-db_ - * db-bulk-docs_post">docs for /db/_bulk_docs</a> + * @see <a href="http://docs.couchdb.org/en/latest/api/database + * /bulk-api.html#db-bulk-docs">docs for /db/_bulk_docs</a> * @param {String[]} docs List of document id's to remove * @param {ajaxSettings} options <a href="http://api.jquery.com/ * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a> @@ -728,13 +719,12 @@ /** * The COPY command (which is non-standard HTTP) copies an existing * document to a new or existing document. - * @see <a href="http://techzone.couchbase.com/sites/default/files/ - * uploads/all/documentation/couchbase-api-dbdoc.html#couchbase-api- - * dbdoc_db-doc_copy">docs for COPY /db/doc</a> + * @see <a href="http://docs.couchdb.org/en/latest/api/document + * /common.html#copy--db-docid">docs for COPY /db/doc</a> * @param {String[]} docId document id to copy * @param {ajaxSettings} options <a href="http://api.jquery.com/ * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a> - * @param {ajaxSettings} options <a href="http://api.jquery.com/ + * @param {ajaxSettings} ajaxOptions <a href="http://api.jquery.com/ * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a> */ copyDoc: function(docId, options, ajaxOptions) { @@ -763,12 +753,11 @@ /** * Creates (and executes) a temporary view based on the view function * supplied in the JSON request. - * @see <a href="http://techzone.couchbase.com/sites/default/files/ - * uploads/all/documentation/couchbase-api-db.html#couchbase-api-db - * _db-temp-view_post">docs for /db/_temp_view</a> + * @see <a href="http://docs.couchdb.org/en/latest/api/database + * /temp-views.html#db-temp-view">docs for /db/_temp_view</a> * @param {Function} mapFun Map function * @param {Function} reduceFun Reduce function - * @param {Function} language Language the map / reduce funs are + * @param {String} language Language the map / reduce funs are * implemented in * @param {ajaxSettings} options <a href="http://api.jquery.com/ * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a> @@ -798,16 +787,16 @@ /** * Fetch a _list view output, you can specify a list of - * <code>keys</code> in the options object to recieve only those keys. - * @see <a href="http://techzone.couchbase.com/sites/default/files/ - * uploads/all/documentation/couchbase-api-design.html#couchbase-api - * -design_db-design-designdoc-list-listname-viewname_get"> - * docs for /db/_design/design-doc/_list/l1/v1</a> + * <code>keys</code> in the options object to receive only those keys. + * @see <a href="http://docs.couchdb.org/en/latest/api/ddoc/render.html + * #db-design-design-doc-list-list-name-view-name"> + * docs for /db/_design/design-doc/_list/list/view</a> * @param {String} list Listname in the form of ddoc/listname * @param {String} view View to run list against - * @param {options} CouchDB <a href="http://wiki.apache.org/couchdb/ - * HTTP_view_API">View Options</a> - * @param {ajaxSettings} options <a href="http://api.jquery.com/ + * @param {Object} options CouchDB <a href="http://docs.couchdb.org/en + * /latest/api/ddoc/views.html#get--db-_design-ddoc-_view-view"> + * View Options</a> + * @param {ajaxSettings} ajaxOptions <a href="http://api.jquery.com/ * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a> */ list: function(list, view, options, ajaxOptions) { @@ -827,19 +816,18 @@ url: this.uri + '_design/' + list[0] + '/_list/' + list[1] + '/' + view + encodeOptions(options) }, - ajaxOptions, 'An error occured accessing the list' + ajaxOptions, 'An error occurred accessing the list' ); }, /** * Executes the specified view-name from the specified design-doc * design document, you can specify a list of <code>keys</code> - * in the options object to recieve only those keys. - * @see <a href="http://techzone.couchbase.com/sites/default/files/ - * uploads/all/documentation/couchbase-api-design.html#couchbase-api- - * design_db-design-designdoc-view-viewname_get">docs for /db/ - * _design/design-doc/_list/l1/v1</a> - * @param {String} name View to run list against (string should have + * in the options object to receive only those keys. + * @see <a href="http://docs.couchdb.org/en/latest/api/ddoc/views.html + * #db-design-design-doc-view-view-name">docs for /db/ + * _design/design-doc/_view/name</a> + * @param {String} name View to run list against (string should have * the design-doc name followed by a slash and the view name) * @param {ajaxSettings} options <a href="http://api.jquery.com/ * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a> @@ -867,9 +855,7 @@ /** * Fetch an arbitrary CouchDB database property - * @see <a href="http://techzone.couchbase.com/sites/default/files/ - * uploads/all/documentation/couchbase-api.html">docs for /db/_prop</a> - * @param {String} propName Propery name to fetch + * @param {String} propName Property name to fetch * @param {ajaxSettings} options <a href="http://api.jquery.com/ * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a> * @param {ajaxSettings} ajaxOptions <a href="http://api.jquery.com/ @@ -885,10 +871,8 @@ /** * Set an arbitrary CouchDB database property - * @see <a href="http://techzone.couchbase.com/sites/default/files/ - * uploads/all/documentation/couchbase-api.html">docs for /db/_prop</a> - * @param {String} propName Propery name to fetch - * @param {String} propValue Propery value to set + * @param {String} propName Property name to fetch + * @param {String} propValue Property value to set * @param {ajaxSettings} options <a href="http://api.jquery.com/ * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a> * @param {ajaxSettings} ajaxOptions <a href="http://api.jquery.com/ @@ -896,7 +880,7 @@ */ setDbProperty: function(propName, propValue, options, ajaxOptions) { ajax({ - type: "PUT", + type: "PUT", url: this.uri + propName + encodeOptions(options), data : JSON.stringify(propValue) }, @@ -908,15 +892,15 @@ }; }, - encodeDocId: encodeDocId, + encodeDocId: encodeDocId, /** * Accessing the root of a CouchDB instance returns meta information about * the instance. The response is a JSON structure containing information * about the server, including a welcome message and the version of the * server. - * @see <a href="http://techzone.couchbase.com/sites/default/files/uploads/ - * all/documentation/couchbase-api-misc.html#couchbase-api-misc_root_get"> + * @see <a href="http://docs.couchdb.org/en/latest/api/server/common.html + * #api-server-root"> * docs for GET /</a> * @param {ajaxSettings} options <a href="http://api.jquery.com/ * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a> @@ -931,9 +915,8 @@ /** * Request, configure, or stop, a replication operation. - * @see <a href="http://techzone.couchbase.com/sites/default/files/ - * uploads/all/documentation/couchbase-api-misc.html#couchbase-api- - * misc_replicate_post">docs for POST /_replicate</a> + * @see <a href="http://docs.couchdb.org/en/latest/api/server/common.html + * #replicate">docs for POST /_replicate</a> * @param {String} source Path or url to source database * @param {String} target Path or url to target database * @param {ajaxSettings} ajaxOptions <a href="http://api.jquery.com/ @@ -957,10 +940,9 @@ /** * Fetch a new UUID - * @see <a href="http://techzone.couchbase.com/sites/default/files/ - * uploads/all/documentation/couchbase-api-misc.html#couchbase-api- - * misc_uuids_get">docs for /_uuids</a> - * @param {Int} cacheNum Number of uuids to keep cached for future use + * @see <a href="http://docs.couchdb.org/en/latest/api/server/common.html + * #uuids">docs for /_uuids</a> + * @param {Integer} cacheNum Number of uuids to keep cached for future use */ newUUID: function(cacheNum) { if (cacheNum === undefined) { @@ -1045,7 +1027,7 @@ xhr.setRequestHeader("X-Couch-Full-Commit", commit.toString()); }; } - }; + } /** * @private
