From user-return-7882-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Sat Dec 05 01:20:44 2009 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 36977 invoked from network); 5 Dec 2009 01:20:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Dec 2009 01:20:44 -0000 Received: (qmail 23282 invoked by uid 500); 5 Dec 2009 01:20:42 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 23218 invoked by uid 500); 5 Dec 2009 01:20:41 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 23208 invoked by uid 99); 5 Dec 2009 01:20:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Dec 2009 01:20:41 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gurdiga@gmail.com designates 209.85.220.212 as permitted sender) Received: from [209.85.220.212] (HELO mail-fx0-f212.google.com) (209.85.220.212) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Dec 2009 01:20:30 +0000 Received: by fxm4 with SMTP id 4so3162490fxm.32 for ; Fri, 04 Dec 2009 17:20:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=7cZf6Jco8/spSnltAHZORHiroGkCedLin9YszF86juM=; b=PJWxP2Ldjrt+f3r2n2Uc0Clx5SU5K3JuvrG8JUggRXXvF/UOGi1dqkZZpXG2C6T7ou WbYDxGSEZZp7A+OQnOcJx/LwN6zxgPlfb86Ul/Hb0r3jA0APHeesGgYTSPRna3RIJJlp BAANH7YtvdCU76ClLEbMQ2V/jrDI0tXCypKVc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=Ny5PmJxDlkoBfuvoz7j7SZW+yS1emr4gAzaA+QOZybseE8dhGzo8sCwv55KXobJIAw AMv+Z74XFiVUwDphVYTZk9DlZ1Rd0dxUb2d4ow4IRDFFpDFrFPfMhFSg9g+HhMWAlcr/ Q+IJOLytkAwDWFD5HHmNZMx+Z5EzORKRMw0l4= MIME-Version: 1.0 Received: by 10.239.181.167 with SMTP id m39mr387749hbg.169.1259976010076; Fri, 04 Dec 2009 17:20:10 -0800 (PST) In-Reply-To: <4B1829E5.3080406@rogerbinns.com> References: <4B1829E5.3080406@rogerbinns.com> From: Vlad GURDIGA Date: Sat, 5 Dec 2009 03:19:50 +0200 Message-ID: Subject: Re: Javascript templating for shows/lists To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Did anyone try E4X? I'm not sure it counts here, but it is kinda working* for me so far... * http://github.com/gurdiga/cozy On Thu, Dec 3, 2009 at 11:13 PM, Roger Binns wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Can anyone recommend Javascript templating engines that can be used withi= n > the CouchDB server side for implementing shows and lists? =C2=A0The Sofa = weblog > app (also described in the book) uses a nice small one from John Resig. > > Book section: > =C2=A0http://books.couchdb.org/relax/design-documents/shows#Using%20Templ= ates > > Engine: > =C2=A0http://ejohn.org/blog/javascript-micro-templating > > I am looking for something a little more complex such as handling > conditionals and automatically HTML escaping all values unless told > otherwise for specific ones (ie make XSS harder to happen accidentally). > > I can find several engines that will only run in the browser, or depend o= n a > DOM being present, or load the templates from a URL, or require a complet= e > HTML document to be present in the template (lists build row by row). =C2= =A0These > are all deal breakers. Some are many kilobytes of code and require other > libraries such as jQuery. =C2=A0Will this much code be a problem for show= /list usage? > > My plan is for the output to be somewhat plain but functional - ie usable= on > a mobile phone. =C2=A0Then client side Javascript runs and adds functiona= lity, > increases information detail, improves formatting etc. =C2=A0An example o= f this > in sofa is that the CouchDB side formatting provides dates in output whic= h > client side Javascript then reformats and the client side also knows what > the local timezone is. =C2=A0Similarly client side javascript can add in = icons, > previews of next items, tooltips etc. =C2=A0This all points to a simpler = CouchDB > server side templating engine. > > I'll summarise responses in the wiki. > > Roger > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iEYEARECAAYFAksYKeIACgkQmOOfHg372QTh2ACeK4yirwjIqvlEaXx+ki6tegLM > /PcAn0SVnuFHFhkl0TWwUDYoWIXH6oAy > =3Djc5m > -----END PGP SIGNATURE----- >