[vendor] backbone version upgrade (ver 1.3.3)
2
vendor/backbone/CNAME
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
backbonejs.org
|
||||||
|
|
22
vendor/backbone/CONTRIBUTING.md
vendored
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
## How to Open a Backbone.js Ticket
|
||||||
|
|
||||||
|
* Do not use tickets to ask for help with (debugging) your application. Ask on
|
||||||
|
the [mailing list](https://groups.google.com/forum/#!forum/backbonejs),
|
||||||
|
in the IRC channel (`#documentcloud` on Freenode), or if you understand your
|
||||||
|
specific problem, on [StackOverflow](http://stackoverflow.com/questions/tagged/backbone.js).
|
||||||
|
|
||||||
|
* Before you open a ticket or send a pull request,
|
||||||
|
[search](https://github.com/jashkenas/backbone/issues) for previous
|
||||||
|
discussions about the same feature or issue. Add to the earlier ticket if you
|
||||||
|
find one.
|
||||||
|
|
||||||
|
* Before sending a pull request for a feature or bug fix, be sure to have
|
||||||
|
[tests](http://backbonejs.org/test/).
|
||||||
|
|
||||||
|
* Use the same coding style as the rest of the
|
||||||
|
[codebase](https://github.com/jashkenas/backbone/blob/master/backbone.js).
|
||||||
|
|
||||||
|
* In your pull request, do not add documentation or rebuild the minified
|
||||||
|
`backbone-min.js` file. We'll do that before cutting a new release.
|
||||||
|
|
||||||
|
* All pull requests should be made to the `master` branch.
|
22
vendor/backbone/LICENSE
vendored
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
Copyright (c) 2010-2017 Jeremy Ashkenas, DocumentCloud
|
||||||
|
|
||||||
|
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.
|
34
vendor/backbone/README.md
vendored
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
____ __ __
|
||||||
|
/\ _`\ /\ \ /\ \ __
|
||||||
|
\ \ \ \ \ __ ___\ \ \/'\\ \ \____ ___ ___ __ /\_\ ____
|
||||||
|
\ \ _ <' /'__`\ /'___\ \ , < \ \ '__`\ / __`\ /' _ `\ /'__`\ \/\ \ /',__\
|
||||||
|
\ \ \ \ \/\ \ \.\_/\ \__/\ \ \\`\\ \ \ \ \/\ \ \ \/\ \/\ \/\ __/ __ \ \ \/\__, `\
|
||||||
|
\ \____/\ \__/.\_\ \____\\ \_\ \_\ \_,__/\ \____/\ \_\ \_\ \____\/\_\_\ \ \/\____/
|
||||||
|
\/___/ \/__/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/_/\/_/\/____/\/_/\ \_\ \/___/
|
||||||
|
\ \____/
|
||||||
|
\/___/
|
||||||
|
(_'_______________________________________________________________________________'_)
|
||||||
|
(_.———————————————————————————————————————————————————————————————————————————————._)
|
||||||
|
|
||||||
|
|
||||||
|
Backbone supplies structure to JavaScript-heavy applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing application over a RESTful JSON interface.
|
||||||
|
|
||||||
|
For Docs, License, Tests, pre-packed downloads, and everything else, really, see:
|
||||||
|
http://backbonejs.org
|
||||||
|
|
||||||
|
To suggest a feature or report a bug:
|
||||||
|
https://github.com/jashkenas/backbone/issues
|
||||||
|
|
||||||
|
For questions on working with Backbone or general discussions:
|
||||||
|
https://groups.google.com/forum/#!forum/backbonejs,
|
||||||
|
http://stackoverflow.com/questions/tagged/backbone.js, or
|
||||||
|
https://gitter.im/jashkenas/backbone
|
||||||
|
|
||||||
|
Backbone is an open-sourced component of DocumentCloud:
|
||||||
|
https://github.com/documentcloud
|
||||||
|
|
||||||
|
Many thanks to our contributors:
|
||||||
|
https://github.com/jashkenas/backbone/graphs/contributors
|
||||||
|
|
||||||
|
Special thanks to Robert Kieffer for the original philosophy behind Backbone.
|
||||||
|
https://github.com/broofa
|
2
vendor/backbone/backbone-min.js
vendored
Normal file
1
vendor/backbone/backbone-min.map
vendored
Normal file
2096
vendor/backbone/backbone.js
vendored
Normal file
8
vendor/backbone/bower.json
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"name" : "backbone",
|
||||||
|
"main" : "backbone.js",
|
||||||
|
"dependencies" : {
|
||||||
|
"underscore" : ">=1.8.3"
|
||||||
|
},
|
||||||
|
"ignore" : ["docs", "examples", "test", "*.yml", "*.html", "*.ico", "*.md", "CNAME", ".*", "karma.*", "package.json"]
|
||||||
|
}
|
5001
vendor/backbone/docs/backbone.html
vendored
Normal file
464
vendor/backbone/docs/backbone.localStorage.html
vendored
Normal file
|
@ -0,0 +1,464 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>backbone.localStorage.js</title>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||||
|
<link rel="stylesheet" media="all" href="docco.css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="container">
|
||||||
|
<div id="background"></div>
|
||||||
|
|
||||||
|
<ul id="jump_to">
|
||||||
|
<li>
|
||||||
|
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||||
|
<a class="small" href="javascript:void(0);">+</a>
|
||||||
|
<div id="jump_wrapper">
|
||||||
|
<div id="jump_page_wrapper">
|
||||||
|
<div id="jump_page">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="source" href="backbone.localStorage.html">
|
||||||
|
backbone.localStorage.js
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
<a class="source" href="todos.html">
|
||||||
|
todos.js
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul class="sections">
|
||||||
|
|
||||||
|
<li id="title">
|
||||||
|
<div class="annotation">
|
||||||
|
<h1>backbone.localStorage.js</h1>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-1">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-1">¶</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre><span class="hljs-comment">/**
|
||||||
|
* Backbone localStorage Adapter
|
||||||
|
* Version 1.1.0
|
||||||
|
*
|
||||||
|
* https://github.com/jeromegn/Backbone.localStorage
|
||||||
|
*/</span>
|
||||||
|
(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">root, factory</span>) </span>{
|
||||||
|
<span class="hljs-keyword">if</span> (<span class="hljs-keyword">typeof</span> define === <span class="hljs-string">"function"</span> && define.amd) {</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-2">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-2">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>AMD. Register as an anonymous module.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> define([<span class="hljs-string">"underscore"</span>,<span class="hljs-string">"backbone"</span>], <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">_, Backbone</span>) </span>{</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-3">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-3">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Use global variables if the locals are undefined.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">return</span> factory(_ || root._, Backbone || root.Backbone);
|
||||||
|
});
|
||||||
|
} <span class="hljs-keyword">else</span> {</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-4">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-4">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>RequireJS isn’t being used. Assume underscore and backbone are loaded in script tags</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> factory(_, Backbone);
|
||||||
|
}
|
||||||
|
}(<span class="hljs-keyword">this</span>, <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">_, Backbone</span>) </span>{</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-5">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-5">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>A simple module to replace <code>Backbone.sync</code> with <em>localStorage</em>-based
|
||||||
|
persistence. Models are given GUIDS, and saved into a JSON object. Simple
|
||||||
|
as that.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-6">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-6">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Hold reference to Underscore.js and Backbone.js in the closure in order
|
||||||
|
to make things work even if they are removed from the global namespace</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-7">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-7">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Generate four random hex digits.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">S4</span>(<span class="hljs-params"></span>) </span>{
|
||||||
|
<span class="hljs-keyword">return</span> (((<span class="hljs-number">1</span>+<span class="hljs-built_in">Math</span>.random())*<span class="hljs-number">0x10000</span>)|<span class="hljs-number">0</span>).toString(<span class="hljs-number">16</span>).substring(<span class="hljs-number">1</span>);
|
||||||
|
};</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-8">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-8">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Generate a pseudo-GUID by concatenating random hexadecimal.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">guid</span>(<span class="hljs-params"></span>) </span>{
|
||||||
|
<span class="hljs-keyword">return</span> (S4()+S4()+<span class="hljs-string">"-"</span>+S4()+<span class="hljs-string">"-"</span>+S4()+<span class="hljs-string">"-"</span>+S4()+<span class="hljs-string">"-"</span>+S4()+S4()+S4());
|
||||||
|
};</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-9">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-9">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Our Store is represented by a single JS object in <em>localStorage</em>. Create it
|
||||||
|
with a meaningful name, like the name you’d give a table.
|
||||||
|
window.Store is deprecated, use Backbone.LocalStorage instead</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre>Backbone.LocalStorage = <span class="hljs-built_in">window</span>.Store = <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">name</span>) </span>{
|
||||||
|
<span class="hljs-keyword">this</span>.name = name;
|
||||||
|
<span class="hljs-keyword">var</span> store = <span class="hljs-keyword">this</span>.localStorage().getItem(<span class="hljs-keyword">this</span>.name);
|
||||||
|
<span class="hljs-keyword">this</span>.records = (store && store.split(<span class="hljs-string">","</span>)) || [];
|
||||||
|
};
|
||||||
|
|
||||||
|
_.extend(Backbone.LocalStorage.prototype, {</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-10">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-10">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Save the current state of the <strong>Store</strong> to <em>localStorage</em>.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> save: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
|
||||||
|
<span class="hljs-keyword">this</span>.localStorage().setItem(<span class="hljs-keyword">this</span>.name, <span class="hljs-keyword">this</span>.records.join(<span class="hljs-string">","</span>));
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-11">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-11">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Add a model, giving it a (hopefully)-unique GUID, if it doesn’t already
|
||||||
|
have an id of it’s own.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> create: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">model</span>) </span>{
|
||||||
|
<span class="hljs-keyword">if</span> (!model.id) {
|
||||||
|
model.id = guid();
|
||||||
|
model.set(model.idAttribute, model.id);
|
||||||
|
}
|
||||||
|
<span class="hljs-keyword">this</span>.localStorage().setItem(<span class="hljs-keyword">this</span>.name+<span class="hljs-string">"-"</span>+model.id, <span class="hljs-built_in">JSON</span>.stringify(model));
|
||||||
|
<span class="hljs-keyword">this</span>.records.push(model.id.toString());
|
||||||
|
<span class="hljs-keyword">this</span>.save();
|
||||||
|
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.find(model);
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-12">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-12">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Update a model by replacing its copy in <code>this.data</code>.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> update: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">model</span>) </span>{
|
||||||
|
<span class="hljs-keyword">this</span>.localStorage().setItem(<span class="hljs-keyword">this</span>.name+<span class="hljs-string">"-"</span>+model.id, <span class="hljs-built_in">JSON</span>.stringify(model));
|
||||||
|
<span class="hljs-keyword">if</span> (!_.include(<span class="hljs-keyword">this</span>.records, model.id.toString()))
|
||||||
|
<span class="hljs-keyword">this</span>.records.push(model.id.toString()); <span class="hljs-keyword">this</span>.save();
|
||||||
|
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.find(model);
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-13">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-13">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Retrieve a model from <code>this.data</code> by id.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> find: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">model</span>) </span>{
|
||||||
|
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.jsonData(<span class="hljs-keyword">this</span>.localStorage().getItem(<span class="hljs-keyword">this</span>.name+<span class="hljs-string">"-"</span>+model.id));
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-14">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-14">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Return the array of all models currently in storage.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> findAll: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
|
||||||
|
<span class="hljs-keyword">return</span> _(<span class="hljs-keyword">this</span>.records).chain()
|
||||||
|
.map(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">id</span>)</span>{
|
||||||
|
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.jsonData(<span class="hljs-keyword">this</span>.localStorage().getItem(<span class="hljs-keyword">this</span>.name+<span class="hljs-string">"-"</span>+id));
|
||||||
|
}, <span class="hljs-keyword">this</span>)
|
||||||
|
.compact()
|
||||||
|
.value();
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-15">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-15">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Delete a model from <code>this.data</code>, returning it.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> destroy: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">model</span>) </span>{
|
||||||
|
<span class="hljs-keyword">if</span> (model.isNew())
|
||||||
|
<span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>
|
||||||
|
<span class="hljs-keyword">this</span>.localStorage().removeItem(<span class="hljs-keyword">this</span>.name+<span class="hljs-string">"-"</span>+model.id);
|
||||||
|
<span class="hljs-keyword">this</span>.records = _.reject(<span class="hljs-keyword">this</span>.records, <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">id</span>)</span>{
|
||||||
|
<span class="hljs-keyword">return</span> id === model.id.toString();
|
||||||
|
});
|
||||||
|
<span class="hljs-keyword">this</span>.save();
|
||||||
|
<span class="hljs-keyword">return</span> model;
|
||||||
|
},
|
||||||
|
|
||||||
|
localStorage: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
|
||||||
|
<span class="hljs-keyword">return</span> localStorage;
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-16">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-16">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>fix for “illegal access” error on Android when JSON.parse is passed null</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> jsonData: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">data</span>) </span>{
|
||||||
|
<span class="hljs-keyword">return</span> data && <span class="hljs-built_in">JSON</span>.parse(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
});</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-17">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-17">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>localSync delegate to the model or collection’s
|
||||||
|
<em>localStorage</em> property, which should be an instance of <code>Store</code>.
|
||||||
|
window.Store.sync and Backbone.localSync is deprectated, use Backbone.LocalStorage.sync instead</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre>Backbone.LocalStorage.sync = <span class="hljs-built_in">window</span>.Store.sync = Backbone.localSync = <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">method, model, options</span>) </span>{
|
||||||
|
<span class="hljs-keyword">var</span> store = model.localStorage || model.collection.localStorage;
|
||||||
|
|
||||||
|
<span class="hljs-keyword">var</span> resp, errorMessage, syncDfd = $.Deferred && $.Deferred(); <span class="hljs-comment">//If $ is having Deferred - use it.</span>
|
||||||
|
|
||||||
|
<span class="hljs-keyword">try</span> {
|
||||||
|
|
||||||
|
<span class="hljs-keyword">switch</span> (method) {
|
||||||
|
<span class="hljs-keyword">case</span> <span class="hljs-string">"read"</span>:
|
||||||
|
resp = model.id != <span class="hljs-literal">undefined</span> ? store.find(model) : store.findAll();
|
||||||
|
<span class="hljs-keyword">break</span>;
|
||||||
|
<span class="hljs-keyword">case</span> <span class="hljs-string">"create"</span>:
|
||||||
|
resp = store.create(model);
|
||||||
|
<span class="hljs-keyword">break</span>;
|
||||||
|
<span class="hljs-keyword">case</span> <span class="hljs-string">"update"</span>:
|
||||||
|
resp = store.update(model);
|
||||||
|
<span class="hljs-keyword">break</span>;
|
||||||
|
<span class="hljs-keyword">case</span> <span class="hljs-string">"delete"</span>:
|
||||||
|
resp = store.destroy(model);
|
||||||
|
<span class="hljs-keyword">break</span>;
|
||||||
|
}
|
||||||
|
|
||||||
|
} <span class="hljs-keyword">catch</span>(error) {
|
||||||
|
<span class="hljs-keyword">if</span> (error.code === DOMException.QUOTA_EXCEEDED_ERR && <span class="hljs-built_in">window</span>.localStorage.length === <span class="hljs-number">0</span>)
|
||||||
|
errorMessage = <span class="hljs-string">"Private browsing is unsupported"</span>;
|
||||||
|
<span class="hljs-keyword">else</span>
|
||||||
|
errorMessage = error.message;
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="hljs-keyword">if</span> (resp) {
|
||||||
|
model.trigger(<span class="hljs-string">"sync"</span>, model, resp, options);
|
||||||
|
<span class="hljs-keyword">if</span> (options && options.success)
|
||||||
|
options.success(resp);
|
||||||
|
<span class="hljs-keyword">if</span> (syncDfd)
|
||||||
|
syncDfd.resolve(resp);
|
||||||
|
|
||||||
|
} <span class="hljs-keyword">else</span> {
|
||||||
|
errorMessage = errorMessage ? errorMessage
|
||||||
|
: <span class="hljs-string">"Record Not Found"</span>;
|
||||||
|
|
||||||
|
<span class="hljs-keyword">if</span> (options && options.error)
|
||||||
|
options.error(errorMessage);
|
||||||
|
<span class="hljs-keyword">if</span> (syncDfd)
|
||||||
|
syncDfd.reject(errorMessage);
|
||||||
|
}</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-18">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-18">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>add compatibility with $.ajax
|
||||||
|
always execute callback for success and error</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> (options && options.complete) options.complete(resp);
|
||||||
|
|
||||||
|
<span class="hljs-keyword">return</span> syncDfd && syncDfd.promise();
|
||||||
|
};
|
||||||
|
|
||||||
|
Backbone.ajaxSync = Backbone.sync;
|
||||||
|
|
||||||
|
Backbone.getSyncMethod = <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">model</span>) </span>{
|
||||||
|
<span class="hljs-keyword">if</span>(model.localStorage || (model.collection && model.collection.localStorage)) {
|
||||||
|
<span class="hljs-keyword">return</span> Backbone.localSync;
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="hljs-keyword">return</span> Backbone.ajaxSync;
|
||||||
|
};</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-19">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-19">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Override ‘Backbone.sync’ to default to localSync,
|
||||||
|
the original ‘Backbone.sync’ is still available in ‘Backbone.ajaxSync’</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre>Backbone.sync = <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">method, model, options</span>) </span>{
|
||||||
|
<span class="hljs-keyword">return</span> Backbone.getSyncMethod(model).apply(<span class="hljs-keyword">this</span>, [method, model, options]);
|
||||||
|
};
|
||||||
|
|
||||||
|
<span class="hljs-keyword">return</span> Backbone.LocalStorage;
|
||||||
|
}));</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
518
vendor/backbone/docs/docco.css
vendored
Normal file
|
@ -0,0 +1,518 @@
|
||||||
|
/*--------------------- Typography ----------------------------*/
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'aller-light';
|
||||||
|
src: url('public/fonts/aller-light.eot');
|
||||||
|
src: url('public/fonts/aller-light.eot?#iefix') format('embedded-opentype'),
|
||||||
|
url('public/fonts/aller-light.woff') format('woff'),
|
||||||
|
url('public/fonts/aller-light.ttf') format('truetype');
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'aller-bold';
|
||||||
|
src: url('public/fonts/aller-bold.eot');
|
||||||
|
src: url('public/fonts/aller-bold.eot?#iefix') format('embedded-opentype'),
|
||||||
|
url('public/fonts/aller-bold.woff') format('woff'),
|
||||||
|
url('public/fonts/aller-bold.ttf') format('truetype');
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'roboto-black';
|
||||||
|
src: url('public/fonts/roboto-black.eot');
|
||||||
|
src: url('public/fonts/roboto-black.eot?#iefix') format('embedded-opentype'),
|
||||||
|
url('public/fonts/roboto-black.woff') format('woff'),
|
||||||
|
url('public/fonts/roboto-black.ttf') format('truetype');
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------- Layout ----------------------------*/
|
||||||
|
html { height: 100%; }
|
||||||
|
body {
|
||||||
|
font-family: "aller-light";
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 18px;
|
||||||
|
color: #30404f;
|
||||||
|
margin: 0; padding: 0;
|
||||||
|
height:100%;
|
||||||
|
}
|
||||||
|
#container { min-height: 100%; }
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
b, strong {
|
||||||
|
font-weight: normal;
|
||||||
|
font-family: "aller-bold";
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 15px 0 0px;
|
||||||
|
}
|
||||||
|
.annotation ul, .annotation ol {
|
||||||
|
margin: 25px 0;
|
||||||
|
}
|
||||||
|
.annotation ul li, .annotation ol li {
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 18px;
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1, h2, h3, h4, h5, h6 {
|
||||||
|
color: #112233;
|
||||||
|
line-height: 1em;
|
||||||
|
font-weight: normal;
|
||||||
|
font-family: "roboto-black";
|
||||||
|
text-transform: uppercase;
|
||||||
|
margin: 30px 0 15px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
margin-top: 40px;
|
||||||
|
}
|
||||||
|
h2 {
|
||||||
|
font-size: 1.26em;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr {
|
||||||
|
border: 0;
|
||||||
|
background: 1px #ddd;
|
||||||
|
height: 1px;
|
||||||
|
margin: 20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre, tt, code {
|
||||||
|
font-size: 12px; line-height: 16px;
|
||||||
|
font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace;
|
||||||
|
margin: 0; padding: 0;
|
||||||
|
}
|
||||||
|
.annotation pre {
|
||||||
|
display: block;
|
||||||
|
margin: 0;
|
||||||
|
padding: 7px 10px;
|
||||||
|
background: #fcfcfc;
|
||||||
|
-moz-box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
|
||||||
|
-webkit-box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
|
||||||
|
box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
.annotation pre code {
|
||||||
|
border: 0;
|
||||||
|
padding: 0;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
blockquote {
|
||||||
|
border-left: 5px solid #ccc;
|
||||||
|
margin: 0;
|
||||||
|
padding: 1px 0 1px 1em;
|
||||||
|
}
|
||||||
|
.sections blockquote p {
|
||||||
|
font-family: Menlo, Consolas, Monaco, monospace;
|
||||||
|
font-size: 12px; line-height: 16px;
|
||||||
|
color: #999;
|
||||||
|
margin: 10px 0 0;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.sections {
|
||||||
|
list-style: none;
|
||||||
|
padding:0 0 5px 0;;
|
||||||
|
margin:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Force border-box so that % widths fit the parent
|
||||||
|
container without overlap because of margin/padding.
|
||||||
|
|
||||||
|
More Info : http://www.quirksmode.org/css/box.html
|
||||||
|
*/
|
||||||
|
ul.sections > li > div {
|
||||||
|
-moz-box-sizing: border-box; /* firefox */
|
||||||
|
-ms-box-sizing: border-box; /* ie */
|
||||||
|
-webkit-box-sizing: border-box; /* webkit */
|
||||||
|
-khtml-box-sizing: border-box; /* konqueror */
|
||||||
|
box-sizing: border-box; /* css3 */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------- Jump Page -----------------------------*/
|
||||||
|
#jump_to, #jump_page {
|
||||||
|
margin: 0;
|
||||||
|
background: white;
|
||||||
|
-webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777;
|
||||||
|
-webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px;
|
||||||
|
font: 16px Arial;
|
||||||
|
cursor: pointer;
|
||||||
|
text-align: right;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#jump_to a {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#jump_to a.large {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#jump_to a.small {
|
||||||
|
font-size: 22px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #676767;
|
||||||
|
}
|
||||||
|
|
||||||
|
#jump_to, #jump_wrapper {
|
||||||
|
position: fixed;
|
||||||
|
right: 0; top: 0;
|
||||||
|
padding: 10px 15px;
|
||||||
|
margin:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#jump_wrapper {
|
||||||
|
display: none;
|
||||||
|
padding:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#jump_to:hover #jump_wrapper {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
#jump_page_wrapper{
|
||||||
|
position: fixed;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#jump_page {
|
||||||
|
padding: 5px 0 3px;
|
||||||
|
margin: 0 0 25px 25px;
|
||||||
|
max-height: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#jump_page .source {
|
||||||
|
display: block;
|
||||||
|
padding: 15px;
|
||||||
|
text-decoration: none;
|
||||||
|
border-top: 1px solid #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
#jump_page .source:hover {
|
||||||
|
background: #f5f5ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#jump_page .source:first-child {
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------- Low resolutions (> 320px) ---------------------*/
|
||||||
|
@media only screen and (min-width: 320px) {
|
||||||
|
.pilwrap { display: none; }
|
||||||
|
|
||||||
|
ul.sections > li > div {
|
||||||
|
display: block;
|
||||||
|
padding:5px 10px 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.sections > li > div.annotation ul, ul.sections > li > div.annotation ol {
|
||||||
|
padding-left: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.sections > li > div.content {
|
||||||
|
overflow-x:auto;
|
||||||
|
-webkit-box-shadow: inset 0 0 5px #e5e5ee;
|
||||||
|
box-shadow: inset 0 0 5px #e5e5ee;
|
||||||
|
border: 1px solid #dedede;
|
||||||
|
margin:5px 10px 5px 10px;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.sections > li > div.annotation pre {
|
||||||
|
margin: 7px 0 7px;
|
||||||
|
padding-left: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.sections > li > div.annotation p tt, .annotation code {
|
||||||
|
background: #f8f8ff;
|
||||||
|
border: 1px solid #dedede;
|
||||||
|
font-size: 12px;
|
||||||
|
padding: 0 0.2em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------- (> 481px) ---------------------*/
|
||||||
|
@media only screen and (min-width: 481px) {
|
||||||
|
#container {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
background-color: #F5F5FF;
|
||||||
|
font-size: 15px;
|
||||||
|
line-height: 21px;
|
||||||
|
}
|
||||||
|
pre, tt, code {
|
||||||
|
line-height: 18px;
|
||||||
|
}
|
||||||
|
p, ul, ol {
|
||||||
|
margin: 0 0 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#jump_to {
|
||||||
|
padding: 5px 10px;
|
||||||
|
}
|
||||||
|
#jump_wrapper {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
#jump_to, #jump_page {
|
||||||
|
font: 10px Arial;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
#jump_page .source {
|
||||||
|
padding: 5px 10px;
|
||||||
|
}
|
||||||
|
#jump_to a.large {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
#jump_to a.small {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#background {
|
||||||
|
position: absolute;
|
||||||
|
top: 0; bottom: 0;
|
||||||
|
width: 350px;
|
||||||
|
background: #fff;
|
||||||
|
border-right: 1px solid #e5e5ee;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.sections > li > div.annotation ul, ul.sections > li > div.annotation ol {
|
||||||
|
padding-left: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.sections > li {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.sections > li > div {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.sections > li > div.annotation {
|
||||||
|
max-width: 350px;
|
||||||
|
min-width: 350px;
|
||||||
|
min-height: 5px;
|
||||||
|
padding: 13px;
|
||||||
|
overflow-x: hidden;
|
||||||
|
white-space: normal;
|
||||||
|
vertical-align: top;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
ul.sections > li > div.annotation pre {
|
||||||
|
margin: 15px 0 15px;
|
||||||
|
padding-left: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.sections > li > div.content {
|
||||||
|
padding: 13px;
|
||||||
|
vertical-align: top;
|
||||||
|
border: none;
|
||||||
|
-webkit-box-shadow: none;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pilwrap {
|
||||||
|
position: relative;
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pilcrow {
|
||||||
|
font: 12px Arial;
|
||||||
|
text-decoration: none;
|
||||||
|
color: #454545;
|
||||||
|
position: absolute;
|
||||||
|
top: 3px; left: -20px;
|
||||||
|
padding: 1px 2px;
|
||||||
|
opacity: 0;
|
||||||
|
-webkit-transition: opacity 0.2s linear;
|
||||||
|
}
|
||||||
|
.for-h1 .pilcrow {
|
||||||
|
top: 47px;
|
||||||
|
}
|
||||||
|
.for-h2 .pilcrow, .for-h3 .pilcrow, .for-h4 .pilcrow {
|
||||||
|
top: 35px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.sections > li > div.annotation:hover .pilcrow {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------- (> 1025px) ---------------------*/
|
||||||
|
@media only screen and (min-width: 1025px) {
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#background {
|
||||||
|
width: 525px;
|
||||||
|
}
|
||||||
|
ul.sections > li > div.annotation {
|
||||||
|
max-width: 525px;
|
||||||
|
min-width: 525px;
|
||||||
|
padding: 10px 25px 1px 50px;
|
||||||
|
}
|
||||||
|
ul.sections > li > div.content {
|
||||||
|
padding: 9px 15px 16px 25px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------- Syntax Highlighting -----------------------------*/
|
||||||
|
|
||||||
|
td.linenos { background-color: #f0f0f0; padding-right: 10px; }
|
||||||
|
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
|
||||||
|
/*
|
||||||
|
|
||||||
|
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
pre code {
|
||||||
|
display: block; padding: 0.5em;
|
||||||
|
color: #000;
|
||||||
|
background: #f8f8ff
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .hljs-comment,
|
||||||
|
pre .hljs-template_comment,
|
||||||
|
pre .hljs-diff .hljs-header,
|
||||||
|
pre .hljs-javadoc {
|
||||||
|
color: #408080;
|
||||||
|
font-style: italic
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .hljs-keyword,
|
||||||
|
pre .hljs-assignment,
|
||||||
|
pre .hljs-literal,
|
||||||
|
pre .hljs-css .hljs-rule .hljs-keyword,
|
||||||
|
pre .hljs-winutils,
|
||||||
|
pre .hljs-javascript .hljs-title,
|
||||||
|
pre .hljs-lisp .hljs-title,
|
||||||
|
pre .hljs-subst {
|
||||||
|
color: #954121;
|
||||||
|
/*font-weight: bold*/
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .hljs-number,
|
||||||
|
pre .hljs-hexcolor {
|
||||||
|
color: #40a070
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .hljs-string,
|
||||||
|
pre .hljs-tag .hljs-value,
|
||||||
|
pre .hljs-phpdoc,
|
||||||
|
pre .hljs-tex .hljs-formula {
|
||||||
|
color: #219161;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .hljs-title,
|
||||||
|
pre .hljs-id {
|
||||||
|
color: #19469D;
|
||||||
|
}
|
||||||
|
pre .hljs-params {
|
||||||
|
color: #00F;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .hljs-javascript .hljs-title,
|
||||||
|
pre .hljs-lisp .hljs-title,
|
||||||
|
pre .hljs-subst {
|
||||||
|
font-weight: normal
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .hljs-class .hljs-title,
|
||||||
|
pre .hljs-haskell .hljs-label,
|
||||||
|
pre .hljs-tex .hljs-command {
|
||||||
|
color: #458;
|
||||||
|
font-weight: bold
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .hljs-tag,
|
||||||
|
pre .hljs-tag .hljs-title,
|
||||||
|
pre .hljs-rules .hljs-property,
|
||||||
|
pre .hljs-django .hljs-tag .hljs-keyword {
|
||||||
|
color: #000080;
|
||||||
|
font-weight: normal
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .hljs-attribute,
|
||||||
|
pre .hljs-variable,
|
||||||
|
pre .hljs-instancevar,
|
||||||
|
pre .hljs-lisp .hljs-body {
|
||||||
|
color: #008080
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .hljs-regexp {
|
||||||
|
color: #B68
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .hljs-class {
|
||||||
|
color: #458;
|
||||||
|
font-weight: bold
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .hljs-symbol,
|
||||||
|
pre .hljs-ruby .hljs-symbol .hljs-string,
|
||||||
|
pre .hljs-ruby .hljs-symbol .hljs-keyword,
|
||||||
|
pre .hljs-ruby .hljs-symbol .hljs-keymethods,
|
||||||
|
pre .hljs-lisp .hljs-keyword,
|
||||||
|
pre .hljs-tex .hljs-special,
|
||||||
|
pre .hljs-input_number {
|
||||||
|
color: #990073
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .hljs-builtin,
|
||||||
|
pre .hljs-constructor,
|
||||||
|
pre .hljs-built_in,
|
||||||
|
pre .hljs-lisp .hljs-title {
|
||||||
|
color: #0086b3
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .hljs-preprocessor,
|
||||||
|
pre .hljs-pi,
|
||||||
|
pre .hljs-doctype,
|
||||||
|
pre .hljs-shebang,
|
||||||
|
pre .hljs-cdata {
|
||||||
|
color: #999;
|
||||||
|
font-weight: bold
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .hljs-deletion {
|
||||||
|
background: #fdd
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .hljs-addition {
|
||||||
|
background: #dfd
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .hljs-diff .hljs-change {
|
||||||
|
background: #0086b3
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .hljs-chunk {
|
||||||
|
color: #aaa
|
||||||
|
}
|
||||||
|
|
||||||
|
pre .hljs-tex .hljs-formula {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
BIN
vendor/backbone/docs/images/airbnb.png
vendored
Normal file
After Width: | Height: | Size: 281 KiB |
BIN
vendor/backbone/docs/images/arrows.png
vendored
Normal file
After Width: | Height: | Size: 763 B |
BIN
vendor/backbone/docs/images/artsy.jpg
vendored
Normal file
After Width: | Height: | Size: 195 KiB |
BIN
vendor/backbone/docs/images/backbone.png
vendored
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
vendor/backbone/docs/images/background.png
vendored
Normal file
After Width: | Height: | Size: 911 B |
BIN
vendor/backbone/docs/images/basecamp-calendar.jpg
vendored
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
vendor/backbone/docs/images/bitbucket.jpg
vendored
Normal file
After Width: | Height: | Size: 97 KiB |
BIN
vendor/backbone/docs/images/blossom.jpg
vendored
Normal file
After Width: | Height: | Size: 68 KiB |
BIN
vendor/backbone/docs/images/cloudapp.jpg
vendored
Normal file
After Width: | Height: | Size: 72 KiB |
BIN
vendor/backbone/docs/images/code-school.jpg
vendored
Normal file
After Width: | Height: | Size: 98 KiB |
BIN
vendor/backbone/docs/images/dc-workspace.jpg
vendored
Normal file
After Width: | Height: | Size: 81 KiB |
BIN
vendor/backbone/docs/images/delicious.jpg
vendored
Normal file
After Width: | Height: | Size: 105 KiB |
BIN
vendor/backbone/docs/images/disqus.jpg
vendored
Normal file
After Width: | Height: | Size: 136 KiB |
BIN
vendor/backbone/docs/images/earth.jpg
vendored
Normal file
After Width: | Height: | Size: 294 KiB |
BIN
vendor/backbone/docs/images/easel.jpg
vendored
Normal file
After Width: | Height: | Size: 84 KiB |
BIN
vendor/backbone/docs/images/enigma.jpg
vendored
Normal file
After Width: | Height: | Size: 114 KiB |
BIN
vendor/backbone/docs/images/flow.jpg
vendored
Normal file
After Width: | Height: | Size: 70 KiB |
BIN
vendor/backbone/docs/images/foursquare.jpg
vendored
Normal file
After Width: | Height: | Size: 132 KiB |
BIN
vendor/backbone/docs/images/gawker.jpg
vendored
Normal file
After Width: | Height: | Size: 143 KiB |
BIN
vendor/backbone/docs/images/gilt.jpg
vendored
Normal file
After Width: | Height: | Size: 74 KiB |
BIN
vendor/backbone/docs/images/groupon.jpg
vendored
Normal file
After Width: | Height: | Size: 126 KiB |
BIN
vendor/backbone/docs/images/hulu.jpg
vendored
Normal file
After Width: | Height: | Size: 140 KiB |
BIN
vendor/backbone/docs/images/inkling.jpg
vendored
Normal file
After Width: | Height: | Size: 125 KiB |
221
vendor/backbone/docs/images/intro-collections.svg
vendored
Normal file
|
@ -0,0 +1,221 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
width="890.447px" height="346.482px" viewBox="0 0 890.447 346.482" enable-background="new 0 0 890.447 346.482"
|
||||||
|
xml:space="preserve">
|
||||||
|
<g id="Layer_1_1_">
|
||||||
|
<path fill="#5C8BEE" d="M100.65,272.563c0-4.285,3.486-7.771,7.771-7.771h39.413v5.441l24.834-10.438l-24.834-10.438v5.438h-39.413
|
||||||
|
c-9.799,0-17.771,7.979-17.771,17.771c0,9.8,7.972,17.771,17.771,17.771h90.791v-10h-90.791
|
||||||
|
C104.136,280.333,100.65,276.847,100.65,272.563z"/>
|
||||||
|
<path fill="#231F20" d="M276.035,338.992h-62.506c-9.374,0-17-7.626-17-17V26c0-9.374,7.626-17,17-17h62.506
|
||||||
|
c9.374,0,17,7.626,17,17v295.991C293.035,331.366,285.409,338.992,276.035,338.992L276.035,338.992z M213.529,88
|
||||||
|
c-3.86,0-7,3.144-7,7v226.991c0,3.859,3.14,7,7,7h62.506c3.86,0,7-3.141,7-7V95c0-3.856-3.14-7-7-7H213.529L213.529,88z"/>
|
||||||
|
|
||||||
|
<rect x="476.259" y="97.744" transform="matrix(0.9634 0.268 -0.268 0.9634 45.2397 -125.9041)" fill="#5C8BEE" width="15" height="10"/>
|
||||||
|
|
||||||
|
<rect x="500.38" y="104.456" transform="matrix(0.9634 0.268 -0.268 0.9634 47.9063 -132.0947)" fill="#5C8BEE" width="15" height="10"/>
|
||||||
|
|
||||||
|
<rect x="572.633" y="124.562" transform="matrix(0.9634 0.268 -0.268 0.9634 55.9542 -150.7542)" fill="#5C8BEE" width="15" height="10"/>
|
||||||
|
<polygon fill="#5C8BEE" points="620.351,140.731 599.227,124.015 597.768,129.255 597.369,129.146 594.688,138.779 595.088,138.89
|
||||||
|
593.629,144.131 "/>
|
||||||
|
|
||||||
|
<rect x="548.558" y="117.812" transform="matrix(0.9634 0.2681 -0.2681 0.9634 53.2689 -144.5569)" fill="#5C8BEE" width="14.999" height="10.001"/>
|
||||||
|
|
||||||
|
<rect x="452.184" y="91.045" transform="matrix(0.9634 0.268 -0.268 0.9634 42.5535 -119.6773)" fill="#5C8BEE" width="14.999" height="10"/>
|
||||||
|
|
||||||
|
<rect x="524.507" y="111.122" transform="matrix(0.9634 0.2681 -0.2681 0.9634 50.6158 -138.3935)" fill="#5C8BEE" width="14.998" height="10"/>
|
||||||
|
|
||||||
|
<rect x="428.089" y="84.341" transform="matrix(0.9634 0.268 -0.268 0.9634 39.872 -113.4586)" fill="#5C8BEE" width="15" height="10"/>
|
||||||
|
|
||||||
|
<rect x="404.005" y="77.642" transform="matrix(0.9634 0.2681 -0.2681 0.9634 37.2111 -107.2796)" fill="#5C8BEE" width="14.999" height="10"/>
|
||||||
|
|
||||||
|
<rect x="379.928" y="70.94" transform="matrix(0.9634 0.268 -0.268 0.9634 34.5225 -101.0489)" fill="#5C8BEE" width="14.999" height="10"/>
|
||||||
|
<path fill="#5C8BEE" d="M307.704,59.048l9.66,2.688c1.812-9.263,1.844-18.525,0.335-27.414l-9.755,2.19
|
||||||
|
C309.125,43.833,309.108,51.437,307.704,59.048z"/>
|
||||||
|
<path fill="#5C8BEE" d="M328.577,64.857l12.063,3.354c2.852-13.235,2.935-26.507,0.612-39.17l-12.205,2.737
|
||||||
|
C330.948,42.488,330.889,53.681,328.577,64.857z"/>
|
||||||
|
<path fill="#5C8BEE" d="M351.802,71.319l14.466,4.021c4.027-17.608,4.151-35.299,0.923-52.109l-14.646,3.281
|
||||||
|
C355.259,40.982,355.162,56.174,351.802,71.319z"/>
|
||||||
|
<polygon fill="#5C8BEE" points="319.243,263.288 298.246,280.162 324.993,283.365 323.494,278.13 639.447,187.606 636.694,177.992
|
||||||
|
320.741,268.519 "/>
|
||||||
|
<g>
|
||||||
|
<path d="M239.466,146.607h-4.027v-26.721h5.779l3.753,19.191l3.603-19.191h5.552v26.72h-4.027v-16.789l-3.494,16.789h-3.238
|
||||||
|
l-3.899-16.746L239.466,146.607L239.466,146.607z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path d="M239.466,223.607h-4.027v-26.721h5.779l3.753,19.191l3.603-19.191h5.552v26.72h-4.027v-16.789l-3.494,16.789h-3.238
|
||||||
|
l-3.899-16.746L239.466,223.607L239.466,223.607z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path d="M38.009,298.096c0,2.112-0.819,3.922-2.458,5.422c-1.639,1.5-3.616,2.25-5.933,2.25h-8.39v-32.062h8.391
|
||||||
|
c2.335,0,4.317,0.75,5.947,2.25c1.629,1.5,2.444,3.302,2.444,5.396L38.009,298.096L38.009,298.096z M26.567,300.988h3.221
|
||||||
|
c0.848,0,1.563-0.271,2.147-0.831c0.583-0.555,0.876-1.205,0.876-1.955v-16.771c0-0.771-0.297-1.425-0.89-1.974
|
||||||
|
c-0.593-0.548-1.304-0.812-2.133-0.812h-3.221V300.988z"/>
|
||||||
|
<path d="M41.682,305.768v-32.062h7.995c2.109,0,4.012,0.504,5.707,1.511c1.45,0.854,2.486,2.178,3.108,3.967
|
||||||
|
c0.339,0.952,0.508,2.09,0.508,3.396c0,2.146-0.631,3.869-1.893,5.165c-0.528,0.546-1.149,0.964-1.865,1.253
|
||||||
|
c1.187,0.407,2.193,1.225,3.023,2.434c0.545,0.812,0.951,1.875,1.215,3.172c0.131,0.666,0.197,1.398,0.197,2.227
|
||||||
|
c0,2.027-0.424,3.75-1.271,5.165c-0.66,1.104-1.593,1.995-2.797,2.659c-1.356,0.75-2.703,1.125-4.04,1.125L41.682,305.768
|
||||||
|
L41.682,305.768L41.682,305.768z M47.445,286.795h2.232c1.657,0,2.769-0.729,3.333-2.196c0.207-0.545,0.311-1.222,0.311-2.021
|
||||||
|
c0-1.33-0.358-2.335-1.074-3.018c-0.66-0.632-1.516-0.946-2.571-0.946h-2.232L47.445,286.795L47.445,286.795z M47.445,300.988
|
||||||
|
h2.232c1.808,0,3.061-0.845,3.757-2.53c0.245-0.575,0.367-1.239,0.367-1.989c0-1.79-0.377-3.099-1.13-3.908
|
||||||
|
c-0.678-0.75-1.677-1.125-2.995-1.125h-2.232L47.445,300.988L47.445,300.988z"/>
|
||||||
|
</g>
|
||||||
|
<path fill="#231F20" d="M39.585,239.392C18.575,239.392,5,244.811,5,253.198v49.712c0,7.871,13.223,16.367,34.585,16.367
|
||||||
|
s34.584-8.496,34.584-16.367v-49.712C74.169,244.811,60.596,239.392,39.585,239.392z M39.591,245.392
|
||||||
|
c20.195,0,28.578,5.085,28.578,7.807c0,2.724-8.384,7.811-28.584,7.811S11,255.921,11,253.198
|
||||||
|
C11,250.477,19.385,245.392,39.591,245.392z M39.585,313.278c-18.496,0-28.585-6.85-28.585-10.367v-41.304
|
||||||
|
c5.911,3.419,15.886,5.399,28.585,5.399c12.698,0,22.673-1.98,28.584-5.399v41.304C68.169,306.428,58.08,313.278,39.585,313.278z"
|
||||||
|
/>
|
||||||
|
<polygon fill="#5C8BEE" points="822.016,138.984 785.604,138.984 785.604,133.54 760.771,143.984 785.604,154.424 785.604,148.984
|
||||||
|
822.016,148.984 "/>
|
||||||
|
<g>
|
||||||
|
<path d="M684.365,184.713l-9.545-53.396h8.438l6.693,41.621l6.75-41.621h8.445l-9.718,53.396H684.365L684.365,184.713z"/>
|
||||||
|
</g>
|
||||||
|
<path d="M689.988,218.056c-33.771,0-61.229-27.468-61.229-61.229c0-33.759,27.467-61.225,61.229-61.225
|
||||||
|
c33.762,0,61.227,27.465,61.227,61.225C751.215,190.594,723.748,218.056,689.988,218.056L689.988,218.056z M689.988,103.608
|
||||||
|
c-29.354,0-53.229,23.876-53.229,53.224c0,29.354,23.877,53.229,53.229,53.229c29.35,0,53.227-23.877,53.227-53.229
|
||||||
|
C743.215,127.485,719.338,103.608,689.988,103.608L689.988,103.608z"/>
|
||||||
|
<path d="M864.363,157.821c0,0,8.649-9.795,8.649-27.766c0-10.746-8.844-19.492-19.487-19.492c-10.845,0-19.496,8.844-19.496,19.492
|
||||||
|
c0,17.971,8.651,27.766,8.651,27.766c0,13.501-21.68,9.318-21.68,24.342v4.374c0,1.236,0.949,2.188,2.188,2.188h60.76
|
||||||
|
c1.234,0,2.186-0.952,2.186-2.188v-4.374C886.041,166.948,864.363,171.322,864.363,157.821z"/>
|
||||||
|
<g>
|
||||||
|
<path fill="#231F20" d="M245.135,164.623c-17.812,0-32.303-14.491-32.303-32.303c0-17.812,14.491-32.304,32.303-32.304
|
||||||
|
c17.812,0,32.303,14.488,32.303,32.304C277.438,150.13,262.947,164.623,245.135,164.623L245.135,164.623z M245.135,108.017
|
||||||
|
c-13.4,0-24.303,10.899-24.303,24.304c0,13.4,10.902,24.303,24.303,24.303c13.401,0,24.303-10.899,24.303-24.303
|
||||||
|
C269.438,118.917,258.536,108.017,245.135,108.017L245.135,108.017z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path fill="#231F20" d="M245.135,241.797c-17.812,0-32.303-14.488-32.303-32.303c0-17.812,14.491-32.303,32.303-32.303
|
||||||
|
c17.812,0,32.303,14.491,32.303,32.303C277.438,227.308,262.947,241.797,245.135,241.797L245.135,241.797z M245.135,185.194
|
||||||
|
c-13.4,0-24.303,10.902-24.303,24.303c0,13.401,10.902,24.303,24.303,24.303c13.401,0,24.303-10.899,24.303-24.303
|
||||||
|
C269.438,196.096,258.536,185.194,245.135,185.194L245.135,185.194z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path fill="#231F20" d="M240.775,318.745c-3.032-0.376-5.988-1.18-8.786-2.387l3.17-7.348c2.102,0.906,4.322,1.513,6.601,1.795
|
||||||
|
L240.775,318.745L240.775,318.745z M249.864,318.596l-1.251-7.902c2.263-0.358,4.462-1.036,6.534-2.015l3.416,7.231
|
||||||
|
C255.804,317.214,252.877,318.118,249.864,318.596L249.864,318.596z M224.228,311.611c-2.351-1.94-4.414-4.2-6.132-6.715
|
||||||
|
l6.605-4.517c1.294,1.896,2.849,3.6,4.62,5.062L224.228,311.611L224.228,311.611z M266.159,310.907l-5.296-5.996
|
||||||
|
c1.722-1.521,3.219-3.271,4.449-5.21l6.752,4.291C270.431,306.563,268.444,308.889,266.159,310.907L266.159,310.907z
|
||||||
|
M214.072,296.732c-0.944-2.892-1.474-5.903-1.575-8.961l7.996-0.267c0.076,2.305,0.474,4.569,1.184,6.74L214.072,296.732
|
||||||
|
L214.072,296.732z M275.812,295.696l-7.684-2.229c0.635-2.188,0.957-4.47,0.957-6.774c0-0.547-0.019-1.094-0.054-1.636
|
||||||
|
l7.982-0.527c0.047,0.711,0.071,1.438,0.072,2.16C277.085,289.75,276.656,292.781,275.812,295.696L275.812,295.696z
|
||||||
|
M221.223,280.697l-7.755-1.965c0.749-2.955,1.915-5.787,3.466-8.42l6.893,4.061C222.661,276.351,221.785,278.479,221.223,280.697
|
||||||
|
L221.223,280.697z M267.622,278.362c-0.784-2.149-1.871-4.178-3.229-6.03l6.449-4.729c1.807,2.462,3.252,5.158,4.296,8.021
|
||||||
|
L267.622,278.362L267.622,278.362z M228.099,269.019l-5.493-5.816c2.219-2.095,4.716-3.863,7.422-5.256l3.66,7.113
|
||||||
|
C231.65,266.109,229.77,267.441,228.099,269.019L228.099,269.019z M259.605,267.427c-1.822-1.403-3.826-2.538-5.955-3.375
|
||||||
|
l2.92-7.445c2.833,1.107,5.497,2.619,7.917,4.482L259.605,267.427L259.605,267.427z M240.15,262.827l-1.517-7.854
|
||||||
|
c2.958-0.57,6.051-0.729,9.078-0.454l-0.717,7.969C244.711,262.278,242.376,262.398,240.15,262.827L240.15,262.827z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path fill="#FFFFFF" d="M243.446,75.439c-3.747,0-6.93-1.214-9.552-3.645c-2.621-2.427-3.933-5.359-3.933-8.802V34.528
|
||||||
|
c0-3.468,1.318-6.415,3.955-8.844c2.638-2.429,5.813-3.644,9.529-3.644c3.745,0,6.922,1.224,9.528,3.662
|
||||||
|
c2.608,2.442,3.911,5.384,3.911,8.823v5.951h-8.811V34.36c0-1.249-0.479-2.316-1.438-3.205c-0.959-0.888-2.112-1.332-3.462-1.332
|
||||||
|
s-2.494,0.444-3.438,1.332c-0.943,0.889-1.415,1.956-1.415,3.205v28.549c0,1.249,0.473,2.311,1.415,3.185
|
||||||
|
c0.944,0.874,2.091,1.312,3.438,1.312c1.35,0,2.502-0.438,3.462-1.312c0.959-0.874,1.438-1.936,1.438-3.185v-7.2h8.811v7.283
|
||||||
|
c0,3.47-1.318,6.41-3.955,8.824C250.293,74.232,247.131,75.439,243.446,75.439z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path d="M247.614,285.373h8.591v4.772h-8.591v8.591h-4.773v-8.591h-8.591v-4.772h8.591v-8.591h4.773V285.373L247.614,285.373z"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g id="labels">
|
||||||
|
<g>
|
||||||
|
<path fill="#BFBFBF" d="M123.738,322.026c0.02,1.303-0.318,2.416-1.014,3.341c-0.458,0.626-1.104,1.069-1.939,1.327
|
||||||
|
c-0.447,0.139-0.969,0.209-1.566,0.209c-1.104,0-2.019-0.273-2.744-0.82c-0.607-0.446-1.086-1.057-1.439-1.827
|
||||||
|
c-0.353-0.77-0.559-1.651-0.619-2.646l2.685-0.193c0.119,1.09,0.407,1.879,0.865,2.368c0.338,0.37,0.726,0.545,1.164,0.524
|
||||||
|
c0.616-0.021,1.108-0.322,1.477-0.91c0.188-0.289,0.283-0.701,0.283-1.238c0-0.776-0.353-1.549-1.059-2.312
|
||||||
|
c-0.557-0.527-1.392-1.318-2.505-2.373c-0.935-0.906-1.596-1.719-1.984-2.436c-0.417-0.807-0.626-1.682-0.626-2.627
|
||||||
|
c0-1.702,0.572-2.991,1.715-3.867c0.706-0.525,1.581-0.791,2.625-0.791c1.004,0,1.864,0.226,2.58,0.671
|
||||||
|
c0.557,0.351,1.007,0.837,1.35,1.464c0.343,0.627,0.549,1.348,0.619,2.16l-2.699,0.492c-0.08-0.766-0.298-1.359-0.656-1.789
|
||||||
|
c-0.259-0.309-0.632-0.463-1.119-0.463c-0.517,0-0.91,0.229-1.178,0.688c-0.219,0.367-0.328,0.824-0.328,1.372
|
||||||
|
c0,0.854,0.368,1.725,1.104,2.607c0.278,0.339,0.696,0.736,1.253,1.193c0.656,0.547,1.089,0.93,1.297,1.146
|
||||||
|
c0.696,0.697,1.233,1.385,1.611,2.061c0.179,0.316,0.323,0.609,0.433,0.88C123.589,320.903,123.729,321.498,123.738,322.026z"/>
|
||||||
|
<path fill="#BFBFBF" d="M128.481,318.849l-3.773-10.873h3.103l2.088,6.712l2.073-6.712h3.117l-3.788,10.873v7.83h-2.819
|
||||||
|
L128.481,318.849L128.481,318.849z"/>
|
||||||
|
<path fill="#BFBFBF" d="M140.505,307.976l3.741,12.567v-12.567h2.819v18.702h-3.028l-3.877-11.978v11.978h-2.819v-18.702H140.505z
|
||||||
|
"/>
|
||||||
|
<path fill="#BFBFBF" d="M154.015,326.917c-1.243,0-2.299-0.436-3.169-1.306c-0.87-0.87-1.305-1.921-1.305-3.154v-10.202
|
||||||
|
c0-1.24,0.438-2.299,1.312-3.169s1.929-1.306,3.162-1.306c1.243,0,2.297,0.438,3.162,1.312c0.865,0.875,1.297,1.932,1.297,3.162
|
||||||
|
v2.134h-2.923v-2.191c0-0.447-0.159-0.83-0.477-1.148c-0.318-0.315-0.701-0.478-1.148-0.478c-0.448,0-0.828,0.16-1.141,0.478
|
||||||
|
c-0.313,0.318-0.47,0.701-0.47,1.148v10.229c0,0.447,0.157,0.828,0.47,1.143c0.313,0.313,0.693,0.471,1.141,0.471
|
||||||
|
c0.447,0,0.83-0.156,1.148-0.471c0.318-0.312,0.477-0.693,0.477-1.143v-2.579h2.923v2.609c0,1.243-0.438,2.297-1.312,3.161
|
||||||
|
C156.287,326.485,155.238,326.917,154.015,326.917z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path fill="#BFBFBF" d="M607.451,230.917c0,1.232-0.434,2.287-1.297,3.162c-0.865,0.875-1.909,1.312-3.133,1.312h-4.432v-18.703
|
||||||
|
h4.432c1.231,0,2.278,0.438,3.141,1.312c0.859,0.875,1.289,1.924,1.289,3.146V230.917z M601.412,232.604h1.699
|
||||||
|
c0.445,0,0.824-0.162,1.134-0.485c0.308-0.323,0.462-0.703,0.462-1.141v-9.784c0-0.447-0.156-0.83-0.469-1.148
|
||||||
|
c-0.314-0.316-0.689-0.478-1.127-0.478h-1.699V232.604L601.412,232.604z"/>
|
||||||
|
<path fill="#BFBFBF" d="M613.01,231.097l-0.684,4.296h-2.938l3.179-18.688h3.878l3.132,18.688h-2.964l-0.66-4.296H613.01z
|
||||||
|
M614.491,220.985l-1.044,7.368h2.088L614.491,220.985z"/>
|
||||||
|
<path fill="#BFBFBF" d="M622.307,219.537h-2.998v-2.833h8.802v2.833h-2.983v15.855h-2.818L622.307,219.537L622.307,219.537z"/>
|
||||||
|
<path fill="#BFBFBF" d="M631.43,231.097l-0.684,4.296h-2.938l3.179-18.688h3.878l3.132,18.688h-2.964l-0.66-4.296H631.43z
|
||||||
|
M632.911,220.985l-1.044,7.368h2.088L632.911,220.985z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path fill="#BFBFBF" d="M318.662,326.916c-1.243,0-2.299-0.435-3.169-1.306c-0.87-0.869-1.307-1.921-1.307-3.154v-10.201
|
||||||
|
c0-1.241,0.438-2.299,1.312-3.17c0.875-0.869,1.929-1.305,3.162-1.305c1.243,0,2.297,0.438,3.162,1.312
|
||||||
|
c0.864,0.875,1.297,1.932,1.297,3.162v2.135h-2.923v-2.193c0-0.447-0.159-0.83-0.479-1.148c-0.316-0.315-0.701-0.477-1.146-0.477
|
||||||
|
c-0.448,0-0.828,0.159-1.143,0.477c-0.312,0.318-0.47,0.701-0.47,1.148v10.23c0,0.447,0.157,0.828,0.47,1.143
|
||||||
|
c0.313,0.312,0.693,0.47,1.143,0.47c0.445,0,0.83-0.156,1.146-0.47c0.318-0.312,0.479-0.693,0.479-1.143v-2.578h2.923v2.607
|
||||||
|
c0,1.243-0.438,2.297-1.312,3.162S319.885,326.916,318.662,326.916z"/>
|
||||||
|
<path fill="#BFBFBF" d="M329.877,307.99c1.571,0,2.724,0.432,3.46,1.297c0.646,0.756,0.969,1.812,0.969,3.162v2.715
|
||||||
|
c0,1.322-0.502,2.441-1.506,3.355l2.088,8.157h-3.048l-1.709-7.038c-0.08,0-0.164,0-0.253,0h-1.625v7.038h-2.819V307.99H329.877
|
||||||
|
L329.877,307.99z M331.562,312.494c0-1.084-0.536-1.625-1.61-1.625h-1.7v5.98h1.7c0.447,0,0.828-0.159,1.141-0.479
|
||||||
|
c0.313-0.315,0.471-0.701,0.471-1.146L331.562,312.494L331.562,312.494z"/>
|
||||||
|
<path fill="#BFBFBF" d="M337.305,326.678v-18.703h8.024v2.834h-5.205v5.102h3.803v2.834h-3.803v5.101h5.205v2.834L337.305,326.678
|
||||||
|
L337.305,326.678z"/>
|
||||||
|
<path fill="#BFBFBF" d="M350.888,322.382l-0.685,4.296h-2.938l3.179-18.688h3.877l3.132,18.688h-2.964l-0.66-4.296H350.888z
|
||||||
|
M352.369,312.271l-1.044,7.368h2.088L352.369,312.271z"/>
|
||||||
|
<path fill="#BFBFBF" d="M360.184,310.824h-2.998v-2.834h8.802v2.834h-2.983v15.854h-2.819L360.184,310.824L360.184,310.824z"/>
|
||||||
|
<path fill="#BFBFBF" d="M368.252,326.678v-18.703h8.024v2.834h-5.205v5.102h3.803v2.834h-3.803v5.101h5.205v2.834L368.252,326.678
|
||||||
|
L368.252,326.678z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path fill="#BFBFBF" d="M386.397,52.443l-0.687,4.296h-2.936l3.177-18.688h3.877l3.132,18.688H390l-0.66-4.296H386.397z
|
||||||
|
M387.878,42.33l-1.044,7.368h2.088L387.878,42.33z"/>
|
||||||
|
<path fill="#BFBFBF" d="M404.194,52.264c0,1.23-0.434,2.285-1.297,3.16c-0.865,0.875-1.909,1.312-3.134,1.312h-4.43V38.034h4.43
|
||||||
|
c1.233,0,2.28,0.438,3.142,1.312c0.858,0.873,1.29,1.924,1.29,3.146L404.194,52.264L404.194,52.264z M398.154,53.949h1.698
|
||||||
|
c0.447,0,0.825-0.162,1.135-0.485c0.308-0.321,0.462-0.701,0.462-1.141v-9.784c0-0.447-0.157-0.83-0.472-1.146
|
||||||
|
c-0.312-0.318-0.688-0.479-1.126-0.479h-1.698L398.154,53.949L398.154,53.949z"/>
|
||||||
|
<path fill="#BFBFBF" d="M415.529,52.264c0,1.23-0.434,2.285-1.297,3.16c-0.865,0.875-1.909,1.312-3.134,1.312h-4.43V38.034h4.43
|
||||||
|
c1.233,0,2.28,0.438,3.142,1.312c0.858,0.873,1.29,1.924,1.29,3.146L415.529,52.264L415.529,52.264z M409.489,53.949h1.7
|
||||||
|
c0.445,0,0.823-0.162,1.133-0.485c0.308-0.321,0.462-0.701,0.462-1.141v-9.784c0-0.447-0.157-0.83-0.47-1.146
|
||||||
|
c-0.313-0.318-0.688-0.479-1.126-0.479h-1.7L409.489,53.949L409.489,53.949z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path fill="#BFBFBF" d="M764.561,186.887h-2.818v-18.689h2.818V186.887z"/>
|
||||||
|
<path fill="#BFBFBF" d="M770.245,168.184l3.741,12.567v-12.567h2.816v18.702h-3.025l-3.878-11.978v11.978h-2.819v-18.702H770.245z
|
||||||
|
"/>
|
||||||
|
<path fill="#BFBFBF" d="M783.77,168.198c1.372,0,2.468,0.433,3.281,1.298c0.756,0.824,1.133,1.879,1.133,3.162v2.714
|
||||||
|
c0,1.233-0.43,2.287-1.289,3.162c-0.858,0.875-1.9,1.312-3.125,1.312h-1.625v7.039h-2.818v-18.688H783.77L783.77,168.198z
|
||||||
|
M785.455,172.702c0-0.487-0.146-0.88-0.439-1.179c-0.294-0.298-0.685-0.447-1.172-0.447h-1.699v5.981h1.699
|
||||||
|
c0.447,0,0.828-0.159,1.143-0.479c0.312-0.317,0.471-0.701,0.471-1.146L785.455,172.702L785.455,172.702z"/>
|
||||||
|
<path fill="#BFBFBF" d="M794.881,187.096c-1.243,0-2.297-0.436-3.162-1.301c-0.865-0.862-1.298-1.914-1.298-3.146v-14.452h2.759
|
||||||
|
v14.423c0,0.447,0.16,0.827,0.479,1.142c0.315,0.312,0.7,0.471,1.146,0.471c0.447,0,0.827-0.157,1.143-0.471
|
||||||
|
c0.312-0.312,0.47-0.692,0.47-1.142v-14.423h2.938v14.452c0,1.253-0.438,2.307-1.312,3.162
|
||||||
|
C797.17,186.667,796.113,187.096,794.881,187.096z"/>
|
||||||
|
<path fill="#BFBFBF" d="M804.604,171.031h-2.996v-2.833h8.8v2.833h-2.982v15.854h-2.817v-15.854H804.604z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path fill="#BFBFBF" d="M577.609,85.914c1.568,0,2.724,0.434,3.46,1.297c0.646,0.756,0.97,1.812,0.97,3.162v2.715
|
||||||
|
c0,1.322-0.503,2.441-1.507,3.355l2.088,8.158h-3.048l-1.71-7.039c-0.079,0-0.164,0-0.253,0h-1.626v7.039h-2.819V85.913
|
||||||
|
L577.609,85.914L577.609,85.914z M579.295,90.417c0-1.084-0.537-1.625-1.611-1.625h-1.698v5.98h1.698
|
||||||
|
c0.447,0,0.828-0.159,1.143-0.479c0.312-0.315,0.471-0.701,0.471-1.146L579.295,90.417L579.295,90.417z"/>
|
||||||
|
<path fill="#BFBFBF" d="M585.035,104.602V85.899h8.023v2.834h-5.203v5.102h3.803v2.834h-3.803v5.102h5.203v2.834L585.035,104.602
|
||||||
|
L585.035,104.602z"/>
|
||||||
|
<path fill="#BFBFBF" d="M598.164,85.899l3.74,12.569V85.899h2.817v18.703h-3.026l-3.877-11.979v11.979h-2.819V85.899H598.164z"/>
|
||||||
|
<path fill="#BFBFBF" d="M616.104,100.126c0,1.234-0.433,2.287-1.298,3.162c-0.863,0.875-1.907,1.312-3.132,1.312h-4.43V85.898
|
||||||
|
h4.43c1.232,0,2.279,0.438,3.139,1.312c0.86,0.875,1.291,1.924,1.291,3.147V100.126z M610.062,101.813h1.699
|
||||||
|
c0.447,0,0.824-0.161,1.135-0.484c0.309-0.322,0.463-0.703,0.463-1.141v-9.784c0-0.448-0.157-0.83-0.473-1.148
|
||||||
|
c-0.312-0.316-0.688-0.478-1.125-0.478h-1.699V101.813z"/>
|
||||||
|
<path fill="#BFBFBF" d="M618.578,104.602V85.899h8.022v2.834h-5.204v5.102h3.805v2.834h-3.805v5.102h5.204v2.834L618.578,104.602
|
||||||
|
L618.578,104.602z"/>
|
||||||
|
<path fill="#BFBFBF" d="M632.986,85.914c1.568,0,2.724,0.434,3.46,1.297c0.646,0.756,0.97,1.812,0.97,3.162v2.715
|
||||||
|
c0,1.322-0.503,2.441-1.507,3.355l2.088,8.158h-3.048l-1.71-7.039c-0.079,0-0.164,0-0.253,0h-1.626v7.039h-2.819V85.913
|
||||||
|
L632.986,85.914L632.986,85.914z M634.672,90.417c0-1.084-0.537-1.625-1.611-1.625h-1.698v5.98h1.698
|
||||||
|
c0.447,0,0.828-0.159,1.143-0.479c0.312-0.315,0.471-0.701,0.471-1.146L634.672,90.417L634.672,90.417z"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 18 KiB |
152
vendor/backbone/docs/images/intro-model-view.svg
vendored
Normal file
|
@ -0,0 +1,152 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
width="890.447px" height="167.398px" viewBox="0 0 890.447 167.398" enable-background="new 0 0 890.447 167.398"
|
||||||
|
xml:space="preserve">
|
||||||
|
<path fill="#5C8BEE" d="M108.421,75.665h80.791v-10h-80.791c-9.799,0-17.771,7.971-17.771,17.771
|
||||||
|
c0,9.797,7.972,17.771,17.771,17.771h39.413v5.438l24.834-10.439l-24.834-10.438v5.438h-39.413c-4.285,0-7.771-3.479-7.771-7.771
|
||||||
|
C100.65,79.151,104.136,75.665,108.421,75.665z"/>
|
||||||
|
<polygon fill="#5C8BEE" points="328.457,76.665 632.869,76.665 632.869,66.665 328.457,66.665 328.457,61.222 303.625,71.665
|
||||||
|
328.457,82.106 "/>
|
||||||
|
<rect x="478.624" y="93.664" fill="#5C8BEE" width="15" height="10"/>
|
||||||
|
<rect x="503.624" y="93.664" fill="#5C8BEE" width="15" height="10"/>
|
||||||
|
<rect x="578.623" y="93.664" fill="#5C8BEE" width="15" height="10"/>
|
||||||
|
<polygon fill="#5C8BEE" points="603.037,88.222 603.037,93.665 602.623,93.665 602.623,103.664 603.037,103.664 603.037,109.105
|
||||||
|
627.869,98.664 "/>
|
||||||
|
<rect x="553.623" y="93.664" fill="#5C8BEE" width="15" height="10"/>
|
||||||
|
<rect x="453.625" y="93.664" fill="#5C8BEE" width="15" height="10"/>
|
||||||
|
<rect x="528.624" y="93.664" fill="#5C8BEE" width="15" height="10"/>
|
||||||
|
<rect x="428.625" y="93.664" fill="#5C8BEE" width="15" height="10"/>
|
||||||
|
<rect x="403.625" y="93.664" fill="#5C8BEE" width="15" height="10"/>
|
||||||
|
<rect x="378.625" y="93.664" fill="#5C8BEE" width="15" height="10"/>
|
||||||
|
<polygon fill="#5C8BEE" points="822.016,67.828 785.604,67.828 785.604,62.385 760.771,72.828 785.604,83.27 785.604,77.828
|
||||||
|
822.016,77.828 "/>
|
||||||
|
<g>
|
||||||
|
<path d="M684.365,113.559l-9.545-53.396h8.439l6.693,41.621l6.75-41.621h8.445l-9.717,53.396H684.365L684.365,113.559z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path d="M231.792,113.559h-8.055V60.12h11.559l7.506,38.386l7.205-38.386h11.104v53.438h-8.054v-33.58l-6.988,33.58h-6.477
|
||||||
|
l-7.799-33.494L231.792,113.559L231.792,113.559z"/>
|
||||||
|
</g>
|
||||||
|
<path d="M689.988,146.9c-33.771,0-61.229-27.465-61.229-61.229c0-33.759,27.467-61.225,61.229-61.225
|
||||||
|
c33.762,0,61.227,27.465,61.227,61.225C751.215,119.438,723.748,146.9,689.988,146.9L689.988,146.9z M689.988,32.452
|
||||||
|
c-29.354,0-53.229,23.876-53.229,53.224c0,29.354,23.877,53.229,53.229,53.229c29.35,0,53.227-23.877,53.227-53.229
|
||||||
|
C743.215,56.329,719.338,32.452,689.988,32.452L689.988,32.452z"/>
|
||||||
|
<path d="M242.424,146.9c-33.76,0-61.225-27.465-61.225-61.229c0-33.759,27.465-61.225,61.225-61.225
|
||||||
|
c33.76,0,61.225,27.465,61.225,61.225C303.649,119.438,276.184,146.9,242.424,146.9L242.424,146.9z M242.424,32.452
|
||||||
|
c-29.349,0-53.225,23.876-53.225,53.224c0,29.354,23.876,53.229,53.225,53.229c29.349,0,53.225-23.877,53.225-53.229
|
||||||
|
C295.649,56.329,271.773,32.452,242.424,32.452L242.424,32.452z"/>
|
||||||
|
<g>
|
||||||
|
<path d="M38.009,99.439c0,2.115-0.819,3.922-2.458,5.422c-1.639,1.5-3.616,2.25-5.933,2.25h-8.39V75.049h8.391
|
||||||
|
c2.335,0,4.317,0.75,5.947,2.25c1.629,1.5,2.444,3.309,2.444,5.396L38.009,99.439L38.009,99.439z M26.567,102.33h3.221
|
||||||
|
c0.848,0,1.563-0.271,2.147-0.831c0.583-0.554,0.876-1.205,0.876-1.955V82.772c0-0.771-0.297-1.422-0.89-1.979
|
||||||
|
c-0.593-0.546-1.304-0.812-2.133-0.812h-3.221V102.33z"/>
|
||||||
|
<path d="M41.682,107.111V75.049h7.995c2.109,0,4.012,0.503,5.707,1.518c1.45,0.854,2.486,2.174,3.108,3.963
|
||||||
|
C58.831,81.482,59,82.617,59,83.923c0,2.146-0.631,3.869-1.893,5.165c-0.528,0.545-1.149,0.963-1.865,1.252
|
||||||
|
c1.187,0.408,2.193,1.229,3.023,2.438c0.545,0.812,0.951,1.875,1.215,3.17c0.131,0.666,0.197,1.396,0.197,2.227
|
||||||
|
c0,2.027-0.424,3.75-1.271,5.165c-0.66,1.106-1.593,1.995-2.797,2.659c-1.356,0.75-2.703,1.125-4.04,1.125L41.682,107.111
|
||||||
|
L41.682,107.111L41.682,107.111z M47.445,88.139h2.232c1.657,0,2.769-0.73,3.333-2.199c0.207-0.545,0.311-1.219,0.311-2.021
|
||||||
|
c0-1.33-0.358-2.335-1.074-3.018c-0.66-0.631-1.516-0.946-2.571-0.946h-2.232L47.445,88.139L47.445,88.139z M47.445,102.33h2.232
|
||||||
|
c1.808,0,3.061-0.844,3.757-2.53c0.245-0.569,0.367-1.233,0.367-1.983c0-1.791-0.377-3.104-1.13-3.912
|
||||||
|
c-0.678-0.75-1.677-1.125-2.995-1.125h-2.232L47.445,102.33L47.445,102.33z"/>
|
||||||
|
</g>
|
||||||
|
<path fill="#231F20" d="M39.585,40.734C18.575,40.734,5,46.154,5,54.541v49.711c0,7.872,13.223,16.368,34.585,16.368
|
||||||
|
s34.584-8.496,34.584-16.368V54.541C74.169,46.154,60.596,40.734,39.585,40.734z M39.591,46.734c20.195,0,28.578,5.084,28.578,7.807
|
||||||
|
c0,2.726-8.384,7.812-28.584,7.812S11,57.265,11,54.541C11,51.819,19.385,46.734,39.591,46.734z M39.585,114.62
|
||||||
|
C21.089,114.62,11,107.77,11,104.252V62.95c5.911,3.42,15.886,5.403,28.585,5.403c12.698,0,22.673-1.983,28.584-5.403v41.302
|
||||||
|
C68.169,107.77,58.08,114.62,39.585,114.62z"/>
|
||||||
|
<path fill="#5C8BEE" d="M303.081,115.44l8.812,4.725c3.835-8.158,6.291-17.09,7.024-26.5H308.89
|
||||||
|
C308.203,101.376,306.181,108.706,303.081,115.44z"/>
|
||||||
|
<path fill="#5C8BEE" d="M322.146,125.657l11.023,5.908c5.629-11.577,9.105-24.383,9.909-37.9h-12.524
|
||||||
|
C329.788,105.052,326.844,115.852,322.146,125.657z"/>
|
||||||
|
<path fill="#5C8BEE" d="M343.369,137.03l13.229,7.088c7.619-15.333,12.24-32.406,13.081-50.453h-15.016
|
||||||
|
C353.841,109.154,349.863,123.818,343.369,137.03z"/>
|
||||||
|
<path d="M864.363,86.665c0,0,8.65-9.795,8.65-27.766c0-10.746-8.844-19.493-19.488-19.493c-10.844,0-19.496,8.844-19.496,19.493
|
||||||
|
c0,17.971,8.652,27.766,8.652,27.766c0,13.501-21.68,9.318-21.68,24.342v4.374c0,1.236,0.949,2.188,2.188,2.188h60.76
|
||||||
|
c1.235,0,2.186-0.952,2.186-2.188v-4.374C886.041,95.793,864.363,100.166,864.363,86.665z"/>
|
||||||
|
<g>
|
||||||
|
<path fill="#BFBFBF" d="M123.738,44.126c0.02,1.304-0.318,2.416-1.014,3.341c-0.458,0.626-1.104,1.069-1.939,1.328
|
||||||
|
c-0.447,0.14-0.969,0.208-1.566,0.208c-1.104,0-2.019-0.272-2.744-0.819c-0.607-0.447-1.086-1.057-1.439-1.827
|
||||||
|
c-0.353-0.771-0.559-1.653-0.619-2.647l2.685-0.193c0.119,1.09,0.407,1.879,0.865,2.368c0.338,0.37,0.726,0.546,1.164,0.525
|
||||||
|
c0.616-0.02,1.108-0.323,1.477-0.911c0.188-0.289,0.283-0.701,0.283-1.239c0-0.775-0.353-1.548-1.059-2.313
|
||||||
|
c-0.557-0.527-1.392-1.318-2.505-2.374c-0.935-0.906-1.596-1.717-1.984-2.434c-0.417-0.807-0.626-1.683-0.626-2.628
|
||||||
|
c0-1.701,0.572-2.99,1.715-3.866c0.706-0.527,1.581-0.791,2.625-0.791c1.004,0,1.864,0.224,2.58,0.671
|
||||||
|
c0.557,0.348,1.007,0.835,1.35,1.462c0.343,0.626,0.549,1.347,0.619,2.163l-2.699,0.492c-0.08-0.767-0.298-1.362-0.656-1.79
|
||||||
|
c-0.259-0.309-0.632-0.462-1.119-0.462c-0.517,0-0.91,0.229-1.178,0.686c-0.219,0.368-0.328,0.825-0.328,1.372
|
||||||
|
c0,0.854,0.368,1.725,1.104,2.61c0.278,0.338,0.696,0.735,1.253,1.192c0.656,0.547,1.089,0.931,1.297,1.148
|
||||||
|
c0.696,0.695,1.233,1.382,1.611,2.058c0.179,0.318,0.323,0.612,0.433,0.88C123.589,43.002,123.729,43.599,123.738,44.126z"/>
|
||||||
|
<path fill="#BFBFBF" d="M128.481,40.949l-3.773-10.873h3.103l2.088,6.711l2.073-6.711h3.117L131.3,40.949v7.83h-2.819V40.949z"/>
|
||||||
|
<path fill="#BFBFBF" d="M140.505,30.076l3.741,12.57v-12.57h2.819v18.703h-3.028l-3.877-11.978v11.978h-2.819V30.076H140.505z"/>
|
||||||
|
<path fill="#BFBFBF" d="M154.015,49.018c-1.243,0-2.299-0.436-3.169-1.306c-0.87-0.87-1.305-1.921-1.305-3.153V34.357
|
||||||
|
c0-1.243,0.438-2.299,1.312-3.169s1.929-1.306,3.162-1.306c1.243,0,2.297,0.438,3.162,1.312c0.865,0.875,1.297,1.929,1.297,3.162
|
||||||
|
v2.133h-2.923v-2.193c0-0.446-0.159-0.83-0.477-1.147c-0.318-0.318-0.701-0.478-1.148-0.478c-0.448,0-0.828,0.159-1.141,0.478
|
||||||
|
c-0.313,0.317-0.47,0.701-0.47,1.147v10.232c0,0.447,0.157,0.828,0.47,1.141c0.313,0.313,0.693,0.471,1.141,0.471
|
||||||
|
c0.447,0,0.83-0.156,1.148-0.471c0.318-0.312,0.477-0.692,0.477-1.141v-2.581h2.923v2.61c0,1.242-0.438,2.297-1.312,3.161
|
||||||
|
C156.287,48.585,155.238,49.018,154.015,49.018z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path fill="#BFBFBF" d="M593.451,44.304c0,1.232-0.433,2.286-1.297,3.161c-0.865,0.875-1.909,1.312-3.133,1.312h-4.431V30.076
|
||||||
|
h4.431c1.232,0,2.279,0.438,3.141,1.312c0.859,0.875,1.289,1.924,1.289,3.146V44.304z M587.412,45.99h1.699
|
||||||
|
c0.446,0,0.825-0.162,1.134-0.485c0.308-0.322,0.462-0.703,0.462-1.141V34.58c0-0.448-0.156-0.83-0.469-1.147
|
||||||
|
c-0.314-0.318-0.689-0.479-1.127-0.479h-1.699V45.99L587.412,45.99z"/>
|
||||||
|
<path fill="#BFBFBF" d="M599.01,44.484l-0.684,4.295h-2.937l3.178-18.688h3.878l3.132,18.688h-2.964l-0.66-4.295H599.01z
|
||||||
|
M600.491,34.371l-1.044,7.368h2.088L600.491,34.371z"/>
|
||||||
|
<path fill="#BFBFBF" d="M608.307,32.925h-2.998v-2.833h8.801v2.833h-2.983v15.854h-2.818L608.307,32.925L608.307,32.925z"/>
|
||||||
|
<path fill="#BFBFBF" d="M617.43,44.484l-0.684,4.295h-2.937l3.178-18.688h3.878l3.132,18.688h-2.964l-0.66-4.295H617.43z
|
||||||
|
M618.911,34.371l-1.044,7.368h2.088L618.911,34.371z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path fill="#BFBFBF" d="M768.561,48.779h-2.819V30.091h2.819V48.779z"/>
|
||||||
|
<path fill="#BFBFBF" d="M774.245,30.076l3.741,12.57v-12.57h2.817v18.703h-3.026l-3.878-11.978v11.978h-2.819V30.076H774.245z"/>
|
||||||
|
<path fill="#BFBFBF" d="M787.77,30.091c1.372,0,2.467,0.433,3.281,1.298c0.756,0.824,1.133,1.879,1.133,3.161v2.715
|
||||||
|
c0,1.232-0.43,2.286-1.289,3.161s-1.901,1.312-3.125,1.312h-1.625v7.04h-2.819V30.091H787.77z M789.455,34.594
|
||||||
|
c0-0.486-0.146-0.88-0.439-1.178c-0.294-0.298-0.685-0.447-1.172-0.447h-1.699v5.981h1.699c0.447,0,0.828-0.159,1.142-0.478
|
||||||
|
s0.471-0.701,0.471-1.148L789.455,34.594L789.455,34.594z"/>
|
||||||
|
<path fill="#BFBFBF" d="M798.881,48.988c-1.243,0-2.297-0.433-3.162-1.298s-1.298-1.914-1.298-3.147V30.091h2.759v14.423
|
||||||
|
c0,0.446,0.16,0.827,0.479,1.141c0.316,0.312,0.7,0.47,1.147,0.47s0.827-0.157,1.142-0.47c0.312-0.313,0.47-0.694,0.47-1.141
|
||||||
|
V30.091h2.938v14.452c0,1.253-0.438,2.308-1.312,3.162C801.17,48.56,800.113,48.988,798.881,48.988z"/>
|
||||||
|
<path fill="#BFBFBF" d="M808.604,32.925h-2.997v-2.833h8.8v2.833h-2.982v15.854h-2.818V32.925H808.604z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path fill="#BFBFBF" d="M384.73,140.802c-1.243,0-2.3-0.435-3.17-1.305c-0.869-0.87-1.305-1.922-1.305-3.154v-10.2
|
||||||
|
c0-1.244,0.438-2.301,1.312-3.17c0.874-0.87,1.929-1.306,3.162-1.306c1.242,0,2.297,0.438,3.161,1.312
|
||||||
|
c0.865,0.875,1.298,1.929,1.298,3.162v2.133h-2.924v-2.193c0-0.447-0.158-0.83-0.477-1.147c-0.318-0.318-0.701-0.478-1.148-0.478
|
||||||
|
s-0.828,0.158-1.141,0.478c-0.312,0.317-0.47,0.7-0.47,1.147v10.232c0,0.446,0.157,0.827,0.47,1.141
|
||||||
|
c0.312,0.312,0.693,0.469,1.141,0.469s0.83-0.155,1.148-0.469c0.318-0.312,0.477-0.693,0.477-1.141v-2.581h2.924v2.609
|
||||||
|
c0,1.242-0.438,2.298-1.312,3.162C387.003,140.369,385.954,140.802,384.73,140.802z"/>
|
||||||
|
<path fill="#BFBFBF" d="M394.32,132.644v7.92h-2.819v-18.688h2.819v7.935h3.399v-7.935h2.819v18.688h-2.819v-7.92H394.32z"/>
|
||||||
|
<path fill="#BFBFBF" d="M406.516,136.269l-0.685,4.295h-2.937l3.178-18.688h3.877l3.132,18.688h-2.964l-0.66-4.295H406.516z
|
||||||
|
M407.997,126.156l-1.044,7.369h2.088L407.997,126.156z"/>
|
||||||
|
<path fill="#BFBFBF" d="M418.619,121.861l3.741,12.57v-12.57h2.818v18.703h-3.027l-3.877-11.978v11.978h-2.819v-18.703H418.619
|
||||||
|
L418.619,121.861z"/>
|
||||||
|
<path fill="#BFBFBF" d="M432.128,140.802c-1.243,0-2.299-0.438-3.169-1.312s-1.305-1.924-1.305-3.146v-10.2
|
||||||
|
c0-1.244,0.438-2.301,1.312-3.17c0.874-0.87,1.929-1.306,3.162-1.306c1.243,0,2.297,0.438,3.162,1.312
|
||||||
|
c0.865,0.875,1.297,1.929,1.297,3.162v2.133h-2.923v-2.193c0-0.447-0.159-0.83-0.478-1.147c-0.317-0.318-0.7-0.478-1.147-0.478
|
||||||
|
c-0.448,0-0.828,0.158-1.141,0.478c-0.313,0.317-0.471,0.7-0.471,1.147v10.232c0,0.446,0.157,0.827,0.471,1.141
|
||||||
|
c0.312,0.312,0.692,0.469,1.141,0.469c0.447,0,0.83-0.154,1.147-0.468c0.318-0.312,0.478-0.69,0.478-1.138v-3.674h-1.566v-2.834
|
||||||
|
h4.489v6.532c0,1.242-0.438,2.298-1.312,3.162C434.401,140.37,433.352,140.802,432.128,140.802z"/>
|
||||||
|
<path fill="#BFBFBF" d="M439.033,140.564v-18.703h8.023v2.834h-5.205v5.101h3.804v2.834h-3.804v5.102h5.205v2.834L439.033,140.564
|
||||||
|
L439.033,140.564z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path fill="#BFBFBF" d="M563.609,123.877c1.569,0,2.724,0.433,3.46,1.297c0.646,0.757,0.97,1.811,0.97,3.162v2.715
|
||||||
|
c0,1.322-0.503,2.44-1.507,3.355l2.088,8.158h-3.048l-1.71-7.039c-0.079,0-0.164,0-0.253,0h-1.626v7.039h-2.819v-18.688
|
||||||
|
L563.609,123.877L563.609,123.877z M565.295,128.381c0-1.084-0.537-1.626-1.611-1.626h-1.699v5.981h1.699
|
||||||
|
c0.447,0,0.828-0.16,1.142-0.479c0.312-0.316,0.471-0.7,0.471-1.147L565.295,128.381L565.295,128.381z"/>
|
||||||
|
<path fill="#BFBFBF" d="M571.035,142.564v-18.703h8.024v2.834h-5.204v5.101h3.803v2.834h-3.803v5.102h5.204v2.834L571.035,142.564
|
||||||
|
L571.035,142.564z"/>
|
||||||
|
<path fill="#BFBFBF" d="M584.164,123.861l3.74,12.57v-12.57h2.818v18.703h-3.027l-3.877-11.978v11.978h-2.819v-18.703H584.164
|
||||||
|
L584.164,123.861z"/>
|
||||||
|
<path fill="#BFBFBF" d="M602.104,138.09c0,1.233-0.433,2.287-1.298,3.162c-0.864,0.875-1.908,1.312-3.132,1.312h-4.43v-18.703h4.43
|
||||||
|
c1.232,0,2.279,0.438,3.139,1.312c0.86,0.875,1.291,1.925,1.291,3.146V138.09z M596.062,139.775h1.7
|
||||||
|
c0.447,0,0.824-0.162,1.134-0.484c0.309-0.323,0.463-0.703,0.463-1.141v-9.785c0-0.447-0.157-0.83-0.472-1.148
|
||||||
|
c-0.312-0.317-0.688-0.477-1.125-0.477h-1.7V139.775z"/>
|
||||||
|
<path fill="#BFBFBF" d="M604.578,142.564v-18.703h8.023v2.834h-5.205v5.101h3.805v2.834h-3.805v5.102h5.205v2.834L604.578,142.564
|
||||||
|
L604.578,142.564z"/>
|
||||||
|
<path fill="#BFBFBF" d="M618.986,123.877c1.569,0,2.724,0.433,3.46,1.297c0.646,0.757,0.97,1.811,0.97,3.162v2.715
|
||||||
|
c0,1.322-0.503,2.44-1.507,3.355l2.088,8.158h-3.048l-1.71-7.039c-0.079,0-0.164,0-0.253,0h-1.626v7.039h-2.819v-18.688
|
||||||
|
L618.986,123.877L618.986,123.877z M620.672,128.381c0-1.084-0.537-1.626-1.611-1.626h-1.699v5.981h1.699
|
||||||
|
c0.447,0,0.828-0.16,1.142-0.479c0.312-0.316,0.471-0.7,0.471-1.147L620.672,128.381L620.672,128.381z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 13 KiB |
135
vendor/backbone/docs/images/intro-routing.svg
vendored
Normal file
|
@ -0,0 +1,135 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
width="890.447px" height="236.988px" viewBox="0 0 890.447 236.988" enable-background="new 0 0 890.447 236.988"
|
||||||
|
xml:space="preserve">
|
||||||
|
<polygon fill="#5C8BEE" points="555.114,52.118 525.116,97.013 529.616,100.076 507.007,114.724 512.351,88.322 516.85,91.385
|
||||||
|
546.849,46.49 "/>
|
||||||
|
<path fill="#BED1F8" d="M570.51,49.536c0,3.312-2.687,6-6,6h-76.788c-3.312,0-6-2.688-6-6V25.649c0-3.313,2.688-6,6-6h76.788
|
||||||
|
c3.313,0,6,2.687,6,6V49.536z"/>
|
||||||
|
<g>
|
||||||
|
<path d="M327.363,39.252v7.92h-2.819V28.484h2.819v7.935h3.397v-7.935h2.819v18.688h-2.819v-7.92H327.363z"/>
|
||||||
|
<path d="M338.847,31.317h-2.998v-2.833h8.803v2.833h-2.983v15.855h-2.819L338.847,31.317L338.847,31.317z"/>
|
||||||
|
<path d="M349.585,31.317h-2.998v-2.833h8.8v2.833h-2.98v15.855h-2.819L349.585,31.317L349.585,31.317z"/>
|
||||||
|
<path d="M362.099,28.484c1.372,0,2.469,0.432,3.281,1.297c0.755,0.825,1.133,1.879,1.133,3.162v2.714
|
||||||
|
c0,1.233-0.43,2.287-1.29,3.162c-0.857,0.875-1.898,1.312-3.125,1.312h-1.625v7.04h-2.816V28.483L362.099,28.484L362.099,28.484z
|
||||||
|
M363.785,32.988c0-0.487-0.147-0.88-0.44-1.178s-0.684-0.447-1.171-0.447h-1.7v5.981h1.7c0.447,0,0.828-0.159,1.144-0.478
|
||||||
|
c0.312-0.318,0.47-0.701,0.47-1.148L363.785,32.988L363.785,32.988z"/>
|
||||||
|
<path d="M368.452,36.433h2.819v2.834h-2.819V36.433z M368.452,44.368h2.819v2.804h-2.819V44.368z"/>
|
||||||
|
<path d="M381.023,27.29h2.299l-7.801,20.448h-2.301L381.023,27.29z"/>
|
||||||
|
<path d="M393.06,27.29h2.302l-7.804,20.448h-2.298L393.06,27.29z"/>
|
||||||
|
<path d="M407.692,47.172h-3.026l-2.163-5.951l-2.18,5.951h-3.026l3.669-9.396l-3.669-9.292h3.117l2.088,5.772l2.073-5.772h3.117
|
||||||
|
l-3.669,9.292L407.692,47.172z"/>
|
||||||
|
<path d="M413.405,39.342l-3.773-10.873h3.104l2.088,6.711l2.073-6.711h3.114l-3.788,10.873v7.83h-2.816L413.405,39.342
|
||||||
|
L413.405,39.342z"/>
|
||||||
|
<path d="M430.185,28.484v2.833l-5.188,13.05h5.188v2.805h-8.23V44.35l5.206-13.047l-5.206,0.015v-2.833L430.185,28.484
|
||||||
|
L430.185,28.484z"/>
|
||||||
|
<path d="M432.123,44.368h2.819v2.819h-2.819V44.368z"/>
|
||||||
|
<path d="M441.355,47.411c-1.243,0-2.302-0.436-3.172-1.305c-0.867-0.87-1.305-1.921-1.305-3.154V32.75
|
||||||
|
c0-1.243,0.438-2.299,1.312-3.169s1.929-1.305,3.16-1.305c1.242,0,2.299,0.438,3.161,1.312c0.865,0.875,1.3,1.929,1.3,3.162v2.133
|
||||||
|
h-2.926V32.69c0-0.447-0.156-0.83-0.477-1.148c-0.318-0.318-0.701-0.477-1.148-0.477c-0.445,0-0.828,0.159-1.141,0.477
|
||||||
|
s-0.47,0.701-0.47,1.148v10.232c0,0.447,0.155,0.828,0.47,1.141c0.312,0.313,0.693,0.47,1.141,0.47c0.448,0,0.83-0.156,1.148-0.47
|
||||||
|
c0.318-0.313,0.477-0.693,0.477-1.141v-2.581h2.926v2.61c0,1.243-0.438,2.297-1.312,3.162
|
||||||
|
C443.627,46.978,442.579,47.411,441.355,47.411z"/>
|
||||||
|
<path d="M452.542,28.245c1.243,0,2.299,0.438,3.169,1.312s1.305,1.929,1.305,3.162v10.202c0,1.243-0.438,2.299-1.312,3.169
|
||||||
|
c-0.875,0.871-1.929,1.305-3.162,1.305c-1.243,0-2.297-0.438-3.162-1.312s-1.298-1.929-1.298-3.162V32.719
|
||||||
|
c0-1.243,0.438-2.299,1.312-3.169C450.268,28.68,451.318,28.245,452.542,28.245z M454.078,32.66c0-0.447-0.157-0.828-0.47-1.141
|
||||||
|
c-0.313-0.313-0.694-0.47-1.144-0.47s-0.831,0.157-1.146,0.47c-0.318,0.313-0.479,0.693-0.479,1.141v10.23
|
||||||
|
c0,0.448,0.159,0.828,0.479,1.141c0.315,0.312,0.698,0.47,1.146,0.47s0.828-0.156,1.144-0.47c0.312-0.313,0.47-0.693,0.47-1.141
|
||||||
|
V32.66z"/>
|
||||||
|
<path d="M462.31,47.172h-2.816V28.469h4.045l2.627,13.438l2.521-13.438h3.889v18.703h-2.819V35.419l-2.445,11.753h-2.267
|
||||||
|
l-2.729-11.723L462.31,47.172L462.31,47.172z"/>
|
||||||
|
<path d="M482.309,27.29h2.302l-7.804,20.448h-2.298L482.309,27.29z"/>
|
||||||
|
<path d="M498.442,36.359l-0.586,3.549h2.9l-0.433,2.834h-2.938l-0.729,4.43h-2.812l0.731-4.43h-2.446l-0.729,4.43h-2.812l0.73-4.43
|
||||||
|
h-2.774l0.434-2.834h2.811l0.585-3.549h-2.771l0.436-2.834h2.803l0.836-5.071h2.812l-0.836,5.071h2.443l0.836-5.071h2.812
|
||||||
|
l-0.836,5.071h2.91l-0.436,2.834H498.442z M495.615,36.359h-2.434l-0.567,3.549h2.431L495.615,36.359z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path d="M504.56,47.49V27.896h4.424c1.166,0,2.219,0.308,3.154,0.922c0.804,0.521,1.375,1.328,1.721,2.422
|
||||||
|
c0.188,0.583,0.279,1.276,0.279,2.078c0,1.312-0.35,2.365-1.047,3.156c-0.292,0.333-0.636,0.589-1.031,0.766
|
||||||
|
c0.656,0.25,1.215,0.745,1.674,1.484c0.302,0.5,0.523,1.146,0.672,1.938c0.07,0.406,0.107,0.859,0.107,1.359
|
||||||
|
c0,1.24-0.232,2.292-0.703,3.156c-0.363,0.677-0.881,1.219-1.547,1.625c-0.75,0.458-1.495,0.688-2.232,0.688H504.56z
|
||||||
|
M507.747,35.896h1.234c0.916,0,1.529-0.448,1.844-1.344c0.114-0.333,0.172-0.745,0.172-1.234c0-0.812-0.198-1.427-0.594-1.844
|
||||||
|
c-0.365-0.385-0.839-0.578-1.422-0.578h-1.234V35.896z M507.747,44.568h1.234c1,0,1.69-0.516,2.076-1.547
|
||||||
|
c0.137-0.354,0.203-0.76,0.203-1.219c0-1.094-0.209-1.891-0.625-2.391c-0.375-0.458-0.928-0.688-1.654-0.688h-1.234V44.568z"/>
|
||||||
|
<path d="M521.7,27.662c1.301,0,2.408,0.458,3.318,1.375s1.367,2.021,1.367,3.312v10.688c0,1.302-0.459,2.409-1.375,3.32
|
||||||
|
c-0.918,0.912-2.021,1.367-3.312,1.367c-1.303,0-2.406-0.458-3.312-1.375c-0.904-0.917-1.357-2.021-1.357-3.312V32.349
|
||||||
|
c0-1.302,0.457-2.409,1.375-3.32C519.319,28.118,520.419,27.662,521.7,27.662z M523.31,32.287c0-0.469-0.163-0.867-0.49-1.195
|
||||||
|
c-0.328-0.328-0.729-0.492-1.195-0.492s-0.871,0.164-1.203,0.492c-0.334,0.328-0.5,0.727-0.5,1.195v10.719
|
||||||
|
c0,0.469,0.166,0.867,0.5,1.195c0.332,0.328,0.734,0.492,1.203,0.492s0.867-0.164,1.195-0.492c0.327-0.328,0.49-0.727,0.49-1.195
|
||||||
|
V32.287z"/>
|
||||||
|
<path d="M533.606,27.662c1.301,0,2.406,0.458,3.318,1.375c0.91,0.917,1.367,2.021,1.367,3.312v10.688
|
||||||
|
c0,1.302-0.459,2.409-1.375,3.32c-0.918,0.912-2.021,1.367-3.312,1.367c-1.305,0-2.406-0.458-3.312-1.375s-1.359-2.021-1.359-3.312
|
||||||
|
V32.349c0-1.302,0.457-2.409,1.375-3.32C531.226,28.118,532.325,27.662,533.606,27.662z M535.216,32.287
|
||||||
|
c0-0.469-0.164-0.867-0.492-1.195c-0.327-0.328-0.727-0.492-1.193-0.492c-0.47,0-0.871,0.164-1.203,0.492
|
||||||
|
c-0.334,0.328-0.5,0.727-0.5,1.195v10.719c0,0.469,0.166,0.867,0.5,1.195c0.332,0.328,0.732,0.492,1.203,0.492
|
||||||
|
c0.469,0,0.867-0.164,1.193-0.492c0.328-0.328,0.492-0.727,0.492-1.195V32.287z"/>
|
||||||
|
<path d="M543.84,41.279v6.211h-2.953V27.896h2.953v6.984l3.609-6.984h3.146l-4.042,7.992l4.74,11.602h-3.472l-3.103-7.955
|
||||||
|
L543.84,41.279z"/>
|
||||||
|
<path d="M561.887,42.615c0.021,1.365-0.334,2.531-1.062,3.5c-0.479,0.656-1.156,1.12-2.031,1.391
|
||||||
|
c-0.469,0.146-1.016,0.219-1.641,0.219c-1.156,0-2.115-0.286-2.875-0.859c-0.638-0.469-1.141-1.106-1.509-1.914
|
||||||
|
c-0.369-0.807-0.587-1.731-0.647-2.773l2.812-0.203c0.125,1.142,0.429,1.969,0.906,2.481c0.354,0.388,0.76,0.571,1.219,0.55
|
||||||
|
c0.646-0.021,1.161-0.339,1.549-0.954c0.195-0.302,0.297-0.735,0.297-1.298c0-0.813-0.37-1.621-1.109-2.424
|
||||||
|
c-0.584-0.553-1.459-1.382-2.625-2.487c-0.979-0.949-1.672-1.798-2.078-2.549c-0.438-0.845-0.656-1.762-0.656-2.752
|
||||||
|
c0-1.783,0.601-3.133,1.799-4.05c0.737-0.553,1.654-0.829,2.75-0.829c1.052,0,1.951,0.234,2.701,0.703
|
||||||
|
c0.584,0.365,1.057,0.875,1.414,1.531c0.359,0.656,0.575,1.412,0.648,2.266l-2.828,0.516c-0.084-0.802-0.312-1.427-0.688-1.875
|
||||||
|
c-0.271-0.323-0.662-0.484-1.174-0.484c-0.541,0-0.951,0.24-1.232,0.719c-0.229,0.386-0.344,0.865-0.344,1.438
|
||||||
|
c0,0.896,0.385,1.808,1.154,2.734c0.291,0.354,0.729,0.771,1.312,1.25c0.688,0.573,1.141,0.974,1.357,1.203
|
||||||
|
c0.729,0.729,1.291,1.448,1.688,2.156c0.188,0.333,0.338,0.641,0.453,0.922C561.73,41.438,561.876,42.063,561.887,42.615z"/>
|
||||||
|
</g>
|
||||||
|
<g id="Layer_1_1_">
|
||||||
|
<g>
|
||||||
|
<path fill="#5C8BEE" d="M536.979,177.98l9.74,2.25c1.562-8.877,1.592-18.143-0.166-27.414l-9.677,2.627
|
||||||
|
C538.234,163.066,538.204,170.669,536.979,177.98z"/>
|
||||||
|
<path fill="#5C8BEE" d="M558.055,182.844l12.188,2.812c2.396-12.648,2.396-25.918-0.37-39.174l-12.086,3.281
|
||||||
|
C560.028,160.955,560.018,172.15,558.055,182.844z"/>
|
||||||
|
<path fill="#5C8BEE" d="M581.517,188.257l14.623,3.374c3.334-16.794,3.32-34.482-0.599-52.117l-14.491,3.938
|
||||||
|
C584.316,158.611,584.32,173.805,581.517,188.257z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path fill="#5C8BEE" d="M395.344,177.98l-9.741,2.25c-1.562-8.877-1.592-18.143,0.166-27.414l9.68,2.627
|
||||||
|
C394.087,163.066,394.117,170.669,395.344,177.98z"/>
|
||||||
|
<path fill="#5C8BEE" d="M374.267,182.844l-12.187,2.812c-2.398-12.648-2.397-25.918,0.37-39.174l12.086,3.281
|
||||||
|
C372.293,160.955,372.304,172.15,374.267,182.844z"/>
|
||||||
|
<path fill="#5C8BEE" d="M350.805,188.257l-14.623,3.374c-3.334-16.794-3.317-34.482,0.602-52.117l14.491,3.938
|
||||||
|
C348.005,158.611,348.001,173.805,350.805,188.257z"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<g>
|
||||||
|
<path d="M684.365,194.646l-9.545-53.396h8.438l6.693,41.621l6.75-41.621h8.445l-9.719,53.396H684.365L684.365,194.646z"/>
|
||||||
|
</g>
|
||||||
|
<path d="M689.988,227.988c-33.771,0-61.229-27.465-61.229-61.229c0-33.759,27.467-61.225,61.229-61.225
|
||||||
|
c33.762,0,61.227,27.465,61.227,61.225C751.215,200.525,723.748,227.988,689.988,227.988L689.988,227.988z M689.988,113.54
|
||||||
|
c-29.354,0-53.229,23.876-53.229,53.224c0,29.354,23.877,53.229,53.229,53.229c29.35,0,53.227-23.877,53.227-53.229
|
||||||
|
C743.215,137.417,719.338,113.54,689.988,113.54L689.988,113.54z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<g>
|
||||||
|
<path d="M231.792,194.646h-8.055v-53.438h11.559l7.506,38.386l7.205-38.386h11.104v53.438h-8.054v-33.58l-6.988,33.58h-6.477
|
||||||
|
l-7.799-33.494L231.792,194.646L231.792,194.646z"/>
|
||||||
|
</g>
|
||||||
|
<path d="M242.424,227.988c-33.76,0-61.225-27.465-61.225-61.229c0-33.759,27.465-61.225,61.225-61.225
|
||||||
|
c33.76,0,61.225,27.465,61.225,61.225C303.649,200.525,276.184,227.988,242.424,227.988L242.424,227.988z M242.424,113.54
|
||||||
|
c-29.349,0-53.225,23.876-53.225,53.224c0,29.354,23.876,53.229,53.225,53.229c29.349,0,53.225-23.877,53.225-53.229
|
||||||
|
C295.649,137.417,271.773,113.54,242.424,113.54L242.424,113.54z"/>
|
||||||
|
</g>
|
||||||
|
<polygon fill="#5C8BEE" points="469.509,111.553 493.126,76.247 488.626,73.184 511.235,58.536 505.892,84.938 501.393,81.875
|
||||||
|
480.388,113.275 "/>
|
||||||
|
<g>
|
||||||
|
<path d="M466.247,227.988c-33.76,0-61.225-27.465-61.225-61.229c0-33.759,27.465-61.225,61.225-61.225s61.225,27.465,61.225,61.225
|
||||||
|
C527.472,200.525,500.007,227.988,466.247,227.988L466.247,227.988z M466.247,113.54c-29.349,0-53.225,23.876-53.225,53.224
|
||||||
|
c0,29.354,23.876,53.229,53.225,53.229s53.225-23.877,53.225-53.229C519.472,137.417,495.596,113.54,466.247,113.54L466.247,113.54
|
||||||
|
z"/>
|
||||||
|
<g>
|
||||||
|
<path d="M465.438,137.24c4.488,0,7.784,1.236,9.889,3.709c1.847,2.158,2.77,5.171,2.77,9.033v7.756
|
||||||
|
c0,3.777-1.435,6.975-4.304,9.588l5.965,23.31h-8.709l-4.883-20.114c-0.229,0-0.469,0-0.728,0h-4.645v20.114h-8.054V137.24
|
||||||
|
H465.438z M470.253,150.109c0-3.096-1.534-4.646-4.603-4.646h-4.858v17.088h4.858c1.276,0,2.362-0.453,3.26-1.361
|
||||||
|
c0.895-0.908,1.342-2.002,1.342-3.281L470.253,150.109L470.253,150.109z"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<path fill="#231F20" d="M574.391,67.172h43.824c8.822,0,16-7.178,16-16v-28c0-8.822-7.178-16-16-16H314.28c-8.822,0-16,7.178-16,16
|
||||||
|
v28c0,8.822,7.178,16,16,16h151.138l4.245-8H314.28c-4.411,0-8-3.589-8-8v-28c0-4.411,3.589-8,8-8h303.935c4.411,0,8,3.589,8,8v28
|
||||||
|
c0,4.411-3.589,8-8,8h-40.101L574.391,67.172z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 10 KiB |
139
vendor/backbone/docs/images/intro-views.svg
vendored
Normal file
|
@ -0,0 +1,139 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
width="890.447px" height="280.484px" viewBox="0 0 890.447 280.484" enable-background="new 0 0 890.447 280.484"
|
||||||
|
xml:space="preserve">
|
||||||
|
<path fill="#5C8BEE" d="M100.65,139.459c0-4.285,3.486-7.771,7.771-7.771h39.413v5.439l24.834-10.438l-24.834-10.439v5.438h-39.413
|
||||||
|
c-9.799,0-17.771,7.976-17.771,17.771c0,9.8,7.972,17.771,17.771,17.771h80.791v-10h-80.791
|
||||||
|
C104.136,147.23,100.65,143.742,100.65,139.459z"/>
|
||||||
|
<polygon fill="#5C8BEE" points="331.821,125.252 308.994,139.554 335.182,145.863 334.306,140.49 634.75,91.496 633.141,81.627
|
||||||
|
332.697,130.621 "/>
|
||||||
|
<polygon fill="#5C8BEE" points="825.936,114.966 780.07,99.605 781.848,94.462 754.967,96.225 775.027,114.2 776.805,109.059
|
||||||
|
822.672,124.417 "/>
|
||||||
|
<g>
|
||||||
|
<path d="M684.365,97.113l-9.545-53.396h8.438l6.695,41.621l6.75-41.621h8.445l-9.721,53.396H684.365L684.365,97.113z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path d="M231.792,163.113h-8.055v-53.438h11.559l7.506,38.389l7.205-38.389h11.104v53.438h-8.054v-33.579l-6.988,33.579h-6.477
|
||||||
|
l-7.799-33.493L231.792,163.113L231.792,163.113z"/>
|
||||||
|
</g>
|
||||||
|
<path d="M689.988,130.453c-33.771,0-61.229-27.466-61.229-61.229C628.759,35.466,656.226,8,689.988,8
|
||||||
|
c33.762,0,61.227,27.465,61.227,61.227C751.215,102.991,723.748,130.453,689.988,130.453L689.988,130.453z M689.988,16.006
|
||||||
|
c-29.354,0-53.229,23.876-53.229,53.227c0,29.354,23.877,53.229,53.229,53.229c29.35,0,53.227-23.878,53.227-53.229
|
||||||
|
C743.215,39.883,719.338,16.006,689.988,16.006L689.988,16.006z"/>
|
||||||
|
<g>
|
||||||
|
<path d="M684.365,240.607l-9.545-53.396h8.438l6.695,41.621l6.75-41.621h8.445l-9.721,53.396H684.365L684.365,240.607z"/>
|
||||||
|
</g>
|
||||||
|
<path d="M689.988,273.952c-33.771,0-61.229-27.469-61.229-61.229c0-33.761,27.467-61.229,61.229-61.229
|
||||||
|
c33.762,0,61.227,27.467,61.227,61.229C751.215,246.486,723.748,273.952,689.988,273.952L689.988,273.952z M689.988,159.504
|
||||||
|
c-29.354,0-53.229,23.876-53.229,53.227c0,29.354,23.877,53.229,53.229,53.229c29.35,0,53.227-23.877,53.227-53.229
|
||||||
|
C743.215,183.381,719.338,159.504,689.988,159.504L689.988,159.504z"/>
|
||||||
|
<path d="M242.424,196.453c-33.76,0-61.225-27.466-61.225-61.229c0-33.762,27.465-61.229,61.225-61.229
|
||||||
|
c33.76,0,61.225,27.466,61.225,61.229C303.649,168.991,276.184,196.453,242.424,196.453L242.424,196.453z M242.424,82.006
|
||||||
|
c-29.349,0-53.225,23.876-53.225,53.229c0,29.354,23.876,53.229,53.225,53.229c29.349,0,53.225-23.877,53.225-53.229
|
||||||
|
S271.773,82.006,242.424,82.006L242.424,82.006z"/>
|
||||||
|
<g>
|
||||||
|
<path d="M38.009,164.991c0,2.115-0.819,3.922-2.458,5.422c-1.639,1.5-3.616,2.25-5.933,2.25h-8.39v-32.062h8.391
|
||||||
|
c2.335,0,4.317,0.75,5.947,2.25c1.629,1.5,2.444,3.303,2.444,5.396L38.009,164.991L38.009,164.991z M26.567,167.884h3.221
|
||||||
|
c0.848,0,1.563-0.271,2.147-0.831c0.583-0.556,0.876-1.203,0.876-1.953v-16.771c0-0.771-0.297-1.422-0.89-1.971
|
||||||
|
c-0.593-0.549-1.304-0.813-2.133-0.813h-3.221V167.884z"/>
|
||||||
|
<path d="M41.682,172.663v-32.062h7.995c2.109,0,4.012,0.504,5.707,1.512c1.45,0.854,2.486,2.175,3.108,3.964
|
||||||
|
c0.339,0.954,0.508,2.09,0.508,3.396c0,2.146-0.631,3.867-1.893,5.165c-0.528,0.546-1.149,0.964-1.865,1.253
|
||||||
|
c1.187,0.405,2.193,1.225,3.023,2.434c0.545,0.812,0.951,1.875,1.215,3.17c0.131,0.666,0.197,1.4,0.197,2.229
|
||||||
|
c0,2.024-0.424,3.75-1.271,5.165c-0.66,1.104-1.593,1.993-2.797,2.657c-1.356,0.75-2.703,1.125-4.04,1.125L41.682,172.663
|
||||||
|
L41.682,172.663L41.682,172.663z M47.445,153.693h2.232c1.657,0,2.769-0.729,3.333-2.199c0.207-0.545,0.311-1.219,0.311-2.021
|
||||||
|
c0-1.33-0.358-2.335-1.074-3.021c-0.66-0.631-1.516-0.945-2.571-0.945h-2.232L47.445,153.693L47.445,153.693z M47.445,167.884
|
||||||
|
h2.232c1.808,0,3.061-0.846,3.757-2.528c0.245-0.574,0.367-1.238,0.367-1.988c0-1.791-0.377-3.1-1.13-3.911
|
||||||
|
c-0.678-0.75-1.677-1.125-2.995-1.125h-2.232L47.445,167.884L47.445,167.884z"/>
|
||||||
|
</g>
|
||||||
|
<path fill="#231F20" d="M39.585,106.287C18.575,106.287,5,111.706,5,120.094v49.714c0,7.869,13.223,16.365,34.585,16.365
|
||||||
|
s34.584-8.496,34.584-16.365v-49.714C74.169,111.706,60.596,106.287,39.585,106.287z M39.591,112.287
|
||||||
|
c20.195,0,28.578,5.085,28.578,7.808c0,2.727-8.384,7.812-28.584,7.812S11,122.819,11,120.094
|
||||||
|
C11,117.372,19.385,112.287,39.591,112.287z M39.585,180.174c-18.496,0-28.585-6.85-28.585-10.365v-41.306
|
||||||
|
c5.911,3.419,15.886,5.401,28.585,5.401c12.698,0,22.673-1.982,28.584-5.401v41.306C68.169,173.324,58.08,180.174,39.585,180.174z"
|
||||||
|
/>
|
||||||
|
<g>
|
||||||
|
|
||||||
|
<rect x="473.998" y="184.928" transform="matrix(0.9869 0.1612 -0.1612 0.9869 36.9186 -75.1423)" fill="#5C8BEE" width="14.998" height="9.998"/>
|
||||||
|
|
||||||
|
<rect x="498.69" y="188.925" transform="matrix(0.9869 0.1613 -0.1613 0.9869 37.9007 -79.0963)" fill="#5C8BEE" width="14.999" height="9.997"/>
|
||||||
|
|
||||||
|
<rect x="572.68" y="201.069" transform="matrix(0.9869 0.1613 -0.1613 0.9869 40.8406 -90.8932)" fill="#5C8BEE" width="15.001" height="9.997"/>
|
||||||
|
<polygon fill="#5C8BEE" points="598.561,198.453 597.684,203.825 597.275,203.759 595.664,213.628 596.072,213.691
|
||||||
|
595.195,219.063 621.385,212.763 "/>
|
||||||
|
|
||||||
|
<rect x="548.044" y="196.977" transform="matrix(0.9869 0.1612 -0.1612 0.9869 39.83 -86.9224)" fill="#5C8BEE" width="14.998" height="9.999"/>
|
||||||
|
|
||||||
|
<rect x="449.316" y="180.918" transform="matrix(0.9869 0.1613 -0.1613 0.9869 35.9797 -71.2654)" fill="#5C8BEE" width="14.999" height="9.999"/>
|
||||||
|
|
||||||
|
<rect x="523.378" y="192.982" transform="matrix(0.9869 0.1611 -0.1611 0.9869 38.8242 -82.9296)" fill="#5C8BEE" width="14.999" height="9.999"/>
|
||||||
|
|
||||||
|
<rect x="424.662" y="176.86" transform="matrix(0.9869 0.1612 -0.1612 0.9869 34.9729 -67.2939)" fill="#5C8BEE" width="14.998" height="10.001"/>
|
||||||
|
|
||||||
|
<rect x="399.983" y="172.832" transform="matrix(0.9869 0.1612 -0.1612 0.9869 33.985 -63.3439)" fill="#5C8BEE" width="14.998" height="9.999"/>
|
||||||
|
|
||||||
|
<rect x="375.313" y="168.8" transform="matrix(0.9869 0.1612 -0.1612 0.9869 33.0254 -59.4397)" fill="#5C8BEE" width="14.999" height="10.002"/>
|
||||||
|
<path fill="#5C8BEE" d="M298.14,176.965l7.938,6.084c5.103-7.434,8.966-15.854,11.205-25.021l-9.896-1.614
|
||||||
|
C305.462,163.909,302.285,170.818,298.14,176.965z"/>
|
||||||
|
<path fill="#5C8BEE" d="M315.308,190.121l9.933,7.604c7.421-10.521,12.92-22.599,15.892-35.811l-12.36-2.021
|
||||||
|
C326.172,171.018,321.526,181.201,315.308,190.121z"/>
|
||||||
|
<path fill="#5C8BEE" d="M334.421,204.768l11.913,9.127c9.988-13.902,17.304-30.012,21.042-47.687l-14.819-2.422
|
||||||
|
C349.25,178.943,342.959,192.773,334.421,204.768z"/>
|
||||||
|
</g>
|
||||||
|
<rect x="475.993" y="79.531" transform="matrix(0.987 -0.1609 0.1609 0.987 -7.3017 78.9079)" fill="#5C8BEE" width="15.001" height="10"/>
|
||||||
|
<rect x="500.646" y="75.536" transform="matrix(0.987 -0.1609 0.1609 0.987 -6.3375 82.8072)" fill="#5C8BEE" width="15.004" height="10"/>
|
||||||
|
<rect x="574.68" y="63.451" transform="matrix(0.987 -0.1609 0.1609 0.987 -3.4286 94.5613)" fill="#5C8BEE" width="15.004" height="10"/>
|
||||||
|
<polygon fill="#5C8BEE" points="623.4,61.766 597.211,55.458 598.086,60.827 597.68,60.895 599.289,70.763 599.695,70.697
|
||||||
|
600.57,76.068 "/>
|
||||||
|
<rect x="550.005" y="67.471" transform="matrix(0.987 -0.1609 0.1609 0.987 -4.3964 90.6553)" fill="#5C8BEE" width="15.002" height="10"/>
|
||||||
|
<rect x="451.344" y="83.648" transform="matrix(0.9869 -0.1611 0.1611 0.9869 -8.2876 75.0647)" fill="#5C8BEE" width="15" height="10.002"/>
|
||||||
|
<rect x="525.312" y="71.542" transform="matrix(0.987 -0.1609 0.1609 0.987 -5.3737 86.7059)" fill="#5C8BEE" width="15.001" height="10"/>
|
||||||
|
<rect x="426.659" y="87.552" transform="matrix(0.987 -0.1609 0.1609 0.987 -9.2341 71.0448)" fill="#5C8BEE" width="15.001" height="10"/>
|
||||||
|
<rect x="401.958" y="91.64" transform="matrix(0.987 -0.1609 0.1609 0.987 -10.2145 67.143)" fill="#5C8BEE" width="15.003" height="10"/>
|
||||||
|
<rect x="377.293" y="95.64" transform="matrix(0.987 -0.1609 0.1609 0.987 -11.1787 63.2183)" fill="#5C8BEE" width="15.005" height="10"/>
|
||||||
|
<path fill="#5C8BEE" d="M309.387,118.035l9.896-1.613c-2.235-9.169-6.104-17.59-11.194-25.021l-7.94,6.08
|
||||||
|
C304.289,103.628,307.463,110.536,309.387,118.035z"/>
|
||||||
|
<path fill="#5C8BEE" d="M330.767,114.55l12.361-2.017c-2.966-13.214-8.462-25.291-15.88-35.812l-9.934,7.604
|
||||||
|
C323.533,93.248,328.175,103.436,330.767,114.55z"/>
|
||||||
|
<path fill="#5C8BEE" d="M354.559,110.67l14.819-2.417c-3.733-17.677-11.042-33.783-21.03-47.688l-11.915,9.125
|
||||||
|
C344.969,81.682,351.255,95.516,354.559,110.67z"/>
|
||||||
|
<path d="M864.363,133.74c0,0,8.648-9.796,8.648-27.768c0-10.745-8.844-19.491-19.486-19.491c-10.846,0-19.496,8.845-19.496,19.491
|
||||||
|
c0,17.972,8.65,27.768,8.65,27.768c0,13.5-21.68,9.315-21.68,24.342v4.372c0,1.237,0.949,2.188,2.188,2.188h60.761
|
||||||
|
c1.233,0,2.186-0.95,2.186-2.188v-4.372C886.041,142.868,864.363,147.24,864.363,133.74z"/>
|
||||||
|
<g>
|
||||||
|
<path fill="#BFBFBF" d="M123.738,189.992c0.02,1.304-0.318,2.416-1.014,3.342c-0.458,0.627-1.104,1.067-1.939,1.327
|
||||||
|
c-0.447,0.14-0.969,0.208-1.566,0.208c-1.104,0-2.019-0.271-2.744-0.819c-0.607-0.445-1.086-1.057-1.439-1.825
|
||||||
|
c-0.353-0.771-0.559-1.652-0.619-2.646l2.685-0.194c0.119,1.092,0.407,1.882,0.865,2.369c0.338,0.369,0.726,0.545,1.164,0.524
|
||||||
|
c0.616-0.021,1.108-0.324,1.477-0.911c0.188-0.288,0.283-0.701,0.283-1.239c0-0.772-0.353-1.547-1.059-2.312
|
||||||
|
c-0.557-0.527-1.392-1.318-2.505-2.374c-0.935-0.905-1.596-1.717-1.984-2.436c-0.417-0.807-0.626-1.683-0.626-2.627
|
||||||
|
c0-1.701,0.572-2.988,1.715-3.864c0.706-0.527,1.581-0.791,2.625-0.791c1.004,0,1.864,0.224,2.58,0.671
|
||||||
|
c0.557,0.348,1.007,0.836,1.35,1.462c0.343,0.626,0.549,1.347,0.619,2.163l-2.699,0.49c-0.08-0.767-0.298-1.361-0.656-1.791
|
||||||
|
c-0.259-0.309-0.632-0.461-1.119-0.461c-0.517,0-0.91,0.229-1.178,0.688c-0.219,0.367-0.328,0.825-0.328,1.372
|
||||||
|
c0,0.854,0.368,1.727,1.104,2.608c0.278,0.34,0.696,0.734,1.253,1.192c0.656,0.547,1.089,0.931,1.297,1.148
|
||||||
|
c0.696,0.693,1.233,1.382,1.611,2.058c0.179,0.318,0.323,0.612,0.433,0.88C123.589,188.868,123.729,189.467,123.738,189.992z"/>
|
||||||
|
<path fill="#BFBFBF" d="M128.481,186.816l-3.773-10.873h3.103l2.088,6.711l2.073-6.711h3.117l-3.788,10.873v7.83h-2.819
|
||||||
|
L128.481,186.816L128.481,186.816z"/>
|
||||||
|
<path fill="#BFBFBF" d="M140.505,175.943l3.741,12.57v-12.57h2.819v18.703h-3.028l-3.877-11.979v11.979h-2.819v-18.703H140.505z"/>
|
||||||
|
<path fill="#BFBFBF" d="M154.015,194.885c-1.243,0-2.299-0.436-3.169-1.306c-0.87-0.869-1.305-1.922-1.305-3.153v-10.199
|
||||||
|
c0-1.244,0.438-2.302,1.312-3.17c0.874-0.87,1.929-1.307,3.162-1.307c1.243,0,2.297,0.438,3.162,1.312
|
||||||
|
c0.865,0.875,1.297,1.929,1.297,3.162v2.133h-2.923v-2.193c0-0.446-0.159-0.829-0.477-1.146c-0.318-0.318-0.701-0.479-1.148-0.479
|
||||||
|
c-0.448,0-0.828,0.158-1.141,0.479c-0.313,0.316-0.47,0.699-0.47,1.146v10.232c0,0.445,0.157,0.827,0.47,1.141
|
||||||
|
c0.313,0.312,0.693,0.47,1.141,0.47c0.447,0,0.83-0.154,1.148-0.47c0.318-0.312,0.477-0.692,0.477-1.141v-2.581h2.923v2.608
|
||||||
|
c0,1.242-0.438,2.299-1.312,3.162C156.288,194.45,155.238,194.885,154.015,194.885z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path fill="#BFBFBF" d="M768.561,76.383h-2.817V57.695h2.817V76.383z"/>
|
||||||
|
<path fill="#BFBFBF" d="M774.245,57.68l3.741,12.568V57.68h2.815v18.701h-3.024l-3.878-11.978v11.978h-2.819V57.68H774.245
|
||||||
|
L774.245,57.68z"/>
|
||||||
|
<path fill="#BFBFBF" d="M787.77,57.695c1.372,0,2.469,0.433,3.281,1.297c0.756,0.825,1.133,1.879,1.133,3.162v2.715
|
||||||
|
c0,1.232-0.43,2.287-1.289,3.162c-0.857,0.875-1.899,1.312-3.125,1.312h-1.625v7.039h-2.817V57.694L787.77,57.695L787.77,57.695z
|
||||||
|
M789.455,62.198c0-0.486-0.146-0.881-0.439-1.179c-0.294-0.298-0.685-0.447-1.172-0.447h-1.699v5.979h1.699
|
||||||
|
c0.447,0,0.828-0.158,1.144-0.479c0.312-0.316,0.471-0.701,0.471-1.147L789.455,62.198L789.455,62.198z"/>
|
||||||
|
<path fill="#BFBFBF" d="M798.881,76.592c-1.243,0-2.297-0.434-3.162-1.298c-0.865-0.862-1.298-1.914-1.298-3.146V57.696h2.759
|
||||||
|
v14.422c0,0.447,0.16,0.828,0.479,1.142c0.314,0.312,0.7,0.473,1.146,0.473c0.447,0,0.827-0.157,1.144-0.473
|
||||||
|
c0.312-0.312,0.47-0.691,0.47-1.142V57.696h2.938v14.451c0,1.254-0.438,2.308-1.312,3.162
|
||||||
|
C801.168,76.163,800.113,76.592,798.881,76.592z"/>
|
||||||
|
<path fill="#BFBFBF" d="M808.604,60.528h-2.995v-2.833h8.8v2.833h-2.982v15.854h-2.816V60.528H808.604z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 12 KiB |
BIN
vendor/backbone/docs/images/irccloud.png
vendored
Normal file
After Width: | Height: | Size: 139 KiB |
BIN
vendor/backbone/docs/images/jolicloud.jpg
vendored
Normal file
After Width: | Height: | Size: 195 KiB |
BIN
vendor/backbone/docs/images/khan-academy.jpg
vendored
Normal file
After Width: | Height: | Size: 101 KiB |
BIN
vendor/backbone/docs/images/newsblur.jpg
vendored
Normal file
After Width: | Height: | Size: 186 KiB |
BIN
vendor/backbone/docs/images/pandora.jpg
vendored
Normal file
After Width: | Height: | Size: 92 KiB |
BIN
vendor/backbone/docs/images/pitchfork.jpg
vendored
Normal file
After Width: | Height: | Size: 122 KiB |
BIN
vendor/backbone/docs/images/quartz.jpg
vendored
Normal file
After Width: | Height: | Size: 136 KiB |
BIN
vendor/backbone/docs/images/rdio.jpg
vendored
Normal file
After Width: | Height: | Size: 64 KiB |
BIN
vendor/backbone/docs/images/salon.jpg
vendored
Normal file
After Width: | Height: | Size: 86 KiB |
BIN
vendor/backbone/docs/images/seatgeek.jpg
vendored
Normal file
After Width: | Height: | Size: 149 KiB |
BIN
vendor/backbone/docs/images/slavery-footprint.jpg
vendored
Normal file
After Width: | Height: | Size: 87 KiB |
BIN
vendor/backbone/docs/images/soundcloud.png
vendored
Normal file
After Width: | Height: | Size: 374 KiB |
BIN
vendor/backbone/docs/images/spin.jpg
vendored
Normal file
After Width: | Height: | Size: 159 KiB |
BIN
vendor/backbone/docs/images/stripe.png
vendored
Normal file
After Width: | Height: | Size: 84 KiB |
BIN
vendor/backbone/docs/images/tilemill.jpg
vendored
Normal file
After Width: | Height: | Size: 118 KiB |
BIN
vendor/backbone/docs/images/todos.jpg
vendored
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
vendor/backbone/docs/images/trello.jpg
vendored
Normal file
After Width: | Height: | Size: 96 KiB |
BIN
vendor/backbone/docs/images/tzigla.jpg
vendored
Normal file
After Width: | Height: | Size: 142 KiB |
BIN
vendor/backbone/docs/images/usa-today.jpg
vendored
Normal file
After Width: | Height: | Size: 182 KiB |
BIN
vendor/backbone/docs/images/vox.jpg
vendored
Normal file
After Width: | Height: | Size: 143 KiB |
BIN
vendor/backbone/docs/images/walmart-mobile.png
vendored
Normal file
After Width: | Height: | Size: 309 KiB |
BIN
vendor/backbone/docs/images/wpcom-notifications.jpg
vendored
Normal file
After Width: | Height: | Size: 73 KiB |
BIN
vendor/backbone/docs/images/zocdoc.jpg
vendored
Normal file
After Width: | Height: | Size: 145 KiB |
210
vendor/backbone/docs/js/jquery.lazyload.js
vendored
Normal file
|
@ -0,0 +1,210 @@
|
||||||
|
/*
|
||||||
|
* Lazy Load - jQuery plugin for lazy loading images
|
||||||
|
*
|
||||||
|
* Copyright (c) 2007-2012 Mika Tuupola
|
||||||
|
*
|
||||||
|
* Licensed under the MIT license:
|
||||||
|
* http://www.opensource.org/licenses/mit-license.php
|
||||||
|
*
|
||||||
|
* Project home:
|
||||||
|
* http://www.appelsiini.net/projects/lazyload
|
||||||
|
*
|
||||||
|
* Version: 1.7.2
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
(function($, window) {
|
||||||
|
|
||||||
|
$window = $(window);
|
||||||
|
|
||||||
|
$.fn.lazyload = function(options) {
|
||||||
|
var elements = this;
|
||||||
|
var settings = {
|
||||||
|
threshold : 0,
|
||||||
|
failure_limit : 0,
|
||||||
|
event : "scroll",
|
||||||
|
effect : "show",
|
||||||
|
container : window,
|
||||||
|
data_attribute : "original",
|
||||||
|
skip_invisible : true,
|
||||||
|
appear : null,
|
||||||
|
load : null
|
||||||
|
};
|
||||||
|
|
||||||
|
function update() {
|
||||||
|
var counter = 0;
|
||||||
|
|
||||||
|
elements.each(function() {
|
||||||
|
var $this = $(this);
|
||||||
|
if (settings.skip_invisible && !$this.is(":visible")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ($.abovethetop(this, settings) ||
|
||||||
|
$.leftofbegin(this, settings)) {
|
||||||
|
/* Nothing. */
|
||||||
|
} else if (!$.belowthefold(this, settings) &&
|
||||||
|
!$.rightoffold(this, settings)) {
|
||||||
|
$this.trigger("appear");
|
||||||
|
} else {
|
||||||
|
if (++counter > settings.failure_limit) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if(options) {
|
||||||
|
/* Maintain BC for a couple of versions. */
|
||||||
|
if (undefined !== options.failurelimit) {
|
||||||
|
options.failure_limit = options.failurelimit;
|
||||||
|
delete options.failurelimit;
|
||||||
|
}
|
||||||
|
if (undefined !== options.effectspeed) {
|
||||||
|
options.effect_speed = options.effectspeed;
|
||||||
|
delete options.effectspeed;
|
||||||
|
}
|
||||||
|
|
||||||
|
$.extend(settings, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Cache container as jQuery as object. */
|
||||||
|
$container = (settings.container === undefined ||
|
||||||
|
settings.container === window) ? $window : $(settings.container);
|
||||||
|
|
||||||
|
/* Fire one scroll event per scroll. Not one scroll event per image. */
|
||||||
|
if (0 === settings.event.indexOf("scroll")) {
|
||||||
|
$container.bind(settings.event, function(event) {
|
||||||
|
return update();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
this.each(function() {
|
||||||
|
var self = this;
|
||||||
|
var $self = $(self);
|
||||||
|
|
||||||
|
self.loaded = false;
|
||||||
|
|
||||||
|
/* When appear is triggered load original image. */
|
||||||
|
$self.one("appear", function() {
|
||||||
|
if (!this.loaded) {
|
||||||
|
if (settings.appear) {
|
||||||
|
var elements_left = elements.length;
|
||||||
|
settings.appear.call(self, elements_left, settings);
|
||||||
|
}
|
||||||
|
$("<img />")
|
||||||
|
.bind("load", function() {
|
||||||
|
$self
|
||||||
|
.hide()
|
||||||
|
.attr("src", $self.data(settings.data_attribute))
|
||||||
|
[settings.effect](settings.effect_speed);
|
||||||
|
self.loaded = true;
|
||||||
|
|
||||||
|
/* Remove image from array so it is not looped next time. */
|
||||||
|
var temp = $.grep(elements, function(element) {
|
||||||
|
return !element.loaded;
|
||||||
|
});
|
||||||
|
elements = $(temp);
|
||||||
|
|
||||||
|
if (settings.load) {
|
||||||
|
var elements_left = elements.length;
|
||||||
|
settings.load.call(self, elements_left, settings);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.attr("src", $self.data(settings.data_attribute));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/* When wanted event is triggered load original image */
|
||||||
|
/* by triggering appear. */
|
||||||
|
if (0 !== settings.event.indexOf("scroll")) {
|
||||||
|
$self.bind(settings.event, function(event) {
|
||||||
|
if (!self.loaded) {
|
||||||
|
$self.trigger("appear");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/* Check if something appears when window is resized. */
|
||||||
|
$window.bind("resize", function(event) {
|
||||||
|
update();
|
||||||
|
});
|
||||||
|
|
||||||
|
/* Force initial check if images should appear. */
|
||||||
|
update();
|
||||||
|
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Convenience methods in jQuery namespace. */
|
||||||
|
/* Use as $.belowthefold(element, {threshold : 100, container : window}) */
|
||||||
|
|
||||||
|
$.belowthefold = function(element, settings) {
|
||||||
|
var fold;
|
||||||
|
|
||||||
|
if (settings.container === undefined || settings.container === window) {
|
||||||
|
fold = $window.height() + $window.scrollTop();
|
||||||
|
} else {
|
||||||
|
fold = $container.offset().top + $container.height();
|
||||||
|
}
|
||||||
|
|
||||||
|
return fold <= $(element).offset().top - settings.threshold;
|
||||||
|
};
|
||||||
|
|
||||||
|
$.rightoffold = function(element, settings) {
|
||||||
|
var fold;
|
||||||
|
|
||||||
|
if (settings.container === undefined || settings.container === window) {
|
||||||
|
fold = $window.width() + $window.scrollLeft();
|
||||||
|
} else {
|
||||||
|
fold = $container.offset().left + $container.width();
|
||||||
|
}
|
||||||
|
|
||||||
|
return fold <= $(element).offset().left - settings.threshold;
|
||||||
|
};
|
||||||
|
|
||||||
|
$.abovethetop = function(element, settings) {
|
||||||
|
var fold;
|
||||||
|
|
||||||
|
if (settings.container === undefined || settings.container === window) {
|
||||||
|
fold = $window.scrollTop();
|
||||||
|
} else {
|
||||||
|
fold = $container.offset().top;
|
||||||
|
}
|
||||||
|
|
||||||
|
return fold >= $(element).offset().top + settings.threshold + $(element).height();
|
||||||
|
};
|
||||||
|
|
||||||
|
$.leftofbegin = function(element, settings) {
|
||||||
|
var fold;
|
||||||
|
|
||||||
|
if (settings.container === undefined || settings.container === window) {
|
||||||
|
fold = $window.scrollLeft();
|
||||||
|
} else {
|
||||||
|
fold = $container.offset().left;
|
||||||
|
}
|
||||||
|
|
||||||
|
return fold >= $(element).offset().left + settings.threshold + $(element).width();
|
||||||
|
};
|
||||||
|
|
||||||
|
$.inviewport = function(element, settings) {
|
||||||
|
return !$.rightofscreen(element, settings) && !$.leftofscreen(element, settings) &&
|
||||||
|
!$.belowthefold(element, settings) && !$.abovethetop(element, settings);
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Custom selectors for your convenience. */
|
||||||
|
/* Use as $("img:below-the-fold").something() */
|
||||||
|
|
||||||
|
$.extend($.expr[':'], {
|
||||||
|
"below-the-fold" : function(a) { return $.belowthefold(a, {threshold : 0, container: window}); },
|
||||||
|
"above-the-top" : function(a) { return !$.belowthefold(a, {threshold : 0, container: window}); },
|
||||||
|
"right-of-screen": function(a) { return $.rightoffold(a, {threshold : 0, container: window}); },
|
||||||
|
"left-of-screen" : function(a) { return !$.rightoffold(a, {threshold : 0, container: window}); },
|
||||||
|
"in-viewport" : function(a) { return !$.inviewport(a, {threshold : 0, container: window}); },
|
||||||
|
/* Maintain BC for couple of versions. */
|
||||||
|
"above-the-fold" : function(a) { return !$.belowthefold(a, {threshold : 0, container: window}); },
|
||||||
|
"right-of-fold" : function(a) { return $.rightoffold(a, {threshold : 0, container: window}); },
|
||||||
|
"left-of-fold" : function(a) { return !$.rightoffold(a, {threshold : 0, container: window}); }
|
||||||
|
});
|
||||||
|
|
||||||
|
})(jQuery, window);
|
BIN
vendor/backbone/docs/public/fonts/aller-bold.eot
vendored
Normal file
BIN
vendor/backbone/docs/public/fonts/aller-bold.ttf
vendored
Normal file
BIN
vendor/backbone/docs/public/fonts/aller-bold.woff
vendored
Normal file
BIN
vendor/backbone/docs/public/fonts/aller-light.eot
vendored
Normal file
BIN
vendor/backbone/docs/public/fonts/aller-light.ttf
vendored
Normal file
BIN
vendor/backbone/docs/public/fonts/aller-light.woff
vendored
Normal file
BIN
vendor/backbone/docs/public/fonts/roboto-black.eot
vendored
Normal file
BIN
vendor/backbone/docs/public/fonts/roboto-black.ttf
vendored
Normal file
BIN
vendor/backbone/docs/public/fonts/roboto-black.woff
vendored
Normal file
BIN
vendor/backbone/docs/public/images/grey_@2X.png
vendored
Normal file
After Width: | Height: | Size: 56 KiB |
375
vendor/backbone/docs/public/stylesheets/normalize.css
vendored
Normal file
|
@ -0,0 +1,375 @@
|
||||||
|
/*! normalize.css v2.0.1 | MIT License | git.io/normalize */
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
HTML5 display definitions
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Corrects `block` display not defined in IE 8/9.
|
||||||
|
*/
|
||||||
|
|
||||||
|
article,
|
||||||
|
aside,
|
||||||
|
details,
|
||||||
|
figcaption,
|
||||||
|
figure,
|
||||||
|
footer,
|
||||||
|
header,
|
||||||
|
hgroup,
|
||||||
|
nav,
|
||||||
|
section,
|
||||||
|
summary {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Corrects `inline-block` display not defined in IE 8/9.
|
||||||
|
*/
|
||||||
|
|
||||||
|
audio,
|
||||||
|
canvas,
|
||||||
|
video {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Prevents modern browsers from displaying `audio` without controls.
|
||||||
|
* Remove excess height in iOS 5 devices.
|
||||||
|
*/
|
||||||
|
|
||||||
|
audio:not([controls]) {
|
||||||
|
display: none;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Addresses styling for `hidden` attribute not present in IE 8/9.
|
||||||
|
*/
|
||||||
|
|
||||||
|
[hidden] {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Base
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 1. Sets default font family to sans-serif.
|
||||||
|
* 2. Prevents iOS text size adjust after orientation change, without disabling
|
||||||
|
* user zoom.
|
||||||
|
*/
|
||||||
|
|
||||||
|
html {
|
||||||
|
font-family: sans-serif; /* 1 */
|
||||||
|
-webkit-text-size-adjust: 100%; /* 2 */
|
||||||
|
-ms-text-size-adjust: 100%; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Removes default margin.
|
||||||
|
*/
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Links
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Addresses `outline` inconsistency between Chrome and other browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
a:focus {
|
||||||
|
outline: thin dotted;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Improves readability when focused and also mouse hovered in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
a:active,
|
||||||
|
a:hover {
|
||||||
|
outline: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Typography
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Addresses `h1` font sizes within `section` and `article` in Firefox 4+,
|
||||||
|
* Safari 5, and Chrome.
|
||||||
|
*/
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Addresses styling not present in IE 8/9, Safari 5, and Chrome.
|
||||||
|
*/
|
||||||
|
|
||||||
|
abbr[title] {
|
||||||
|
border-bottom: 1px dotted;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Addresses style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
|
||||||
|
*/
|
||||||
|
|
||||||
|
b,
|
||||||
|
strong {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Addresses styling not present in Safari 5 and Chrome.
|
||||||
|
*/
|
||||||
|
|
||||||
|
dfn {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Addresses styling not present in IE 8/9.
|
||||||
|
*/
|
||||||
|
|
||||||
|
mark {
|
||||||
|
background: #ff0;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Corrects font family set oddly in Safari 5 and Chrome.
|
||||||
|
*/
|
||||||
|
|
||||||
|
code,
|
||||||
|
kbd,
|
||||||
|
pre,
|
||||||
|
samp {
|
||||||
|
font-family: monospace, serif;
|
||||||
|
font-size: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Improves readability of pre-formatted text in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
pre {
|
||||||
|
white-space: pre;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sets consistent quote types.
|
||||||
|
*/
|
||||||
|
|
||||||
|
q {
|
||||||
|
quotes: "\201C" "\201D" "\2018" "\2019";
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Addresses inconsistent and variable font size in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
small {
|
||||||
|
font-size: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Prevents `sub` and `sup` affecting `line-height` in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
sub,
|
||||||
|
sup {
|
||||||
|
font-size: 75%;
|
||||||
|
line-height: 0;
|
||||||
|
position: relative;
|
||||||
|
vertical-align: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
sup {
|
||||||
|
top: -0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub {
|
||||||
|
bottom: -0.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Embedded content
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Removes border when inside `a` element in IE 8/9.
|
||||||
|
*/
|
||||||
|
|
||||||
|
img {
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Corrects overflow displayed oddly in IE 9.
|
||||||
|
*/
|
||||||
|
|
||||||
|
svg:not(:root) {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Figures
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Addresses margin not present in IE 8/9 and Safari 5.
|
||||||
|
*/
|
||||||
|
|
||||||
|
figure {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Forms
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Define consistent border, margin, and padding.
|
||||||
|
*/
|
||||||
|
|
||||||
|
fieldset {
|
||||||
|
border: 1px solid #c0c0c0;
|
||||||
|
margin: 0 2px;
|
||||||
|
padding: 0.35em 0.625em 0.75em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 1. Corrects color not being inherited in IE 8/9.
|
||||||
|
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
|
||||||
|
*/
|
||||||
|
|
||||||
|
legend {
|
||||||
|
border: 0; /* 1 */
|
||||||
|
padding: 0; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 1. Corrects font family not being inherited in all browsers.
|
||||||
|
* 2. Corrects font size not being inherited in all browsers.
|
||||||
|
* 3. Addresses margins set differently in Firefox 4+, Safari 5, and Chrome
|
||||||
|
*/
|
||||||
|
|
||||||
|
button,
|
||||||
|
input,
|
||||||
|
select,
|
||||||
|
textarea {
|
||||||
|
font-family: inherit; /* 1 */
|
||||||
|
font-size: 100%; /* 2 */
|
||||||
|
margin: 0; /* 3 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Addresses Firefox 4+ setting `line-height` on `input` using `!important` in
|
||||||
|
* the UA stylesheet.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button,
|
||||||
|
input {
|
||||||
|
line-height: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
|
||||||
|
* and `video` controls.
|
||||||
|
* 2. Corrects inability to style clickable `input` types in iOS.
|
||||||
|
* 3. Improves usability and consistency of cursor style between image-type
|
||||||
|
* `input` and others.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button,
|
||||||
|
html input[type="button"], /* 1 */
|
||||||
|
input[type="reset"],
|
||||||
|
input[type="submit"] {
|
||||||
|
-webkit-appearance: button; /* 2 */
|
||||||
|
cursor: pointer; /* 3 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Re-set default cursor for disabled elements.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button[disabled],
|
||||||
|
input[disabled] {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 1. Addresses box sizing set to `content-box` in IE 8/9.
|
||||||
|
* 2. Removes excess padding in IE 8/9.
|
||||||
|
*/
|
||||||
|
|
||||||
|
input[type="checkbox"],
|
||||||
|
input[type="radio"] {
|
||||||
|
box-sizing: border-box; /* 1 */
|
||||||
|
padding: 0; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome.
|
||||||
|
* 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome
|
||||||
|
* (include `-moz` to future-proof).
|
||||||
|
*/
|
||||||
|
|
||||||
|
input[type="search"] {
|
||||||
|
-webkit-appearance: textfield; /* 1 */
|
||||||
|
-moz-box-sizing: content-box;
|
||||||
|
-webkit-box-sizing: content-box; /* 2 */
|
||||||
|
box-sizing: content-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Removes inner padding and search cancel button in Safari 5 and Chrome
|
||||||
|
* on OS X.
|
||||||
|
*/
|
||||||
|
|
||||||
|
input[type="search"]::-webkit-search-cancel-button,
|
||||||
|
input[type="search"]::-webkit-search-decoration {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Removes inner padding and border in Firefox 4+.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button::-moz-focus-inner,
|
||||||
|
input::-moz-focus-inner {
|
||||||
|
border: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 1. Removes default vertical scrollbar in IE 8/9.
|
||||||
|
* 2. Improves readability and alignment in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
overflow: auto; /* 1 */
|
||||||
|
vertical-align: top; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Tables
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Remove most spacing between table cells.
|
||||||
|
*/
|
||||||
|
|
||||||
|
table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
border-spacing: 0;
|
||||||
|
}
|
58
vendor/backbone/docs/search.js
vendored
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
(function() {
|
||||||
|
var functions = document.querySelectorAll('[data-name]');
|
||||||
|
var sections = document.querySelectorAll('.searchable_section');
|
||||||
|
var searchInput = document.getElementById('function_filter');
|
||||||
|
|
||||||
|
function strIn(a, b) {
|
||||||
|
a = a.toLowerCase();
|
||||||
|
b = b.toLowerCase();
|
||||||
|
return b.indexOf(a) >= 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function doesMatch(element) {
|
||||||
|
var name = element.getAttribute('data-name');
|
||||||
|
var aliases = element.getAttribute('data-aliases') || '';
|
||||||
|
return strIn(searchInput.value, name) || strIn(searchInput.value, aliases);
|
||||||
|
}
|
||||||
|
|
||||||
|
function filterElement(element) {
|
||||||
|
element.style.display = doesMatch(element) ? '' : 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
function filterToc() {
|
||||||
|
_.each(functions, filterElement);
|
||||||
|
|
||||||
|
var emptySearch = searchInput.value === '';
|
||||||
|
|
||||||
|
// Hide the titles of empty sections
|
||||||
|
_.each(sections, function(section) {
|
||||||
|
var sectionFunctions = section.querySelectorAll('[data-name]');
|
||||||
|
var showSection = emptySearch || _.some(sectionFunctions, doesMatch);
|
||||||
|
section.style.display = showSection ? '' : 'none';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function gotoFirst() {
|
||||||
|
var firstFunction = _.find(functions, doesMatch);
|
||||||
|
if(firstFunction) {
|
||||||
|
window.location.hash = firstFunction.lastChild.getAttribute('href');
|
||||||
|
searchInput.focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
searchInput.addEventListener('input', filterToc, false);
|
||||||
|
|
||||||
|
// Press "Enter" to jump to the first matching function
|
||||||
|
searchInput.addEventListener('keypress', function(e) {
|
||||||
|
if (e.which === 13) {
|
||||||
|
gotoFirst();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Press "/" to search
|
||||||
|
document.body.addEventListener('keyup', function(event) {
|
||||||
|
if (191 === event.which) {
|
||||||
|
searchInput.focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}());
|
791
vendor/backbone/docs/todos.html
vendored
Normal file
|
@ -0,0 +1,791 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>todos.js</title>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||||
|
<link rel="stylesheet" media="all" href="docco.css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="container">
|
||||||
|
<div id="background"></div>
|
||||||
|
|
||||||
|
<ul id="jump_to">
|
||||||
|
<li>
|
||||||
|
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||||
|
<a class="small" href="javascript:void(0);">+</a>
|
||||||
|
<div id="jump_wrapper">
|
||||||
|
<div id="jump_page_wrapper">
|
||||||
|
<div id="jump_page">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="source" href="backbone.localStorage.html">
|
||||||
|
backbone.localStorage.js
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
<a class="source" href="todos.html">
|
||||||
|
todos.js
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul class="sections">
|
||||||
|
|
||||||
|
<li id="title">
|
||||||
|
<div class="annotation">
|
||||||
|
<h1>todos.js</h1>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-1">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-1">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>An example Backbone application contributed by
|
||||||
|
<a href="http://jgn.me/">Jérôme Gravel-Niquet</a>. This demo uses a simple
|
||||||
|
<a href="backbone.localStorage.html">LocalStorage adapter</a>
|
||||||
|
to persist Backbone models within your browser.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-2">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-2">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Load the application once the DOM is ready, using <code>jQuery.ready</code>:</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre>$(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>)</span>{</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-3">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-3">¶</a>
|
||||||
|
</div>
|
||||||
|
<h2 id="todo-model">Todo Model</h2>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-4">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-4">¶</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-5">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-5">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Our basic <strong>Todo</strong> model has <code>title</code>, <code>order</code>, and <code>done</code> attributes.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">var</span> Todo = Backbone.Model.extend({</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-6">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-6">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Default attributes for the todo item.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> defaults: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
|
||||||
|
<span class="hljs-keyword">return</span> {
|
||||||
|
title: <span class="hljs-string">"empty todo..."</span>,
|
||||||
|
order: Todos.nextOrder(),
|
||||||
|
done: <span class="hljs-literal">false</span>
|
||||||
|
};
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-7">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-7">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Toggle the <code>done</code> state of this todo item.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> toggle: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
|
||||||
|
<span class="hljs-keyword">this</span>.save({done: !<span class="hljs-keyword">this</span>.get(<span class="hljs-string">"done"</span>)});
|
||||||
|
}
|
||||||
|
|
||||||
|
});</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-8">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-8">¶</a>
|
||||||
|
</div>
|
||||||
|
<h2 id="todo-collection">Todo Collection</h2>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-9">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-9">¶</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-10">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-10">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>The collection of todos is backed by <em>localStorage</em> instead of a remote
|
||||||
|
server.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">var</span> TodoList = Backbone.Collection.extend({</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-11">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-11">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Reference to this collection’s model.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> model: Todo,</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-12">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-12">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Save all of the todo items under the <code>"todos-backbone"</code> namespace.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> localStorage: <span class="hljs-keyword">new</span> Backbone.LocalStorage(<span class="hljs-string">"todos-backbone"</span>),</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-13">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-13">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Filter down the list of all todo items that are finished.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> done: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
|
||||||
|
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.where({done: <span class="hljs-literal">true</span>});
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-14">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-14">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Filter down the list to only todo items that are still not finished.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> remaining: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
|
||||||
|
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.where({done: <span class="hljs-literal">false</span>});
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-15">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-15">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>We keep the Todos in sequential order, despite being saved by unordered
|
||||||
|
GUID in the database. This generates the next order number for new items.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> nextOrder: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
|
||||||
|
<span class="hljs-keyword">if</span> (!<span class="hljs-keyword">this</span>.length) <span class="hljs-keyword">return</span> <span class="hljs-number">1</span>;
|
||||||
|
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.last().get(<span class="hljs-string">'order'</span>) + <span class="hljs-number">1</span>;
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-16">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-16">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Todos are sorted by their original insertion order.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> comparator: <span class="hljs-string">'order'</span>
|
||||||
|
|
||||||
|
});</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-17">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-17">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Create our global collection of <strong>Todos</strong>.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">var</span> Todos = <span class="hljs-keyword">new</span> TodoList;</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-18">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-18">¶</a>
|
||||||
|
</div>
|
||||||
|
<h2 id="todo-item-view">Todo Item View</h2>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-19">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-19">¶</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-20">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-20">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>The DOM element for a todo item…</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">var</span> TodoView = Backbone.View.extend({</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-21">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-21">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>… is a list tag.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> tagName: <span class="hljs-string">"li"</span>,</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-22">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-22">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Cache the template function for a single item.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> template: _.template($(<span class="hljs-string">'#item-template'</span>).html()),</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-23">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-23">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>The DOM events specific to an item.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> events: {
|
||||||
|
<span class="hljs-string">"click .toggle"</span> : <span class="hljs-string">"toggleDone"</span>,
|
||||||
|
<span class="hljs-string">"dblclick .view"</span> : <span class="hljs-string">"edit"</span>,
|
||||||
|
<span class="hljs-string">"click a.destroy"</span> : <span class="hljs-string">"clear"</span>,
|
||||||
|
<span class="hljs-string">"keypress .edit"</span> : <span class="hljs-string">"updateOnEnter"</span>,
|
||||||
|
<span class="hljs-string">"blur .edit"</span> : <span class="hljs-string">"close"</span>
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-24">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-24">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>The TodoView listens for changes to its model, re-rendering. Since there’s
|
||||||
|
a one-to-one correspondence between a <strong>Todo</strong> and a <strong>TodoView</strong> in this
|
||||||
|
app, we set a direct reference on the model for convenience.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> initialize: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
|
||||||
|
<span class="hljs-keyword">this</span>.listenTo(<span class="hljs-keyword">this</span>.model, <span class="hljs-string">'change'</span>, <span class="hljs-keyword">this</span>.render);
|
||||||
|
<span class="hljs-keyword">this</span>.listenTo(<span class="hljs-keyword">this</span>.model, <span class="hljs-string">'destroy'</span>, <span class="hljs-keyword">this</span>.remove);
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-25">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-25">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Re-render the titles of the todo item.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> render: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
|
||||||
|
<span class="hljs-keyword">this</span>.$el.html(<span class="hljs-keyword">this</span>.template(<span class="hljs-keyword">this</span>.model.toJSON()));
|
||||||
|
<span class="hljs-keyword">this</span>.$el.toggleClass(<span class="hljs-string">'done'</span>, <span class="hljs-keyword">this</span>.model.get(<span class="hljs-string">'done'</span>));
|
||||||
|
<span class="hljs-keyword">this</span>.input = <span class="hljs-keyword">this</span>.$(<span class="hljs-string">'.edit'</span>);
|
||||||
|
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>;
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-26">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-26">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Toggle the <code>"done"</code> state of the model.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> toggleDone: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
|
||||||
|
<span class="hljs-keyword">this</span>.model.toggle();
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-27">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-27">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Switch this view into <code>"editing"</code> mode, displaying the input field.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> edit: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
|
||||||
|
<span class="hljs-keyword">this</span>.$el.addClass(<span class="hljs-string">"editing"</span>);
|
||||||
|
<span class="hljs-keyword">this</span>.input.focus();
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-28">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-28">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Close the <code>"editing"</code> mode, saving changes to the todo.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> close: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
|
||||||
|
<span class="hljs-keyword">var</span> value = <span class="hljs-keyword">this</span>.input.val();
|
||||||
|
<span class="hljs-keyword">if</span> (!value) {
|
||||||
|
<span class="hljs-keyword">this</span>.clear();
|
||||||
|
} <span class="hljs-keyword">else</span> {
|
||||||
|
<span class="hljs-keyword">this</span>.model.save({title: value});
|
||||||
|
<span class="hljs-keyword">this</span>.$el.removeClass(<span class="hljs-string">"editing"</span>);
|
||||||
|
}
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-29">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-29">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>If you hit <code>enter</code>, we’re through editing the item.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> updateOnEnter: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">e</span>) </span>{
|
||||||
|
<span class="hljs-keyword">if</span> (e.keyCode == <span class="hljs-number">13</span>) <span class="hljs-keyword">this</span>.close();
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-30">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-30">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Remove the item, destroy the model.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> clear: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
|
||||||
|
<span class="hljs-keyword">this</span>.model.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
});</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-31">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-31">¶</a>
|
||||||
|
</div>
|
||||||
|
<h2 id="the-application">The Application</h2>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-32">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-32">¶</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-33">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-33">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Our overall <strong>AppView</strong> is the top-level piece of UI.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">var</span> AppView = Backbone.View.extend({</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-34">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-34">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Instead of generating a new element, bind to the existing skeleton of
|
||||||
|
the App already present in the HTML.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> el: $(<span class="hljs-string">"#todoapp"</span>),</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-35">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-35">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Our template for the line of statistics at the bottom of the app.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> statsTemplate: _.template($(<span class="hljs-string">'#stats-template'</span>).html()),</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-36">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-36">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Delegated events for creating new items, and clearing completed ones.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> events: {
|
||||||
|
<span class="hljs-string">"keypress #new-todo"</span>: <span class="hljs-string">"createOnEnter"</span>,
|
||||||
|
<span class="hljs-string">"click #clear-completed"</span>: <span class="hljs-string">"clearCompleted"</span>,
|
||||||
|
<span class="hljs-string">"click #toggle-all"</span>: <span class="hljs-string">"toggleAllComplete"</span>
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-37">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-37">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>At initialization we bind to the relevant events on the <code>Todos</code>
|
||||||
|
collection, when items are added or changed. Kick things off by
|
||||||
|
loading any preexisting todos that might be saved in <em>localStorage</em>.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> initialize: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
|
||||||
|
|
||||||
|
<span class="hljs-keyword">this</span>.input = <span class="hljs-keyword">this</span>.$(<span class="hljs-string">"#new-todo"</span>);
|
||||||
|
<span class="hljs-keyword">this</span>.allCheckbox = <span class="hljs-keyword">this</span>.$(<span class="hljs-string">"#toggle-all"</span>)[<span class="hljs-number">0</span>];
|
||||||
|
|
||||||
|
<span class="hljs-keyword">this</span>.listenTo(Todos, <span class="hljs-string">'add'</span>, <span class="hljs-keyword">this</span>.addOne);
|
||||||
|
<span class="hljs-keyword">this</span>.listenTo(Todos, <span class="hljs-string">'reset'</span>, <span class="hljs-keyword">this</span>.addAll);
|
||||||
|
<span class="hljs-keyword">this</span>.listenTo(Todos, <span class="hljs-string">'all'</span>, <span class="hljs-keyword">this</span>.render);
|
||||||
|
|
||||||
|
<span class="hljs-keyword">this</span>.footer = <span class="hljs-keyword">this</span>.$(<span class="hljs-string">'footer'</span>);
|
||||||
|
<span class="hljs-keyword">this</span>.main = $(<span class="hljs-string">'#main'</span>);
|
||||||
|
|
||||||
|
Todos.fetch();
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-38">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-38">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Re-rendering the App just means refreshing the statistics – the rest
|
||||||
|
of the app doesn’t change.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> render: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
|
||||||
|
<span class="hljs-keyword">var</span> done = Todos.done().length;
|
||||||
|
<span class="hljs-keyword">var</span> remaining = Todos.remaining().length;
|
||||||
|
|
||||||
|
<span class="hljs-keyword">if</span> (Todos.length) {
|
||||||
|
<span class="hljs-keyword">this</span>.main.show();
|
||||||
|
<span class="hljs-keyword">this</span>.footer.show();
|
||||||
|
<span class="hljs-keyword">this</span>.footer.html(<span class="hljs-keyword">this</span>.statsTemplate({done: done, remaining: remaining}));
|
||||||
|
} <span class="hljs-keyword">else</span> {
|
||||||
|
<span class="hljs-keyword">this</span>.main.hide();
|
||||||
|
<span class="hljs-keyword">this</span>.footer.hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="hljs-keyword">this</span>.allCheckbox.checked = !remaining;
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-39">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-39">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Add a single todo item to the list by creating a view for it, and
|
||||||
|
appending its element to the <code><ul></code>.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> addOne: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">todo</span>) </span>{
|
||||||
|
<span class="hljs-keyword">var</span> view = <span class="hljs-keyword">new</span> TodoView({model: todo});
|
||||||
|
<span class="hljs-keyword">this</span>.$(<span class="hljs-string">"#todo-list"</span>).append(view.render().el);
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-40">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-40">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Add all items in the <strong>Todos</strong> collection at once.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> addAll: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
|
||||||
|
Todos.each(<span class="hljs-keyword">this</span>.addOne, <span class="hljs-keyword">this</span>);
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-41">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-41">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>If you hit return in the main input field, create new <strong>Todo</strong> model,
|
||||||
|
persisting it to <em>localStorage</em>.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> createOnEnter: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">e</span>) </span>{
|
||||||
|
<span class="hljs-keyword">if</span> (e.keyCode != <span class="hljs-number">13</span>) <span class="hljs-keyword">return</span>;
|
||||||
|
<span class="hljs-keyword">if</span> (!<span class="hljs-keyword">this</span>.input.val()) <span class="hljs-keyword">return</span>;
|
||||||
|
|
||||||
|
Todos.create({title: <span class="hljs-keyword">this</span>.input.val()});
|
||||||
|
<span class="hljs-keyword">this</span>.input.val(<span class="hljs-string">''</span>);
|
||||||
|
},</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-42">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-42">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Clear all done todo items, destroying their models.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> clearCompleted: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
|
||||||
|
_.invoke(Todos.done(), <span class="hljs-string">'destroy'</span>);
|
||||||
|
<span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>;
|
||||||
|
},
|
||||||
|
|
||||||
|
toggleAllComplete: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{
|
||||||
|
<span class="hljs-keyword">var</span> done = <span class="hljs-keyword">this</span>.allCheckbox.checked;
|
||||||
|
Todos.each(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">todo</span>) </span>{ todo.save({<span class="hljs-string">'done'</span>: done}); });
|
||||||
|
}
|
||||||
|
|
||||||
|
});</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li id="section-43">
|
||||||
|
<div class="annotation">
|
||||||
|
|
||||||
|
<div class="pilwrap ">
|
||||||
|
<a class="pilcrow" href="#section-43">¶</a>
|
||||||
|
</div>
|
||||||
|
<p>Finally, we kick things off by creating the <strong>App</strong>.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">var</span> App = <span class="hljs-keyword">new</span> AppView;
|
||||||
|
|
||||||
|
});</pre></div></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
184
vendor/backbone/examples/backbone.localStorage.js
vendored
Normal file
|
@ -0,0 +1,184 @@
|
||||||
|
/**
|
||||||
|
* Backbone localStorage Adapter
|
||||||
|
* Version 1.1.0
|
||||||
|
*
|
||||||
|
* https://github.com/jeromegn/Backbone.localStorage
|
||||||
|
*/
|
||||||
|
(function (root, factory) {
|
||||||
|
if (typeof define === "function" && define.amd) {
|
||||||
|
// AMD. Register as an anonymous module.
|
||||||
|
define(["underscore","backbone"], function(_, Backbone) {
|
||||||
|
// Use global variables if the locals are undefined.
|
||||||
|
return factory(_ || root._, Backbone || root.Backbone);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// RequireJS isn't being used. Assume underscore and backbone are loaded in script tags
|
||||||
|
factory(_, Backbone);
|
||||||
|
}
|
||||||
|
}(this, function(_, Backbone) {
|
||||||
|
// A simple module to replace `Backbone.sync` with *localStorage*-based
|
||||||
|
// persistence. Models are given GUIDS, and saved into a JSON object. Simple
|
||||||
|
// as that.
|
||||||
|
|
||||||
|
// Hold reference to Underscore.js and Backbone.js in the closure in order
|
||||||
|
// to make things work even if they are removed from the global namespace
|
||||||
|
|
||||||
|
// Generate four random hex digits.
|
||||||
|
function S4() {
|
||||||
|
return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Generate a pseudo-GUID by concatenating random hexadecimal.
|
||||||
|
function guid() {
|
||||||
|
return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
|
||||||
|
};
|
||||||
|
|
||||||
|
// Our Store is represented by a single JS object in *localStorage*. Create it
|
||||||
|
// with a meaningful name, like the name you'd give a table.
|
||||||
|
// window.Store is deprecated, use Backbone.LocalStorage instead
|
||||||
|
Backbone.LocalStorage = window.Store = function(name) {
|
||||||
|
this.name = name;
|
||||||
|
var store = this.localStorage().getItem(this.name);
|
||||||
|
this.records = (store && store.split(",")) || [];
|
||||||
|
};
|
||||||
|
|
||||||
|
_.extend(Backbone.LocalStorage.prototype, {
|
||||||
|
|
||||||
|
// Save the current state of the **Store** to *localStorage*.
|
||||||
|
save: function() {
|
||||||
|
this.localStorage().setItem(this.name, this.records.join(","));
|
||||||
|
},
|
||||||
|
|
||||||
|
// Add a model, giving it a (hopefully)-unique GUID, if it doesn't already
|
||||||
|
// have an id of it's own.
|
||||||
|
create: function(model) {
|
||||||
|
if (!model.id) {
|
||||||
|
model.id = guid();
|
||||||
|
model.set(model.idAttribute, model.id);
|
||||||
|
}
|
||||||
|
this.localStorage().setItem(this.name+"-"+model.id, JSON.stringify(model));
|
||||||
|
this.records.push(model.id.toString());
|
||||||
|
this.save();
|
||||||
|
return this.find(model);
|
||||||
|
},
|
||||||
|
|
||||||
|
// Update a model by replacing its copy in `this.data`.
|
||||||
|
update: function(model) {
|
||||||
|
this.localStorage().setItem(this.name+"-"+model.id, JSON.stringify(model));
|
||||||
|
if (!_.include(this.records, model.id.toString()))
|
||||||
|
this.records.push(model.id.toString()); this.save();
|
||||||
|
return this.find(model);
|
||||||
|
},
|
||||||
|
|
||||||
|
// Retrieve a model from `this.data` by id.
|
||||||
|
find: function(model) {
|
||||||
|
return this.jsonData(this.localStorage().getItem(this.name+"-"+model.id));
|
||||||
|
},
|
||||||
|
|
||||||
|
// Return the array of all models currently in storage.
|
||||||
|
findAll: function() {
|
||||||
|
return _(this.records).chain()
|
||||||
|
.map(function(id){
|
||||||
|
return this.jsonData(this.localStorage().getItem(this.name+"-"+id));
|
||||||
|
}, this)
|
||||||
|
.compact()
|
||||||
|
.value();
|
||||||
|
},
|
||||||
|
|
||||||
|
// Delete a model from `this.data`, returning it.
|
||||||
|
destroy: function(model) {
|
||||||
|
if (model.isNew())
|
||||||
|
return false
|
||||||
|
this.localStorage().removeItem(this.name+"-"+model.id);
|
||||||
|
this.records = _.reject(this.records, function(id){
|
||||||
|
return id === model.id.toString();
|
||||||
|
});
|
||||||
|
this.save();
|
||||||
|
return model;
|
||||||
|
},
|
||||||
|
|
||||||
|
localStorage: function() {
|
||||||
|
return localStorage;
|
||||||
|
},
|
||||||
|
|
||||||
|
// fix for "illegal access" error on Android when JSON.parse is passed null
|
||||||
|
jsonData: function (data) {
|
||||||
|
return data && JSON.parse(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// localSync delegate to the model or collection's
|
||||||
|
// *localStorage* property, which should be an instance of `Store`.
|
||||||
|
// window.Store.sync and Backbone.localSync is deprectated, use Backbone.LocalStorage.sync instead
|
||||||
|
Backbone.LocalStorage.sync = window.Store.sync = Backbone.localSync = function(method, model, options) {
|
||||||
|
var store = model.localStorage || model.collection.localStorage;
|
||||||
|
|
||||||
|
var resp, errorMessage, syncDfd = $.Deferred && $.Deferred(); //If $ is having Deferred - use it.
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
switch (method) {
|
||||||
|
case "read":
|
||||||
|
resp = model.id != undefined ? store.find(model) : store.findAll();
|
||||||
|
break;
|
||||||
|
case "create":
|
||||||
|
resp = store.create(model);
|
||||||
|
break;
|
||||||
|
case "update":
|
||||||
|
resp = store.update(model);
|
||||||
|
break;
|
||||||
|
case "delete":
|
||||||
|
resp = store.destroy(model);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch(error) {
|
||||||
|
if (error.code === DOMException.QUOTA_EXCEEDED_ERR && window.localStorage.length === 0)
|
||||||
|
errorMessage = "Private browsing is unsupported";
|
||||||
|
else
|
||||||
|
errorMessage = error.message;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (resp) {
|
||||||
|
model.trigger("sync", model, resp, options);
|
||||||
|
if (options && options.success)
|
||||||
|
options.success(resp);
|
||||||
|
if (syncDfd)
|
||||||
|
syncDfd.resolve(resp);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
errorMessage = errorMessage ? errorMessage
|
||||||
|
: "Record Not Found";
|
||||||
|
|
||||||
|
if (options && options.error)
|
||||||
|
options.error(errorMessage);
|
||||||
|
if (syncDfd)
|
||||||
|
syncDfd.reject(errorMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
// add compatibility with $.ajax
|
||||||
|
// always execute callback for success and error
|
||||||
|
if (options && options.complete) options.complete(resp);
|
||||||
|
|
||||||
|
return syncDfd && syncDfd.promise();
|
||||||
|
};
|
||||||
|
|
||||||
|
Backbone.ajaxSync = Backbone.sync;
|
||||||
|
|
||||||
|
Backbone.getSyncMethod = function(model) {
|
||||||
|
if(model.localStorage || (model.collection && model.collection.localStorage)) {
|
||||||
|
return Backbone.localSync;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Backbone.ajaxSync;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Override 'Backbone.sync' to default to localSync,
|
||||||
|
// the original 'Backbone.sync' is still available in 'Backbone.ajaxSync'
|
||||||
|
Backbone.sync = function(method, model, options) {
|
||||||
|
return Backbone.getSyncMethod(model).apply(this, [method, model, options]);
|
||||||
|
};
|
||||||
|
|
||||||
|
return Backbone.LocalStorage;
|
||||||
|
}));
|
BIN
vendor/backbone/examples/todos/destroy.png
vendored
Normal file
After Width: | Height: | Size: 357 B |
69
vendor/backbone/examples/todos/index.html
vendored
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Backbone.js Todos</title>
|
||||||
|
<link rel="stylesheet" href="todos.css"/>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div id="todoapp">
|
||||||
|
|
||||||
|
<header>
|
||||||
|
<h1>Todos</h1>
|
||||||
|
<input id="new-todo" type="text" placeholder="What needs to be done?">
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<section id="main">
|
||||||
|
<input id="toggle-all" type="checkbox">
|
||||||
|
<label for="toggle-all">Mark all as complete</label>
|
||||||
|
<ul id="todo-list"></ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
<a id="clear-completed">Clear completed</a>
|
||||||
|
<div id="todo-count"></div>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="instructions">
|
||||||
|
Double-click to edit a todo.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="credits">
|
||||||
|
Created by
|
||||||
|
<br />
|
||||||
|
<a href="http://jgn.me/">Jérôme Gravel-Niquet</a>.
|
||||||
|
<br />Rewritten by: <a href="https://github.com/tastejs/todomvc">TodoMVC</a>.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="../../test/vendor/json2.js"></script>
|
||||||
|
<script src="../../test/vendor/jquery.js"></script>
|
||||||
|
<script src="../../test/vendor/underscore.js"></script>
|
||||||
|
<script src="../../backbone.js"></script>
|
||||||
|
<script src="../backbone.localStorage.js"></script>
|
||||||
|
<script src="todos.js"></script>
|
||||||
|
|
||||||
|
<!-- Templates -->
|
||||||
|
|
||||||
|
<script type="text/template" id="item-template">
|
||||||
|
<div class="view">
|
||||||
|
<input class="toggle" type="checkbox" <%= done ? 'checked="checked"' : '' %> />
|
||||||
|
<label><%- title %></label>
|
||||||
|
<a class="destroy"></a>
|
||||||
|
</div>
|
||||||
|
<input class="edit" type="text" value="<%- title %>" />
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/template" id="stats-template">
|
||||||
|
<% if (done) { %>
|
||||||
|
<a id="clear-completed">Clear <%= done %> completed <%= done == 1 ? 'item' : 'items' %></a>
|
||||||
|
<% } %>
|
||||||
|
<div class="todo-count"><b><%= remaining %></b> <%= remaining == 1 ? 'item' : 'items' %> left</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
211
vendor/backbone/examples/todos/todos.css
vendored
Normal file
|
@ -0,0 +1,211 @@
|
||||||
|
html,
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font: 14px "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
line-height: 1.4em;
|
||||||
|
background: #eeeeee;
|
||||||
|
color: #333333;
|
||||||
|
width: 520px;
|
||||||
|
margin: 0 auto;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
}
|
||||||
|
|
||||||
|
#todoapp {
|
||||||
|
background: #fff;
|
||||||
|
padding: 20px;
|
||||||
|
margin-bottom: 40px;
|
||||||
|
-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 2px 6px 0;
|
||||||
|
-moz-box-shadow: rgba(0, 0, 0, 0.2) 0 2px 6px 0;
|
||||||
|
-ms-box-shadow: rgba(0, 0, 0, 0.2) 0 2px 6px 0;
|
||||||
|
-o-box-shadow: rgba(0, 0, 0, 0.2) 0 2px 6px 0;
|
||||||
|
box-shadow: rgba(0, 0, 0, 0.2) 0 2px 6px 0;
|
||||||
|
-webkit-border-radius: 0 0 5px 5px;
|
||||||
|
-moz-border-radius: 0 0 5px 5px;
|
||||||
|
-ms-border-radius: 0 0 5px 5px;
|
||||||
|
-o-border-radius: 0 0 5px 5px;
|
||||||
|
border-radius: 0 0 5px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#todoapp h1 {
|
||||||
|
font-size: 36px;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
padding: 0 0 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#todoapp input[type="text"] {
|
||||||
|
width: 466px;
|
||||||
|
font-size: 24px;
|
||||||
|
font-family: inherit;
|
||||||
|
line-height: 1.4em;
|
||||||
|
border: 0;
|
||||||
|
outline: none;
|
||||||
|
padding: 6px;
|
||||||
|
border: 1px solid #999999;
|
||||||
|
-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 2px 0 inset;
|
||||||
|
-moz-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 2px 0 inset;
|
||||||
|
-ms-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 2px 0 inset;
|
||||||
|
-o-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 2px 0 inset;
|
||||||
|
box-shadow: rgba(0, 0, 0, 0.2) 0 1px 2px 0 inset;
|
||||||
|
}
|
||||||
|
|
||||||
|
#todoapp input::-webkit-input-placeholder {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#todo-list {
|
||||||
|
margin: 10px 0;
|
||||||
|
padding: 0;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#todo-list li {
|
||||||
|
padding: 18px 20px 18px 0;
|
||||||
|
position: relative;
|
||||||
|
font-size: 24px;
|
||||||
|
border-bottom: 1px solid #cccccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
#todo-list li:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#todo-list li.done label {
|
||||||
|
color: #777777;
|
||||||
|
text-decoration: line-through;
|
||||||
|
}
|
||||||
|
|
||||||
|
#todo-list .destroy {
|
||||||
|
position: absolute;
|
||||||
|
right: 5px;
|
||||||
|
top: 20px;
|
||||||
|
display: none;
|
||||||
|
cursor: pointer;
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
background: url(destroy.png) no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
#todo-list li:hover .destroy {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
#todo-list .destroy:hover {
|
||||||
|
background-position: 0 -20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#todo-list li.editing {
|
||||||
|
border-bottom: none;
|
||||||
|
margin-top: -1px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#todo-list li.editing:last-child {
|
||||||
|
margin-bottom: -1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#todo-list li.editing .edit {
|
||||||
|
display: block;
|
||||||
|
width: 444px;
|
||||||
|
padding: 13px 15px 14px 20px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#todo-list li.editing .view {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#todo-list li .view label {
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
#todo-list li .edit {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#todoapp footer {
|
||||||
|
display: none;
|
||||||
|
margin: 0 -20px -20px -20px;
|
||||||
|
overflow: hidden;
|
||||||
|
color: #555555;
|
||||||
|
background: #f4fce8;
|
||||||
|
border-top: 1px solid #ededed;
|
||||||
|
padding: 0 20px;
|
||||||
|
line-height: 37px;
|
||||||
|
-webkit-border-radius: 0 0 5px 5px;
|
||||||
|
-moz-border-radius: 0 0 5px 5px;
|
||||||
|
-ms-border-radius: 0 0 5px 5px;
|
||||||
|
-o-border-radius: 0 0 5px 5px;
|
||||||
|
border-radius: 0 0 5px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clear-completed {
|
||||||
|
float: right;
|
||||||
|
line-height: 20px;
|
||||||
|
text-decoration: none;
|
||||||
|
background: rgba(0, 0, 0, 0.1);
|
||||||
|
color: #555555;
|
||||||
|
font-size: 11px;
|
||||||
|
margin-top: 8px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
padding: 0 10px 1px;
|
||||||
|
cursor: pointer;
|
||||||
|
-webkit-border-radius: 12px;
|
||||||
|
-moz-border-radius: 12px;
|
||||||
|
-ms-border-radius: 12px;
|
||||||
|
-o-border-radius: 12px;
|
||||||
|
border-radius: 12px;
|
||||||
|
-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 0 0;
|
||||||
|
-moz-box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 0 0;
|
||||||
|
-ms-box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 0 0;
|
||||||
|
-o-box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 0 0;
|
||||||
|
box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clear-completed:hover {
|
||||||
|
background: rgba(0, 0, 0, 0.15);
|
||||||
|
-webkit-box-shadow: rgba(0, 0, 0, 0.3) 0 -1px 0 0;
|
||||||
|
-moz-box-shadow: rgba(0, 0, 0, 0.3) 0 -1px 0 0;
|
||||||
|
-ms-box-shadow: rgba(0, 0, 0, 0.3) 0 -1px 0 0;
|
||||||
|
-o-box-shadow: rgba(0, 0, 0, 0.3) 0 -1px 0 0;
|
||||||
|
box-shadow: rgba(0, 0, 0, 0.3) 0 -1px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clear-completed:active {
|
||||||
|
position: relative;
|
||||||
|
top: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#todo-count span {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
#instructions {
|
||||||
|
margin: 10px auto;
|
||||||
|
color: #777777;
|
||||||
|
text-shadow: rgba(255, 255, 255, 0.8) 0 1px 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#instructions a {
|
||||||
|
color: #336699;
|
||||||
|
}
|
||||||
|
|
||||||
|
#credits {
|
||||||
|
margin: 30px auto;
|
||||||
|
color: #999;
|
||||||
|
text-shadow: rgba(255, 255, 255, 0.8) 0 1px 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#credits a {
|
||||||
|
color: #888;
|
||||||
|
}
|
234
vendor/backbone/examples/todos/todos.js
vendored
Normal file
|
@ -0,0 +1,234 @@
|
||||||
|
// An example Backbone application contributed by
|
||||||
|
// [Jérôme Gravel-Niquet](http://jgn.me/). This demo uses a simple
|
||||||
|
// [LocalStorage adapter](backbone.localStorage.html)
|
||||||
|
// to persist Backbone models within your browser.
|
||||||
|
|
||||||
|
// Load the application once the DOM is ready, using `jQuery.ready`:
|
||||||
|
$(function(){
|
||||||
|
|
||||||
|
// Todo Model
|
||||||
|
// ----------
|
||||||
|
|
||||||
|
// Our basic **Todo** model has `title`, `order`, and `done` attributes.
|
||||||
|
var Todo = Backbone.Model.extend({
|
||||||
|
|
||||||
|
// Default attributes for the todo item.
|
||||||
|
defaults: function() {
|
||||||
|
return {
|
||||||
|
title: "empty todo...",
|
||||||
|
order: Todos.nextOrder(),
|
||||||
|
done: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
// Toggle the `done` state of this todo item.
|
||||||
|
toggle: function() {
|
||||||
|
this.save({done: !this.get("done")});
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// Todo Collection
|
||||||
|
// ---------------
|
||||||
|
|
||||||
|
// The collection of todos is backed by *localStorage* instead of a remote
|
||||||
|
// server.
|
||||||
|
var TodoList = Backbone.Collection.extend({
|
||||||
|
|
||||||
|
// Reference to this collection's model.
|
||||||
|
model: Todo,
|
||||||
|
|
||||||
|
// Save all of the todo items under the `"todos-backbone"` namespace.
|
||||||
|
localStorage: new Backbone.LocalStorage("todos-backbone"),
|
||||||
|
|
||||||
|
// Filter down the list of all todo items that are finished.
|
||||||
|
done: function() {
|
||||||
|
return this.where({done: true});
|
||||||
|
},
|
||||||
|
|
||||||
|
// Filter down the list to only todo items that are still not finished.
|
||||||
|
remaining: function() {
|
||||||
|
return this.where({done: false});
|
||||||
|
},
|
||||||
|
|
||||||
|
// We keep the Todos in sequential order, despite being saved by unordered
|
||||||
|
// GUID in the database. This generates the next order number for new items.
|
||||||
|
nextOrder: function() {
|
||||||
|
if (!this.length) return 1;
|
||||||
|
return this.last().get('order') + 1;
|
||||||
|
},
|
||||||
|
|
||||||
|
// Todos are sorted by their original insertion order.
|
||||||
|
comparator: 'order'
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create our global collection of **Todos**.
|
||||||
|
var Todos = new TodoList;
|
||||||
|
|
||||||
|
// Todo Item View
|
||||||
|
// --------------
|
||||||
|
|
||||||
|
// The DOM element for a todo item...
|
||||||
|
var TodoView = Backbone.View.extend({
|
||||||
|
|
||||||
|
//... is a list tag.
|
||||||
|
tagName: "li",
|
||||||
|
|
||||||
|
// Cache the template function for a single item.
|
||||||
|
template: _.template($('#item-template').html()),
|
||||||
|
|
||||||
|
// The DOM events specific to an item.
|
||||||
|
events: {
|
||||||
|
"click .toggle" : "toggleDone",
|
||||||
|
"dblclick .view" : "edit",
|
||||||
|
"click a.destroy" : "clear",
|
||||||
|
"keypress .edit" : "updateOnEnter",
|
||||||
|
"blur .edit" : "close"
|
||||||
|
},
|
||||||
|
|
||||||
|
// The TodoView listens for changes to its model, re-rendering. Since there's
|
||||||
|
// a one-to-one correspondence between a **Todo** and a **TodoView** in this
|
||||||
|
// app, we set a direct reference on the model for convenience.
|
||||||
|
initialize: function() {
|
||||||
|
this.listenTo(this.model, 'change', this.render);
|
||||||
|
this.listenTo(this.model, 'destroy', this.remove);
|
||||||
|
},
|
||||||
|
|
||||||
|
// Re-render the titles of the todo item.
|
||||||
|
render: function() {
|
||||||
|
this.$el.html(this.template(this.model.toJSON()));
|
||||||
|
this.$el.toggleClass('done', this.model.get('done'));
|
||||||
|
this.input = this.$('.edit');
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
|
// Toggle the `"done"` state of the model.
|
||||||
|
toggleDone: function() {
|
||||||
|
this.model.toggle();
|
||||||
|
},
|
||||||
|
|
||||||
|
// Switch this view into `"editing"` mode, displaying the input field.
|
||||||
|
edit: function() {
|
||||||
|
this.$el.addClass("editing");
|
||||||
|
this.input.focus();
|
||||||
|
},
|
||||||
|
|
||||||
|
// Close the `"editing"` mode, saving changes to the todo.
|
||||||
|
close: function() {
|
||||||
|
var value = this.input.val();
|
||||||
|
if (!value) {
|
||||||
|
this.clear();
|
||||||
|
} else {
|
||||||
|
this.model.save({title: value});
|
||||||
|
this.$el.removeClass("editing");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// If you hit `enter`, we're through editing the item.
|
||||||
|
updateOnEnter: function(e) {
|
||||||
|
if (e.keyCode == 13) this.close();
|
||||||
|
},
|
||||||
|
|
||||||
|
// Remove the item, destroy the model.
|
||||||
|
clear: function() {
|
||||||
|
this.model.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// The Application
|
||||||
|
// ---------------
|
||||||
|
|
||||||
|
// Our overall **AppView** is the top-level piece of UI.
|
||||||
|
var AppView = Backbone.View.extend({
|
||||||
|
|
||||||
|
// Instead of generating a new element, bind to the existing skeleton of
|
||||||
|
// the App already present in the HTML.
|
||||||
|
el: $("#todoapp"),
|
||||||
|
|
||||||
|
// Our template for the line of statistics at the bottom of the app.
|
||||||
|
statsTemplate: _.template($('#stats-template').html()),
|
||||||
|
|
||||||
|
// Delegated events for creating new items, and clearing completed ones.
|
||||||
|
events: {
|
||||||
|
"keypress #new-todo": "createOnEnter",
|
||||||
|
"click #clear-completed": "clearCompleted",
|
||||||
|
"click #toggle-all": "toggleAllComplete"
|
||||||
|
},
|
||||||
|
|
||||||
|
// At initialization we bind to the relevant events on the `Todos`
|
||||||
|
// collection, when items are added or changed. Kick things off by
|
||||||
|
// loading any preexisting todos that might be saved in *localStorage*.
|
||||||
|
initialize: function() {
|
||||||
|
|
||||||
|
this.input = this.$("#new-todo");
|
||||||
|
this.allCheckbox = this.$("#toggle-all")[0];
|
||||||
|
|
||||||
|
this.listenTo(Todos, 'add', this.addOne);
|
||||||
|
this.listenTo(Todos, 'reset', this.addAll);
|
||||||
|
this.listenTo(Todos, 'all', this.render);
|
||||||
|
|
||||||
|
this.footer = this.$('footer');
|
||||||
|
this.main = $('#main');
|
||||||
|
|
||||||
|
Todos.fetch();
|
||||||
|
},
|
||||||
|
|
||||||
|
// Re-rendering the App just means refreshing the statistics -- the rest
|
||||||
|
// of the app doesn't change.
|
||||||
|
render: function() {
|
||||||
|
var done = Todos.done().length;
|
||||||
|
var remaining = Todos.remaining().length;
|
||||||
|
|
||||||
|
if (Todos.length) {
|
||||||
|
this.main.show();
|
||||||
|
this.footer.show();
|
||||||
|
this.footer.html(this.statsTemplate({done: done, remaining: remaining}));
|
||||||
|
} else {
|
||||||
|
this.main.hide();
|
||||||
|
this.footer.hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.allCheckbox.checked = !remaining;
|
||||||
|
},
|
||||||
|
|
||||||
|
// Add a single todo item to the list by creating a view for it, and
|
||||||
|
// appending its element to the `<ul>`.
|
||||||
|
addOne: function(todo) {
|
||||||
|
var view = new TodoView({model: todo});
|
||||||
|
this.$("#todo-list").append(view.render().el);
|
||||||
|
},
|
||||||
|
|
||||||
|
// Add all items in the **Todos** collection at once.
|
||||||
|
addAll: function() {
|
||||||
|
Todos.each(this.addOne, this);
|
||||||
|
},
|
||||||
|
|
||||||
|
// If you hit return in the main input field, create new **Todo** model,
|
||||||
|
// persisting it to *localStorage*.
|
||||||
|
createOnEnter: function(e) {
|
||||||
|
if (e.keyCode != 13) return;
|
||||||
|
if (!this.input.val()) return;
|
||||||
|
|
||||||
|
Todos.create({title: this.input.val()});
|
||||||
|
this.input.val('');
|
||||||
|
},
|
||||||
|
|
||||||
|
// Clear all done todo items, destroying their models.
|
||||||
|
clearCompleted: function() {
|
||||||
|
_.invoke(Todos.done(), 'destroy');
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
|
toggleAllComplete: function () {
|
||||||
|
var done = this.allCheckbox.checked;
|
||||||
|
Todos.each(function (todo) { todo.save({'done': done}); });
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// Finally, we kick things off by creating the **App**.
|
||||||
|
var App = new AppView;
|
||||||
|
|
||||||
|
});
|
BIN
vendor/backbone/favicon.ico
vendored
Normal file
After Width: | Height: | Size: 8.2 KiB |
5260
vendor/backbone/index.html
vendored
Normal file
94
vendor/backbone/karma.conf-sauce.js
vendored
Normal file
|
@ -0,0 +1,94 @@
|
||||||
|
var _ = require('underscore');
|
||||||
|
|
||||||
|
// Browsers to run on Sauce Labs platforms
|
||||||
|
var sauceBrowsers = _.reduce([
|
||||||
|
['firefox', '35'],
|
||||||
|
['firefox', '30'],
|
||||||
|
['firefox', '21'],
|
||||||
|
['firefox', '11'],
|
||||||
|
['firefox', '4'],
|
||||||
|
|
||||||
|
['chrome', '40'],
|
||||||
|
['chrome', '39'],
|
||||||
|
['chrome', '31'],
|
||||||
|
['chrome', '26'],
|
||||||
|
|
||||||
|
['microsoftedge', '20.10240', 'Windows 10'],
|
||||||
|
['internet explorer', '11', 'Windows 10'],
|
||||||
|
['internet explorer', '10', 'Windows 8'],
|
||||||
|
['internet explorer', '9', 'Windows 7'],
|
||||||
|
|
||||||
|
['opera', '12'],
|
||||||
|
['opera', '11'],
|
||||||
|
|
||||||
|
['android', '5'],
|
||||||
|
['android', '4.4'],
|
||||||
|
|
||||||
|
// 4.3 currently erros with some router tests
|
||||||
|
// ['android', '4.3'],
|
||||||
|
|
||||||
|
['android', '4.0'],
|
||||||
|
|
||||||
|
['safari', '8.0', 'OS X 10.10'],
|
||||||
|
['safari', '7'],
|
||||||
|
['safari', '6'],
|
||||||
|
['safari', '5']
|
||||||
|
], function(memo, platform) {
|
||||||
|
// internet explorer -> ie
|
||||||
|
var label = platform[0].split(' ');
|
||||||
|
if (label.length > 1) {
|
||||||
|
label = _.invoke(label, 'charAt', 0)
|
||||||
|
}
|
||||||
|
label = (label.join("") + '_v' + platform[1]).replace(' ', '_').toUpperCase();
|
||||||
|
memo[label] = _.pick({
|
||||||
|
'base': 'SauceLabs',
|
||||||
|
'browserName': platform[0],
|
||||||
|
'version': platform[1],
|
||||||
|
'platform': platform[2]
|
||||||
|
}, Boolean);
|
||||||
|
return memo;
|
||||||
|
}, {});
|
||||||
|
|
||||||
|
module.exports = function(config) {
|
||||||
|
if ( !process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY ) {
|
||||||
|
console.log('Sauce environments not set --- Skipping');
|
||||||
|
return process.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
config.set({
|
||||||
|
basePath: '',
|
||||||
|
frameworks: ['qunit'],
|
||||||
|
singleRun: true,
|
||||||
|
|
||||||
|
// list of files / patterns to load in the browser
|
||||||
|
files: [
|
||||||
|
'test/vendor/jquery.js',
|
||||||
|
'test/vendor/json2.js',
|
||||||
|
'test/vendor/underscore.js',
|
||||||
|
'backbone.js',
|
||||||
|
'test/setup/*.js',
|
||||||
|
'test/*.js'
|
||||||
|
],
|
||||||
|
|
||||||
|
// Number of sauce tests to start in parallel
|
||||||
|
concurrency: 9,
|
||||||
|
|
||||||
|
// test results reporter to use
|
||||||
|
reporters: ['dots', 'saucelabs'],
|
||||||
|
port: 9876,
|
||||||
|
colors: true,
|
||||||
|
logLevel: config.LOG_INFO,
|
||||||
|
sauceLabs: {
|
||||||
|
build: 'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER + ' (' + process.env.TRAVIS_BUILD_ID + ')',
|
||||||
|
startConnect: true,
|
||||||
|
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER
|
||||||
|
},
|
||||||
|
|
||||||
|
captureTimeout: 120000,
|
||||||
|
customLaunchers: sauceBrowsers,
|
||||||
|
|
||||||
|
// Browsers to launch, commented out to prevent karma from starting
|
||||||
|
// too many concurrent browsers and timing sauce out.
|
||||||
|
browsers: _.keys(sauceBrowsers)
|
||||||
|
});
|
||||||
|
};
|
54
vendor/backbone/karma.conf.js
vendored
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
// Note some browser launchers should be installed before using karma start.
|
||||||
|
// For example:
|
||||||
|
// npm install karma-firefox-launcher
|
||||||
|
// karma start --browsers=Firefox
|
||||||
|
module.exports = function(config) {
|
||||||
|
config.set({
|
||||||
|
basePath: '',
|
||||||
|
frameworks: ['qunit'],
|
||||||
|
|
||||||
|
// list of files / patterns to load in the browser
|
||||||
|
files: [
|
||||||
|
'test/vendor/jquery.js',
|
||||||
|
'test/vendor/json2.js',
|
||||||
|
'test/vendor/underscore.js',
|
||||||
|
'backbone.js',
|
||||||
|
'test/setup/*.js',
|
||||||
|
'test/*.js'
|
||||||
|
],
|
||||||
|
|
||||||
|
// test results reporter to use
|
||||||
|
// possible values: 'dots', 'progress'
|
||||||
|
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
||||||
|
reporters: ['progress'],
|
||||||
|
|
||||||
|
// web server port
|
||||||
|
port: 9877,
|
||||||
|
|
||||||
|
// enable / disable colors in the output (reporters and logs)
|
||||||
|
colors: true,
|
||||||
|
|
||||||
|
// level of logging
|
||||||
|
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
||||||
|
logLevel: config.LOG_INFO,
|
||||||
|
|
||||||
|
// enable / disable watching file and executing tests whenever any file changes
|
||||||
|
autoWatch: false,
|
||||||
|
|
||||||
|
// start these browsers
|
||||||
|
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
||||||
|
browsers: ['PhantomJS'],
|
||||||
|
|
||||||
|
// Continuous Integration mode
|
||||||
|
// if true, Karma captures browsers, runs the tests and exits
|
||||||
|
singleRun: true,
|
||||||
|
|
||||||
|
// See http://stackoverflow.com/a/27873086/1517919
|
||||||
|
customLaunchers: {
|
||||||
|
Chrome_sandbox: {
|
||||||
|
base: 'Chrome',
|
||||||
|
flags: ['--no-sandbox']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
48
vendor/backbone/package.json
vendored
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
{
|
||||||
|
"name": "backbone",
|
||||||
|
"description": "Give your JS App some Backbone with Models, Views, Collections, and Events.",
|
||||||
|
"url": "http://backbonejs.org",
|
||||||
|
"keywords": [
|
||||||
|
"model",
|
||||||
|
"view",
|
||||||
|
"controller",
|
||||||
|
"router",
|
||||||
|
"server",
|
||||||
|
"client",
|
||||||
|
"browser"
|
||||||
|
],
|
||||||
|
"author": "Jeremy Ashkenas",
|
||||||
|
"dependencies": {
|
||||||
|
"underscore": ">=1.8.3"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"coffee-script": "1.7.1",
|
||||||
|
"docco": "0.7.0",
|
||||||
|
"eslint": "^2.11.0",
|
||||||
|
"karma": "^0.13.13",
|
||||||
|
"karma-phantomjs-launcher": "^1.0.0",
|
||||||
|
"karma-qunit": "^1.0.0",
|
||||||
|
"phantomjs-prebuilt": "^2.1.7",
|
||||||
|
"qunitjs": "^2.0.0",
|
||||||
|
"uglify-js": "^2.4.17"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "karma start && coffee test/model.coffee && npm run lint",
|
||||||
|
"build": "uglifyjs backbone.js --mangle --source-map backbone-min.map -o backbone-min.js",
|
||||||
|
"doc": "docco backbone.js && docco examples/todos/todos.js examples/backbone.localStorage.js",
|
||||||
|
"lint": "eslint backbone.js test/*.js"
|
||||||
|
},
|
||||||
|
"main": "backbone.js",
|
||||||
|
"version": "1.3.3",
|
||||||
|
"license": "MIT",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/jashkenas/backbone.git"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"backbone.js",
|
||||||
|
"backbone-min.js",
|
||||||
|
"backbone-min.map",
|
||||||
|
"LICENSE"
|
||||||
|
]
|
||||||
|
}
|
15
vendor/backbone/test/.eslintrc
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true
|
||||||
|
},
|
||||||
|
"globals": {
|
||||||
|
"QUnit": false,
|
||||||
|
"Backbone": true,
|
||||||
|
"_": true,
|
||||||
|
"$": true
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"no-throw-literal": 0,
|
||||||
|
"no-undefined": 0
|
||||||
|
}
|
||||||
|
}
|
2103
vendor/backbone/test/collection.js
vendored
Normal file
743
vendor/backbone/test/events.js
vendored
Normal file
|
@ -0,0 +1,743 @@
|
||||||
|
(function(QUnit) {
|
||||||
|
|
||||||
|
QUnit.module('Backbone.Events');
|
||||||
|
|
||||||
|
QUnit.test('on and trigger', function(assert) {
|
||||||
|
assert.expect(2);
|
||||||
|
var obj = {counter: 0};
|
||||||
|
_.extend(obj, Backbone.Events);
|
||||||
|
obj.on('event', function() { obj.counter += 1; });
|
||||||
|
obj.trigger('event');
|
||||||
|
assert.equal(obj.counter, 1, 'counter should be incremented.');
|
||||||
|
obj.trigger('event');
|
||||||
|
obj.trigger('event');
|
||||||
|
obj.trigger('event');
|
||||||
|
obj.trigger('event');
|
||||||
|
assert.equal(obj.counter, 5, 'counter should be incremented five times.');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('binding and triggering multiple events', function(assert) {
|
||||||
|
assert.expect(4);
|
||||||
|
var obj = {counter: 0};
|
||||||
|
_.extend(obj, Backbone.Events);
|
||||||
|
|
||||||
|
obj.on('a b c', function() { obj.counter += 1; });
|
||||||
|
|
||||||
|
obj.trigger('a');
|
||||||
|
assert.equal(obj.counter, 1);
|
||||||
|
|
||||||
|
obj.trigger('a b');
|
||||||
|
assert.equal(obj.counter, 3);
|
||||||
|
|
||||||
|
obj.trigger('c');
|
||||||
|
assert.equal(obj.counter, 4);
|
||||||
|
|
||||||
|
obj.off('a c');
|
||||||
|
obj.trigger('a b c');
|
||||||
|
assert.equal(obj.counter, 5);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('binding and triggering with event maps', function(assert) {
|
||||||
|
var obj = {counter: 0};
|
||||||
|
_.extend(obj, Backbone.Events);
|
||||||
|
|
||||||
|
var increment = function() {
|
||||||
|
this.counter += 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
obj.on({
|
||||||
|
a: increment,
|
||||||
|
b: increment,
|
||||||
|
c: increment
|
||||||
|
}, obj);
|
||||||
|
|
||||||
|
obj.trigger('a');
|
||||||
|
assert.equal(obj.counter, 1);
|
||||||
|
|
||||||
|
obj.trigger('a b');
|
||||||
|
assert.equal(obj.counter, 3);
|
||||||
|
|
||||||
|
obj.trigger('c');
|
||||||
|
assert.equal(obj.counter, 4);
|
||||||
|
|
||||||
|
obj.off({
|
||||||
|
a: increment,
|
||||||
|
c: increment
|
||||||
|
}, obj);
|
||||||
|
obj.trigger('a b c');
|
||||||
|
assert.equal(obj.counter, 5);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('binding and triggering multiple event names with event maps', function(assert) {
|
||||||
|
var obj = {counter: 0};
|
||||||
|
_.extend(obj, Backbone.Events);
|
||||||
|
|
||||||
|
var increment = function() {
|
||||||
|
this.counter += 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
obj.on({
|
||||||
|
'a b c': increment
|
||||||
|
});
|
||||||
|
|
||||||
|
obj.trigger('a');
|
||||||
|
assert.equal(obj.counter, 1);
|
||||||
|
|
||||||
|
obj.trigger('a b');
|
||||||
|
assert.equal(obj.counter, 3);
|
||||||
|
|
||||||
|
obj.trigger('c');
|
||||||
|
assert.equal(obj.counter, 4);
|
||||||
|
|
||||||
|
obj.off({
|
||||||
|
'a c': increment
|
||||||
|
});
|
||||||
|
obj.trigger('a b c');
|
||||||
|
assert.equal(obj.counter, 5);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('binding and trigger with event maps context', function(assert) {
|
||||||
|
assert.expect(2);
|
||||||
|
var obj = {counter: 0};
|
||||||
|
var context = {};
|
||||||
|
_.extend(obj, Backbone.Events);
|
||||||
|
|
||||||
|
obj.on({
|
||||||
|
a: function() {
|
||||||
|
assert.strictEqual(this, context, 'defaults `context` to `callback` param');
|
||||||
|
}
|
||||||
|
}, context).trigger('a');
|
||||||
|
|
||||||
|
obj.off().on({
|
||||||
|
a: function() {
|
||||||
|
assert.strictEqual(this, context, 'will not override explicit `context` param');
|
||||||
|
}
|
||||||
|
}, this, context).trigger('a');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('listenTo and stopListening', function(assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
var a = _.extend({}, Backbone.Events);
|
||||||
|
var b = _.extend({}, Backbone.Events);
|
||||||
|
a.listenTo(b, 'all', function(){ assert.ok(true); });
|
||||||
|
b.trigger('anything');
|
||||||
|
a.listenTo(b, 'all', function(){ assert.ok(false); });
|
||||||
|
a.stopListening();
|
||||||
|
b.trigger('anything');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('listenTo and stopListening with event maps', function(assert) {
|
||||||
|
assert.expect(4);
|
||||||
|
var a = _.extend({}, Backbone.Events);
|
||||||
|
var b = _.extend({}, Backbone.Events);
|
||||||
|
var cb = function(){ assert.ok(true); };
|
||||||
|
a.listenTo(b, {event: cb});
|
||||||
|
b.trigger('event');
|
||||||
|
a.listenTo(b, {event2: cb});
|
||||||
|
b.on('event2', cb);
|
||||||
|
a.stopListening(b, {event2: cb});
|
||||||
|
b.trigger('event event2');
|
||||||
|
a.stopListening();
|
||||||
|
b.trigger('event event2');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('stopListening with omitted args', function(assert) {
|
||||||
|
assert.expect(2);
|
||||||
|
var a = _.extend({}, Backbone.Events);
|
||||||
|
var b = _.extend({}, Backbone.Events);
|
||||||
|
var cb = function() { assert.ok(true); };
|
||||||
|
a.listenTo(b, 'event', cb);
|
||||||
|
b.on('event', cb);
|
||||||
|
a.listenTo(b, 'event2', cb);
|
||||||
|
a.stopListening(null, {event: cb});
|
||||||
|
b.trigger('event event2');
|
||||||
|
b.off();
|
||||||
|
a.listenTo(b, 'event event2', cb);
|
||||||
|
a.stopListening(null, 'event');
|
||||||
|
a.stopListening();
|
||||||
|
b.trigger('event2');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('listenToOnce', function(assert) {
|
||||||
|
assert.expect(2);
|
||||||
|
// Same as the previous test, but we use once rather than having to explicitly unbind
|
||||||
|
var obj = {counterA: 0, counterB: 0};
|
||||||
|
_.extend(obj, Backbone.Events);
|
||||||
|
var incrA = function(){ obj.counterA += 1; obj.trigger('event'); };
|
||||||
|
var incrB = function(){ obj.counterB += 1; };
|
||||||
|
obj.listenToOnce(obj, 'event', incrA);
|
||||||
|
obj.listenToOnce(obj, 'event', incrB);
|
||||||
|
obj.trigger('event');
|
||||||
|
assert.equal(obj.counterA, 1, 'counterA should have only been incremented once.');
|
||||||
|
assert.equal(obj.counterB, 1, 'counterB should have only been incremented once.');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('listenToOnce and stopListening', function(assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
var a = _.extend({}, Backbone.Events);
|
||||||
|
var b = _.extend({}, Backbone.Events);
|
||||||
|
a.listenToOnce(b, 'all', function() { assert.ok(true); });
|
||||||
|
b.trigger('anything');
|
||||||
|
b.trigger('anything');
|
||||||
|
a.listenToOnce(b, 'all', function() { assert.ok(false); });
|
||||||
|
a.stopListening();
|
||||||
|
b.trigger('anything');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('listenTo, listenToOnce and stopListening', function(assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
var a = _.extend({}, Backbone.Events);
|
||||||
|
var b = _.extend({}, Backbone.Events);
|
||||||
|
a.listenToOnce(b, 'all', function() { assert.ok(true); });
|
||||||
|
b.trigger('anything');
|
||||||
|
b.trigger('anything');
|
||||||
|
a.listenTo(b, 'all', function() { assert.ok(false); });
|
||||||
|
a.stopListening();
|
||||||
|
b.trigger('anything');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('listenTo and stopListening with event maps', function(assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
var a = _.extend({}, Backbone.Events);
|
||||||
|
var b = _.extend({}, Backbone.Events);
|
||||||
|
a.listenTo(b, {change: function(){ assert.ok(true); }});
|
||||||
|
b.trigger('change');
|
||||||
|
a.listenTo(b, {change: function(){ assert.ok(false); }});
|
||||||
|
a.stopListening();
|
||||||
|
b.trigger('change');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('listenTo yourself', function(assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
var e = _.extend({}, Backbone.Events);
|
||||||
|
e.listenTo(e, 'foo', function(){ assert.ok(true); });
|
||||||
|
e.trigger('foo');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('listenTo yourself cleans yourself up with stopListening', function(assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
var e = _.extend({}, Backbone.Events);
|
||||||
|
e.listenTo(e, 'foo', function(){ assert.ok(true); });
|
||||||
|
e.trigger('foo');
|
||||||
|
e.stopListening();
|
||||||
|
e.trigger('foo');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('stopListening cleans up references', function(assert) {
|
||||||
|
assert.expect(12);
|
||||||
|
var a = _.extend({}, Backbone.Events);
|
||||||
|
var b = _.extend({}, Backbone.Events);
|
||||||
|
var fn = function() {};
|
||||||
|
b.on('event', fn);
|
||||||
|
a.listenTo(b, 'event', fn).stopListening();
|
||||||
|
assert.equal(_.size(a._listeningTo), 0);
|
||||||
|
assert.equal(_.size(b._events.event), 1);
|
||||||
|
assert.equal(_.size(b._listeners), 0);
|
||||||
|
a.listenTo(b, 'event', fn).stopListening(b);
|
||||||
|
assert.equal(_.size(a._listeningTo), 0);
|
||||||
|
assert.equal(_.size(b._events.event), 1);
|
||||||
|
assert.equal(_.size(b._listeners), 0);
|
||||||
|
a.listenTo(b, 'event', fn).stopListening(b, 'event');
|
||||||
|
assert.equal(_.size(a._listeningTo), 0);
|
||||||
|
assert.equal(_.size(b._events.event), 1);
|
||||||
|
assert.equal(_.size(b._listeners), 0);
|
||||||
|
a.listenTo(b, 'event', fn).stopListening(b, 'event', fn);
|
||||||
|
assert.equal(_.size(a._listeningTo), 0);
|
||||||
|
assert.equal(_.size(b._events.event), 1);
|
||||||
|
assert.equal(_.size(b._listeners), 0);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('stopListening cleans up references from listenToOnce', function(assert) {
|
||||||
|
assert.expect(12);
|
||||||
|
var a = _.extend({}, Backbone.Events);
|
||||||
|
var b = _.extend({}, Backbone.Events);
|
||||||
|
var fn = function() {};
|
||||||
|
b.on('event', fn);
|
||||||
|
a.listenToOnce(b, 'event', fn).stopListening();
|
||||||
|
assert.equal(_.size(a._listeningTo), 0);
|
||||||
|
assert.equal(_.size(b._events.event), 1);
|
||||||
|
assert.equal(_.size(b._listeners), 0);
|
||||||
|
a.listenToOnce(b, 'event', fn).stopListening(b);
|
||||||
|
assert.equal(_.size(a._listeningTo), 0);
|
||||||
|
assert.equal(_.size(b._events.event), 1);
|
||||||
|
assert.equal(_.size(b._listeners), 0);
|
||||||
|
a.listenToOnce(b, 'event', fn).stopListening(b, 'event');
|
||||||
|
assert.equal(_.size(a._listeningTo), 0);
|
||||||
|
assert.equal(_.size(b._events.event), 1);
|
||||||
|
assert.equal(_.size(b._listeners), 0);
|
||||||
|
a.listenToOnce(b, 'event', fn).stopListening(b, 'event', fn);
|
||||||
|
assert.equal(_.size(a._listeningTo), 0);
|
||||||
|
assert.equal(_.size(b._events.event), 1);
|
||||||
|
assert.equal(_.size(b._listeners), 0);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('listenTo and off cleaning up references', function(assert) {
|
||||||
|
assert.expect(8);
|
||||||
|
var a = _.extend({}, Backbone.Events);
|
||||||
|
var b = _.extend({}, Backbone.Events);
|
||||||
|
var fn = function() {};
|
||||||
|
a.listenTo(b, 'event', fn);
|
||||||
|
b.off();
|
||||||
|
assert.equal(_.size(a._listeningTo), 0);
|
||||||
|
assert.equal(_.size(b._listeners), 0);
|
||||||
|
a.listenTo(b, 'event', fn);
|
||||||
|
b.off('event');
|
||||||
|
assert.equal(_.size(a._listeningTo), 0);
|
||||||
|
assert.equal(_.size(b._listeners), 0);
|
||||||
|
a.listenTo(b, 'event', fn);
|
||||||
|
b.off(null, fn);
|
||||||
|
assert.equal(_.size(a._listeningTo), 0);
|
||||||
|
assert.equal(_.size(b._listeners), 0);
|
||||||
|
a.listenTo(b, 'event', fn);
|
||||||
|
b.off(null, null, a);
|
||||||
|
assert.equal(_.size(a._listeningTo), 0);
|
||||||
|
assert.equal(_.size(b._listeners), 0);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('listenTo and stopListening cleaning up references', function(assert) {
|
||||||
|
assert.expect(2);
|
||||||
|
var a = _.extend({}, Backbone.Events);
|
||||||
|
var b = _.extend({}, Backbone.Events);
|
||||||
|
a.listenTo(b, 'all', function(){ assert.ok(true); });
|
||||||
|
b.trigger('anything');
|
||||||
|
a.listenTo(b, 'other', function(){ assert.ok(false); });
|
||||||
|
a.stopListening(b, 'other');
|
||||||
|
a.stopListening(b, 'all');
|
||||||
|
assert.equal(_.size(a._listeningTo), 0);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('listenToOnce without context cleans up references after the event has fired', function(assert) {
|
||||||
|
assert.expect(2);
|
||||||
|
var a = _.extend({}, Backbone.Events);
|
||||||
|
var b = _.extend({}, Backbone.Events);
|
||||||
|
a.listenToOnce(b, 'all', function(){ assert.ok(true); });
|
||||||
|
b.trigger('anything');
|
||||||
|
assert.equal(_.size(a._listeningTo), 0);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('listenToOnce with event maps cleans up references', function(assert) {
|
||||||
|
assert.expect(2);
|
||||||
|
var a = _.extend({}, Backbone.Events);
|
||||||
|
var b = _.extend({}, Backbone.Events);
|
||||||
|
a.listenToOnce(b, {
|
||||||
|
one: function() { assert.ok(true); },
|
||||||
|
two: function() { assert.ok(false); }
|
||||||
|
});
|
||||||
|
b.trigger('one');
|
||||||
|
assert.equal(_.size(a._listeningTo), 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('listenToOnce with event maps binds the correct `this`', function(assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
var a = _.extend({}, Backbone.Events);
|
||||||
|
var b = _.extend({}, Backbone.Events);
|
||||||
|
a.listenToOnce(b, {
|
||||||
|
one: function() { assert.ok(this === a); },
|
||||||
|
two: function() { assert.ok(false); }
|
||||||
|
});
|
||||||
|
b.trigger('one');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test("listenTo with empty callback doesn't throw an error", function(assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
var e = _.extend({}, Backbone.Events);
|
||||||
|
e.listenTo(e, 'foo', null);
|
||||||
|
e.trigger('foo');
|
||||||
|
assert.ok(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('trigger all for each event', function(assert) {
|
||||||
|
assert.expect(3);
|
||||||
|
var a, b, obj = {counter: 0};
|
||||||
|
_.extend(obj, Backbone.Events);
|
||||||
|
obj.on('all', function(event) {
|
||||||
|
obj.counter++;
|
||||||
|
if (event === 'a') a = true;
|
||||||
|
if (event === 'b') b = true;
|
||||||
|
})
|
||||||
|
.trigger('a b');
|
||||||
|
assert.ok(a);
|
||||||
|
assert.ok(b);
|
||||||
|
assert.equal(obj.counter, 2);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('on, then unbind all functions', function(assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
var obj = {counter: 0};
|
||||||
|
_.extend(obj, Backbone.Events);
|
||||||
|
var callback = function() { obj.counter += 1; };
|
||||||
|
obj.on('event', callback);
|
||||||
|
obj.trigger('event');
|
||||||
|
obj.off('event');
|
||||||
|
obj.trigger('event');
|
||||||
|
assert.equal(obj.counter, 1, 'counter should have only been incremented once.');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('bind two callbacks, unbind only one', function(assert) {
|
||||||
|
assert.expect(2);
|
||||||
|
var obj = {counterA: 0, counterB: 0};
|
||||||
|
_.extend(obj, Backbone.Events);
|
||||||
|
var callback = function() { obj.counterA += 1; };
|
||||||
|
obj.on('event', callback);
|
||||||
|
obj.on('event', function() { obj.counterB += 1; });
|
||||||
|
obj.trigger('event');
|
||||||
|
obj.off('event', callback);
|
||||||
|
obj.trigger('event');
|
||||||
|
assert.equal(obj.counterA, 1, 'counterA should have only been incremented once.');
|
||||||
|
assert.equal(obj.counterB, 2, 'counterB should have been incremented twice.');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('unbind a callback in the midst of it firing', function(assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
var obj = {counter: 0};
|
||||||
|
_.extend(obj, Backbone.Events);
|
||||||
|
var callback = function() {
|
||||||
|
obj.counter += 1;
|
||||||
|
obj.off('event', callback);
|
||||||
|
};
|
||||||
|
obj.on('event', callback);
|
||||||
|
obj.trigger('event');
|
||||||
|
obj.trigger('event');
|
||||||
|
obj.trigger('event');
|
||||||
|
assert.equal(obj.counter, 1, 'the callback should have been unbound.');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('two binds that unbind themeselves', function(assert) {
|
||||||
|
assert.expect(2);
|
||||||
|
var obj = {counterA: 0, counterB: 0};
|
||||||
|
_.extend(obj, Backbone.Events);
|
||||||
|
var incrA = function(){ obj.counterA += 1; obj.off('event', incrA); };
|
||||||
|
var incrB = function(){ obj.counterB += 1; obj.off('event', incrB); };
|
||||||
|
obj.on('event', incrA);
|
||||||
|
obj.on('event', incrB);
|
||||||
|
obj.trigger('event');
|
||||||
|
obj.trigger('event');
|
||||||
|
obj.trigger('event');
|
||||||
|
assert.equal(obj.counterA, 1, 'counterA should have only been incremented once.');
|
||||||
|
assert.equal(obj.counterB, 1, 'counterB should have only been incremented once.');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('bind a callback with a default context when none supplied', function(assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
var obj = _.extend({
|
||||||
|
assertTrue: function() {
|
||||||
|
assert.equal(this, obj, '`this` was bound to the callback');
|
||||||
|
}
|
||||||
|
}, Backbone.Events);
|
||||||
|
|
||||||
|
obj.once('event', obj.assertTrue);
|
||||||
|
obj.trigger('event');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('bind a callback with a supplied context', function(assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
var TestClass = function() {
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
TestClass.prototype.assertTrue = function() {
|
||||||
|
assert.ok(true, '`this` was bound to the callback');
|
||||||
|
};
|
||||||
|
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
obj.on('event', function() { this.assertTrue(); }, new TestClass);
|
||||||
|
obj.trigger('event');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('nested trigger with unbind', function(assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
var obj = {counter: 0};
|
||||||
|
_.extend(obj, Backbone.Events);
|
||||||
|
var incr1 = function(){ obj.counter += 1; obj.off('event', incr1); obj.trigger('event'); };
|
||||||
|
var incr2 = function(){ obj.counter += 1; };
|
||||||
|
obj.on('event', incr1);
|
||||||
|
obj.on('event', incr2);
|
||||||
|
obj.trigger('event');
|
||||||
|
assert.equal(obj.counter, 3, 'counter should have been incremented three times');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('callback list is not altered during trigger', function(assert) {
|
||||||
|
assert.expect(2);
|
||||||
|
var counter = 0, obj = _.extend({}, Backbone.Events);
|
||||||
|
var incr = function(){ counter++; };
|
||||||
|
var incrOn = function(){ obj.on('event all', incr); };
|
||||||
|
var incrOff = function(){ obj.off('event all', incr); };
|
||||||
|
|
||||||
|
obj.on('event all', incrOn).trigger('event');
|
||||||
|
assert.equal(counter, 0, 'on does not alter callback list');
|
||||||
|
|
||||||
|
obj.off().on('event', incrOff).on('event all', incr).trigger('event');
|
||||||
|
assert.equal(counter, 2, 'off does not alter callback list');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test("#1282 - 'all' callback list is retrieved after each event.", function(assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
var counter = 0;
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
var incr = function(){ counter++; };
|
||||||
|
obj.on('x', function() {
|
||||||
|
obj.on('y', incr).on('all', incr);
|
||||||
|
})
|
||||||
|
.trigger('x y');
|
||||||
|
assert.strictEqual(counter, 2);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('if no callback is provided, `on` is a noop', function(assert) {
|
||||||
|
assert.expect(0);
|
||||||
|
_.extend({}, Backbone.Events).on('test').trigger('test');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('if callback is truthy but not a function, `on` should throw an error just like jQuery', function(assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
var view = _.extend({}, Backbone.Events).on('test', 'noop');
|
||||||
|
assert.raises(function() {
|
||||||
|
view.trigger('test');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('remove all events for a specific context', function(assert) {
|
||||||
|
assert.expect(4);
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
obj.on('x y all', function() { assert.ok(true); });
|
||||||
|
obj.on('x y all', function() { assert.ok(false); }, obj);
|
||||||
|
obj.off(null, null, obj);
|
||||||
|
obj.trigger('x y');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('remove all events for a specific callback', function(assert) {
|
||||||
|
assert.expect(4);
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
var success = function() { assert.ok(true); };
|
||||||
|
var fail = function() { assert.ok(false); };
|
||||||
|
obj.on('x y all', success);
|
||||||
|
obj.on('x y all', fail);
|
||||||
|
obj.off(null, fail);
|
||||||
|
obj.trigger('x y');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('#1310 - off does not skip consecutive events', function(assert) {
|
||||||
|
assert.expect(0);
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
obj.on('event', function() { assert.ok(false); }, obj);
|
||||||
|
obj.on('event', function() { assert.ok(false); }, obj);
|
||||||
|
obj.off(null, null, obj);
|
||||||
|
obj.trigger('event');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('once', function(assert) {
|
||||||
|
assert.expect(2);
|
||||||
|
// Same as the previous test, but we use once rather than having to explicitly unbind
|
||||||
|
var obj = {counterA: 0, counterB: 0};
|
||||||
|
_.extend(obj, Backbone.Events);
|
||||||
|
var incrA = function(){ obj.counterA += 1; obj.trigger('event'); };
|
||||||
|
var incrB = function(){ obj.counterB += 1; };
|
||||||
|
obj.once('event', incrA);
|
||||||
|
obj.once('event', incrB);
|
||||||
|
obj.trigger('event');
|
||||||
|
assert.equal(obj.counterA, 1, 'counterA should have only been incremented once.');
|
||||||
|
assert.equal(obj.counterB, 1, 'counterB should have only been incremented once.');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('once variant one', function(assert) {
|
||||||
|
assert.expect(3);
|
||||||
|
var f = function(){ assert.ok(true); };
|
||||||
|
|
||||||
|
var a = _.extend({}, Backbone.Events).once('event', f);
|
||||||
|
var b = _.extend({}, Backbone.Events).on('event', f);
|
||||||
|
|
||||||
|
a.trigger('event');
|
||||||
|
|
||||||
|
b.trigger('event');
|
||||||
|
b.trigger('event');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('once variant two', function(assert) {
|
||||||
|
assert.expect(3);
|
||||||
|
var f = function(){ assert.ok(true); };
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
|
||||||
|
obj
|
||||||
|
.once('event', f)
|
||||||
|
.on('event', f)
|
||||||
|
.trigger('event')
|
||||||
|
.trigger('event');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('once with off', function(assert) {
|
||||||
|
assert.expect(0);
|
||||||
|
var f = function(){ assert.ok(true); };
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
|
||||||
|
obj.once('event', f);
|
||||||
|
obj.off('event', f);
|
||||||
|
obj.trigger('event');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('once with event maps', function(assert) {
|
||||||
|
var obj = {counter: 0};
|
||||||
|
_.extend(obj, Backbone.Events);
|
||||||
|
|
||||||
|
var increment = function() {
|
||||||
|
this.counter += 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
obj.once({
|
||||||
|
a: increment,
|
||||||
|
b: increment,
|
||||||
|
c: increment
|
||||||
|
}, obj);
|
||||||
|
|
||||||
|
obj.trigger('a');
|
||||||
|
assert.equal(obj.counter, 1);
|
||||||
|
|
||||||
|
obj.trigger('a b');
|
||||||
|
assert.equal(obj.counter, 2);
|
||||||
|
|
||||||
|
obj.trigger('c');
|
||||||
|
assert.equal(obj.counter, 3);
|
||||||
|
|
||||||
|
obj.trigger('a b c');
|
||||||
|
assert.equal(obj.counter, 3);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('bind a callback with a supplied context using once with object notation', function(assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
var obj = {counter: 0};
|
||||||
|
var context = {};
|
||||||
|
_.extend(obj, Backbone.Events);
|
||||||
|
|
||||||
|
obj.once({
|
||||||
|
a: function() {
|
||||||
|
assert.strictEqual(this, context, 'defaults `context` to `callback` param');
|
||||||
|
}
|
||||||
|
}, context).trigger('a');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('once with off only by context', function(assert) {
|
||||||
|
assert.expect(0);
|
||||||
|
var context = {};
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
obj.once('event', function(){ assert.ok(false); }, context);
|
||||||
|
obj.off(null, null, context);
|
||||||
|
obj.trigger('event');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('Backbone object inherits Events', function(assert) {
|
||||||
|
assert.ok(Backbone.on === Backbone.Events.on);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('once with asynchronous events', function(assert) {
|
||||||
|
var done = assert.async();
|
||||||
|
assert.expect(1);
|
||||||
|
var func = _.debounce(function() { assert.ok(true); done(); }, 50);
|
||||||
|
var obj = _.extend({}, Backbone.Events).once('async', func);
|
||||||
|
|
||||||
|
obj.trigger('async');
|
||||||
|
obj.trigger('async');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('once with multiple events.', function(assert) {
|
||||||
|
assert.expect(2);
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
obj.once('x y', function() { assert.ok(true); });
|
||||||
|
obj.trigger('x y');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('Off during iteration with once.', function(assert) {
|
||||||
|
assert.expect(2);
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
var f = function(){ this.off('event', f); };
|
||||||
|
obj.on('event', f);
|
||||||
|
obj.once('event', function(){});
|
||||||
|
obj.on('event', function(){ assert.ok(true); });
|
||||||
|
|
||||||
|
obj.trigger('event');
|
||||||
|
obj.trigger('event');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('`once` on `all` should work as expected', function(assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
Backbone.once('all', function() {
|
||||||
|
assert.ok(true);
|
||||||
|
Backbone.trigger('all');
|
||||||
|
});
|
||||||
|
Backbone.trigger('all');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('once without a callback is a noop', function(assert) {
|
||||||
|
assert.expect(0);
|
||||||
|
_.extend({}, Backbone.Events).once('event').trigger('event');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('listenToOnce without a callback is a noop', function(assert) {
|
||||||
|
assert.expect(0);
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
obj.listenToOnce(obj, 'event').trigger('event');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('event functions are chainable', function(assert) {
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
var obj2 = _.extend({}, Backbone.Events);
|
||||||
|
var fn = function() {};
|
||||||
|
assert.equal(obj, obj.trigger('noeventssetyet'));
|
||||||
|
assert.equal(obj, obj.off('noeventssetyet'));
|
||||||
|
assert.equal(obj, obj.stopListening('noeventssetyet'));
|
||||||
|
assert.equal(obj, obj.on('a', fn));
|
||||||
|
assert.equal(obj, obj.once('c', fn));
|
||||||
|
assert.equal(obj, obj.trigger('a'));
|
||||||
|
assert.equal(obj, obj.listenTo(obj2, 'a', fn));
|
||||||
|
assert.equal(obj, obj.listenToOnce(obj2, 'b', fn));
|
||||||
|
assert.equal(obj, obj.off('a c'));
|
||||||
|
assert.equal(obj, obj.stopListening(obj2, 'a'));
|
||||||
|
assert.equal(obj, obj.stopListening());
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('#3448 - listenToOnce with space-separated events', function(assert) {
|
||||||
|
assert.expect(2);
|
||||||
|
var one = _.extend({}, Backbone.Events);
|
||||||
|
var two = _.extend({}, Backbone.Events);
|
||||||
|
var count = 1;
|
||||||
|
one.listenToOnce(two, 'x y', function(n) { assert.ok(n === count++); });
|
||||||
|
two.trigger('x', 1);
|
||||||
|
two.trigger('x', 1);
|
||||||
|
two.trigger('y', 2);
|
||||||
|
two.trigger('y', 2);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('#3611 - listenTo is compatible with non-Backbone event libraries', function(assert) {
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
var other = {
|
||||||
|
events: {},
|
||||||
|
on: function(name, callback) {
|
||||||
|
this.events[name] = callback;
|
||||||
|
},
|
||||||
|
trigger: function(name) {
|
||||||
|
this.events[name]();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
obj.listenTo(other, 'test', function() { assert.ok(true); });
|
||||||
|
other.trigger('test');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('#3611 - stopListening is compatible with non-Backbone event libraries', function(assert) {
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
var other = {
|
||||||
|
events: {},
|
||||||
|
on: function(name, callback) {
|
||||||
|
this.events[name] = callback;
|
||||||
|
},
|
||||||
|
off: function() {
|
||||||
|
this.events = {};
|
||||||
|
},
|
||||||
|
trigger: function(name) {
|
||||||
|
var fn = this.events[name];
|
||||||
|
if (fn) fn();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
obj.listenTo(other, 'test', function() { assert.ok(false); });
|
||||||
|
obj.stopListening(other);
|
||||||
|
other.trigger('test');
|
||||||
|
assert.equal(_.size(obj._listeningTo), 0);
|
||||||
|
});
|
||||||
|
})(QUnit);
|
24
vendor/backbone/test/index.html
vendored
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset='utf8'>
|
||||||
|
<title>Backbone Test Suite</title>
|
||||||
|
<link rel="stylesheet" href="vendor/qunit.css" type="text/css" media="screen">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script src="vendor/qunit.js"></script>
|
||||||
|
<script src="vendor/jquery.js"></script>
|
||||||
|
<script src="vendor/json2.js"></script>
|
||||||
|
<script src="vendor/underscore.js"></script>
|
||||||
|
<script src="../backbone.js"></script>
|
||||||
|
<script src="setup/dom-setup.js"></script>
|
||||||
|
<script src="setup/environment.js"></script>
|
||||||
|
<script src="noconflict.js"></script>
|
||||||
|
<script src="events.js"></script>
|
||||||
|
<script src="model.js"></script>
|
||||||
|
<script src="collection.js"></script>
|
||||||
|
<script src="router.js"></script>
|
||||||
|
<script src="view.js"></script>
|
||||||
|
<script src="sync.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
43
vendor/backbone/test/model.coffee
vendored
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
# Quick Backbone/CoffeeScript tests to make sure that inheritance
|
||||||
|
# works correctly.
|
||||||
|
|
||||||
|
{ok, equal, deepEqual} = require 'assert'
|
||||||
|
{Model, Collection, Events} = require '../backbone'
|
||||||
|
|
||||||
|
|
||||||
|
# Patch `ok` to store a count of passed tests...
|
||||||
|
count = 0
|
||||||
|
oldOk = ok
|
||||||
|
ok = ->
|
||||||
|
oldOk arguments...
|
||||||
|
count++
|
||||||
|
|
||||||
|
|
||||||
|
class Document extends Model
|
||||||
|
|
||||||
|
fullName: ->
|
||||||
|
@get('name') + ' ' + @get('surname')
|
||||||
|
|
||||||
|
tempest = new Document
|
||||||
|
id : '1-the-tempest',
|
||||||
|
title : "The Tempest",
|
||||||
|
name : "William"
|
||||||
|
surname : "Shakespeare"
|
||||||
|
length : 123
|
||||||
|
|
||||||
|
ok tempest.fullName() is "William Shakespeare"
|
||||||
|
ok tempest.get('length') is 123
|
||||||
|
|
||||||
|
|
||||||
|
class ProperDocument extends Document
|
||||||
|
|
||||||
|
fullName: ->
|
||||||
|
"Mr. " + super
|
||||||
|
|
||||||
|
properTempest = new ProperDocument tempest.attributes
|
||||||
|
|
||||||
|
ok properTempest.fullName() is "Mr. William Shakespeare"
|
||||||
|
ok properTempest.get('length') is 123
|
||||||
|
|
||||||
|
|
||||||
|
console.log "passed #{count} tests"
|
1470
vendor/backbone/test/model.js
vendored
Normal file
13
vendor/backbone/test/noconflict.js
vendored
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
(function(QUnit) {
|
||||||
|
|
||||||
|
QUnit.module('Backbone.noConflict');
|
||||||
|
|
||||||
|
QUnit.test('noConflict', function(assert) {
|
||||||
|
assert.expect(2);
|
||||||
|
var noconflictBackbone = Backbone.noConflict();
|
||||||
|
assert.equal(window.Backbone, undefined, 'Returned window.Backbone');
|
||||||
|
window.Backbone = noconflictBackbone;
|
||||||
|
assert.equal(window.Backbone, noconflictBackbone, 'Backbone is still pointing to the original Backbone');
|
||||||
|
});
|
||||||
|
|
||||||
|
})(QUnit);
|
1081
vendor/backbone/test/router.js
vendored
Normal file
4
vendor/backbone/test/setup/dom-setup.js
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
$('body').append(
|
||||||
|
'<div id="qunit"></div>' +
|
||||||
|
'<div id="qunit-fixture"></div>'
|
||||||
|
);
|
45
vendor/backbone/test/setup/environment.js
vendored
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
(function(QUnit) {
|
||||||
|
|
||||||
|
var sync = Backbone.sync;
|
||||||
|
var ajax = Backbone.ajax;
|
||||||
|
var emulateHTTP = Backbone.emulateHTTP;
|
||||||
|
var emulateJSON = Backbone.emulateJSON;
|
||||||
|
var history = window.history;
|
||||||
|
var pushState = history.pushState;
|
||||||
|
var replaceState = history.replaceState;
|
||||||
|
|
||||||
|
QUnit.config.noglobals = true;
|
||||||
|
|
||||||
|
QUnit.testStart(function() {
|
||||||
|
var env = QUnit.config.current.testEnvironment;
|
||||||
|
|
||||||
|
// We never want to actually call these during tests.
|
||||||
|
history.pushState = history.replaceState = function() {};
|
||||||
|
|
||||||
|
// Capture ajax settings for comparison.
|
||||||
|
Backbone.ajax = function(settings) {
|
||||||
|
env.ajaxSettings = settings;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Capture the arguments to Backbone.sync for comparison.
|
||||||
|
Backbone.sync = function(method, model, options) {
|
||||||
|
env.syncArgs = {
|
||||||
|
method: method,
|
||||||
|
model: model,
|
||||||
|
options: options
|
||||||
|
};
|
||||||
|
sync.apply(this, arguments);
|
||||||
|
};
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.testDone(function() {
|
||||||
|
Backbone.sync = sync;
|
||||||
|
Backbone.ajax = ajax;
|
||||||
|
Backbone.emulateHTTP = emulateHTTP;
|
||||||
|
Backbone.emulateJSON = emulateJSON;
|
||||||
|
history.pushState = pushState;
|
||||||
|
history.replaceState = replaceState;
|
||||||
|
});
|
||||||
|
|
||||||
|
})(QUnit);
|
239
vendor/backbone/test/sync.js
vendored
Normal file
|
@ -0,0 +1,239 @@
|
||||||
|
(function(QUnit) {
|
||||||
|
|
||||||
|
var Library = Backbone.Collection.extend({
|
||||||
|
url: function() { return '/library'; }
|
||||||
|
});
|
||||||
|
var library;
|
||||||
|
|
||||||
|
var attrs = {
|
||||||
|
title: 'The Tempest',
|
||||||
|
author: 'Bill Shakespeare',
|
||||||
|
length: 123
|
||||||
|
};
|
||||||
|
|
||||||
|
QUnit.module('Backbone.sync', {
|
||||||
|
|
||||||
|
beforeEach: function(assert) {
|
||||||
|
library = new Library;
|
||||||
|
library.create(attrs, {wait: false});
|
||||||
|
},
|
||||||
|
|
||||||
|
afterEach: function(assert) {
|
||||||
|
Backbone.emulateHTTP = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('read', function(assert) {
|
||||||
|
assert.expect(4);
|
||||||
|
library.fetch();
|
||||||
|
assert.equal(this.ajaxSettings.url, '/library');
|
||||||
|
assert.equal(this.ajaxSettings.type, 'GET');
|
||||||
|
assert.equal(this.ajaxSettings.dataType, 'json');
|
||||||
|
assert.ok(_.isEmpty(this.ajaxSettings.data));
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('passing data', function(assert) {
|
||||||
|
assert.expect(3);
|
||||||
|
library.fetch({data: {a: 'a', one: 1}});
|
||||||
|
assert.equal(this.ajaxSettings.url, '/library');
|
||||||
|
assert.equal(this.ajaxSettings.data.a, 'a');
|
||||||
|
assert.equal(this.ajaxSettings.data.one, 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('create', function(assert) {
|
||||||
|
assert.expect(6);
|
||||||
|
assert.equal(this.ajaxSettings.url, '/library');
|
||||||
|
assert.equal(this.ajaxSettings.type, 'POST');
|
||||||
|
assert.equal(this.ajaxSettings.dataType, 'json');
|
||||||
|
var data = JSON.parse(this.ajaxSettings.data);
|
||||||
|
assert.equal(data.title, 'The Tempest');
|
||||||
|
assert.equal(data.author, 'Bill Shakespeare');
|
||||||
|
assert.equal(data.length, 123);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('update', function(assert) {
|
||||||
|
assert.expect(7);
|
||||||
|
library.first().save({id: '1-the-tempest', author: 'William Shakespeare'});
|
||||||
|
assert.equal(this.ajaxSettings.url, '/library/1-the-tempest');
|
||||||
|
assert.equal(this.ajaxSettings.type, 'PUT');
|
||||||
|
assert.equal(this.ajaxSettings.dataType, 'json');
|
||||||
|
var data = JSON.parse(this.ajaxSettings.data);
|
||||||
|
assert.equal(data.id, '1-the-tempest');
|
||||||
|
assert.equal(data.title, 'The Tempest');
|
||||||
|
assert.equal(data.author, 'William Shakespeare');
|
||||||
|
assert.equal(data.length, 123);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('update with emulateHTTP and emulateJSON', function(assert) {
|
||||||
|
assert.expect(7);
|
||||||
|
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'}, {
|
||||||
|
emulateHTTP: true,
|
||||||
|
emulateJSON: true
|
||||||
|
});
|
||||||
|
assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||||
|
assert.equal(this.ajaxSettings.type, 'POST');
|
||||||
|
assert.equal(this.ajaxSettings.dataType, 'json');
|
||||||
|
assert.equal(this.ajaxSettings.data._method, 'PUT');
|
||||||
|
var data = JSON.parse(this.ajaxSettings.data.model);
|
||||||
|
assert.equal(data.id, '2-the-tempest');
|
||||||
|
assert.equal(data.author, 'Tim Shakespeare');
|
||||||
|
assert.equal(data.length, 123);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('update with just emulateHTTP', function(assert) {
|
||||||
|
assert.expect(6);
|
||||||
|
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'}, {
|
||||||
|
emulateHTTP: true
|
||||||
|
});
|
||||||
|
assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||||
|
assert.equal(this.ajaxSettings.type, 'POST');
|
||||||
|
assert.equal(this.ajaxSettings.contentType, 'application/json');
|
||||||
|
var data = JSON.parse(this.ajaxSettings.data);
|
||||||
|
assert.equal(data.id, '2-the-tempest');
|
||||||
|
assert.equal(data.author, 'Tim Shakespeare');
|
||||||
|
assert.equal(data.length, 123);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('update with just emulateJSON', function(assert) {
|
||||||
|
assert.expect(6);
|
||||||
|
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'}, {
|
||||||
|
emulateJSON: true
|
||||||
|
});
|
||||||
|
assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||||
|
assert.equal(this.ajaxSettings.type, 'PUT');
|
||||||
|
assert.equal(this.ajaxSettings.contentType, 'application/x-www-form-urlencoded');
|
||||||
|
var data = JSON.parse(this.ajaxSettings.data.model);
|
||||||
|
assert.equal(data.id, '2-the-tempest');
|
||||||
|
assert.equal(data.author, 'Tim Shakespeare');
|
||||||
|
assert.equal(data.length, 123);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('read model', function(assert) {
|
||||||
|
assert.expect(3);
|
||||||
|
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
|
||||||
|
library.first().fetch();
|
||||||
|
assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||||
|
assert.equal(this.ajaxSettings.type, 'GET');
|
||||||
|
assert.ok(_.isEmpty(this.ajaxSettings.data));
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('destroy', function(assert) {
|
||||||
|
assert.expect(3);
|
||||||
|
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
|
||||||
|
library.first().destroy({wait: true});
|
||||||
|
assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||||
|
assert.equal(this.ajaxSettings.type, 'DELETE');
|
||||||
|
assert.equal(this.ajaxSettings.data, null);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('destroy with emulateHTTP', function(assert) {
|
||||||
|
assert.expect(3);
|
||||||
|
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
|
||||||
|
library.first().destroy({
|
||||||
|
emulateHTTP: true,
|
||||||
|
emulateJSON: true
|
||||||
|
});
|
||||||
|
assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||||
|
assert.equal(this.ajaxSettings.type, 'POST');
|
||||||
|
assert.equal(JSON.stringify(this.ajaxSettings.data), '{"_method":"DELETE"}');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('urlError', function(assert) {
|
||||||
|
assert.expect(2);
|
||||||
|
var model = new Backbone.Model();
|
||||||
|
assert.raises(function() {
|
||||||
|
model.fetch();
|
||||||
|
});
|
||||||
|
model.fetch({url: '/one/two'});
|
||||||
|
assert.equal(this.ajaxSettings.url, '/one/two');
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('#1052 - `options` is optional.', function(assert) {
|
||||||
|
assert.expect(0);
|
||||||
|
var model = new Backbone.Model();
|
||||||
|
model.url = '/test';
|
||||||
|
Backbone.sync('create', model);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('Backbone.ajax', function(assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
Backbone.ajax = function(settings) {
|
||||||
|
assert.strictEqual(settings.url, '/test');
|
||||||
|
};
|
||||||
|
var model = new Backbone.Model();
|
||||||
|
model.url = '/test';
|
||||||
|
Backbone.sync('create', model);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('Call provided error callback on error.', function(assert) {
|
||||||
|
assert.expect(1);
|
||||||
|
var model = new Backbone.Model;
|
||||||
|
model.url = '/test';
|
||||||
|
Backbone.sync('read', model, {
|
||||||
|
error: function() { assert.ok(true); }
|
||||||
|
});
|
||||||
|
this.ajaxSettings.error();
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('Use Backbone.emulateHTTP as default.', function(assert) {
|
||||||
|
assert.expect(2);
|
||||||
|
var model = new Backbone.Model;
|
||||||
|
model.url = '/test';
|
||||||
|
|
||||||
|
Backbone.emulateHTTP = true;
|
||||||
|
model.sync('create', model);
|
||||||
|
assert.strictEqual(this.ajaxSettings.emulateHTTP, true);
|
||||||
|
|
||||||
|
Backbone.emulateHTTP = false;
|
||||||
|
model.sync('create', model);
|
||||||
|
assert.strictEqual(this.ajaxSettings.emulateHTTP, false);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('Use Backbone.emulateJSON as default.', function(assert) {
|
||||||
|
assert.expect(2);
|
||||||
|
var model = new Backbone.Model;
|
||||||
|
model.url = '/test';
|
||||||
|
|
||||||
|
Backbone.emulateJSON = true;
|
||||||
|
model.sync('create', model);
|
||||||
|
assert.strictEqual(this.ajaxSettings.emulateJSON, true);
|
||||||
|
|
||||||
|
Backbone.emulateJSON = false;
|
||||||
|
model.sync('create', model);
|
||||||
|
assert.strictEqual(this.ajaxSettings.emulateJSON, false);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('#1756 - Call user provided beforeSend function.', function(assert) {
|
||||||
|
assert.expect(4);
|
||||||
|
Backbone.emulateHTTP = true;
|
||||||
|
var model = new Backbone.Model;
|
||||||
|
model.url = '/test';
|
||||||
|
var xhr = {
|
||||||
|
setRequestHeader: function(header, value) {
|
||||||
|
assert.strictEqual(header, 'X-HTTP-Method-Override');
|
||||||
|
assert.strictEqual(value, 'DELETE');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
model.sync('delete', model, {
|
||||||
|
beforeSend: function(_xhr) {
|
||||||
|
assert.ok(_xhr === xhr);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
assert.strictEqual(this.ajaxSettings.beforeSend(xhr), false);
|
||||||
|
});
|
||||||
|
|
||||||
|
QUnit.test('#2928 - Pass along `textStatus` and `errorThrown`.', function(assert) {
|
||||||
|
assert.expect(2);
|
||||||
|
var model = new Backbone.Model;
|
||||||
|
model.url = '/test';
|
||||||
|
model.on('error', function(m, xhr, options) {
|
||||||
|
assert.strictEqual(options.textStatus, 'textStatus');
|
||||||
|
assert.strictEqual(options.errorThrown, 'errorThrown');
|
||||||
|
});
|
||||||
|
model.fetch();
|
||||||
|
this.ajaxSettings.error({}, 'textStatus', 'errorThrown');
|
||||||
|
});
|
||||||
|
|
||||||
|
})(QUnit);
|
9472
vendor/backbone/test/vendor/jquery.js
vendored
Normal file
481
vendor/backbone/test/vendor/json2.js
vendored
Normal file
|
@ -0,0 +1,481 @@
|
||||||
|
/*
|
||||||
|
http://www.JSON.org/json2.js
|
||||||
|
2009-09-29
|
||||||
|
|
||||||
|
Public Domain.
|
||||||
|
|
||||||
|
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
|
||||||
|
|
||||||
|
See http://www.JSON.org/js.html
|
||||||
|
|
||||||
|
|
||||||
|
This code should be minified before deployment.
|
||||||
|
See http://javascript.crockford.com/jsmin.html
|
||||||
|
|
||||||
|
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
|
||||||
|
NOT CONTROL.
|
||||||
|
|
||||||
|
|
||||||
|
This file creates a global JSON object containing two methods: stringify
|
||||||
|
and parse.
|
||||||
|
|
||||||
|
JSON.stringify(value, replacer, space)
|
||||||
|
value any JavaScript value, usually an object or array.
|
||||||
|
|
||||||
|
replacer an optional parameter that determines how object
|
||||||
|
values are stringified for objects. It can be a
|
||||||
|
function or an array of strings.
|
||||||
|
|
||||||
|
space an optional parameter that specifies the indentation
|
||||||
|
of nested structures. If it is omitted, the text will
|
||||||
|
be packed without extra whitespace. If it is a number,
|
||||||
|
it will specify the number of spaces to indent at each
|
||||||
|
level. If it is a string (such as '\t' or ' '),
|
||||||
|
it contains the characters used to indent at each level.
|
||||||
|
|
||||||
|
This method produces a JSON text from a JavaScript value.
|
||||||
|
|
||||||
|
When an object value is found, if the object contains a toJSON
|
||||||
|
method, its toJSON method will be called and the result will be
|
||||||
|
stringified. A toJSON method does not serialize: it returns the
|
||||||
|
value represented by the name/value pair that should be serialized,
|
||||||
|
or undefined if nothing should be serialized. The toJSON method
|
||||||
|
will be passed the key associated with the value, and this will be
|
||||||
|
bound to the value
|
||||||
|
|
||||||
|
For example, this would serialize Dates as ISO strings.
|
||||||
|
|
||||||
|
Date.prototype.toJSON = function (key) {
|
||||||
|
function f(n) {
|
||||||
|
// Format integers to have at least two digits.
|
||||||
|
return n < 10 ? '0' + n : n;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.getUTCFullYear() + '-' +
|
||||||
|
f(this.getUTCMonth() + 1) + '-' +
|
||||||
|
f(this.getUTCDate()) + 'T' +
|
||||||
|
f(this.getUTCHours()) + ':' +
|
||||||
|
f(this.getUTCMinutes()) + ':' +
|
||||||
|
f(this.getUTCSeconds()) + 'Z';
|
||||||
|
};
|
||||||
|
|
||||||
|
You can provide an optional replacer method. It will be passed the
|
||||||
|
key and value of each member, with this bound to the containing
|
||||||
|
object. The value that is returned from your method will be
|
||||||
|
serialized. If your method returns undefined, then the member will
|
||||||
|
be excluded from the serialization.
|
||||||
|
|
||||||
|
If the replacer parameter is an array of strings, then it will be
|
||||||
|
used to select the members to be serialized. It filters the results
|
||||||
|
such that only members with keys listed in the replacer array are
|
||||||
|
stringified.
|
||||||
|
|
||||||
|
Values that do not have JSON representations, such as undefined or
|
||||||
|
functions, will not be serialized. Such values in objects will be
|
||||||
|
dropped; in arrays they will be replaced with null. You can use
|
||||||
|
a replacer function to replace those with JSON values.
|
||||||
|
JSON.stringify(undefined) returns undefined.
|
||||||
|
|
||||||
|
The optional space parameter produces a stringification of the
|
||||||
|
value that is filled with line breaks and indentation to make it
|
||||||
|
easier to read.
|
||||||
|
|
||||||
|
If the space parameter is a non-empty string, then that string will
|
||||||
|
be used for indentation. If the space parameter is a number, then
|
||||||
|
the indentation will be that many spaces.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
text = JSON.stringify(['e', {pluribus: 'unum'}]);
|
||||||
|
// text is '["e",{"pluribus":"unum"}]'
|
||||||
|
|
||||||
|
|
||||||
|
text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
|
||||||
|
// text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
|
||||||
|
|
||||||
|
text = JSON.stringify([new Date()], function (key, value) {
|
||||||
|
return this[key] instanceof Date ?
|
||||||
|
'Date(' + this[key] + ')' : value;
|
||||||
|
});
|
||||||
|
// text is '["Date(---current time---)"]'
|
||||||
|
|
||||||
|
|
||||||
|
JSON.parse(text, reviver)
|
||||||
|
This method parses a JSON text to produce an object or array.
|
||||||
|
It can throw a SyntaxError exception.
|
||||||
|
|
||||||
|
The optional reviver parameter is a function that can filter and
|
||||||
|
transform the results. It receives each of the keys and values,
|
||||||
|
and its return value is used instead of the original value.
|
||||||
|
If it returns what it received, then the structure is not modified.
|
||||||
|
If it returns undefined then the member is deleted.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
// Parse the text. Values that look like ISO date strings will
|
||||||
|
// be converted to Date objects.
|
||||||
|
|
||||||
|
myData = JSON.parse(text, function (key, value) {
|
||||||
|
var a;
|
||||||
|
if (typeof value === 'string') {
|
||||||
|
a =
|
||||||
|
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
|
||||||
|
if (a) {
|
||||||
|
return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
|
||||||
|
+a[5], +a[6]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
});
|
||||||
|
|
||||||
|
myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
|
||||||
|
var d;
|
||||||
|
if (typeof value === 'string' &&
|
||||||
|
value.slice(0, 5) === 'Date(' &&
|
||||||
|
value.slice(-1) === ')') {
|
||||||
|
d = new Date(value.slice(5, -1));
|
||||||
|
if (d) {
|
||||||
|
return d;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
This is a reference implementation. You are free to copy, modify, or
|
||||||
|
redistribute.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*jslint evil: true, strict: false */
|
||||||
|
|
||||||
|
/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
|
||||||
|
call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
|
||||||
|
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
|
||||||
|
lastIndex, length, parse, prototype, push, replace, slice, stringify,
|
||||||
|
test, toJSON, toString, valueOf
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// Create a JSON object only if one does not already exist. We create the
|
||||||
|
// methods in a closure to avoid creating global variables.
|
||||||
|
|
||||||
|
if (!this.JSON) {
|
||||||
|
this.JSON = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
|
||||||
|
function f(n) {
|
||||||
|
// Format integers to have at least two digits.
|
||||||
|
return n < 10 ? '0' + n : n;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof Date.prototype.toJSON !== 'function') {
|
||||||
|
|
||||||
|
Date.prototype.toJSON = function (key) {
|
||||||
|
|
||||||
|
return isFinite(this.valueOf()) ?
|
||||||
|
this.getUTCFullYear() + '-' +
|
||||||
|
f(this.getUTCMonth() + 1) + '-' +
|
||||||
|
f(this.getUTCDate()) + 'T' +
|
||||||
|
f(this.getUTCHours()) + ':' +
|
||||||
|
f(this.getUTCMinutes()) + ':' +
|
||||||
|
f(this.getUTCSeconds()) + 'Z' : null;
|
||||||
|
};
|
||||||
|
|
||||||
|
String.prototype.toJSON =
|
||||||
|
Number.prototype.toJSON =
|
||||||
|
Boolean.prototype.toJSON = function (key) {
|
||||||
|
return this.valueOf();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
||||||
|
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
||||||
|
gap,
|
||||||
|
indent,
|
||||||
|
meta = { // table of character substitutions
|
||||||
|
'\b': '\\b',
|
||||||
|
'\t': '\\t',
|
||||||
|
'\n': '\\n',
|
||||||
|
'\f': '\\f',
|
||||||
|
'\r': '\\r',
|
||||||
|
'"' : '\\"',
|
||||||
|
'\\': '\\\\'
|
||||||
|
},
|
||||||
|
rep;
|
||||||
|
|
||||||
|
|
||||||
|
function quote(string) {
|
||||||
|
|
||||||
|
// If the string contains no control characters, no quote characters, and no
|
||||||
|
// backslash characters, then we can safely slap some quotes around it.
|
||||||
|
// Otherwise we must also replace the offending characters with safe escape
|
||||||
|
// sequences.
|
||||||
|
|
||||||
|
escapable.lastIndex = 0;
|
||||||
|
return escapable.test(string) ?
|
||||||
|
'"' + string.replace(escapable, function (a) {
|
||||||
|
var c = meta[a];
|
||||||
|
return typeof c === 'string' ? c :
|
||||||
|
'\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
||||||
|
}) + '"' :
|
||||||
|
'"' + string + '"';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function str(key, holder) {
|
||||||
|
|
||||||
|
// Produce a string from holder[key].
|
||||||
|
|
||||||
|
var i, // The loop counter.
|
||||||
|
k, // The member key.
|
||||||
|
v, // The member value.
|
||||||
|
length,
|
||||||
|
mind = gap,
|
||||||
|
partial,
|
||||||
|
value = holder[key];
|
||||||
|
|
||||||
|
// If the value has a toJSON method, call it to obtain a replacement value.
|
||||||
|
|
||||||
|
if (value && typeof value === 'object' &&
|
||||||
|
typeof value.toJSON === 'function') {
|
||||||
|
value = value.toJSON(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
// If we were called with a replacer function, then call the replacer to
|
||||||
|
// obtain a replacement value.
|
||||||
|
|
||||||
|
if (typeof rep === 'function') {
|
||||||
|
value = rep.call(holder, key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// What happens next depends on the value's type.
|
||||||
|
|
||||||
|
switch (typeof value) {
|
||||||
|
case 'string':
|
||||||
|
return quote(value);
|
||||||
|
|
||||||
|
case 'number':
|
||||||
|
|
||||||
|
// JSON numbers must be finite. Encode non-finite numbers as null.
|
||||||
|
|
||||||
|
return isFinite(value) ? String(value) : 'null';
|
||||||
|
|
||||||
|
case 'boolean':
|
||||||
|
case 'null':
|
||||||
|
|
||||||
|
// If the value is a boolean or null, convert it to a string. Note:
|
||||||
|
// typeof null does not produce 'null'. The case is included here in
|
||||||
|
// the remote chance that this gets fixed someday.
|
||||||
|
|
||||||
|
return String(value);
|
||||||
|
|
||||||
|
// If the type is 'object', we might be dealing with an object or an array or
|
||||||
|
// null.
|
||||||
|
|
||||||
|
case 'object':
|
||||||
|
|
||||||
|
// Due to a specification blunder in ECMAScript, typeof null is 'object',
|
||||||
|
// so watch out for that case.
|
||||||
|
|
||||||
|
if (!value) {
|
||||||
|
return 'null';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make an array to hold the partial results of stringifying this object value.
|
||||||
|
|
||||||
|
gap += indent;
|
||||||
|
partial = [];
|
||||||
|
|
||||||
|
// Is the value an array?
|
||||||
|
|
||||||
|
if (Object.prototype.toString.apply(value) === '[object Array]') {
|
||||||
|
|
||||||
|
// The value is an array. Stringify every element. Use null as a placeholder
|
||||||
|
// for non-JSON values.
|
||||||
|
|
||||||
|
length = value.length;
|
||||||
|
for (i = 0; i < length; i += 1) {
|
||||||
|
partial[i] = str(i, value) || 'null';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Join all of the elements together, separated with commas, and wrap them in
|
||||||
|
// brackets.
|
||||||
|
|
||||||
|
v = partial.length === 0 ? '[]' :
|
||||||
|
gap ? '[\n' + gap +
|
||||||
|
partial.join(',\n' + gap) + '\n' +
|
||||||
|
mind + ']' :
|
||||||
|
'[' + partial.join(',') + ']';
|
||||||
|
gap = mind;
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the replacer is an array, use it to select the members to be stringified.
|
||||||
|
|
||||||
|
if (rep && typeof rep === 'object') {
|
||||||
|
length = rep.length;
|
||||||
|
for (i = 0; i < length; i += 1) {
|
||||||
|
k = rep[i];
|
||||||
|
if (typeof k === 'string') {
|
||||||
|
v = str(k, value);
|
||||||
|
if (v) {
|
||||||
|
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// Otherwise, iterate through all of the keys in the object.
|
||||||
|
|
||||||
|
for (k in value) {
|
||||||
|
if (Object.hasOwnProperty.call(value, k)) {
|
||||||
|
v = str(k, value);
|
||||||
|
if (v) {
|
||||||
|
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Join all of the member texts together, separated with commas,
|
||||||
|
// and wrap them in braces.
|
||||||
|
|
||||||
|
v = partial.length === 0 ? '{}' :
|
||||||
|
gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
|
||||||
|
mind + '}' : '{' + partial.join(',') + '}';
|
||||||
|
gap = mind;
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the JSON object does not yet have a stringify method, give it one.
|
||||||
|
|
||||||
|
if (typeof JSON.stringify !== 'function') {
|
||||||
|
JSON.stringify = function (value, replacer, space) {
|
||||||
|
|
||||||
|
// The stringify method takes a value and an optional replacer, and an optional
|
||||||
|
// space parameter, and returns a JSON text. The replacer can be a function
|
||||||
|
// that can replace values, or an array of strings that will select the keys.
|
||||||
|
// A default replacer method can be provided. Use of the space parameter can
|
||||||
|
// produce text that is more easily readable.
|
||||||
|
|
||||||
|
var i;
|
||||||
|
gap = '';
|
||||||
|
indent = '';
|
||||||
|
|
||||||
|
// If the space parameter is a number, make an indent string containing that
|
||||||
|
// many spaces.
|
||||||
|
|
||||||
|
if (typeof space === 'number') {
|
||||||
|
for (i = 0; i < space; i += 1) {
|
||||||
|
indent += ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the space parameter is a string, it will be used as the indent string.
|
||||||
|
|
||||||
|
} else if (typeof space === 'string') {
|
||||||
|
indent = space;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If there is a replacer, it must be a function or an array.
|
||||||
|
// Otherwise, throw an error.
|
||||||
|
|
||||||
|
rep = replacer;
|
||||||
|
if (replacer && typeof replacer !== 'function' &&
|
||||||
|
(typeof replacer !== 'object' ||
|
||||||
|
typeof replacer.length !== 'number')) {
|
||||||
|
throw new Error('JSON.stringify');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make a fake root object containing our value under the key of ''.
|
||||||
|
// Return the result of stringifying the value.
|
||||||
|
|
||||||
|
return str('', {'': value});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// If the JSON object does not yet have a parse method, give it one.
|
||||||
|
|
||||||
|
if (typeof JSON.parse !== 'function') {
|
||||||
|
JSON.parse = function (text, reviver) {
|
||||||
|
|
||||||
|
// The parse method takes a text and an optional reviver function, and returns
|
||||||
|
// a JavaScript value if the text is a valid JSON text.
|
||||||
|
|
||||||
|
var j;
|
||||||
|
|
||||||
|
function walk(holder, key) {
|
||||||
|
|
||||||
|
// The walk method is used to recursively walk the resulting structure so
|
||||||
|
// that modifications can be made.
|
||||||
|
|
||||||
|
var k, v, value = holder[key];
|
||||||
|
if (value && typeof value === 'object') {
|
||||||
|
for (k in value) {
|
||||||
|
if (Object.hasOwnProperty.call(value, k)) {
|
||||||
|
v = walk(value, k);
|
||||||
|
if (v !== undefined) {
|
||||||
|
value[k] = v;
|
||||||
|
} else {
|
||||||
|
delete value[k];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return reviver.call(holder, key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Parsing happens in four stages. In the first stage, we replace certain
|
||||||
|
// Unicode characters with escape sequences. JavaScript handles many characters
|
||||||
|
// incorrectly, either silently deleting them, or treating them as line endings.
|
||||||
|
|
||||||
|
cx.lastIndex = 0;
|
||||||
|
if (cx.test(text)) {
|
||||||
|
text = text.replace(cx, function (a) {
|
||||||
|
return '\\u' +
|
||||||
|
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// In the second stage, we run the text against regular expressions that look
|
||||||
|
// for non-JSON patterns. We are especially concerned with '()' and 'new'
|
||||||
|
// because they can cause invocation, and '=' because it can cause mutation.
|
||||||
|
// But just to be safe, we want to reject all unexpected forms.
|
||||||
|
|
||||||
|
// We split the second stage into 4 regexp operations in order to work around
|
||||||
|
// crippling inefficiencies in IE's and Safari's regexp engines. First we
|
||||||
|
// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
|
||||||
|
// replace all simple value tokens with ']' characters. Third, we delete all
|
||||||
|
// open brackets that follow a colon or comma or that begin the text. Finally,
|
||||||
|
// we look to see that the remaining characters are only whitespace or ']' or
|
||||||
|
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
|
||||||
|
|
||||||
|
if (/^[\],:{}\s]*$/.
|
||||||
|
test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
|
||||||
|
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
|
||||||
|
replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
|
||||||
|
|
||||||
|
// In the third stage we use the eval function to compile the text into a
|
||||||
|
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
|
||||||
|
// in JavaScript: it can begin a block or an object literal. We wrap the text
|
||||||
|
// in parens to eliminate the ambiguity.
|
||||||
|
|
||||||
|
j = eval('(' + text + ')');
|
||||||
|
|
||||||
|
// In the optional fourth stage, we recursively walk the new structure, passing
|
||||||
|
// each name/value pair to a reviver function for possible transformation.
|
||||||
|
|
||||||
|
return typeof reviver === 'function' ?
|
||||||
|
walk({'': j}, '') : j;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the text is not JSON parseable, then a SyntaxError is thrown.
|
||||||
|
|
||||||
|
throw new SyntaxError('JSON.parse');
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}());
|
305
vendor/backbone/test/vendor/qunit.css
vendored
Normal file
|
@ -0,0 +1,305 @@
|
||||||
|
/*!
|
||||||
|
* QUnit 1.21.0
|
||||||
|
* https://qunitjs.com/
|
||||||
|
*
|
||||||
|
* Copyright jQuery Foundation and other contributors
|
||||||
|
* Released under the MIT license
|
||||||
|
* https://jquery.org/license
|
||||||
|
*
|
||||||
|
* Date: 2016-02-01T13:07Z
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** Font Family and Sizes */
|
||||||
|
|
||||||
|
#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult {
|
||||||
|
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-testrunner-toolbar, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
|
||||||
|
#qunit-tests { font-size: smaller; }
|
||||||
|
|
||||||
|
|
||||||
|
/** Resets */
|
||||||
|
|
||||||
|
#qunit-tests, #qunit-header, #qunit-banner, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** Header */
|
||||||
|
|
||||||
|
#qunit-header {
|
||||||
|
padding: 0.5em 0 0.5em 1em;
|
||||||
|
|
||||||
|
color: #8699A4;
|
||||||
|
background-color: #0D3349;
|
||||||
|
|
||||||
|
font-size: 1.5em;
|
||||||
|
line-height: 1em;
|
||||||
|
font-weight: 400;
|
||||||
|
|
||||||
|
border-radius: 5px 5px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-header a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: #C2CCD1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-header a:hover,
|
||||||
|
#qunit-header a:focus {
|
||||||
|
color: #FFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-testrunner-toolbar label {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0 0.5em 0 0.1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-banner {
|
||||||
|
height: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-testrunner-toolbar {
|
||||||
|
padding: 0.5em 1em 0.5em 1em;
|
||||||
|
color: #5E740B;
|
||||||
|
background-color: #EEE;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-filteredTest {
|
||||||
|
padding: 0.5em 1em 0.5em 1em;
|
||||||
|
background-color: #F4FF77;
|
||||||
|
color: #366097;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-userAgent {
|
||||||
|
padding: 0.5em 1em 0.5em 1em;
|
||||||
|
background-color: #2B81AF;
|
||||||
|
color: #FFF;
|
||||||
|
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-modulefilter-container {
|
||||||
|
float: right;
|
||||||
|
padding: 0.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qunit-url-config {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0.1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qunit-filter {
|
||||||
|
display: block;
|
||||||
|
float: right;
|
||||||
|
margin-left: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Tests: Pass/Fail */
|
||||||
|
|
||||||
|
#qunit-tests {
|
||||||
|
list-style-position: inside;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-tests li {
|
||||||
|
padding: 0.4em 1em 0.4em 1em;
|
||||||
|
border-bottom: 1px solid #FFF;
|
||||||
|
list-style-position: inside;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-tests > li {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-tests li.running,
|
||||||
|
#qunit-tests li.pass,
|
||||||
|
#qunit-tests li.fail,
|
||||||
|
#qunit-tests li.skipped {
|
||||||
|
display: list-item;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-tests.hidepass {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-tests.hidepass li.running,
|
||||||
|
#qunit-tests.hidepass li.pass {
|
||||||
|
visibility: hidden;
|
||||||
|
position: absolute;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-tests li strong {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-tests li.skipped strong {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-tests li a {
|
||||||
|
padding: 0.5em;
|
||||||
|
color: #C2CCD1;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-tests li p a {
|
||||||
|
padding: 0.25em;
|
||||||
|
color: #6B6464;
|
||||||
|
}
|
||||||
|
#qunit-tests li a:hover,
|
||||||
|
#qunit-tests li a:focus {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-tests li .runtime {
|
||||||
|
float: right;
|
||||||
|
font-size: smaller;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qunit-assert-list {
|
||||||
|
margin-top: 0.5em;
|
||||||
|
padding: 0.5em;
|
||||||
|
|
||||||
|
background-color: #FFF;
|
||||||
|
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qunit-source {
|
||||||
|
margin: 0.6em 0 0.3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qunit-collapsed {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-tests table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
margin-top: 0.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-tests th {
|
||||||
|
text-align: right;
|
||||||
|
vertical-align: top;
|
||||||
|
padding: 0 0.5em 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-tests td {
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-tests pre {
|
||||||
|
margin: 0;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-tests del {
|
||||||
|
background-color: #E0F2BE;
|
||||||
|
color: #374E0C;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-tests ins {
|
||||||
|
background-color: #FFCACA;
|
||||||
|
color: #500;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*** Test Counts */
|
||||||
|
|
||||||
|
#qunit-tests b.counts { color: #000; }
|
||||||
|
#qunit-tests b.passed { color: #5E740B; }
|
||||||
|
#qunit-tests b.failed { color: #710909; }
|
||||||
|
|
||||||
|
#qunit-tests li li {
|
||||||
|
padding: 5px;
|
||||||
|
background-color: #FFF;
|
||||||
|
border-bottom: none;
|
||||||
|
list-style-position: inside;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*** Passing Styles */
|
||||||
|
|
||||||
|
#qunit-tests li li.pass {
|
||||||
|
color: #3C510C;
|
||||||
|
background-color: #FFF;
|
||||||
|
border-left: 10px solid #C6E746;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
|
||||||
|
#qunit-tests .pass .test-name { color: #366097; }
|
||||||
|
|
||||||
|
#qunit-tests .pass .test-actual,
|
||||||
|
#qunit-tests .pass .test-expected { color: #999; }
|
||||||
|
|
||||||
|
#qunit-banner.qunit-pass { background-color: #C6E746; }
|
||||||
|
|
||||||
|
/*** Failing Styles */
|
||||||
|
|
||||||
|
#qunit-tests li li.fail {
|
||||||
|
color: #710909;
|
||||||
|
background-color: #FFF;
|
||||||
|
border-left: 10px solid #EE5757;
|
||||||
|
white-space: pre;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-tests > li:last-child {
|
||||||
|
border-radius: 0 0 5px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-tests .fail { color: #000; background-color: #EE5757; }
|
||||||
|
#qunit-tests .fail .test-name,
|
||||||
|
#qunit-tests .fail .module-name { color: #000; }
|
||||||
|
|
||||||
|
#qunit-tests .fail .test-actual { color: #EE5757; }
|
||||||
|
#qunit-tests .fail .test-expected { color: #008000; }
|
||||||
|
|
||||||
|
#qunit-banner.qunit-fail { background-color: #EE5757; }
|
||||||
|
|
||||||
|
/*** Skipped tests */
|
||||||
|
|
||||||
|
#qunit-tests .skipped {
|
||||||
|
background-color: #EBECE9;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qunit-tests .qunit-skipped-label {
|
||||||
|
background-color: #F4FF77;
|
||||||
|
display: inline-block;
|
||||||
|
font-style: normal;
|
||||||
|
color: #366097;
|
||||||
|
line-height: 1.8em;
|
||||||
|
padding: 0 0.5em;
|
||||||
|
margin: -0.4em 0.4em -0.4em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Result */
|
||||||
|
|
||||||
|
#qunit-testresult {
|
||||||
|
padding: 0.5em 1em 0.5em 1em;
|
||||||
|
|
||||||
|
color: #2B81AF;
|
||||||
|
background-color: #D2E0E6;
|
||||||
|
|
||||||
|
border-bottom: 1px solid #FFF;
|
||||||
|
}
|
||||||
|
#qunit-testresult .module-name {
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Fixture */
|
||||||
|
|
||||||
|
#qunit-fixture {
|
||||||
|
position: absolute;
|
||||||
|
top: -10000px;
|
||||||
|
left: -10000px;
|
||||||
|
width: 1000px;
|
||||||
|
height: 1000px;
|
||||||
|
}
|