summaryrefslogtreecommitdiff
path: root/share/server/render.js
AgeCommit message (Collapse)Author
2011-04-17Make this reference ddoc in provides() functionsJan Lehnardt
In show and list functions in the Javascript query server, the this member is a reference to the design doc object. The same should be true in the functions registered by Mime.provides(), for consistency. Closes COUCHDB-959 Patch by Tim Smith. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1094140 13f79535-47bb-0310-9956-ffa450edef68
2010-02-25commonjs require for show list etc via Mikeal Rogers. closes COUCHDB-658John Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@916076 13f79535-47bb-0310-9956-ffa450edef68
2010-02-05add list()-API cmompatible API to _show. Symmetry FTW.Jan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@906755 13f79535-47bb-0310-9956-ffa450edef68
2010-02-04re-enable 404 handling in show functions while retaining user-friendly error ↵Jan Lehnardt
behaviour git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@906721 13f79535-47bb-0310-9956-ffa450edef68
2009-12-23Follow RFC 2616 closer and use "verb" instead of "method"Jan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@893364 13f79535-47bb-0310-9956-ffa450edef68
2009-12-22move query server to a design-doc based protocol, closes COUCHDB-589John Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@893249 13f79535-47bb-0310-9956-ffa450edef68
2009-12-06fix COUCHDB-593, thanks Roger Binns for reportingJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@887791 13f79535-47bb-0310-9956-ffa450edef68
2009-08-11Initial commit of _update handler. Thanks to Paul Davis, Jason Davies for ↵John Christopher Anderson
code and others for discussion. The _update handler accepts POSTs to paths like: /db/_design/foo/_update/bar and PUTs which include docids, like: /db/_design/foo/_update/bar/docid The function signature: function(doc, req) { doc.a_new_field = req.query.something; return [doc, "<h1>added something to your doc</h1>"]; } The tests in update_documents.js are fairly complete and include examples of bumping a counter, changing only a single field, parsing from (and returning) XML, and creating new documents. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@803245 13f79535-47bb-0310-9956-ffa450edef68
2009-08-05proper handling of 406 Not Acceptable errors in list and show functionsJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@801345 13f79535-47bb-0310-9956-ffa450edef68
2009-08-05Upgraded JavaScript Accept header handling to make it useful.John Christopher Anderson
After user@ thread with Adam Jacob [1] http://tinyurl.com/kuhl2j I realized that giving users the option to set a server preference of mime-types was crucial. Without ordering, you see nasty side effects like a browser getting an Atom feed by default. With ordering, you can ensure that browsers get HTML, API clients see XML, and Ajax apps use JSON in a no-hassle way. Example new API: function(doc, req) { provides("html", function() { return "Hello " + doc.name + "."; }); provides("xml", function() { var xml = new XML('<xml></xml>'); xml.hello = doc.name; return xml; } }; If a client sends an Accept header like "application/xml, text/html" this will return html. If the client sends just "application/xml" they will get xml. respondsWith() has been removed. I don't think it's worth the cost to maintain a parallel implementation just to be deprecated as buggy. This patch also continues us on the path to a cleaner, more organized query server. Cheers and enjoy. [1] http://mail-archives.apache.org/mod_mbox/couchdb-user/200907.mbox/%3cb8602b350907241906l7c7f97fdg9d78facacd8605fd@mail.gmail.com%3e git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@801056 13f79535-47bb-0310-9956-ffa450edef68
2009-08-04Move mimeparse.js to it's own file, add to NOTICE as an external library.John Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@801018 13f79535-47bb-0310-9956-ffa450edef68
2009-07-14wheeeeeeeeNoah Slater
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@794057 13f79535-47bb-0310-9956-ffa450edef68
2009-07-06trimmed trailing whitespaceNoah Slater
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@791350 13f79535-47bb-0310-9956-ffa450edef68
2009-07-04send utf-8 hearders with list and show responses. closes COUCHDB-392John Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@791145 13f79535-47bb-0310-9956-ffa450edef68
2009-06-14merge list-iterator branch to trunk. changes JavaScript _list APIJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@784601 13f79535-47bb-0310-9956-ffa450edef68
2009-04-18move main.js generation to MakefileJan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@766406 13f79535-47bb-0310-9956-ffa450edef68
2009-04-18refactor main.js into many files and improve show/list error handlingJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@766383 13f79535-47bb-0310-9956-ffa450edef68