First, thanks for making PURE available. The concept makes perfect sense.
I'm trying use PURE in a JQMobile app with multiple pages. Most pages are variations on a layout that can be described succinctly in JSON or YAML. (See the code comments below.) After getting familiar with simple examples, I took a stab at writing a template and data+directives for a portion of the real app. I'm using CoffeeScript to generate the JS and that's what I've included below for readability. There's a complete Gist with the HTML and JS concatenated at https://gist.github.com/Michael-F-Ellis/aecdf25694b9b2c3577240fb09f19274.
The problem is that PURE is throwing: "pure.js:84 Uncaught pure error: cannot have more than one loop on a target". Is that actually a limitation and, if so, how can I work around it?
Here's the CoffeeScript:
pagedata =
###
Pages have one or more blocks of readouts and setpoints
arranged side-by-side beneath the page title. From left to
right we suffix the block classes with "a b c ..." to match
the jQuery Mobile grid layout syntax.
###
pages: [
id: 'ah-cal', title: 'Air-Humidity Calibration',
blocks: [
'id' : 'air-cal', letter: 'a',
, 'id' : 'water-cal', letter: 'b'
]
, id: 'wx-cal', title: 'Water-Aux Calibration',
blocks: [
'id' : 'water-cal', letter: 'a',
, 'id' : 'aux-cal', letter: 'b'
]
]
pagedirective =
###
Expands page template. Applies ids and titles.
Expands blocks in each page applying id's and class.
###
"div[data-role='page']" :
'page<-pages' :
'@id' : 'page.id'
"div[data-role='content'] > h2" : 'page.title'
'blk<-page.blocks':
'div.block@id' : 'blk.id'
'div.block@class': 'ui-block-' + 'blk.letter'
$p('body').render pagedata, pagedirective
And here's the HTML
<!DOCTYPE html>
<html>
<head>
<title>PURE Test</title>
<script src="http://pure.github.io/pure/libs/pure.js"></script>
</head>
<body>
<!-- HTML template -->
<div data-role="page">
<div data-role="header"></div>
<div data-role="content">
<h2></h2>
<div class="ui-grid-a">
<div class="block">
<div class="ui-bar ui-bar-a" style="height: 100%;">
<form class="pgc-parms">
<div class='ui-field-contain'>
<label></label>
<input class="number pgc-parm"/>
</div>
</form>
</div>
</div>
</div>
</div>
<div data-role="footer"></div>
</div>
<script src="junk.js">
</script>
</body>
</html>
'ui-block-#{blk.letter}'
'ui-block-' + 'blk.letter'