couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Landolt <d...@deanlandolt.com>
Subject Re: Adding functions to the JavaScript global object for use in views
Date Sat, 10 Jan 2009 20:18:05 GMT
On Sat, Jan 10, 2009 at 1:15 PM, Chris Anderson <jchris@gmail.com> wrote:

> On Fri, Jan 9, 2009 at 2:03 PM, Dave <dave@myheartisagapinghole.com>
> wrote:
> > Hi,
> >
> > I was wondering if there was a standard way to add helper functions or
> > augment the built-in data types (Array, Date, etc.) in the JavaScript
> > global object used by couch db for map/reduce functions. My motivation
> > here is to add some code for parsing ISO8601 date strings into
> > JavaScript Date objects for the purpose of view collation in multiple
> > views.
> >
>
> The preferred way to do this is to add the library code itself to your
> function. I use a script designed to push filesystem contents to
> design documents. It has an ability to inline additional JavaScript
> into your functions.
>
> I'm in the middle of extracting it to its own project, so the install
> will be getting easier, but the Ruby code is available here:
>
> http://github.com/jchris/couchapp/tree/master
>
> --
> Chris Anderson
> http://jchris.mfdz.com
>

is this related to the !json and !code macros I've seen in the sofa code? Is
what executes these macros buried in couch trunk or is it something else?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message