Updating js plugins
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
({
|
||||
message: 'Some <code>'
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{{&message}}
|
||||
@@ -0,0 +1 @@
|
||||
Some <code>
|
||||
@@ -0,0 +1,4 @@
|
||||
({
|
||||
'apos': "'",
|
||||
'control': 'X'
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{{apos}}{{control}}
|
||||
@@ -0,0 +1 @@
|
||||
'X
|
||||
@@ -0,0 +1,3 @@
|
||||
({
|
||||
array_of_strings: ['hello', 'world']
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{{#array_of_strings}}{{.}} {{/array_of_strings}}
|
||||
@@ -0,0 +1 @@
|
||||
hello world
|
||||
@@ -0,0 +1,4 @@
|
||||
({
|
||||
valueOf: 'Avoids methods',
|
||||
watch: 'in Object.prototype'
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{{valueOf}} {{watch}}
|
||||
@@ -0,0 +1 @@
|
||||
Avoids methods in Object.prototype
|
||||
@@ -0,0 +1,3 @@
|
||||
({
|
||||
value: '\\abc'
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
* {{value}}
|
||||
* {{{value}}}
|
||||
* {{&value}}
|
||||
<script>
|
||||
foo = { bar: 'abc\"xyz\"' };
|
||||
foo = { bar: 'x\'y' };
|
||||
</script>
|
||||
@@ -0,0 +1,7 @@
|
||||
* \abc
|
||||
* \abc
|
||||
* \abc
|
||||
<script>
|
||||
foo = { bar: 'abc\"xyz\"' };
|
||||
foo = { bar: 'x\'y' };
|
||||
</script>
|
||||
@@ -0,0 +1,3 @@
|
||||
({
|
||||
tag: 'yo'
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{{tag}} foo
|
||||
@@ -0,0 +1 @@
|
||||
yo foo
|
||||
@@ -0,0 +1,3 @@
|
||||
({
|
||||
length: 'hello'
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{{#length}}The length variable is: {{length}}{{/length}}
|
||||
@@ -0,0 +1 @@
|
||||
The length variable is: hello
|
||||
@@ -0,0 +1,4 @@
|
||||
({
|
||||
'foo': 'foooooooooooooo',
|
||||
'bar': '<b>bar!</b>'
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{{=<% %>=}}<% foo %> {{foo}} <%{bar}%> {{{bar}}}
|
||||
@@ -0,0 +1 @@
|
||||
foooooooooooooo {{foo}} <b>bar!</b> {{{bar}}}
|
||||
@@ -0,0 +1,7 @@
|
||||
({
|
||||
number: function (text, render) {
|
||||
return function (text, render) {
|
||||
return +render(text);
|
||||
};
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
<p>{{#number}}0{{/number}}</p>
|
||||
@@ -0,0 +1 @@
|
||||
<p>0</p>
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
name: 'LeBron'
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
name: 'LeBron'
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"name": "LeBron"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Howdy {{name}}, CLI rox
|
||||
@@ -0,0 +1 @@
|
||||
Howdy LeBron, CLI rox
|
||||
@@ -0,0 +1,8 @@
|
||||
module.exports = {
|
||||
'name': 'Tater',
|
||||
'bold': function () {
|
||||
return function (text, render) {
|
||||
return '<b>' + render(text) + '</b>';
|
||||
};
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{{#bold}}Hi {{name}}.{{/bold}}
|
||||
@@ -0,0 +1 @@
|
||||
<b>Hi Tater.</b>
|
||||
@@ -0,0 +1,14 @@
|
||||
{ "users": [
|
||||
{
|
||||
"name": "LeBron"
|
||||
},
|
||||
{
|
||||
"name": "LeBron 2"
|
||||
}
|
||||
],
|
||||
"comments": [
|
||||
{
|
||||
"title": "A Comedy of Errors"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{{#users}}
|
||||
{{>cli}}
|
||||
{{/users}}
|
||||
|
||||
{{#comments}}
|
||||
{{>comments}}
|
||||
{{/comments}}
|
||||
@@ -0,0 +1,2 @@
|
||||
Howdy LeBron, CLI roxHowdy LeBron 2, CLI rox
|
||||
<h1>A Comedy of Errors</h1>
|
||||
@@ -0,0 +1,5 @@
|
||||
({
|
||||
title: function () {
|
||||
return 'A Comedy of Errors';
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
<h1>{{title}}{{! just something interesting... or not... }}</h1>
|
||||
@@ -0,0 +1 @@
|
||||
<h1>A Comedy of Errors</h1>
|
||||
@@ -0,0 +1,19 @@
|
||||
({
|
||||
header: function () {
|
||||
return 'Colors';
|
||||
},
|
||||
item: [
|
||||
{name: 'red', current: true, url: '#Red'},
|
||||
{name: 'green', current: false, url: '#Green'},
|
||||
{name: 'blue', current: false, url: '#Blue'}
|
||||
],
|
||||
link: function () {
|
||||
return this['current'] !== true;
|
||||
},
|
||||
list: function () {
|
||||
return this.item.length !== 0;
|
||||
},
|
||||
empty: function () {
|
||||
return this.item.length === 0;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,16 @@
|
||||
<h1>{{header}}</h1>
|
||||
{{#list}}
|
||||
<ul>
|
||||
{{#item}}
|
||||
{{#current}}
|
||||
<li><strong>{{name}}</strong></li>
|
||||
{{/current}}
|
||||
{{#link}}
|
||||
<li><a href="{{url}}">{{name}}</a></li>
|
||||
{{/link}}
|
||||
{{/item}}
|
||||
</ul>
|
||||
{{/list}}
|
||||
{{#empty}}
|
||||
<p>The list is empty.</p>
|
||||
{{/empty}}
|
||||
@@ -0,0 +1,6 @@
|
||||
<h1>Colors</h1>
|
||||
<ul>
|
||||
<li><strong>red</strong></li>
|
||||
<li><a href="#Green">green</a></li>
|
||||
<li><a href="#Blue">blue</a></li>
|
||||
</ul>
|
||||
@@ -0,0 +1,8 @@
|
||||
({
|
||||
'outer': {
|
||||
'id': 1,
|
||||
'second': {
|
||||
'nothing': 2
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{{#outer}}{{#second}}{{id}}{{/second}}{{/outer}}
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1,6 @@
|
||||
({
|
||||
first: 'It worked the first time.',
|
||||
second: 'And it worked the second time.',
|
||||
third: 'Then, surprisingly, it worked the third time.',
|
||||
fourth: 'Fourth time also fine!.'
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
{{=<% %>=}}*
|
||||
<% first %>
|
||||
* <% second %>
|
||||
<%=| |=%>
|
||||
* | third |
|
||||
|={{ }}=|
|
||||
* {{ fourth }}
|
||||
@@ -0,0 +1,5 @@
|
||||
*
|
||||
It worked the first time.
|
||||
* And it worked the second time.
|
||||
* Then, surprisingly, it worked the third time.
|
||||
* Fourth time also fine!.
|
||||
@@ -0,0 +1,4 @@
|
||||
({
|
||||
bedrooms: true,
|
||||
total: 1
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{{#bedrooms}}{{total}}{{/bedrooms}} BED
|
||||
@@ -0,0 +1 @@
|
||||
1 BED
|
||||
@@ -0,0 +1,24 @@
|
||||
({
|
||||
name: 'A Book',
|
||||
authors: ['John Power', 'Jamie Walsh'],
|
||||
price: {
|
||||
value: 200,
|
||||
vat: function () {
|
||||
return this.value * 0.2;
|
||||
},
|
||||
currency: {
|
||||
symbol: '$',
|
||||
name: 'USD'
|
||||
}
|
||||
},
|
||||
availability: {
|
||||
status: true,
|
||||
text: 'In Stock'
|
||||
},
|
||||
// And now, some truthy false values
|
||||
truthy: {
|
||||
zero: 0,
|
||||
notTrue: false
|
||||
},
|
||||
singletonList: [{singletonItem: 'singleton item'}]
|
||||
});
|
||||
@@ -0,0 +1,12 @@
|
||||
<!-- exciting part -->
|
||||
<h1>{{name}}</h1>
|
||||
<p>Authors: <ul>{{#authors}}<li>{{.}}</li>{{/authors}}</ul></p>
|
||||
<p>Price: {{{price.currency.symbol}}}{{price.value}} {{#price.currency}}{{name}} <b>{{availability.text}}</b>{{/price.currency}}</p>
|
||||
<p>VAT: {{{price.currency.symbol}}}{{#price}}{{vat}}{{/price}}</p>
|
||||
<!-- boring part -->
|
||||
<h2>Test truthy false values:</h2>
|
||||
<p>Zero: {{truthy.zero}}</p>
|
||||
<p>False: {{truthy.notTrue}}</p>
|
||||
<p>length of string should be rendered: {{price.currency.name.length}}</p>
|
||||
<p>length of string in a list should be rendered: {{#singletonList}}{{singletonItem.length}}{{/singletonList}}</p>
|
||||
<p>length of an array should be rendered: {{authors.length}}</p>
|
||||
@@ -0,0 +1,12 @@
|
||||
<!-- exciting part -->
|
||||
<h1>A Book</h1>
|
||||
<p>Authors: <ul><li>John Power</li><li>Jamie Walsh</li></ul></p>
|
||||
<p>Price: $200 USD <b>In Stock</b></p>
|
||||
<p>VAT: $40</p>
|
||||
<!-- boring part -->
|
||||
<h2>Test truthy false values:</h2>
|
||||
<p>Zero: 0</p>
|
||||
<p>False: false</p>
|
||||
<p>length of string should be rendered: 3</p>
|
||||
<p>length of string in a list should be rendered: 14</p>
|
||||
<p>length of an array should be rendered: 2</p>
|
||||
@@ -0,0 +1,5 @@
|
||||
({
|
||||
foo: true,
|
||||
bar: '{{win}}',
|
||||
win: 'FAIL'
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{{#foo}}{{bar}}{{/foo}}
|
||||
@@ -0,0 +1 @@
|
||||
{{win}}
|
||||
@@ -0,0 +1,3 @@
|
||||
({
|
||||
jobs: []
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
These are the jobs:
|
||||
{{#jobs}}
|
||||
{{.}}
|
||||
{{/jobs}}
|
||||
@@ -0,0 +1 @@
|
||||
These are the jobs:
|
||||
@@ -0,0 +1 @@
|
||||
({});
|
||||
@@ -0,0 +1 @@
|
||||
{{#foo}}{{/foo}}foo{{#bar}}{{/bar}}
|
||||
@@ -0,0 +1 @@
|
||||
foo
|
||||
@@ -0,0 +1,6 @@
|
||||
({
|
||||
description: 'That is all!',
|
||||
child: {
|
||||
description: ''
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{{description}}{{#child}}{{description}}{{/child}}
|
||||
@@ -0,0 +1 @@
|
||||
That is all!
|
||||
@@ -0,0 +1 @@
|
||||
({});
|
||||
@@ -0,0 +1 @@
|
||||
<html><head></head><body><h1>Test</h1></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
<html><head></head><body><h1>Test</h1></body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
({
|
||||
bar: 2
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{{foo}}
|
||||
@@ -0,0 +1,7 @@
|
||||
({
|
||||
title: function () {
|
||||
return 'Bear > Shark';
|
||||
},
|
||||
symbol: null,
|
||||
entities: "" \"'<>`=/"
|
||||
});
|
||||
@@ -0,0 +1,2 @@
|
||||
<h1>{{title}}{{symbol}}</h1>
|
||||
And even {{entities}}, but not {{{entities}}}.
|
||||
@@ -0,0 +1,2 @@
|
||||
<h1>Bear > Shark</h1>
|
||||
And even &quot; "'<>`=/, but not " "'<>`=/.
|
||||
@@ -0,0 +1,8 @@
|
||||
({
|
||||
'emptyString': '',
|
||||
'emptyArray': [],
|
||||
'zero': 0,
|
||||
'null': null,
|
||||
'undefined': undefined,
|
||||
'NaN': 0/0
|
||||
});
|
||||
@@ -0,0 +1,12 @@
|
||||
{{#emptyString}}empty string{{/emptyString}}
|
||||
{{^emptyString}}inverted empty string{{/emptyString}}
|
||||
{{#emptyArray}}empty array{{/emptyArray}}
|
||||
{{^emptyArray}}inverted empty array{{/emptyArray}}
|
||||
{{#zero}}zero{{/zero}}
|
||||
{{^zero}}inverted zero{{/zero}}
|
||||
{{#null}}null{{/null}}
|
||||
{{^null}}inverted null{{/null}}
|
||||
{{#undefined}}undefined{{/undefined}}
|
||||
{{^undefined}}inverted undefined{{/undefined}}
|
||||
{{#NaN}}NaN{{/NaN}}
|
||||
{{^NaN}}inverted NaN{{/NaN}}
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
inverted empty string
|
||||
|
||||
inverted empty array
|
||||
|
||||
inverted zero
|
||||
|
||||
inverted null
|
||||
|
||||
inverted undefined
|
||||
|
||||
inverted NaN
|
||||
@@ -0,0 +1,10 @@
|
||||
({
|
||||
'list': [
|
||||
['', 'emptyString'],
|
||||
[[], 'emptyArray'],
|
||||
[0, 'zero'],
|
||||
[null, 'null'],
|
||||
[undefined, 'undefined'],
|
||||
[0/0, 'NaN']
|
||||
]
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
{{#list}}
|
||||
{{#.}}{{#.}}{{.}}{{/.}}{{^.}}inverted {{/.}}{{/.}}
|
||||
{{/list}}
|
||||
@@ -0,0 +1,6 @@
|
||||
inverted emptyString
|
||||
inverted emptyArray
|
||||
inverted zero
|
||||
inverted null
|
||||
inverted undefined
|
||||
inverted NaN
|
||||
@@ -0,0 +1,19 @@
|
||||
({
|
||||
grand_parent_id: 'grand_parent1',
|
||||
parent_contexts: [
|
||||
{
|
||||
parent_id: 'parent1',
|
||||
child_contexts: [
|
||||
{ child_id: 'parent1-child1' },
|
||||
{ child_id: 'parent1-child2' }
|
||||
]
|
||||
},
|
||||
{
|
||||
parent_id: 'parent2',
|
||||
child_contexts: [
|
||||
{ child_id: 'parent2-child1' },
|
||||
{ child_id: 'parent2-child2' }
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
@@ -0,0 +1,10 @@
|
||||
{{grand_parent_id}}
|
||||
{{#parent_contexts}}
|
||||
{{grand_parent_id}}
|
||||
{{parent_id}}
|
||||
{{#child_contexts}}
|
||||
{{grand_parent_id}}
|
||||
{{parent_id}}
|
||||
{{child_id}}
|
||||
{{/child_contexts}}
|
||||
{{/parent_contexts}}
|
||||
@@ -0,0 +1,17 @@
|
||||
grand_parent1
|
||||
grand_parent1
|
||||
parent1
|
||||
grand_parent1
|
||||
parent1
|
||||
parent1-child1
|
||||
grand_parent1
|
||||
parent1
|
||||
parent1-child2
|
||||
grand_parent1
|
||||
parent2
|
||||
grand_parent1
|
||||
parent2
|
||||
parent2-child1
|
||||
grand_parent1
|
||||
parent2
|
||||
parent2-child2
|
||||
@@ -0,0 +1,9 @@
|
||||
({
|
||||
name: 'Tater',
|
||||
helper: 'To tinker?',
|
||||
bolder: function () {
|
||||
return function (text, render) {
|
||||
return text + ' => <b>' + render(text) + '</b> ' + this.helper;
|
||||
};
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{{#bolder}}Hi {{name}}.{{/bolder}}
|
||||
@@ -0,0 +1 @@
|
||||
Hi {{name}}. => <b>Hi Tater.</b> To tinker?
|
||||
@@ -0,0 +1,8 @@
|
||||
({
|
||||
data: {
|
||||
author: {
|
||||
twitter_id: 819606,
|
||||
name: 'janl'
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
{{# data.author.twitter_id }}
|
||||
<meta name="twitter:site:id" content="{{.}}">
|
||||
{{/ data.author.twitter_id }}
|
||||
|
||||
{{# data.author.name }}
|
||||
<meta name="twitter:site" content="{{.}}">
|
||||
{{/ data.author.name }}
|
||||
@@ -0,0 +1,3 @@
|
||||
<meta name="twitter:site:id" content="819606">
|
||||
|
||||
<meta name="twitter:site" content="janl">
|
||||
@@ -0,0 +1,3 @@
|
||||
({
|
||||
html: 'I like {{mustache}}'
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
You said "{{{html}}}" today
|
||||
@@ -0,0 +1 @@
|
||||
You said "I like {{mustache}}" today
|
||||
@@ -0,0 +1,3 @@
|
||||
({
|
||||
'repos': []
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
{{#repos}}<b>{{name}}</b>{{/repos}}
|
||||
{{^repos}}No repos :({{/repos}}
|
||||
{{^nothin}}Hello!{{/nothin}}
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
No repos :(
|
||||
Hello!
|
||||
@@ -0,0 +1,5 @@
|
||||
({
|
||||
'person?': {
|
||||
name: 'Jon'
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
{{#person?}}
|
||||
Hi {{name}}!
|
||||
{{/person?}}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user