close Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes between Version 3 and Version 4 of Divan


Ignore:
Timestamp:
Jul 8, 2008, 10:24:45 AM (13 years ago)
Author:
cmlenz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Divan

    v3 v4  
    4141}}}
    4242
     43==== `by_tag` ====
     44
     45{{{
     46#!javascript
     47function(doc) {
     48  if (doc.type == 'Post' && doc.tags) {
     49    for (var idx in doc.tags) {
     50      emit([doc.tags[idx], doc.published], {
     51        slug: doc.slug, title: doc.title, author: doc.author, published: doc.published, updated: doc.updated,
     52        summary: doc.summary, body: doc.body, tags: doc.tags, extended: doc.extended != '' ? '…' : null
     53      });
     54    }
     55  }
     56}
     57}}}
     58
    4359==== `by_time` ====
    4460{{{
     
    5773
    5874
    59 === `_design/comments` ===
     75=== `_design/pings` ===
    6076
    61 === `_design/pings` ===
     77==== `by_uri` ====
     78
     79{{{
     80#!javascript
     81function(doc) {
     82  if (doc.type == 'Ping') {
     83    emit([doc.post_id, doc.uri], null);
     84  }
     85}
     86}}}
    6287
    6388=== `_design/reactions` ===
    6489
     90==== `by_post` ====
    6591
     92{{{
     93#!javascript
     94function(doc) {
     95  if (doc.type == 'Ping' && doc.published) {
     96    emit([doc.post_id, doc.time], {
     97      type: doc.type, uri: doc.uri, title: doc.title,
     98      author: doc.author, excerpt: doc.excerpt,
     99      time: doc.time
     100    });
     101  } else if (doc.type == 'Comment' && doc.published) {
     102    emit([doc.post_id, doc.time], {
     103      type: doc.type, openid: doc.openid, author: doc.author,
     104      markup: doc.markup, time: doc.time
     105    });
     106  }
     107}
     108}}}
     109
     110==== `by_time` ====
     111
     112{{{
     113#!javascript
     114function(doc) {
     115  if (doc.type == 'Ping' && !doc.published) {
     116    emit([doc.time, doc.type], doc);
     117  } else if (doc.type == 'Comment' && doc.authenticated && !doc.published) {
     118    emit([doc.time, doc.type], doc);
     119  }
     120}
     121}}}
     122