mustache no longer needed
getting shaved :P
This commit is contained in:
parent
7ed8b8ab57
commit
0e02023aba
5
node_modules/mustache/.jshintrc
generated
vendored
5
node_modules/mustache/.jshintrc
generated
vendored
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"eqnull": true,
|
|
||||||
"evil": true
|
|
||||||
}
|
|
||||||
|
|
10
node_modules/mustache/.npmignore
generated
vendored
10
node_modules/mustache/.npmignore
generated
vendored
@ -1,10 +0,0 @@
|
|||||||
.DS_Store
|
|
||||||
.rvmrc
|
|
||||||
node_modules
|
|
||||||
runner.js
|
|
||||||
jquery.mustache.js
|
|
||||||
qooxdoo.mustache.js
|
|
||||||
dojox
|
|
||||||
yui3
|
|
||||||
requirejs.mustache.js
|
|
||||||
|
|
4
node_modules/mustache/.travis.yml
generated
vendored
4
node_modules/mustache/.travis.yml
generated
vendored
@ -1,4 +0,0 @@
|
|||||||
language: node_js
|
|
||||||
node_js:
|
|
||||||
- 0.6
|
|
||||||
|
|
34
node_modules/mustache/CHANGES
generated
vendored
34
node_modules/mustache/CHANGES
generated
vendored
@ -1,34 +0,0 @@
|
|||||||
= 0.7.2 / 27 Dec 2012
|
|
||||||
|
|
||||||
* Fixed a rendering bug (#274) when using nested higher-order sections.
|
|
||||||
* Converted tests to use mocha instead of vows.
|
|
||||||
|
|
||||||
= 0.7.1 / 6 Dec 2012
|
|
||||||
|
|
||||||
* Handle empty templates gracefully. Fixes #265, #267, and #270.
|
|
||||||
* Cache partials by template, not by name. Fixes #257.
|
|
||||||
* Added Mustache.compileTokens to compile the output of Mustache.parse. Fixes
|
|
||||||
#258.
|
|
||||||
|
|
||||||
= 0.7.0 / 10 Sep 2012
|
|
||||||
|
|
||||||
* Rename Renderer => Writer.
|
|
||||||
* Allow partials to be loaded dynamically using a callback (thanks
|
|
||||||
@TiddoLangerak for the suggestion).
|
|
||||||
* Fixed a bug with higher-order sections that prevented them from being
|
|
||||||
passed the raw text of the section from the original template.
|
|
||||||
* More concise token format. Tokens also include start/end indices in the
|
|
||||||
original template.
|
|
||||||
* High-level API is consistent with the Writer API.
|
|
||||||
* Allow partials to be passed to the pre-compiled function (thanks
|
|
||||||
@fallenice).
|
|
||||||
* Don't use eval (thanks @cweider).
|
|
||||||
|
|
||||||
= 0.6.0 / 31 Aug 2012
|
|
||||||
|
|
||||||
* Use JavaScript's definition of falsy when determining whether to render an
|
|
||||||
inverted section or not. Issue #186.
|
|
||||||
* Use Mustache.escape to escape values inside {{}}. This function may be
|
|
||||||
reassigned to alter the default escaping behavior. Issue #244.
|
|
||||||
* Fixed a bug that clashed with QUnit (thanks @kannix).
|
|
||||||
* Added volo support (thanks @guybedford).
|
|
10
node_modules/mustache/LICENSE
generated
vendored
10
node_modules/mustache/LICENSE
generated
vendored
@ -1,10 +0,0 @@
|
|||||||
The MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2009 Chris Wanstrath (Ruby)
|
|
||||||
Copyright (c) 2010 Jan Lehnardt (JavaScript)
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
400
node_modules/mustache/README.md
generated
vendored
400
node_modules/mustache/README.md
generated
vendored
@ -1,400 +0,0 @@
|
|||||||
# mustache.js - Logic-less {{mustache}} templates with JavaScript
|
|
||||||
|
|
||||||
> What could be more logical awesome than no logic at all?
|
|
||||||
|
|
||||||
[mustache.js](http://github.com/janl/mustache.js) is an implementation of the [mustache](http://mustache.github.com/) template system in JavaScript.
|
|
||||||
|
|
||||||
[Mustache](http://mustache.github.com/) is a logic-less template syntax. It can be used for HTML, config files, source code - anything. It works by expanding tags in a template using values provided in a hash or object.
|
|
||||||
|
|
||||||
We call it "logic-less" because there are no if statements, else clauses, or for loops. Instead there are only tags. Some tags are replaced with a value, some nothing, and others a series of values.
|
|
||||||
|
|
||||||
For a language-agnostic overview of mustache's template syntax, see the `mustache(5)` [manpage](http://mustache.github.com/mustache.5.html).
|
|
||||||
|
|
||||||
## Where to use mustache.js?
|
|
||||||
|
|
||||||
You can use mustache.js to render mustache templates anywhere you can use JavaScript. This includes web browsers, server-side environments such as [node](http://nodejs.org/), and [CouchDB](http://couchdb.apache.org/) views.
|
|
||||||
|
|
||||||
mustache.js ships with support for both the [CommonJS](http://www.commonjs.org/) module API and the [Asynchronous Module Definition](https://github.com/amdjs/amdjs-api/wiki/AMD) API, or AMD.
|
|
||||||
|
|
||||||
## Who uses mustache.js?
|
|
||||||
|
|
||||||
An updated list of mustache.js users is kept [on the Github wiki](http://wiki.github.com/janl/mustache.js/beard-competition). Add yourself or your company if you use mustache.js!
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
Below is quick example how to use mustache.js:
|
|
||||||
|
|
||||||
var view = {
|
|
||||||
title: "Joe",
|
|
||||||
calc: function () {
|
|
||||||
return 2 + 4;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var output = Mustache.render("{{title}} spends {{calc}}", view);
|
|
||||||
|
|
||||||
In this example, the `Mustache.render` function takes two parameters: 1) the [mustache](http://mustache.github.com/) template and 2) a `view` object that contains the data and code needed to render the template.
|
|
||||||
|
|
||||||
## Templates
|
|
||||||
|
|
||||||
A [mustache](http://mustache.github.com/) template is a string that contains any number of mustache tags. Tags are indicated by the double mustaches that surround them. `{{person}}` is a tag, as is `{{#person}}`. In both examples we refer to `person` as the tag's key.
|
|
||||||
|
|
||||||
There are several types of tags available in mustache.js.
|
|
||||||
|
|
||||||
### Variables
|
|
||||||
|
|
||||||
The most basic tag type is a simple variable. A `{{name}}` tag renders the value of the `name` key in the current context. If there is no such key, nothing is rendered.
|
|
||||||
|
|
||||||
All variables are HTML-escaped by default. If you want to render unescaped HTML, use the triple mustache: `{{{name}}}`. You can also use `&` to unescape a variable.
|
|
||||||
|
|
||||||
View:
|
|
||||||
|
|
||||||
{
|
|
||||||
"name": "Chris",
|
|
||||||
"company": "<b>GitHub</b>"
|
|
||||||
}
|
|
||||||
|
|
||||||
Template:
|
|
||||||
|
|
||||||
* {{name}}
|
|
||||||
* {{age}}
|
|
||||||
* {{company}}
|
|
||||||
* {{{company}}}
|
|
||||||
* {{&company}}
|
|
||||||
|
|
||||||
Output:
|
|
||||||
|
|
||||||
* Chris
|
|
||||||
*
|
|
||||||
* <b>GitHub</b>
|
|
||||||
* <b>GitHub</b>
|
|
||||||
* <b>GitHub</b>
|
|
||||||
|
|
||||||
JavaScript's dot notation may be used to access keys that are properties of objects in a view.
|
|
||||||
|
|
||||||
View:
|
|
||||||
|
|
||||||
{
|
|
||||||
"name": {
|
|
||||||
"first": "Michael",
|
|
||||||
"last": "Jackson"
|
|
||||||
},
|
|
||||||
"age": "RIP"
|
|
||||||
}
|
|
||||||
|
|
||||||
Template:
|
|
||||||
|
|
||||||
* {{name.first}} {{name.last}}
|
|
||||||
* {{age}}
|
|
||||||
|
|
||||||
Output:
|
|
||||||
|
|
||||||
* Michael Jackson
|
|
||||||
* RIP
|
|
||||||
|
|
||||||
### Sections
|
|
||||||
|
|
||||||
Sections render blocks of text one or more times, depending on the value of the key in the current context.
|
|
||||||
|
|
||||||
A section begins with a pound and ends with a slash. That is, `{{#person}}` begins a `person` section, while `{{/person}}` ends it. The text between the two tags is referred to as that section's "block".
|
|
||||||
|
|
||||||
The behavior of the section is determined by the value of the key.
|
|
||||||
|
|
||||||
#### False Values or Empty Lists
|
|
||||||
|
|
||||||
If the `person` key does not exist, or exists and has a value of `null`, `undefined`, or `false`, or is an empty list, the block will not be rendered.
|
|
||||||
|
|
||||||
View:
|
|
||||||
|
|
||||||
{
|
|
||||||
"person": false
|
|
||||||
}
|
|
||||||
|
|
||||||
Template:
|
|
||||||
|
|
||||||
Shown.
|
|
||||||
{{#person}}
|
|
||||||
Never shown!
|
|
||||||
{{/person}}
|
|
||||||
|
|
||||||
Output:
|
|
||||||
|
|
||||||
Shown.
|
|
||||||
|
|
||||||
#### Non-Empty Lists
|
|
||||||
|
|
||||||
If the `person` key exists and is not `null`, `undefined`, or `false`, and is not an empty list the block will be rendered one or more times.
|
|
||||||
|
|
||||||
When the value is a list, the block is rendered once for each item in the list. The context of the block is set to the current item in the list for each iteration. In this way we can loop over collections.
|
|
||||||
|
|
||||||
View:
|
|
||||||
|
|
||||||
{
|
|
||||||
"stooges": [
|
|
||||||
{ "name": "Moe" },
|
|
||||||
{ "name": "Larry" },
|
|
||||||
{ "name": "Curly" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
Template:
|
|
||||||
|
|
||||||
{{#stooges}}
|
|
||||||
<b>{{name}}</b>
|
|
||||||
{{/stooges}}
|
|
||||||
|
|
||||||
Output:
|
|
||||||
|
|
||||||
<b>Moe</b>
|
|
||||||
<b>Larry</b>
|
|
||||||
<b>Curly</b>
|
|
||||||
|
|
||||||
When looping over an array of strings, a `.` can be used to refer to the current item in the list.
|
|
||||||
|
|
||||||
View:
|
|
||||||
|
|
||||||
{
|
|
||||||
"musketeers": ["Athos", "Aramis", "Porthos", "D'Artagnan"]
|
|
||||||
}
|
|
||||||
|
|
||||||
Template:
|
|
||||||
|
|
||||||
{{#musketeers}}
|
|
||||||
* {{.}}
|
|
||||||
{{/musketeers}}
|
|
||||||
|
|
||||||
Output:
|
|
||||||
|
|
||||||
* Athos
|
|
||||||
* Aramis
|
|
||||||
* Porthos
|
|
||||||
* D'Artagnan
|
|
||||||
|
|
||||||
If the value of a section variable is a function, it will be called in the context of the current item in the list on each iteration.
|
|
||||||
|
|
||||||
View:
|
|
||||||
|
|
||||||
{
|
|
||||||
"beatles": [
|
|
||||||
{ "firstName": "John", "lastName": "Lennon" },
|
|
||||||
{ "firstName": "Paul", "lastName": "McCartney" },
|
|
||||||
{ "firstName": "George", "lastName": "Harrison" },
|
|
||||||
{ "firstName": "Ringo", "lastName": "Starr" }
|
|
||||||
],
|
|
||||||
"name": function () {
|
|
||||||
return this.firstName + " " + this.lastName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Template:
|
|
||||||
|
|
||||||
{{#beatles}}
|
|
||||||
* {{name}}
|
|
||||||
{{/beatles}}
|
|
||||||
|
|
||||||
Output:
|
|
||||||
|
|
||||||
* John Lennon
|
|
||||||
* Paul McCartney
|
|
||||||
* George Harrison
|
|
||||||
* Ringo Starr
|
|
||||||
|
|
||||||
#### Functions
|
|
||||||
|
|
||||||
If the value of a section key is a function, it is called with the section's literal block of text, un-rendered, as its first argument. The second argument is a special rendering function that uses the current view as its view argument. It is called in the context of the current view object.
|
|
||||||
|
|
||||||
View:
|
|
||||||
|
|
||||||
{
|
|
||||||
"name": "Tater",
|
|
||||||
"bold": function () {
|
|
||||||
return function (text, render) {
|
|
||||||
return "<b>" + render(text) + "</b>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Template:
|
|
||||||
|
|
||||||
{{#bold}}Hi {{name}}.{{/bold}}
|
|
||||||
|
|
||||||
Output:
|
|
||||||
|
|
||||||
<b>Hi Tater.</b>
|
|
||||||
|
|
||||||
### Inverted Sections
|
|
||||||
|
|
||||||
An inverted section opens with `{{^section}}` instead of `{{#section}}`. The block of an inverted section is rendered only if the value of that section's tag is `null`, `undefined`, `false`, or an empty list.
|
|
||||||
|
|
||||||
View:
|
|
||||||
|
|
||||||
{
|
|
||||||
"repos": []
|
|
||||||
}
|
|
||||||
|
|
||||||
Template:
|
|
||||||
|
|
||||||
{{#repos}}<b>{{name}}</b>{{/repos}}
|
|
||||||
{{^repos}}No repos :({{/repos}}
|
|
||||||
|
|
||||||
Output:
|
|
||||||
|
|
||||||
No repos :(
|
|
||||||
|
|
||||||
### Comments
|
|
||||||
|
|
||||||
Comments begin with a bang and are ignored. The following template:
|
|
||||||
|
|
||||||
<h1>Today{{! ignore me }}.</h1>
|
|
||||||
|
|
||||||
Will render as follows:
|
|
||||||
|
|
||||||
<h1>Today.</h1>
|
|
||||||
|
|
||||||
Comments may contain newlines.
|
|
||||||
|
|
||||||
### Partials
|
|
||||||
|
|
||||||
Partials begin with a greater than sign, like {{> box}}.
|
|
||||||
|
|
||||||
Partials are rendered at runtime (as opposed to compile time), so recursive partials are possible. Just avoid infinite loops.
|
|
||||||
|
|
||||||
They also inherit the calling context. Whereas in ERB you may have this:
|
|
||||||
|
|
||||||
<%= partial :next_more, :start => start, :size => size %>
|
|
||||||
|
|
||||||
Mustache requires only this:
|
|
||||||
|
|
||||||
{{> next_more}}
|
|
||||||
|
|
||||||
Why? Because the `next_more.mustache` file will inherit the `size` and `start` variables from the calling context. In this way you may want to think of partials as includes, or template expansion, even though it's not literally true.
|
|
||||||
|
|
||||||
For example, this template and partial:
|
|
||||||
|
|
||||||
base.mustache:
|
|
||||||
<h2>Names</h2>
|
|
||||||
{{#names}}
|
|
||||||
{{> user}}
|
|
||||||
{{/names}}
|
|
||||||
|
|
||||||
user.mustache:
|
|
||||||
<strong>{{name}}</strong>
|
|
||||||
|
|
||||||
Can be thought of as a single, expanded template:
|
|
||||||
|
|
||||||
<h2>Names</h2>
|
|
||||||
{{#names}}
|
|
||||||
<strong>{{name}}</strong>
|
|
||||||
{{/names}}
|
|
||||||
|
|
||||||
In mustache.js an object of partials may be passed as the third argument to `Mustache.render`. The object should be keyed by the name of the partial, and its value should be the partial text.
|
|
||||||
|
|
||||||
### Set Delimiter
|
|
||||||
|
|
||||||
Set Delimiter tags start with an equals sign and change the tag delimiters from `{{` and `}}` to custom strings.
|
|
||||||
|
|
||||||
Consider the following contrived example:
|
|
||||||
|
|
||||||
* {{ default_tags }}
|
|
||||||
{{=<% %>=}}
|
|
||||||
* <% erb_style_tags %>
|
|
||||||
<%={{ }}=%>
|
|
||||||
* {{ default_tags_again }}
|
|
||||||
|
|
||||||
Here we have a list with three items. The first item uses the default tag style, the second uses ERB style as defined by the Set Delimiter tag, and the third returns to the default style after yet another Set Delimiter declaration.
|
|
||||||
|
|
||||||
According to [ctemplates](http://google-ctemplate.googlecode.com/svn/trunk/doc/howto.html), this "is useful for languages like TeX, where double-braces may occur in the text and are awkward to use for markup."
|
|
||||||
|
|
||||||
Custom delimiters may not contain whitespace or the equals sign.
|
|
||||||
|
|
||||||
### Compiled Templates
|
|
||||||
|
|
||||||
Mustache templates can be compiled into JavaScript functions using `Mustache.compile` for improved rendering performance.
|
|
||||||
|
|
||||||
If you have template views that are rendered multiple times, compiling your template into a JavaScript function will minimise the amount of work required for each re-render.
|
|
||||||
|
|
||||||
Pre-compiled templates can also be generated server-side, for delivery to the browser as ready to use JavaScript functions, further reducing the amount of client side processing required for initialising templates.
|
|
||||||
|
|
||||||
**Mustache.compile**
|
|
||||||
|
|
||||||
Use `Mustache.compile` to compile standard Mustache string templates into reusable Mustache template functions.
|
|
||||||
|
|
||||||
var compiledTemplate = Mustache.compile(stringTemplate);
|
|
||||||
|
|
||||||
The function returned from `Mustache.compile` can then be called directly, passing in the template data as an argument (with an object of partials as an optional second parameter), to generate the final output.
|
|
||||||
|
|
||||||
var templateOutput = compiledTemplate(templateData);
|
|
||||||
|
|
||||||
**Mustache.compilePartial**
|
|
||||||
|
|
||||||
Template partials can also be compiled using the `Mustache.compilePartial` function. The first parameter of this function, is the name of the partial as it appears within parent templates.
|
|
||||||
|
|
||||||
Mustache.compilePartial('partial-name', stringTemplate);
|
|
||||||
|
|
||||||
Compiled partials are then available to both `Mustache.render` and `Mustache.compile`.
|
|
||||||
|
|
||||||
## Plugins for JavaScript Libraries
|
|
||||||
|
|
||||||
mustache.js may be built specifically for several different client libraries, including the following:
|
|
||||||
|
|
||||||
- [jQuery](http://jquery.com/)
|
|
||||||
- [MooTools](http://mootools.net/)
|
|
||||||
- [Dojo](http://www.dojotoolkit.org/)
|
|
||||||
- [YUI](http://developer.yahoo.com/yui/)
|
|
||||||
- [qooxdoo](http://qooxdoo.org/)
|
|
||||||
|
|
||||||
These may be built using [Rake](http://rake.rubyforge.org/) and one of the following commands:
|
|
||||||
|
|
||||||
$ rake jquery
|
|
||||||
$ rake mootools
|
|
||||||
$ rake dojo
|
|
||||||
$ rake yui
|
|
||||||
$ rake qooxdoo
|
|
||||||
|
|
||||||
## Testing
|
|
||||||
|
|
||||||
The mustache.js test suite uses the [vows](http://vowsjs.org/) testing framework. In order to run the tests you'll need to install [node](http://nodejs.org/). Once that's done you can install vows using [npm](http://npmjs.org/).
|
|
||||||
|
|
||||||
$ npm install -g vows
|
|
||||||
|
|
||||||
Then run the tests.
|
|
||||||
|
|
||||||
$ vows --spec
|
|
||||||
|
|
||||||
The test suite consists of both unit and integration tests. If a template isn't rendering correctly for you, you can make a test for it by doing the following:
|
|
||||||
|
|
||||||
1. Create a template file named `mytest.mustache` in the `test/_files`
|
|
||||||
directory. Replace `mytest` with the name of your test.
|
|
||||||
2. Create a corresponding view file named `mytest.js` in the same directory.
|
|
||||||
This file should contain a JavaScript object literal enclosed in
|
|
||||||
parentheses. See any of the other view files for an example.
|
|
||||||
3. Create a file with the expected output in `mytest.txt` in the same
|
|
||||||
directory.
|
|
||||||
|
|
||||||
Then, you can run the test with:
|
|
||||||
|
|
||||||
$ TEST=mytest vows test/render_test.js
|
|
||||||
|
|
||||||
## Thanks
|
|
||||||
|
|
||||||
mustache.js wouldn't kick ass if it weren't for these fine souls:
|
|
||||||
|
|
||||||
* Chris Wanstrath / defunkt
|
|
||||||
* Alexander Lang / langalex
|
|
||||||
* Sebastian Cohnen / tisba
|
|
||||||
* J Chris Anderson / jchris
|
|
||||||
* Tom Robinson / tlrobinson
|
|
||||||
* Aaron Quint / quirkey
|
|
||||||
* Douglas Crockford
|
|
||||||
* Nikita Vasilyev / NV
|
|
||||||
* Elise Wood / glytch
|
|
||||||
* Damien Mathieu / dmathieu
|
|
||||||
* Jakub Kuźma / qoobaa
|
|
||||||
* Will Leinweber / will
|
|
||||||
* dpree
|
|
||||||
* Jason Smith / jhs
|
|
||||||
* Aaron Gibralter / agibralter
|
|
||||||
* Ross Boucher / boucher
|
|
||||||
* Matt Sanford / mzsanford
|
|
||||||
* Ben Cherry / bcherry
|
|
||||||
* Michael Jackson / mjijackson
|
|
68
node_modules/mustache/Rakefile
generated
vendored
68
node_modules/mustache/Rakefile
generated
vendored
@ -1,68 +0,0 @@
|
|||||||
require 'rake'
|
|
||||||
require 'rake/clean'
|
|
||||||
|
|
||||||
task :default => :test
|
|
||||||
|
|
||||||
ROOT = File.expand_path('..', __FILE__)
|
|
||||||
MUSTACHE_JS = File.read(File.join(ROOT, 'mustache.js'))
|
|
||||||
|
|
||||||
def mustache_version
|
|
||||||
match = MUSTACHE_JS.match(/exports\.version = "([^"]+)";/)
|
|
||||||
match[1]
|
|
||||||
end
|
|
||||||
|
|
||||||
def minified_file
|
|
||||||
ENV['FILE'] || 'mustache.min.js'
|
|
||||||
end
|
|
||||||
|
|
||||||
desc "Run all tests, requires vows (see http://vowsjs.org)"
|
|
||||||
task :test do
|
|
||||||
sh "vows --spec"
|
|
||||||
end
|
|
||||||
|
|
||||||
desc "Minify to #{minified_file}, requires UglifyJS (see http://marijnhaverbeke.nl/uglifyjs)"
|
|
||||||
task :minify do
|
|
||||||
sh "uglifyjs mustache.js > #{minified_file}"
|
|
||||||
end
|
|
||||||
|
|
||||||
desc "Run JSHint, requires jshint (see http://www.jshint.com)"
|
|
||||||
task :lint do
|
|
||||||
sh "jshint mustache.js"
|
|
||||||
end
|
|
||||||
|
|
||||||
# Creates a task that uses the various template wrappers to make a wrapped
|
|
||||||
# output file. There is some extra complexity because Dojo and YUI use
|
|
||||||
# different final locations.
|
|
||||||
def templated_build(name, opts={})
|
|
||||||
short = name.downcase
|
|
||||||
source = File.join("wrappers", short)
|
|
||||||
dependencies = ["mustache.js"] + Dir.glob("#{source}/*.tpl.*")
|
|
||||||
target_js = opts[:location] ? "mustache.js" : "#{short}.mustache.js"
|
|
||||||
|
|
||||||
CLEAN.include(opts[:location] ? opts[:location] : target_js)
|
|
||||||
|
|
||||||
desc "Package for #{name}"
|
|
||||||
task short.to_sym => dependencies do
|
|
||||||
puts "Packaging for #{name}"
|
|
||||||
|
|
||||||
mkdir_p opts[:location] if opts[:location]
|
|
||||||
|
|
||||||
files = [
|
|
||||||
"#{source}/mustache.js.pre",
|
|
||||||
'mustache.js',
|
|
||||||
"#{source}/mustache.js.post"
|
|
||||||
]
|
|
||||||
|
|
||||||
open("#{opts[:location] || '.'}/#{target_js}", 'w') do |f|
|
|
||||||
files.each {|file| f << File.read(file) }
|
|
||||||
end
|
|
||||||
|
|
||||||
puts "Done, see #{opts[:location] || '.'}/#{target_js}"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
templated_build "jQuery"
|
|
||||||
templated_build "MooTools"
|
|
||||||
templated_build "Dojo", :location => "dojox/string"
|
|
||||||
templated_build "YUI3", :location => "yui3/mustache"
|
|
||||||
templated_build "qooxdoo"
|
|
610
node_modules/mustache/mustache.js
generated
vendored
610
node_modules/mustache/mustache.js
generated
vendored
@ -1,610 +0,0 @@
|
|||||||
/*!
|
|
||||||
* mustache.js - Logic-less {{mustache}} templates with JavaScript
|
|
||||||
* http://github.com/janl/mustache.js
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*global define: false*/
|
|
||||||
|
|
||||||
(function (root, factory) {
|
|
||||||
if (typeof exports === "object" && exports) {
|
|
||||||
module.exports = factory; // CommonJS
|
|
||||||
} else if (typeof define === "function" && define.amd) {
|
|
||||||
define(factory); // AMD
|
|
||||||
} else {
|
|
||||||
root.Mustache = factory; // <script>
|
|
||||||
}
|
|
||||||
}(this, (function () {
|
|
||||||
|
|
||||||
var exports = {};
|
|
||||||
|
|
||||||
exports.name = "mustache.js";
|
|
||||||
exports.version = "0.7.2";
|
|
||||||
exports.tags = ["{{", "}}"];
|
|
||||||
|
|
||||||
exports.Scanner = Scanner;
|
|
||||||
exports.Context = Context;
|
|
||||||
exports.Writer = Writer;
|
|
||||||
|
|
||||||
var whiteRe = /\s*/;
|
|
||||||
var spaceRe = /\s+/;
|
|
||||||
var nonSpaceRe = /\S/;
|
|
||||||
var eqRe = /\s*=/;
|
|
||||||
var curlyRe = /\s*\}/;
|
|
||||||
var tagRe = /#|\^|\/|>|\{|&|=|!/;
|
|
||||||
|
|
||||||
// Workaround for https://issues.apache.org/jira/browse/COUCHDB-577
|
|
||||||
// See https://github.com/janl/mustache.js/issues/189
|
|
||||||
function testRe(re, string) {
|
|
||||||
return RegExp.prototype.test.call(re, string);
|
|
||||||
}
|
|
||||||
|
|
||||||
function isWhitespace(string) {
|
|
||||||
return !testRe(nonSpaceRe, string);
|
|
||||||
}
|
|
||||||
|
|
||||||
var isArray = Array.isArray || function (obj) {
|
|
||||||
return Object.prototype.toString.call(obj) === "[object Array]";
|
|
||||||
};
|
|
||||||
|
|
||||||
function escapeRe(string) {
|
|
||||||
return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
|
|
||||||
}
|
|
||||||
|
|
||||||
var entityMap = {
|
|
||||||
"&": "&",
|
|
||||||
"<": "<",
|
|
||||||
">": ">",
|
|
||||||
'"': '"',
|
|
||||||
"'": ''',
|
|
||||||
"/": '/'
|
|
||||||
};
|
|
||||||
|
|
||||||
function escapeHtml(string) {
|
|
||||||
return String(string).replace(/[&<>"'\/]/g, function (s) {
|
|
||||||
return entityMap[s];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Export the escaping function so that the user may override it.
|
|
||||||
// See https://github.com/janl/mustache.js/issues/244
|
|
||||||
exports.escape = escapeHtml;
|
|
||||||
|
|
||||||
function Scanner(string) {
|
|
||||||
this.string = string;
|
|
||||||
this.tail = string;
|
|
||||||
this.pos = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns `true` if the tail is empty (end of string).
|
|
||||||
*/
|
|
||||||
Scanner.prototype.eos = function () {
|
|
||||||
return this.tail === "";
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tries to match the given regular expression at the current position.
|
|
||||||
* Returns the matched text if it can match, the empty string otherwise.
|
|
||||||
*/
|
|
||||||
Scanner.prototype.scan = function (re) {
|
|
||||||
var match = this.tail.match(re);
|
|
||||||
|
|
||||||
if (match && match.index === 0) {
|
|
||||||
this.tail = this.tail.substring(match[0].length);
|
|
||||||
this.pos += match[0].length;
|
|
||||||
return match[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
return "";
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Skips all text until the given regular expression can be matched. Returns
|
|
||||||
* the skipped string, which is the entire tail if no match can be made.
|
|
||||||
*/
|
|
||||||
Scanner.prototype.scanUntil = function (re) {
|
|
||||||
var match, pos = this.tail.search(re);
|
|
||||||
|
|
||||||
switch (pos) {
|
|
||||||
case -1:
|
|
||||||
match = this.tail;
|
|
||||||
this.pos += this.tail.length;
|
|
||||||
this.tail = "";
|
|
||||||
break;
|
|
||||||
case 0:
|
|
||||||
match = "";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
match = this.tail.substring(0, pos);
|
|
||||||
this.tail = this.tail.substring(pos);
|
|
||||||
this.pos += pos;
|
|
||||||
}
|
|
||||||
|
|
||||||
return match;
|
|
||||||
};
|
|
||||||
|
|
||||||
function Context(view, parent) {
|
|
||||||
this.view = view;
|
|
||||||
this.parent = parent;
|
|
||||||
this.clearCache();
|
|
||||||
}
|
|
||||||
|
|
||||||
Context.make = function (view) {
|
|
||||||
return (view instanceof Context) ? view : new Context(view);
|
|
||||||
};
|
|
||||||
|
|
||||||
Context.prototype.clearCache = function () {
|
|
||||||
this._cache = {};
|
|
||||||
};
|
|
||||||
|
|
||||||
Context.prototype.push = function (view) {
|
|
||||||
return new Context(view, this);
|
|
||||||
};
|
|
||||||
|
|
||||||
Context.prototype.lookup = function (name) {
|
|
||||||
var value = this._cache[name];
|
|
||||||
|
|
||||||
if (!value) {
|
|
||||||
if (name === ".") {
|
|
||||||
value = this.view;
|
|
||||||
} else {
|
|
||||||
var context = this;
|
|
||||||
|
|
||||||
while (context) {
|
|
||||||
if (name.indexOf(".") > 0) {
|
|
||||||
var names = name.split("."), i = 0;
|
|
||||||
|
|
||||||
value = context.view;
|
|
||||||
|
|
||||||
while (value && i < names.length) {
|
|
||||||
value = value[names[i++]];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
value = context.view[name];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (value != null) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
context = context.parent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this._cache[name] = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof value === "function") {
|
|
||||||
value = value.call(this.view);
|
|
||||||
}
|
|
||||||
|
|
||||||
return value;
|
|
||||||
};
|
|
||||||
|
|
||||||
function Writer() {
|
|
||||||
this.clearCache();
|
|
||||||
}
|
|
||||||
|
|
||||||
Writer.prototype.clearCache = function () {
|
|
||||||
this._cache = {};
|
|
||||||
this._partialCache = {};
|
|
||||||
};
|
|
||||||
|
|
||||||
Writer.prototype.compile = function (template, tags) {
|
|
||||||
var fn = this._cache[template];
|
|
||||||
|
|
||||||
if (!fn) {
|
|
||||||
var tokens = exports.parse(template, tags);
|
|
||||||
fn = this._cache[template] = this.compileTokens(tokens, template);
|
|
||||||
}
|
|
||||||
|
|
||||||
return fn;
|
|
||||||
};
|
|
||||||
|
|
||||||
Writer.prototype.compilePartial = function (name, template, tags) {
|
|
||||||
var fn = this.compile(template, tags);
|
|
||||||
this._partialCache[name] = fn;
|
|
||||||
return fn;
|
|
||||||
};
|
|
||||||
|
|
||||||
Writer.prototype.compileTokens = function (tokens, template) {
|
|
||||||
var fn = compileTokens(tokens);
|
|
||||||
var self = this;
|
|
||||||
|
|
||||||
return function (view, partials) {
|
|
||||||
if (partials) {
|
|
||||||
if (typeof partials === "function") {
|
|
||||||
self._loadPartial = partials;
|
|
||||||
} else {
|
|
||||||
for (var name in partials) {
|
|
||||||
self.compilePartial(name, partials[name]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return fn(self, Context.make(view), template);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
Writer.prototype.render = function (template, view, partials) {
|
|
||||||
return this.compile(template)(view, partials);
|
|
||||||
};
|
|
||||||
|
|
||||||
Writer.prototype._section = function (name, context, text, callback) {
|
|
||||||
var value = context.lookup(name);
|
|
||||||
|
|
||||||
switch (typeof value) {
|
|
||||||
case "object":
|
|
||||||
if (isArray(value)) {
|
|
||||||
var buffer = "";
|
|
||||||
|
|
||||||
for (var i = 0, len = value.length; i < len; ++i) {
|
|
||||||
buffer += callback(this, context.push(value[i]));
|
|
||||||
}
|
|
||||||
|
|
||||||
return buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
return value ? callback(this, context.push(value)) : "";
|
|
||||||
case "function":
|
|
||||||
var self = this;
|
|
||||||
var scopedRender = function (template) {
|
|
||||||
return self.render(template, context);
|
|
||||||
};
|
|
||||||
|
|
||||||
var result = value.call(context.view, text, scopedRender);
|
|
||||||
return result != null ? result : "";
|
|
||||||
default:
|
|
||||||
if (value) {
|
|
||||||
return callback(this, context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return "";
|
|
||||||
};
|
|
||||||
|
|
||||||
Writer.prototype._inverted = function (name, context, callback) {
|
|
||||||
var value = context.lookup(name);
|
|
||||||
|
|
||||||
// Use JavaScript's definition of falsy. Include empty arrays.
|
|
||||||
// See https://github.com/janl/mustache.js/issues/186
|
|
||||||
if (!value || (isArray(value) && value.length === 0)) {
|
|
||||||
return callback(this, context);
|
|
||||||
}
|
|
||||||
|
|
||||||
return "";
|
|
||||||
};
|
|
||||||
|
|
||||||
Writer.prototype._partial = function (name, context) {
|
|
||||||
if (!(name in this._partialCache) && this._loadPartial) {
|
|
||||||
this.compilePartial(name, this._loadPartial(name));
|
|
||||||
}
|
|
||||||
|
|
||||||
var fn = this._partialCache[name];
|
|
||||||
|
|
||||||
return fn ? fn(context) : "";
|
|
||||||
};
|
|
||||||
|
|
||||||
Writer.prototype._name = function (name, context) {
|
|
||||||
var value = context.lookup(name);
|
|
||||||
|
|
||||||
if (typeof value === "function") {
|
|
||||||
value = value.call(context.view);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (value == null) ? "" : String(value);
|
|
||||||
};
|
|
||||||
|
|
||||||
Writer.prototype._escaped = function (name, context) {
|
|
||||||
return exports.escape(this._name(name, context));
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Low-level function that compiles the given `tokens` into a function
|
|
||||||
* that accepts three arguments: a Writer, a Context, and the template.
|
|
||||||
*/
|
|
||||||
function compileTokens(tokens) {
|
|
||||||
var subRenders = {};
|
|
||||||
|
|
||||||
function subRender(i, tokens, template) {
|
|
||||||
if (!subRenders[i]) {
|
|
||||||
var fn = compileTokens(tokens);
|
|
||||||
subRenders[i] = function (writer, context) {
|
|
||||||
return fn(writer, context, template);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return subRenders[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
return function (writer, context, template) {
|
|
||||||
var buffer = "";
|
|
||||||
var token, sectionText;
|
|
||||||
|
|
||||||
for (var i = 0, len = tokens.length; i < len; ++i) {
|
|
||||||
token = tokens[i];
|
|
||||||
|
|
||||||
switch (token[0]) {
|
|
||||||
case "#":
|
|
||||||
sectionText = template.slice(token[3], token[5]);
|
|
||||||
buffer += writer._section(token[1], context, sectionText, subRender(i, token[4], template));
|
|
||||||
break;
|
|
||||||
case "^":
|
|
||||||
buffer += writer._inverted(token[1], context, subRender(i, token[4], template));
|
|
||||||
break;
|
|
||||||
case ">":
|
|
||||||
buffer += writer._partial(token[1], context);
|
|
||||||
break;
|
|
||||||
case "&":
|
|
||||||
buffer += writer._name(token[1], context);
|
|
||||||
break;
|
|
||||||
case "name":
|
|
||||||
buffer += writer._escaped(token[1], context);
|
|
||||||
break;
|
|
||||||
case "text":
|
|
||||||
buffer += token[1];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return buffer;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Forms the given array of `tokens` into a nested tree structure where
|
|
||||||
* tokens that represent a section have two additional items: 1) an array of
|
|
||||||
* all tokens that appear in that section and 2) the index in the original
|
|
||||||
* template that represents the end of that section.
|
|
||||||
*/
|
|
||||||
function nestTokens(tokens) {
|
|
||||||
var tree = [];
|
|
||||||
var collector = tree;
|
|
||||||
var sections = [];
|
|
||||||
|
|
||||||
var token;
|
|
||||||
for (var i = 0, len = tokens.length; i < len; ++i) {
|
|
||||||
token = tokens[i];
|
|
||||||
switch (token[0]) {
|
|
||||||
case '#':
|
|
||||||
case '^':
|
|
||||||
sections.push(token);
|
|
||||||
collector.push(token);
|
|
||||||
collector = token[4] = [];
|
|
||||||
break;
|
|
||||||
case '/':
|
|
||||||
var section = sections.pop();
|
|
||||||
section[5] = token[2];
|
|
||||||
collector = sections.length > 0 ? sections[sections.length - 1][4] : tree;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
collector.push(token);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return tree;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Combines the values of consecutive text tokens in the given `tokens` array
|
|
||||||
* to a single token.
|
|
||||||
*/
|
|
||||||
function squashTokens(tokens) {
|
|
||||||
var squashedTokens = [];
|
|
||||||
|
|
||||||
var token, lastToken;
|
|
||||||
for (var i = 0, len = tokens.length; i < len; ++i) {
|
|
||||||
token = tokens[i];
|
|
||||||
if (token[0] === 'text' && lastToken && lastToken[0] === 'text') {
|
|
||||||
lastToken[1] += token[1];
|
|
||||||
lastToken[3] = token[3];
|
|
||||||
} else {
|
|
||||||
lastToken = token;
|
|
||||||
squashedTokens.push(token);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return squashedTokens;
|
|
||||||
}
|
|
||||||
|
|
||||||
function escapeTags(tags) {
|
|
||||||
return [
|
|
||||||
new RegExp(escapeRe(tags[0]) + "\\s*"),
|
|
||||||
new RegExp("\\s*" + escapeRe(tags[1]))
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Breaks up the given `template` string into a tree of token objects. If
|
|
||||||
* `tags` is given here it must be an array with two string values: the
|
|
||||||
* opening and closing tags used in the template (e.g. ["<%", "%>"]). Of
|
|
||||||
* course, the default is to use mustaches (i.e. Mustache.tags).
|
|
||||||
*/
|
|
||||||
exports.parse = function (template, tags) {
|
|
||||||
template = template || '';
|
|
||||||
tags = tags || exports.tags;
|
|
||||||
|
|
||||||
if (typeof tags === 'string') tags = tags.split(spaceRe);
|
|
||||||
if (tags.length !== 2) {
|
|
||||||
throw new Error('Invalid tags: ' + tags.join(', '));
|
|
||||||
}
|
|
||||||
|
|
||||||
var tagRes = escapeTags(tags);
|
|
||||||
var scanner = new Scanner(template);
|
|
||||||
|
|
||||||
var sections = []; // Stack to hold section tokens
|
|
||||||
var tokens = []; // Buffer to hold the tokens
|
|
||||||
var spaces = []; // Indices of whitespace tokens on the current line
|
|
||||||
var hasTag = false; // Is there a {{tag}} on the current line?
|
|
||||||
var nonSpace = false; // Is there a non-space char on the current line?
|
|
||||||
|
|
||||||
// Strips all whitespace tokens array for the current line
|
|
||||||
// if there was a {{#tag}} on it and otherwise only space.
|
|
||||||
function stripSpace() {
|
|
||||||
if (hasTag && !nonSpace) {
|
|
||||||
while (spaces.length) {
|
|
||||||
tokens.splice(spaces.pop(), 1);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
spaces = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
hasTag = false;
|
|
||||||
nonSpace = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var start, type, value, chr;
|
|
||||||
while (!scanner.eos()) {
|
|
||||||
start = scanner.pos;
|
|
||||||
value = scanner.scanUntil(tagRes[0]);
|
|
||||||
|
|
||||||
if (value) {
|
|
||||||
for (var i = 0, len = value.length; i < len; ++i) {
|
|
||||||
chr = value.charAt(i);
|
|
||||||
|
|
||||||
if (isWhitespace(chr)) {
|
|
||||||
spaces.push(tokens.length);
|
|
||||||
} else {
|
|
||||||
nonSpace = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
tokens.push(["text", chr, start, start + 1]);
|
|
||||||
start += 1;
|
|
||||||
|
|
||||||
if (chr === "\n") {
|
|
||||||
stripSpace(); // Check for whitespace on the current line.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
start = scanner.pos;
|
|
||||||
|
|
||||||
// Match the opening tag.
|
|
||||||
if (!scanner.scan(tagRes[0])) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
hasTag = true;
|
|
||||||
type = scanner.scan(tagRe) || "name";
|
|
||||||
|
|
||||||
// Skip any whitespace between tag and value.
|
|
||||||
scanner.scan(whiteRe);
|
|
||||||
|
|
||||||
// Extract the tag value.
|
|
||||||
if (type === "=") {
|
|
||||||
value = scanner.scanUntil(eqRe);
|
|
||||||
scanner.scan(eqRe);
|
|
||||||
scanner.scanUntil(tagRes[1]);
|
|
||||||
} else if (type === "{") {
|
|
||||||
var closeRe = new RegExp("\\s*" + escapeRe("}" + tags[1]));
|
|
||||||
value = scanner.scanUntil(closeRe);
|
|
||||||
scanner.scan(curlyRe);
|
|
||||||
scanner.scanUntil(tagRes[1]);
|
|
||||||
type = "&";
|
|
||||||
} else {
|
|
||||||
value = scanner.scanUntil(tagRes[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Match the closing tag.
|
|
||||||
if (!scanner.scan(tagRes[1])) {
|
|
||||||
throw new Error('Unclosed tag at ' + scanner.pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check section nesting.
|
|
||||||
if (type === '/') {
|
|
||||||
if (sections.length === 0) {
|
|
||||||
throw new Error('Unopened section "' + value + '" at ' + start);
|
|
||||||
}
|
|
||||||
|
|
||||||
var section = sections.pop();
|
|
||||||
|
|
||||||
if (section[1] !== value) {
|
|
||||||
throw new Error('Unclosed section "' + section[1] + '" at ' + start);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var token = [type, value, start, scanner.pos];
|
|
||||||
tokens.push(token);
|
|
||||||
|
|
||||||
if (type === '#' || type === '^') {
|
|
||||||
sections.push(token);
|
|
||||||
} else if (type === "name" || type === "{" || type === "&") {
|
|
||||||
nonSpace = true;
|
|
||||||
} else if (type === "=") {
|
|
||||||
// Set the tags for the next time around.
|
|
||||||
tags = value.split(spaceRe);
|
|
||||||
|
|
||||||
if (tags.length !== 2) {
|
|
||||||
throw new Error('Invalid tags at ' + start + ': ' + tags.join(', '));
|
|
||||||
}
|
|
||||||
|
|
||||||
tagRes = escapeTags(tags);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make sure there are no open sections when we're done.
|
|
||||||
var section = sections.pop();
|
|
||||||
if (section) {
|
|
||||||
throw new Error('Unclosed section "' + section[1] + '" at ' + scanner.pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
return nestTokens(squashTokens(tokens));
|
|
||||||
};
|
|
||||||
|
|
||||||
// The high-level clearCache, compile, compilePartial, and render functions
|
|
||||||
// use this default writer.
|
|
||||||
var _writer = new Writer();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Clears all cached templates and partials in the default writer.
|
|
||||||
*/
|
|
||||||
exports.clearCache = function () {
|
|
||||||
return _writer.clearCache();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Compiles the given `template` to a reusable function using the default
|
|
||||||
* writer.
|
|
||||||
*/
|
|
||||||
exports.compile = function (template, tags) {
|
|
||||||
return _writer.compile(template, tags);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Compiles the partial with the given `name` and `template` to a reusable
|
|
||||||
* function using the default writer.
|
|
||||||
*/
|
|
||||||
exports.compilePartial = function (name, template, tags) {
|
|
||||||
return _writer.compilePartial(name, template, tags);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Compiles the given array of tokens (the output of a parse) to a reusable
|
|
||||||
* function using the default writer.
|
|
||||||
*/
|
|
||||||
exports.compileTokens = function (tokens, template) {
|
|
||||||
return _writer.compileTokens(tokens, template);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders the `template` with the given `view` and `partials` using the
|
|
||||||
* default writer.
|
|
||||||
*/
|
|
||||||
exports.render = function (template, view, partials) {
|
|
||||||
return _writer.render(template, view, partials);
|
|
||||||
};
|
|
||||||
|
|
||||||
// This is here for backwards compatibility with 0.4.x.
|
|
||||||
exports.to_html = function (template, view, partials, send) {
|
|
||||||
var result = exports.render(template, view, partials);
|
|
||||||
|
|
||||||
if (typeof send === "function") {
|
|
||||||
send(result);
|
|
||||||
} else {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return exports;
|
|
||||||
|
|
||||||
}())));
|
|
14
node_modules/mustache/mustache.js.nuspec
generated
vendored
14
node_modules/mustache/mustache.js.nuspec
generated
vendored
@ -1,14 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<package >
|
|
||||||
<metadata>
|
|
||||||
<id>mustache.js</id>
|
|
||||||
<version>0.7.2</version>
|
|
||||||
<authors>mustache.js Authors</authors>
|
|
||||||
<licenseUrl>https://github.com/janl/mustache.js/blob/master/LICENSE</licenseUrl>
|
|
||||||
<projectUrl>http://mustache.github.com/</projectUrl>
|
|
||||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
|
||||||
<description>Logic-less templates in JavaScript.</description>
|
|
||||||
<releaseNotes></releaseNotes>
|
|
||||||
<tags>mustache template templates javascript</tags>
|
|
||||||
</metadata>
|
|
||||||
</package>
|
|
32
node_modules/mustache/package.json
generated
vendored
32
node_modules/mustache/package.json
generated
vendored
File diff suppressed because one or more lines are too long
3
node_modules/mustache/test/_files/ampersand_escape.js
generated
vendored
3
node_modules/mustache/test/_files/ampersand_escape.js
generated
vendored
@ -1,3 +0,0 @@
|
|||||||
({
|
|
||||||
message: "Some <code>"
|
|
||||||
})
|
|
1
node_modules/mustache/test/_files/ampersand_escape.mustache
generated
vendored
1
node_modules/mustache/test/_files/ampersand_escape.mustache
generated
vendored
@ -1 +0,0 @@
|
|||||||
{{&message}}
|
|
1
node_modules/mustache/test/_files/ampersand_escape.txt
generated
vendored
1
node_modules/mustache/test/_files/ampersand_escape.txt
generated
vendored
@ -1 +0,0 @@
|
|||||||
Some <code>
|
|
4
node_modules/mustache/test/_files/apostrophe.js
generated
vendored
4
node_modules/mustache/test/_files/apostrophe.js
generated
vendored
@ -1,4 +0,0 @@
|
|||||||
({
|
|
||||||
'apos': "'",
|
|
||||||
'control': 'X'
|
|
||||||
})
|
|
1
node_modules/mustache/test/_files/apostrophe.mustache
generated
vendored
1
node_modules/mustache/test/_files/apostrophe.mustache
generated
vendored
@ -1 +0,0 @@
|
|||||||
{{apos}}{{control}}
|
|
1
node_modules/mustache/test/_files/apostrophe.txt
generated
vendored
1
node_modules/mustache/test/_files/apostrophe.txt
generated
vendored
@ -1 +0,0 @@
|
|||||||
'X
|
|
3
node_modules/mustache/test/_files/array_of_strings.js
generated
vendored
3
node_modules/mustache/test/_files/array_of_strings.js
generated
vendored
@ -1,3 +0,0 @@
|
|||||||
({
|
|
||||||
array_of_strings: ['hello', 'world']
|
|
||||||
})
|
|
1
node_modules/mustache/test/_files/array_of_strings.mustache
generated
vendored
1
node_modules/mustache/test/_files/array_of_strings.mustache
generated
vendored
@ -1 +0,0 @@
|
|||||||
{{#array_of_strings}}{{.}} {{/array_of_strings}}
|
|
1
node_modules/mustache/test/_files/array_of_strings.txt
generated
vendored
1
node_modules/mustache/test/_files/array_of_strings.txt
generated
vendored
@ -1 +0,0 @@
|
|||||||
hello world
|
|
3
node_modules/mustache/test/_files/backslashes.js
generated
vendored
3
node_modules/mustache/test/_files/backslashes.js
generated
vendored
@ -1,3 +0,0 @@
|
|||||||
({
|
|
||||||
value: "\\abc"
|
|
||||||
})
|
|
7
node_modules/mustache/test/_files/backslashes.mustache
generated
vendored
7
node_modules/mustache/test/_files/backslashes.mustache
generated
vendored
@ -1,7 +0,0 @@
|
|||||||
* {{value}}
|
|
||||||
* {{{value}}}
|
|
||||||
* {{&value}}
|
|
||||||
<script>
|
|
||||||
foo = { bar: 'abc\"xyz\"' };
|
|
||||||
foo = { bar: 'x\'y' };
|
|
||||||
</script>
|
|
7
node_modules/mustache/test/_files/backslashes.txt
generated
vendored
7
node_modules/mustache/test/_files/backslashes.txt
generated
vendored
@ -1,7 +0,0 @@
|
|||||||
* \abc
|
|
||||||
* \abc
|
|
||||||
* \abc
|
|
||||||
<script>
|
|
||||||
foo = { bar: 'abc\"xyz\"' };
|
|
||||||
foo = { bar: 'x\'y' };
|
|
||||||
</script>
|
|
3
node_modules/mustache/test/_files/bug_11_eating_whitespace.js
generated
vendored
3
node_modules/mustache/test/_files/bug_11_eating_whitespace.js
generated
vendored
@ -1,3 +0,0 @@
|
|||||||
({
|
|
||||||
tag: "yo"
|
|
||||||
})
|
|
1
node_modules/mustache/test/_files/bug_11_eating_whitespace.mustache
generated
vendored
1
node_modules/mustache/test/_files/bug_11_eating_whitespace.mustache
generated
vendored
@ -1 +0,0 @@
|
|||||||
{{tag}} foo
|
|
1
node_modules/mustache/test/_files/bug_11_eating_whitespace.txt
generated
vendored
1
node_modules/mustache/test/_files/bug_11_eating_whitespace.txt
generated
vendored
@ -1 +0,0 @@
|
|||||||
yo foo
|
|
4
node_modules/mustache/test/_files/changing_delimiters.js
generated
vendored
4
node_modules/mustache/test/_files/changing_delimiters.js
generated
vendored
@ -1,4 +0,0 @@
|
|||||||
({
|
|
||||||
"foo": "foooooooooooooo",
|
|
||||||
"bar": "<b>bar!</b>"
|
|
||||||
})
|
|
1
node_modules/mustache/test/_files/changing_delimiters.mustache
generated
vendored
1
node_modules/mustache/test/_files/changing_delimiters.mustache
generated
vendored
@ -1 +0,0 @@
|
|||||||
{{=<% %>=}}<% foo %> {{foo}} <%{bar}%> {{{bar}}}
|
|
1
node_modules/mustache/test/_files/changing_delimiters.txt
generated
vendored
1
node_modules/mustache/test/_files/changing_delimiters.txt
generated
vendored
@ -1 +0,0 @@
|
|||||||
foooooooooooooo {{foo}} <b>bar!</b> {{{bar}}}
|
|
7
node_modules/mustache/test/_files/check_falsy.js
generated
vendored
7
node_modules/mustache/test/_files/check_falsy.js
generated
vendored
@ -1,7 +0,0 @@
|
|||||||
({
|
|
||||||
number: function(text, render) {
|
|
||||||
return function(text, render) {
|
|
||||||
return +render(text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
1
node_modules/mustache/test/_files/check_falsy.mustache
generated
vendored
1
node_modules/mustache/test/_files/check_falsy.mustache
generated
vendored
@ -1 +0,0 @@
|
|||||||
<p>{{#number}}0{{/number}}</p>
|
|
1
node_modules/mustache/test/_files/check_falsy.txt
generated
vendored
1
node_modules/mustache/test/_files/check_falsy.txt
generated
vendored
@ -1 +0,0 @@
|
|||||||
<p>0</p>
|
|
5
node_modules/mustache/test/_files/comments.js
generated
vendored
5
node_modules/mustache/test/_files/comments.js
generated
vendored
@ -1,5 +0,0 @@
|
|||||||
({
|
|
||||||
title: function () {
|
|
||||||
return "A Comedy of Errors";
|
|
||||||
}
|
|
||||||
})
|
|
1
node_modules/mustache/test/_files/comments.mustache
generated
vendored
1
node_modules/mustache/test/_files/comments.mustache
generated
vendored
@ -1 +0,0 @@
|
|||||||
<h1>{{title}}{{! just something interesting... or not... }}</h1>
|
|
1
node_modules/mustache/test/_files/comments.txt
generated
vendored
1
node_modules/mustache/test/_files/comments.txt
generated
vendored
@ -1 +0,0 @@
|
|||||||
<h1>A Comedy of Errors</h1>
|
|
19
node_modules/mustache/test/_files/complex.js
generated
vendored
19
node_modules/mustache/test/_files/complex.js
generated
vendored
@ -1,19 +0,0 @@
|
|||||||
({
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
})
|
|
16
node_modules/mustache/test/_files/complex.mustache
generated
vendored
16
node_modules/mustache/test/_files/complex.mustache
generated
vendored
@ -1,16 +0,0 @@
|
|||||||
<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}}
|
|
6
node_modules/mustache/test/_files/complex.txt
generated
vendored
6
node_modules/mustache/test/_files/complex.txt
generated
vendored
@ -1,6 +0,0 @@
|
|||||||
<h1>Colors</h1>
|
|
||||||
<ul>
|
|
||||||
<li><strong>red</strong></li>
|
|
||||||
<li><a href="#Green">green</a></li>
|
|
||||||
<li><a href="#Blue">blue</a></li>
|
|
||||||
</ul>
|
|
8
node_modules/mustache/test/_files/context_lookup.js
generated
vendored
8
node_modules/mustache/test/_files/context_lookup.js
generated
vendored
@ -1,8 +0,0 @@
|
|||||||
({
|
|
||||||
"outer": {
|
|
||||||
"id": 1,
|
|
||||||
"second": {
|
|
||||||
"nothing": 2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
1
node_modules/mustache/test/_files/context_lookup.mustache
generated
vendored
1
node_modules/mustache/test/_files/context_lookup.mustache
generated
vendored
@ -1 +0,0 @@
|
|||||||
{{#outer}}{{#second}}{{id}}{{/second}}{{/outer}}
|
|
1
node_modules/mustache/test/_files/context_lookup.txt
generated
vendored
1
node_modules/mustache/test/_files/context_lookup.txt
generated
vendored
@ -1 +0,0 @@
|
|||||||
1
|
|
6
node_modules/mustache/test/_files/delimiters.js
generated
vendored
6
node_modules/mustache/test/_files/delimiters.js
generated
vendored
@ -1,6 +0,0 @@
|
|||||||
({
|
|
||||||
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!."
|
|
||||||
})
|
|
7
node_modules/mustache/test/_files/delimiters.mustache
generated
vendored
7
node_modules/mustache/test/_files/delimiters.mustache
generated
vendored
@ -1,7 +0,0 @@
|
|||||||
{{=<% %>=}}*
|
|
||||||
<% first %>
|
|
||||||
* <% second %>
|
|
||||||
<%=| |=%>
|
|
||||||
* | third |
|
|
||||||
|={{ }}=|
|
|
||||||
* {{ fourth }}
|
|
5
node_modules/mustache/test/_files/delimiters.txt
generated
vendored
5
node_modules/mustache/test/_files/delimiters.txt
generated
vendored
@ -1,5 +0,0 @@
|
|||||||
*
|
|
||||||
It worked the first time.
|
|
||||||
* And it worked the second time.
|
|
||||||
* Then, surprisingly, it worked the third time.
|
|
||||||
* Fourth time also fine!.
|
|
4
node_modules/mustache/test/_files/disappearing_whitespace.js
generated
vendored
4
node_modules/mustache/test/_files/disappearing_whitespace.js
generated
vendored
@ -1,4 +0,0 @@
|
|||||||
({
|
|
||||||
bedrooms: true,
|
|
||||||
total: 1
|
|
||||||
})
|
|
1
node_modules/mustache/test/_files/disappearing_whitespace.mustache
generated
vendored
1
node_modules/mustache/test/_files/disappearing_whitespace.mustache
generated
vendored
@ -1 +0,0 @@
|
|||||||
{{#bedrooms}}{{total}}{{/bedrooms}} BED
|
|
1
node_modules/mustache/test/_files/disappearing_whitespace.txt
generated
vendored
1
node_modules/mustache/test/_files/disappearing_whitespace.txt
generated
vendored
@ -1 +0,0 @@
|
|||||||
1 BED
|
|
23
node_modules/mustache/test/_files/dot_notation.js
generated
vendored
23
node_modules/mustache/test/_files/dot_notation.js
generated
vendored
@ -1,23 +0,0 @@
|
|||||||
({
|
|
||||||
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
|
|
||||||
}
|
|
||||||
})
|
|
9
node_modules/mustache/test/_files/dot_notation.mustache
generated
vendored
9
node_modules/mustache/test/_files/dot_notation.mustache
generated
vendored
@ -1,9 +0,0 @@
|
|||||||
<!-- 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>
|
|
9
node_modules/mustache/test/_files/dot_notation.txt
generated
vendored
9
node_modules/mustache/test/_files/dot_notation.txt
generated
vendored
@ -1,9 +0,0 @@
|
|||||||
<!-- 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>
|
|
5
node_modules/mustache/test/_files/double_render.js
generated
vendored
5
node_modules/mustache/test/_files/double_render.js
generated
vendored
@ -1,5 +0,0 @@
|
|||||||
({
|
|
||||||
foo: true,
|
|
||||||
bar: "{{win}}",
|
|
||||||
win: "FAIL"
|
|
||||||
})
|
|
1
node_modules/mustache/test/_files/double_render.mustache
generated
vendored
1
node_modules/mustache/test/_files/double_render.mustache
generated
vendored
@ -1 +0,0 @@
|
|||||||
{{#foo}}{{bar}}{{/foo}}
|
|
1
node_modules/mustache/test/_files/double_render.txt
generated
vendored
1
node_modules/mustache/test/_files/double_render.txt
generated
vendored
@ -1 +0,0 @@
|
|||||||
{{win}}
|
|
3
node_modules/mustache/test/_files/empty_list.js
generated
vendored
3
node_modules/mustache/test/_files/empty_list.js
generated
vendored
@ -1,3 +0,0 @@
|
|||||||
({
|
|
||||||
jobs: []
|
|
||||||
})
|
|
4
node_modules/mustache/test/_files/empty_list.mustache
generated
vendored
4
node_modules/mustache/test/_files/empty_list.mustache
generated
vendored
@ -1,4 +0,0 @@
|
|||||||
These are the jobs:
|
|
||||||
{{#jobs}}
|
|
||||||
{{.}}
|
|
||||||
{{/jobs}}
|
|
1
node_modules/mustache/test/_files/empty_list.txt
generated
vendored
1
node_modules/mustache/test/_files/empty_list.txt
generated
vendored
@ -1 +0,0 @@
|
|||||||
These are the jobs:
|
|
1
node_modules/mustache/test/_files/empty_sections.js
generated
vendored
1
node_modules/mustache/test/_files/empty_sections.js
generated
vendored
@ -1 +0,0 @@
|
|||||||
({})
|
|
1
node_modules/mustache/test/_files/empty_sections.mustache
generated
vendored
1
node_modules/mustache/test/_files/empty_sections.mustache
generated
vendored
@ -1 +0,0 @@
|
|||||||
{{#foo}}{{/foo}}foo{{#bar}}{{/bar}}
|
|
1
node_modules/mustache/test/_files/empty_sections.txt
generated
vendored
1
node_modules/mustache/test/_files/empty_sections.txt
generated
vendored
@ -1 +0,0 @@
|
|||||||
foo
|
|
6
node_modules/mustache/test/_files/empty_string.js
generated
vendored
6
node_modules/mustache/test/_files/empty_string.js
generated
vendored
@ -1,6 +0,0 @@
|
|||||||
({
|
|
||||||
description: "That is all!",
|
|
||||||
child: {
|
|
||||||
description: ""
|
|
||||||
}
|
|
||||||
})
|
|
1
node_modules/mustache/test/_files/empty_string.mustache
generated
vendored
1
node_modules/mustache/test/_files/empty_string.mustache
generated
vendored
@ -1 +0,0 @@
|
|||||||
{{description}}{{#child}}{{description}}{{/child}}
|
|
1
node_modules/mustache/test/_files/empty_string.txt
generated
vendored
1
node_modules/mustache/test/_files/empty_string.txt
generated
vendored
@ -1 +0,0 @@
|
|||||||
That is all!
|
|
1
node_modules/mustache/test/_files/empty_template.js
generated
vendored
1
node_modules/mustache/test/_files/empty_template.js
generated
vendored
@ -1 +0,0 @@
|
|||||||
({})
|
|
1
node_modules/mustache/test/_files/empty_template.mustache
generated
vendored
1
node_modules/mustache/test/_files/empty_template.mustache
generated
vendored
@ -1 +0,0 @@
|
|||||||
<html><head></head><body><h1>Test</h1></body></html>
|
|
1
node_modules/mustache/test/_files/empty_template.txt
generated
vendored
1
node_modules/mustache/test/_files/empty_template.txt
generated
vendored
@ -1 +0,0 @@
|
|||||||
<html><head></head><body><h1>Test</h1></body></html>
|
|
3
node_modules/mustache/test/_files/error_not_found.js
generated
vendored
3
node_modules/mustache/test/_files/error_not_found.js
generated
vendored
@ -1,3 +0,0 @@
|
|||||||
({
|
|
||||||
bar: 2
|
|
||||||
})
|
|
1
node_modules/mustache/test/_files/error_not_found.mustache
generated
vendored
1
node_modules/mustache/test/_files/error_not_found.mustache
generated
vendored
@ -1 +0,0 @@
|
|||||||
{{foo}}
|
|
0
node_modules/mustache/test/_files/error_not_found.txt
generated
vendored
0
node_modules/mustache/test/_files/error_not_found.txt
generated
vendored
6
node_modules/mustache/test/_files/escaped.js
generated
vendored
6
node_modules/mustache/test/_files/escaped.js
generated
vendored
@ -1,6 +0,0 @@
|
|||||||
({
|
|
||||||
title: function () {
|
|
||||||
return "Bear > Shark";
|
|
||||||
},
|
|
||||||
entities: "" \"'<>/"
|
|
||||||
})
|
|
2
node_modules/mustache/test/_files/escaped.mustache
generated
vendored
2
node_modules/mustache/test/_files/escaped.mustache
generated
vendored
@ -1,2 +0,0 @@
|
|||||||
<h1>{{title}}</h1>
|
|
||||||
And even {{entities}}, but not {{{entities}}}.
|
|
2
node_modules/mustache/test/_files/escaped.txt
generated
vendored
2
node_modules/mustache/test/_files/escaped.txt
generated
vendored
@ -1,2 +0,0 @@
|
|||||||
<h1>Bear > Shark</h1>
|
|
||||||
And even &quot; "'<>/, but not " "'<>/.
|
|
8
node_modules/mustache/test/_files/falsy.js
generated
vendored
8
node_modules/mustache/test/_files/falsy.js
generated
vendored
@ -1,8 +0,0 @@
|
|||||||
({
|
|
||||||
"emptyString": "",
|
|
||||||
"emptyArray": [],
|
|
||||||
"zero": 0,
|
|
||||||
"null": null,
|
|
||||||
"undefined": undefined,
|
|
||||||
"NaN": 0/0
|
|
||||||
})
|
|
12
node_modules/mustache/test/_files/falsy.mustache
generated
vendored
12
node_modules/mustache/test/_files/falsy.mustache
generated
vendored
@ -1,12 +0,0 @@
|
|||||||
{{#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}}
|
|
12
node_modules/mustache/test/_files/falsy.txt
generated
vendored
12
node_modules/mustache/test/_files/falsy.txt
generated
vendored
@ -1,12 +0,0 @@
|
|||||||
|
|
||||||
inverted empty string
|
|
||||||
|
|
||||||
inverted empty array
|
|
||||||
|
|
||||||
inverted zero
|
|
||||||
|
|
||||||
inverted null
|
|
||||||
|
|
||||||
inverted undefined
|
|
||||||
|
|
||||||
inverted NaN
|
|
19
node_modules/mustache/test/_files/grandparent_context.js
generated
vendored
19
node_modules/mustache/test/_files/grandparent_context.js
generated
vendored
@ -1,19 +0,0 @@
|
|||||||
({
|
|
||||||
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' }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
})
|
|
10
node_modules/mustache/test/_files/grandparent_context.mustache
generated
vendored
10
node_modules/mustache/test/_files/grandparent_context.mustache
generated
vendored
@ -1,10 +0,0 @@
|
|||||||
{{grand_parent_id}}
|
|
||||||
{{#parent_contexts}}
|
|
||||||
{{grand_parent_id}}
|
|
||||||
{{parent_id}}
|
|
||||||
{{#child_contexts}}
|
|
||||||
{{grand_parent_id}}
|
|
||||||
{{parent_id}}
|
|
||||||
{{child_id}}
|
|
||||||
{{/child_contexts}}
|
|
||||||
{{/parent_contexts}}
|
|
17
node_modules/mustache/test/_files/grandparent_context.txt
generated
vendored
17
node_modules/mustache/test/_files/grandparent_context.txt
generated
vendored
@ -1,17 +0,0 @@
|
|||||||
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
|
|
9
node_modules/mustache/test/_files/higher_order_sections.js
generated
vendored
9
node_modules/mustache/test/_files/higher_order_sections.js
generated
vendored
@ -1,9 +0,0 @@
|
|||||||
({
|
|
||||||
name: "Tater",
|
|
||||||
helper: "To tinker?",
|
|
||||||
bolder: function () {
|
|
||||||
return function (text, render) {
|
|
||||||
return text + ' => <b>' + render(text) + '</b> ' + this.helper;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
1
node_modules/mustache/test/_files/higher_order_sections.mustache
generated
vendored
1
node_modules/mustache/test/_files/higher_order_sections.mustache
generated
vendored
@ -1 +0,0 @@
|
|||||||
{{#bolder}}Hi {{name}}.{{/bolder}}
|
|
1
node_modules/mustache/test/_files/higher_order_sections.txt
generated
vendored
1
node_modules/mustache/test/_files/higher_order_sections.txt
generated
vendored
@ -1 +0,0 @@
|
|||||||
Hi {{name}}. => <b>Hi Tater.</b> To tinker?
|
|
3
node_modules/mustache/test/_files/included_tag.js
generated
vendored
3
node_modules/mustache/test/_files/included_tag.js
generated
vendored
@ -1,3 +0,0 @@
|
|||||||
({
|
|
||||||
html: "I like {{mustache}}"
|
|
||||||
})
|
|
1
node_modules/mustache/test/_files/included_tag.mustache
generated
vendored
1
node_modules/mustache/test/_files/included_tag.mustache
generated
vendored
@ -1 +0,0 @@
|
|||||||
You said "{{{html}}}" today
|
|
1
node_modules/mustache/test/_files/included_tag.txt
generated
vendored
1
node_modules/mustache/test/_files/included_tag.txt
generated
vendored
@ -1 +0,0 @@
|
|||||||
You said "I like {{mustache}}" today
|
|
3
node_modules/mustache/test/_files/inverted_section.js
generated
vendored
3
node_modules/mustache/test/_files/inverted_section.js
generated
vendored
@ -1,3 +0,0 @@
|
|||||||
({
|
|
||||||
"repos": []
|
|
||||||
})
|
|
3
node_modules/mustache/test/_files/inverted_section.mustache
generated
vendored
3
node_modules/mustache/test/_files/inverted_section.mustache
generated
vendored
@ -1,3 +0,0 @@
|
|||||||
{{#repos}}<b>{{name}}</b>{{/repos}}
|
|
||||||
{{^repos}}No repos :({{/repos}}
|
|
||||||
{{^nothin}}Hello!{{/nothin}}
|
|
3
node_modules/mustache/test/_files/inverted_section.txt
generated
vendored
3
node_modules/mustache/test/_files/inverted_section.txt
generated
vendored
@ -1,3 +0,0 @@
|
|||||||
|
|
||||||
No repos :(
|
|
||||||
Hello!
|
|
5
node_modules/mustache/test/_files/keys_with_questionmarks.js
generated
vendored
5
node_modules/mustache/test/_files/keys_with_questionmarks.js
generated
vendored
@ -1,5 +0,0 @@
|
|||||||
({
|
|
||||||
"person?": {
|
|
||||||
name: "Jon"
|
|
||||||
}
|
|
||||||
})
|
|
3
node_modules/mustache/test/_files/keys_with_questionmarks.mustache
generated
vendored
3
node_modules/mustache/test/_files/keys_with_questionmarks.mustache
generated
vendored
@ -1,3 +0,0 @@
|
|||||||
{{#person?}}
|
|
||||||
Hi {{name}}!
|
|
||||||
{{/person?}}
|
|
1
node_modules/mustache/test/_files/keys_with_questionmarks.txt
generated
vendored
1
node_modules/mustache/test/_files/keys_with_questionmarks.txt
generated
vendored
@ -1 +0,0 @@
|
|||||||
Hi Jon!
|
|
1
node_modules/mustache/test/_files/malicious_template.js
generated
vendored
1
node_modules/mustache/test/_files/malicious_template.js
generated
vendored
@ -1 +0,0 @@
|
|||||||
({})
|
|
5
node_modules/mustache/test/_files/malicious_template.mustache
generated
vendored
5
node_modules/mustache/test/_files/malicious_template.mustache
generated
vendored
@ -1,5 +0,0 @@
|
|||||||
{{"+(function () {throw "evil"})()+"}}
|
|
||||||
{{{"+(function () {throw "evil"})()+"}}}
|
|
||||||
{{> "+(function () {throw "evil"})()+"}}
|
|
||||||
{{# "+(function () {throw "evil"})()+"}}
|
|
||||||
{{/ "+(function () {throw "evil"})()+"}}
|
|
2
node_modules/mustache/test/_files/malicious_template.txt
generated
vendored
2
node_modules/mustache/test/_files/malicious_template.txt
generated
vendored
@ -1,2 +0,0 @@
|
|||||||
|
|
||||||
|
|
1
node_modules/mustache/test/_files/multiline_comment.js
generated
vendored
1
node_modules/mustache/test/_files/multiline_comment.js
generated
vendored
@ -1 +0,0 @@
|
|||||||
({})
|
|
6
node_modules/mustache/test/_files/multiline_comment.mustache
generated
vendored
6
node_modules/mustache/test/_files/multiline_comment.mustache
generated
vendored
@ -1,6 +0,0 @@
|
|||||||
{{!
|
|
||||||
|
|
||||||
This is a multi-line comment.
|
|
||||||
|
|
||||||
}}
|
|
||||||
Hello world!
|
|
1
node_modules/mustache/test/_files/multiline_comment.txt
generated
vendored
1
node_modules/mustache/test/_files/multiline_comment.txt
generated
vendored
@ -1 +0,0 @@
|
|||||||
Hello world!
|
|
8
node_modules/mustache/test/_files/nested_higher_order_sections.js
generated
vendored
8
node_modules/mustache/test/_files/nested_higher_order_sections.js
generated
vendored
@ -1,8 +0,0 @@
|
|||||||
({
|
|
||||||
bold: function () {
|
|
||||||
return function (text, render) {
|
|
||||||
return '<b>' + render(text) + '</b>';
|
|
||||||
};
|
|
||||||
},
|
|
||||||
person: { name: 'Jonas' }
|
|
||||||
});
|
|
1
node_modules/mustache/test/_files/nested_higher_order_sections.mustache
generated
vendored
1
node_modules/mustache/test/_files/nested_higher_order_sections.mustache
generated
vendored
@ -1 +0,0 @@
|
|||||||
{{#bold}}{{#person}}My name is {{name}}!{{/person}}{{/bold}}
|
|
1
node_modules/mustache/test/_files/nested_higher_order_sections.txt
generated
vendored
1
node_modules/mustache/test/_files/nested_higher_order_sections.txt
generated
vendored
@ -1 +0,0 @@
|
|||||||
<b>My name is Jonas!</b>
|
|
8
node_modules/mustache/test/_files/nested_iterating.js
generated
vendored
8
node_modules/mustache/test/_files/nested_iterating.js
generated
vendored
@ -1,8 +0,0 @@
|
|||||||
({
|
|
||||||
inner: [{
|
|
||||||
foo: 'foo',
|
|
||||||
inner: [{
|
|
||||||
bar: 'bar'
|
|
||||||
}]
|
|
||||||
}]
|
|
||||||
})
|
|
1
node_modules/mustache/test/_files/nested_iterating.mustache
generated
vendored
1
node_modules/mustache/test/_files/nested_iterating.mustache
generated
vendored
@ -1 +0,0 @@
|
|||||||
{{#inner}}{{foo}}{{#inner}}{{bar}}{{/inner}}{{/inner}}
|
|
1
node_modules/mustache/test/_files/nested_iterating.txt
generated
vendored
1
node_modules/mustache/test/_files/nested_iterating.txt
generated
vendored
@ -1 +0,0 @@
|
|||||||
foobar
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user