Comparing version 0.5.4 to 0.5.5
{ | ||
"name": "temple", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"description": "A modern JavaScript view framework.", | ||
@@ -5,0 +5,0 @@ "repo": "BeneathTheInk/Temple", |
{ | ||
"name": "temple", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"description": "A modern JavaScript view framework.", | ||
@@ -5,0 +5,0 @@ "repository": "BeneathTheInk/Temple", |
@@ -9,3 +9,3 @@ var _ = require("underscore"), | ||
var Temple = module.exports = _.defaults({ | ||
VERSION: "0.5.4", | ||
VERSION: "0.5.5", | ||
NODE_TYPE: NODE_TYPE, | ||
@@ -63,2 +63,2 @@ | ||
Temple.View = require("./view"); | ||
Temple.Section = require("./section"); | ||
Temple.Section = require("./section"); |
@@ -32,3 +32,3 @@ module.exports = (function() { | ||
peg$startRuleIndices = { start: 0, attrValue: 10, attrArguments: 11, pathQuery: 21, path: 23 }, | ||
peg$startRuleIndices = { start: 0, attrValue: 9, attrArguments: 10, pathQuery: 19, path: 21 }, | ||
peg$startRuleIndex = 0, | ||
@@ -52,11 +52,9 @@ | ||
{ type: "literal", value: "<!--", description: "\"<!--\"" }, | ||
void 0, | ||
"-->", | ||
{ type: "literal", value: "-->", description: "\"-->\"" }, | ||
{ type: "any", description: "any character" }, | ||
function(v) { | ||
return { type: NODE_TYPE.XCOMMENT, value: v.trim() }; | ||
return { type: NODE_TYPE.XCOMMENT, value: v }; | ||
}, | ||
void 0, | ||
{ type: "any", description: "any character" }, | ||
null, | ||
function(l, r) { return l + (r != null ? r : ""); }, | ||
function(start, nodes, end) { | ||
@@ -91,2 +89,3 @@ if (start.name.toLowerCase() !== end.toLowerCase()) { | ||
function(tagname) { return tagname; }, | ||
null, | ||
"=", | ||
@@ -96,3 +95,3 @@ { type: "literal", value: "=", description: "\"=\"" }, | ||
value = value != null ? value[2] : ""; | ||
return { | ||
@@ -108,13 +107,8 @@ type: NODE_TYPE.ATTRIBUTE, | ||
{ type: "literal", value: ",", description: "\",\"" }, | ||
function(l, r) { return r != null && r[1] != null ? [l].concat(r[1]) : [l]; }, | ||
function(v) { return v; }, | ||
/^[^,]/, | ||
{ type: "class", value: "[^,]", description: "[^,]" }, | ||
function(l, r) { return [].concat(l, _.pluck(r, 1)); }, | ||
function(v) { return v.trim(); }, | ||
function(val) { | ||
if (_.isObject(val)) return val; | ||
else return { type: NODE_TYPE.LITERAL, value: val }; | ||
if (val != null && val.type) return val; | ||
return { type: NODE_TYPE.LITERAL, value: val }; | ||
}, | ||
/^[,]/, | ||
{ type: "class", value: "[,]", description: "[,]" }, | ||
function(start, nodes, end) { | ||
@@ -247,2 +241,3 @@ if (options.strict && !_.isEqual(start.value.raw, end)) { | ||
{ type: "class", value: "[ \\t\\n\\r]", description: "[ \\t\\n\\r]" }, | ||
{ type: "other", description: "guaranteed whitespace" }, | ||
"\\", | ||
@@ -255,39 +250,37 @@ { type: "literal", value: "\\", description: "\"\\\\\"" }, | ||
peg$decode("!7!+' 4!6 !! %"), | ||
peg$decode("! !7.*A \"74*; \"72*5 \"73*/ \"7#*) \"7%*# \"7\",G&7.*A \"74*; \"72*5 \"73*/ \"7#*) \"7%*# \"7\"\"+' 4!6\"!! %"), | ||
peg$decode("! !7,*A \"72*; \"70*5 \"71*/ \"7#*) \"7$*# \"7\",G&7,*A \"72*; \"70*5 \"71*/ \"7#*) \"7$*# \"7\"\"+' 4!6\"!! %"), | ||
peg$decode("! !0$\"\"1!3%+,$,)&0$\"\"1!3%\"\"\" #+' 4!6&!! %"), | ||
peg$decode("!.'\"\"2'3(+B$7$+8%.)\"\"2)3*+(%4#6+#!!%$## #$\"# #\"# #"), | ||
peg$decode("!8.)\"\"2)3*9+$$\"# ,\"\" #*I \"!-\"\"1!3-+9$7$*# \" .+)%4\"6/\"\"! %$\"# #\"# #"), | ||
peg$decode("7&*I \"!7'+>$7!+4%7(+*%4#60##\"! %$## #$\"# #\"# #"), | ||
peg$decode("!.1\"\"2132+U$7C+K% !7),#&7)\"+9%.3\"\"2334+)%4$65$\"\"!%$$# #$## #$\"# #\"# #"), | ||
peg$decode("!.1\"\"2132+U$7C+K% !7),#&7)\"+9%.6\"\"2637+)%4$68$\"\"!%$$# #$## #$\"# #\"# #"), | ||
peg$decode("!.9\"\"293:+B$7C+8%.6\"\"2637+(%4#6;#!!%$## #$\"# #\"# #"), | ||
peg$decode("!7C+h$!.<\"\"2<3=+A$7D+7%7@+-%7D+#%'$%$$# #$## #$\"# #\"# #*# \" .+)%4\"6>\"\"! %$\"# #\"# #"), | ||
peg$decode("! !7.*5 \"74*/ \"72*) \"73*# \"7\",;&7.*5 \"74*/ \"72*) \"73*# \"7\"\"+' 4!6\"!! %"), | ||
peg$decode("!7,+T$!.?\"\"2?3@+-$7++#%'\"%$\"# #\"# #*# \" .+)%4\"6A\"\"! %$\"# #\"# #"), | ||
peg$decode("!!7D+F$71+<%7D+2%7-+(%4$6B$!\"%$$# #$## #$\"# #\"# #*\u014D \"!7D+F$7?+<%7D+2%7-+(%4$6B$!\"%$$# #$## #$\"# #\"# #*\u0119 \"!7D+F$7<+<%7D+2%7-+(%4$6B$!\"%$$# #$## #$\"# #\"# #*\xE5 \"!7D+F$7=+<%7D+2%7-+(%4$6B$!\"%$$# #$## #$\"# #\"# #*\xB1 \"!7D+F$7A+<%7D+2%7-+(%4$6B$!\"%$$# #$## #$\"# #\"# #*} \"!7D+F$7B+<%7D+2%7-+(%4$6B$!\"%$$# #$## #$\"# #\"# #*I \"!! !0C\"\"1!3D,)&0C\"\"1!3D\"+! (%+' 4!6E!! %+' 4!6F!! %"), | ||
peg$decode("!80G\"\"1!3H*6 \"!8-\"\"1!3-9*$$\"\" ,\"# #9+$$\"# ,\"\" #"), | ||
peg$decode("!7/+>$7!+4%70+*%4#6I##\"! %$## #$\"# #\"# #"), | ||
peg$decode("!.J\"\"2J3K+S$0L\"\"1!3M+C%76+9%.N\"\"2N3O+)%4$6P$\"\"!%$$# #$## #$\"# #\"# #"), | ||
peg$decode("!.Q\"\"2Q3R+b$ !7E*) \"0S\"\"1!3T,/&7E*) \"0S\"\"1!3T\"+8%.N\"\"2N3O+(%4#6U#!!%$## #$\"# #\"# #"), | ||
peg$decode("!!.V\"\"2V3W+=$75+3%.X\"\"2X3Y+#%'#%$## #$\"# #\"# #*N \"!.J\"\"2J3K+=$75+3%.N\"\"2N3O+#%'#%$## #$\"# #\"# #+' 4!6Z!! %"), | ||
peg$decode("!.J\"\"2J3K+w$!80[\"\"1!3\\9*$$\"\" ,\"# #+Y%.]\"\"2]3^*# \" .+C%75+9%.N\"\"2N3O+)%4%6_%\"\"!%$%# #$$# #$## #$\"# #\"# #"), | ||
peg$decode("!.V\"\"2V3W+B$75+8%.X\"\"2X3Y+(%4#6`#!!%$## #$\"# #\"# #"), | ||
peg$decode("!.J\"\"2J3K+s$0a\"\"1!3b+c% !7E*) \"0S\"\"1!3T,/&7E*) \"0S\"\"1!3T\"+9%.N\"\"2N3O+)%4$6c$\"\"!%$$# #$## #$\"# #\"# #"), | ||
peg$decode("!77+T$!.d\"\"2d3e+-$75+#%'\"%$\"# #\"# #*# \" .+)%4\"6A\"\"! %$\"# #\"# #"), | ||
peg$decode("!75+' 4!6f!! %"), | ||
peg$decode("!7D+M$78*# \" .+=%79+3%7D+)%4$6g$\"\"!%$$# #$## #$\"# #\"# #*G \"!7D+<$78+2%7D+(%4#6h#!!%$## #$\"# #\"# #"), | ||
peg$decode("! !.i\"\"2i3j+,$,)&.i\"\"2i3j\"\"\" #+' 4!6k!! %*b \"!.l\"\"2l3m+& 4!6n! %*K \"!.o\"\"2o3p+& 4!6n! %*4 \"!.q\"\"2q3r+& 4!6s! %"), | ||
peg$decode("!7:+T$!.o\"\"2o3p+-$79+#%'\"%$\"# #\"# #*# \" .+)%4\"6A\"\"! %$\"# #\"# #"), | ||
peg$decode("!!!0t\"\"1!3u+A$ !0v\"\"1!3w,)&0v\"\"1!3w\"+#%'\"%$\"# #\"# #+! (%+;$ !7;,#&7;\"+)%4\"6x\"\"! %$\"# #\"# #"), | ||
peg$decode("!.y\"\"2y3z+b$7D+X%7>*) \"7?*# \"77+B%7D+8%.{\"\"2{3|+(%4%6}%!\"%$%# #$$# #$## #$\"# #\"# #"), | ||
peg$decode("!.~\"\"2~3+& 4!6\x80! %*4 \"!.\x81\"\"2\x813\x82+& 4!6\x83! %"), | ||
peg$decode("!.\x84\"\"2\x843\x85*# \" .+\x92$ !0\x86\"\"1!3\x87+,$,)&0\x86\"\"1!3\x87\"\"\" #+m%!.o\"\"2o3p+H$ !0\x86\"\"1!3\x87+,$,)&0\x86\"\"1!3\x87\"\"\" #+#%'\"%$\"# #\"# #*# \" .+'%4#6\x88# %$## #$\"# #\"# #"), | ||
peg$decode("! !0\x86\"\"1!3\x87+,$,)&0\x86\"\"1!3\x87\"\"\" #+& 4!6\x89! %"), | ||
peg$decode("!.\x8A\"\"2\x8A3\x8B+b$ !7E*) \"0\x8C\"\"1!3\x8D,/&7E*) \"0\x8C\"\"1!3\x8D\"+8%.\x8A\"\"2\x8A3\x8B+(%4#6\x8E#!!%$## #$\"# #\"# #*s \"!.\x8F\"\"2\x8F3\x90+b$ !7E*) \"0\x91\"\"1!3\x92,/&7E*) \"0\x91\"\"1!3\x92\"+8%.\x8F\"\"2\x8F3\x90+(%4#6\x8E#!!%$## #$\"# #\"# #"), | ||
peg$decode("!.\x8A\"\"2\x8A3\x8B+\\$! !0\x8C\"\"1!3\x8D,)&0\x8C\"\"1!3\x8D\"+! (%+8%.\x8A\"\"2\x8A3\x8B+(%4#6B#!!%$## #$\"# #\"# #*m \"!.\x8F\"\"2\x8F3\x90+\\$! !0\x91\"\"1!3\x92,)&0\x91\"\"1!3\x92\"+! (%+8%.\x8F\"\"2\x8F3\x90+(%4#6B#!!%$## #$\"# #\"# #"), | ||
peg$decode("!.\x93\"\"2\x933\x94+& 4!6\x95! %"), | ||
peg$decode("!.\x96\"\"2\x963\x97*q \"!.\x98\"\"2\x983\x99+`$7D+V%!8 !0\x9A\"\"1!3\x9B+,$,)&0\x9A\"\"1!3\x9B\"\"\" #9*$$\"\" ,\"# #+#%'#%$## #$\"# #\"# #+& 4!6\x9C! %"), | ||
peg$decode("!7D+]$! !0\x9D\"\"1!3\x9E+,$,)&0\x9D\"\"1!3\x9E\"\"\" #+! (%+2%7D+(%4#6\x9F#!!%$## #$\"# #\"# #"), | ||
peg$decode("8! !0\xA1\"\"1!3\xA2,)&0\xA1\"\"1!3\xA2\"+! (%9*\" 3\xA0"), | ||
peg$decode("!.\xA3\"\"2\xA33\xA4+7$-\"\"1!3-+(%4\"6\xA5\"! %$\"# #\"# #") | ||
peg$decode("!.'\"\"2'3(+\xAC$! !!!8.*\"\"2*3+9*$$\"\" )\"# #+2$-\"\"1!3,+#%'\"%$\"# #\"# #,Q&!!8.*\"\"2*3+9*$$\"\" )\"# #+2$-\"\"1!3,+#%'\"%$\"# #\"# #\"+! (%+8%.*\"\"2*3++(%4#6-#!!%$## #$\"# #\"# #"), | ||
peg$decode("7%*I \"!7&+>$7!+4%7'+*%4#6.##\"! %$## #$\"# #\"# #"), | ||
peg$decode("!./\"\"2/30+U$7@+K% !7(,#&7(\"+9%.1\"\"2132+)%4$63$\"\"!%$$# #$## #$\"# #\"# #"), | ||
peg$decode("!./\"\"2/30+U$7@+K% !7(,#&7(\"+9%.4\"\"2435+)%4$66$\"\"!%$$# #$## #$\"# #\"# #"), | ||
peg$decode("!.7\"\"2738+B$7@+8%.4\"\"2435+(%4#69#!!%$## #$\"# #\"# #"), | ||
peg$decode("!7@+h$!.;\"\"2;3<+A$7A+7%7=+-%7A+#%'$%$$# #$## #$\"# #\"# #*# \" :+)%4\"6=\"\"! %$\"# #\"# #"), | ||
peg$decode("! !7,*5 \"72*/ \"70*) \"71*# \"7\",;&7,*5 \"72*/ \"70*) \"71*# \"7\"\"+' 4!6\"!! %"), | ||
peg$decode("!7++q$ !!.>\"\"2>3?+-$7++#%'\"%$\"# #\"# #,>&!.>\"\"2>3?+-$7++#%'\"%$\"# #\"# #\"+)%4\"6@\"\"! %$\"# #\"# #"), | ||
peg$decode("!7A+\xD6$7/*\xB7 \"7=*\xB1 \"7:*\xAB \"7;*\xA5 \"7>*\x9F \"7?*\x99 \"!! !!!8.>\"\"2>3?9*$$\"\" )\"# #+2$-\"\"1!3,+#%'\"%$\"# #\"# #,Q&!!8.>\"\"2>3?9*$$\"\" )\"# #+2$-\"\"1!3,+#%'\"%$\"# #\"# #\"+! (%+' 4!6A!! %+2%7A+(%4#6B#!!%$## #$\"# #\"# #"), | ||
peg$decode("!7-+>$7!+4%7.+*%4#6C##\"! %$## #$\"# #\"# #"), | ||
peg$decode("!.D\"\"2D3E+S$0F\"\"1!3G+C%74+9%.H\"\"2H3I+)%4$6J$\"\"!%$$# #$## #$\"# #\"# #"), | ||
peg$decode("!.K\"\"2K3L+b$ !7C*) \"0M\"\"1!3N,/&7C*) \"0M\"\"1!3N\"+8%.H\"\"2H3I+(%4#6O#!!%$## #$\"# #\"# #"), | ||
peg$decode("!!.P\"\"2P3Q+=$73+3%.R\"\"2R3S+#%'#%$## #$\"# #\"# #*N \"!.D\"\"2D3E+=$73+3%.H\"\"2H3I+#%'#%$## #$\"# #\"# #+' 4!6T!! %"), | ||
peg$decode("!.D\"\"2D3E+w$!80U\"\"1!3V9*$$\"\" )\"# #+Y%.W\"\"2W3X*# \" :+C%73+9%.H\"\"2H3I+)%4%6Y%\"\"!%$%# #$$# #$## #$\"# #\"# #"), | ||
peg$decode("!.P\"\"2P3Q+B$73+8%.R\"\"2R3S+(%4#6Z#!!%$## #$\"# #\"# #"), | ||
peg$decode("!.D\"\"2D3E+s$0[\"\"1!3\\+c% !7C*) \"0M\"\"1!3N,/&7C*) \"0M\"\"1!3N\"+9%.H\"\"2H3I+)%4$6]$\"\"!%$$# #$## #$\"# #\"# #"), | ||
peg$decode("!75+q$ !!.^\"\"2^3_+-$75+#%'\"%$\"# #\"# #,>&!.^\"\"2^3_+-$75+#%'\"%$\"# #\"# #\"+)%4\"6@\"\"! %$\"# #\"# #"), | ||
peg$decode("!73+' 4!6`!! %"), | ||
peg$decode("!7A+M$76*# \" :+=%77+3%7A+)%4$6a$\"\"!%$$# #$## #$\"# #\"# #*G \"!7A+<$76+2%7A+(%4#6b#!!%$## #$\"# #\"# #"), | ||
peg$decode("! !.c\"\"2c3d+,$,)&.c\"\"2c3d\"\"\" #+' 4!6e!! %*b \"!.f\"\"2f3g+& 4!6h! %*K \"!.i\"\"2i3j+& 4!6h! %*4 \"!.k\"\"2k3l+& 4!6m! %"), | ||
peg$decode("!78+q$ !!.i\"\"2i3j+-$78+#%'\"%$\"# #\"# #,>&!.i\"\"2i3j+-$78+#%'\"%$\"# #\"# #\"+)%4\"6@\"\"! %$\"# #\"# #"), | ||
peg$decode("!!!0n\"\"1!3o+A$ !0p\"\"1!3q,)&0p\"\"1!3q\"+#%'\"%$\"# #\"# #+! (%+;$ !79,#&79\"+)%4\"6r\"\"! %$\"# #\"# #"), | ||
peg$decode("!.s\"\"2s3t+b$7A+X%7<*) \"7=*# \"75+B%7A+8%.u\"\"2u3v+(%4%6w%!\"%$%# #$$# #$## #$\"# #\"# #"), | ||
peg$decode("!.x\"\"2x3y+& 4!6z! %*4 \"!.{\"\"2{3|+& 4!6}! %"), | ||
peg$decode("!.~\"\"2~3*# \" :+\x92$ !0\x80\"\"1!3\x81+,$,)&0\x80\"\"1!3\x81\"\"\" #+m%!.i\"\"2i3j+H$ !0\x80\"\"1!3\x81+,$,)&0\x80\"\"1!3\x81\"\"\" #+#%'\"%$\"# #\"# #*# \" :+'%4#6\x82# %$## #$\"# #\"# #"), | ||
peg$decode("! !0\x80\"\"1!3\x81+,$,)&0\x80\"\"1!3\x81\"\"\" #+& 4!6\x83! %"), | ||
peg$decode("!.\x84\"\"2\x843\x85+b$ !7C*) \"0\x86\"\"1!3\x87,/&7C*) \"0\x86\"\"1!3\x87\"+8%.\x84\"\"2\x843\x85+(%4#6\x88#!!%$## #$\"# #\"# #*s \"!.\x89\"\"2\x893\x8A+b$ !7C*) \"0\x8B\"\"1!3\x8C,/&7C*) \"0\x8B\"\"1!3\x8C\"+8%.\x89\"\"2\x893\x8A+(%4#6\x88#!!%$## #$\"# #\"# #"), | ||
peg$decode("!.\x8D\"\"2\x8D3\x8E+& 4!6\x8F! %"), | ||
peg$decode("!.\x90\"\"2\x903\x91*\xB3 \"!.\x92\"\"2\x923\x93+\xA2$7B+\x98% !!!80\x94\"\"1!3\x959*$$\"\" )\"# #+2$-\"\"1!3,+#%'\"%$\"# #\"# #+T$,Q&!!80\x94\"\"1!3\x959*$$\"\" )\"# #+2$-\"\"1!3,+#%'\"%$\"# #\"# #\"\"\" #+#%'#%$## #$\"# #\"# #+& 4!6\x96! %"), | ||
peg$decode("!7A+]$! !0\x97\"\"1!3\x98+,$,)&0\x97\"\"1!3\x98\"\"\" #+! (%+2%7A+(%4#6\x99#!!%$## #$\"# #\"# #"), | ||
peg$decode("8! !0\x9B\"\"1!3\x9C,)&0\x9B\"\"1!3\x9C\"+! (%9*\" 3\x9A"), | ||
peg$decode("8! !0\x9B\"\"1!3\x9C+,$,)&0\x9B\"\"1!3\x9C\"\"\" #+! (%9*\" 3\x9D"), | ||
peg$decode("!.\x9E\"\"2\x9E3\x9F+7$-\"\"1!3,+(%4\"6\xA0\"! %$\"# #\"# #") | ||
], | ||
@@ -294,0 +287,0 @@ |
@@ -69,3 +69,3 @@ var Trackr = require("trackr"), | ||
var model = this; | ||
while (index && model) { | ||
@@ -75,3 +75,3 @@ model = model.parent; | ||
} | ||
return model; | ||
@@ -182,5 +182,12 @@ }, | ||
proxies.push.apply(proxies, Model._defaultProxies); | ||
return proxies; | ||
}, | ||
hasProxy: function(proxy, proxies) { | ||
if (proxies == null) proxies = this.getAllProxies(); | ||
return _.contains(proxies, proxy); | ||
}, | ||
registerProxy: function(proxy) { | ||
@@ -190,30 +197,14 @@ if (typeof proxy !== "object" || proxy == null) throw new Error("Expecting object for proxy."); | ||
if (typeof proxy.get !== "function") throw new Error("Layer missing required get method."); | ||
this.proxies.unshift(proxy); | ||
if (!this.hasProxy(proxy)) this.proxies.unshift(proxy); | ||
return this; | ||
}, | ||
getProxyByValue: function(target) { | ||
var proxy; | ||
// look locally first | ||
proxy = _.find(this.proxies, function(p) { | ||
return p.match(target); | ||
getProxyByValue: function(target, proxies) { | ||
if (proxies == null) proxies = this.getAllProxies(); | ||
return _.find(proxies, function(proxy) { | ||
return proxy.match(target); | ||
}); | ||
// then recursively check the parents | ||
if (proxy == null && this.parent != null) { | ||
proxy = this.parent.getProxyByValue(target); | ||
} | ||
// otherwise look through the defaults | ||
if (proxy == null) { | ||
proxy = _.find(Model._defaultProxies, function(p) { | ||
return p.match(target); | ||
}); | ||
} | ||
return proxy; | ||
}, | ||
// defines a symbolic property on an object that points to the data | ||
// defines a reactive property on an object that points to the data | ||
defineDataLink: function(obj, prop, options) { | ||
@@ -220,0 +211,0 @@ var model = this; |
{ | ||
"name": "templejs", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"description": "A reactive Mustache view framework.", | ||
@@ -5,0 +5,0 @@ "author": "Beneath the Ink <info@beneaththeink.com>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
99240
2835