diff --git a/Gruntfile.coffee b/Gruntfile.coffee
index 108308b8..a45ccdd7 100644
--- a/Gruntfile.coffee
+++ b/Gruntfile.coffee
@@ -13,11 +13,13 @@ module.exports = (grunt) ->
grunt.loadNpmTasks('grunt-contrib-uglify')
grunt.loadNpmTasks('grunt-contrib-watch')
grunt.loadNpmTasks('grunt-release')
+ grunt.loadNpmTasks('grunt-karma')
grunt.initConfig
pkg: ''
distFolder: 'dist'
+ testFolder: 'test'
jst:
all:
@@ -63,5 +65,11 @@ module.exports = (grunt) ->
release:
npm: false
+ karma:
+ unit:
+ configFile: '<%= testFolder %>/karma.conf.coffee'
+
+
grunt.registerTask 'default', ALL_TASKS
grunt.registerTask 'dist', ['cssmin:dist', 'uglify:dist']
+ grunt.registerTask 'test', ['dist', 'karma']
diff --git a/bower.json b/bower.json
index 8a3044ec..21f361ac 100644
--- a/bower.json
+++ b/bower.json
@@ -6,7 +6,7 @@
"adamjacobbecker "
],
"description": "Graphical form builder for the web.",
- "main": "dist",
+ "main": "index.js",
"license": "MIT",
"ignore": [
"**/.*",
@@ -16,14 +16,14 @@
"tests"
],
"dependencies": {
- "jquery": "*",
- "jquery-ui": "*",
+ "jquery": "~2.0.3",
+ "jquery-ui": "~1.10.3",
"jquery.scrollWindowTo": "https://gist.github.com/adamjacobbecker/6519570/raw/cd741057495d0fb19e545a0f9a098efba3bef9c8/jquery.scrollWindowTo.js",
- "underscore": "*",
+ "underscore": "~1.5.2",
"underscore.mixin.deepExtend": "https://gist.github.com/adamjacobbecker/6519561/raw/63682037af9b10200b05c1a3d5890903397b2103/underscore.mixin.deepExtend.js",
- "backbone": "*",
- "backbone-deep-model": "*",
- "rivets": "*",
- "font-awesome": "~4.0.1"
+ "backbone": "~1.1.0",
+ "backbone-deep-model": "~0.10.4",
+ "rivets": "~0.5.13",
+ "font-awesome": "~3.2.1"
}
-}
+}
\ No newline at end of file
diff --git a/bower_components/backbone-deep-model/.bower.json b/bower_components/backbone-deep-model/.bower.json
index 5fcad0cc..731c929f 100644
--- a/bower_components/backbone-deep-model/.bower.json
+++ b/bower_components/backbone-deep-model/.bower.json
@@ -9,6 +9,6 @@
"commit": "709ca367afa864253517f05690984179a0504664"
},
"_source": "git://github.com/powmedia/backbone-deep-model.git",
- "_target": "*",
+ "_target": "~0.10.4",
"_originalSource": "backbone-deep-model"
}
\ No newline at end of file
diff --git a/bower_components/backbone/.bower.json b/bower_components/backbone/.bower.json
index 998f6b4e..7cc42d12 100644
--- a/bower_components/backbone/.bower.json
+++ b/bower_components/backbone/.bower.json
@@ -1,14 +1,14 @@
{
"name": "backbone",
"homepage": "https://github.com/jashkenas/backbone",
- "version": "1.0.0",
- "_release": "1.0.0",
+ "version": "1.1.0",
+ "_release": "1.1.0",
"_resolution": {
"type": "version",
- "tag": "1.0.0",
- "commit": "699fe3271262043bb137bae97bd0003d6d193f27"
+ "tag": "1.1.0",
+ "commit": "0a4399e3de5cb2ab75a0338669582f18c1fae3ae"
},
"_source": "git://github.com/jashkenas/backbone.git",
- "_target": "*",
+ "_target": "~1.1.0",
"_originalSource": "backbone"
}
\ No newline at end of file
diff --git a/bower_components/backbone/CONTRIBUTING.md b/bower_components/backbone/CONTRIBUTING.md
index 5f4ff1a4..55403616 100644
--- a/bower_components/backbone/CONTRIBUTING.md
+++ b/bower_components/backbone/CONTRIBUTING.md
@@ -1,15 +1,20 @@
-## How to contribute to Backbone.js
+## 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/documentcloud/backbone/issues) for previous
+[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/test.html).
+[tests](http://backbonejs.org/test/).
* Use the same coding style as the rest of the
-[codebase](https://github.com/documentcloud/backbone/blob/master/backbone.js).
+[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.
diff --git a/bower_components/backbone/README.md b/bower_components/backbone/README.md
index 75aa0780..7b0482df 100644
--- a/bower_components/backbone/README.md
+++ b/bower_components/backbone/README.md
@@ -1,26 +1,29 @@
- ____ __ __
- /\ _`\ /\ \ /\ \ __
- \ \ \ \ \ __ ___\ \ \/'\\ \ \____ ___ ___ __ /\_\ ____
- \ \ _ <' /'__`\ /'___\ \ , < \ \ '__`\ / __`\ /' _ `\ /'__`\ \/\ \ /',__\
+ ____ __ __
+ /\ _`\ /\ \ /\ \ __
+ \ \ \ \ \ __ ___\ \ \/'\\ \ \____ ___ ___ __ /\_\ ____
+ \ \ _ <' /'__`\ /'___\ \ , < \ \ '__`\ / __`\ /' _ `\ /'__`\ \/\ \ /',__\
\ \ \ \ \/\ \ \.\_/\ \__/\ \ \\`\\ \ \ \ \/\ \ \ \/\ \/\ \/\ __/ __ \ \ \/\__, `\
\ \____/\ \__/.\_\ \____\\ \_\ \_\ \_,__/\ \____/\ \_\ \_\ \____\/\_\_\ \ \/\____/
- \/___/ \/__/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/_/\/_/\/____/\/_/\ \_\ \/___/
- \ \____/
- \/___/
+ \/___/ \/__/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/_/\/_/\/____/\/_/\ \_\ \/___/
+ \ \____/
+ \/___/
(_'_______________________________________________________________________________'_)
(_.———————————————————————————————————————————————————————————————————————————————._)
-
-
+
+
Backbone supplies structure to JavaScript-heavy applications by providing models 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, report a bug, or general discussion:
-http://github.com/documentcloud/backbone/issues/
+http://github.com/jashkenas/backbone/issues
+
+Backbone is an open-sourced component of DocumentCloud:
+https://github.com/documentcloud
-All contributors are listed here:
-http://github.com/documentcloud/backbone/contributors
+Many thanks to our contributors:
+http://github.com/jashkenas/backbone/contributors
-Special thanks to Robert Kieffer for the original philosophy behind Backbone.
+Special thanks to Robert Kieffer for the original philosophy behind Backbone.
http://github.com/broofa
diff --git a/bower_components/backbone/Rakefile b/bower_components/backbone/Rakefile
deleted file mode 100644
index e9723648..00000000
--- a/bower_components/backbone/Rakefile
+++ /dev/null
@@ -1,24 +0,0 @@
-desc "rebuild the backbone-min.js files for distribution"
-task :build do
- check 'uglifyjs', 'UglifyJS', 'https://github.com/mishoo/UglifyJS2'
- system 'uglifyjs backbone.js --source-map backbone-min.map -o backbone-min.js'
-end
-
-desc "build the docco documentation"
-task :doc do
- check 'docco', 'docco', 'https://github.com/jashkenas/docco'
- system 'docco backbone.js && docco examples/todos/todos.js examples/backbone.localstorage.js'
-end
-
-desc "run JavaScriptLint on the source"
-task :lint do
- check 'jsl', 'JavaScript Lint', 'http://www.javascriptlint.com/'
- system "jsl -nofilelisting -nologo -conf docs/jsl.conf -process backbone.js"
-end
-
-# Check for the existence of an executable.
-def check(exec, name, url)
- return unless `which #{exec}`.empty?
- puts "#{name} not found.\nInstall it from #{url}"
- exit
-end
diff --git a/bower_components/backbone/backbone-min.js b/bower_components/backbone/backbone-min.js
index 7243e5f0..3b2593dd 100644
--- a/bower_components/backbone/backbone-min.js
+++ b/bower_components/backbone/backbone-min.js
@@ -1,4 +1,2 @@
-(function(){var root=this;var previousBackbone=root.Backbone;var array=[];var push=array.push;var slice=array.slice;var splice=array.splice;var Backbone;if(typeof exports!=="undefined"){Backbone=exports}else{Backbone=root.Backbone={}}Backbone.VERSION="1.0.0";var _=root._;if(!_&&typeof require!=="undefined")_=require("underscore");Backbone.$=root.jQuery||root.Zepto||root.ender||root.$;Backbone.noConflict=function(){root.Backbone=previousBackbone;return this};Backbone.emulateHTTP=false;Backbone.emulateJSON=false;var Events=Backbone.Events={on:function(name,callback,context){if(!eventsApi(this,"on",name,[callback,context])||!callback)return this;this._events||(this._events={});var events=this._events[name]||(this._events[name]=[]);events.push({callback:callback,context:context,ctx:context||this});return this},once:function(name,callback,context){if(!eventsApi(this,"once",name,[callback,context])||!callback)return this;var self=this;var once=_.once(function(){self.off(name,once);callback.apply(this,arguments)});once._callback=callback;return this.on(name,once,context)},off:function(name,callback,context){var retain,ev,events,names,i,l,j,k;if(!this._events||!eventsApi(this,"off",name,[callback,context]))return this;if(!name&&!callback&&!context){this._events={};return this}names=name?[name]:_.keys(this._events);for(i=0,l=names.length;i").attr(attrs);this.setElement($el,false)}else{this.setElement(_.result(this,"el"),false)}}});Backbone.sync=function(method,model,options){var type=methodMap[method];_.defaults(options||(options={}),{emulateHTTP:Backbone.emulateHTTP,emulateJSON:Backbone.emulateJSON});var params={type:type,dataType:"json"};if(!options.url){params.url=_.result(model,"url")||urlError()}if(options.data==null&&model&&(method==="create"||method==="update"||method==="patch")){params.contentType="application/json";params.data=JSON.stringify(options.attrs||model.toJSON(options))}if(options.emulateJSON){params.contentType="application/x-www-form-urlencoded";params.data=params.data?{model:params.data}:{}}if(options.emulateHTTP&&(type==="PUT"||type==="DELETE"||type==="PATCH")){params.type="POST";if(options.emulateJSON)params.data._method=type;var beforeSend=options.beforeSend;options.beforeSend=function(xhr){xhr.setRequestHeader("X-HTTP-Method-Override",type);if(beforeSend)return beforeSend.apply(this,arguments)}}if(params.type!=="GET"&&!options.emulateJSON){params.processData=false}if(params.type==="PATCH"&&window.ActiveXObject&&!(window.external&&window.external.msActiveXFilteringEnabled)){params.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var xhr=options.xhr=Backbone.ajax(_.extend(params,options));model.trigger("request",model,xhr,options);return xhr};var methodMap={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};Backbone.ajax=function(){return Backbone.$.ajax.apply(Backbone.$,arguments)};var Router=Backbone.Router=function(options){options||(options={});if(options.routes)this.routes=options.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var optionalParam=/\((.*?)\)/g;var namedParam=/(\(\?)?:\w+/g;var splatParam=/\*\w+/g;var escapeRegExp=/[\-{}\[\]+?.,\\\^$|#\s]/g;_.extend(Router.prototype,Events,{initialize:function(){},route:function(route,name,callback){if(!_.isRegExp(route))route=this._routeToRegExp(route);if(_.isFunction(name)){callback=name;name=""}if(!callback)callback=this[name];var router=this;Backbone.history.route(route,function(fragment){var args=router._extractParameters(route,fragment);callback&&callback.apply(router,args);router.trigger.apply(router,["route:"+name].concat(args));router.trigger("route",name,args);Backbone.history.trigger("route",router,name,args)});return this},navigate:function(fragment,options){Backbone.history.navigate(fragment,options);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=_.result(this,"routes");var route,routes=_.keys(this.routes);while((route=routes.pop())!=null){this.route(route,this.routes[route])}},_routeToRegExp:function(route){route=route.replace(escapeRegExp,"\\$&").replace(optionalParam,"(?:$1)?").replace(namedParam,function(match,optional){return optional?match:"([^/]+)"}).replace(splatParam,"(.*?)");return new RegExp("^"+route+"$")},_extractParameters:function(route,fragment){var params=route.exec(fragment).slice(1);return _.map(params,function(param){return param?decodeURIComponent(param):null})}});var History=Backbone.History=function(){this.handlers=[];_.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var routeStripper=/^[#\/]|\s+$/g;var rootStripper=/^\/+|\/+$/g;var isExplorer=/msie [\w.]+/;var trailingSlash=/\/$/;History.started=false;_.extend(History.prototype,Events,{interval:50,getHash:function(window){var match=(window||this).location.href.match(/#(.*)$/);return match?match[1]:""},getFragment:function(fragment,forcePushState){if(fragment==null){if(this._hasPushState||!this._wantsHashChange||forcePushState){fragment=this.location.pathname;var root=this.root.replace(trailingSlash,"");if(!fragment.indexOf(root))fragment=fragment.substr(root.length)}else{fragment=this.getHash()}}return fragment.replace(routeStripper,"")},start:function(options){if(History.started)throw new Error("Backbone.history has already been started");History.started=true;this.options=_.extend({},{root:"/"},this.options,options);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var fragment=this.getFragment();var docMode=document.documentMode;var oldIE=isExplorer.exec(navigator.userAgent.toLowerCase())&&(!docMode||docMode<=7);this.root=("/"+this.root+"/").replace(rootStripper,"/");if(oldIE&&this._wantsHashChange){this.iframe=Backbone.$('').hide().appendTo("body")[0].contentWindow;this.navigate(fragment)}if(this._hasPushState){Backbone.$(window).on("popstate",this.checkUrl)}else if(this._wantsHashChange&&"onhashchange"in window&&!oldIE){Backbone.$(window).on("hashchange",this.checkUrl)}else if(this._wantsHashChange){this._checkUrlInterval=setInterval(this.checkUrl,this.interval)}this.fragment=fragment;var loc=this.location;var atRoot=loc.pathname.replace(/[^\/]$/,"$&/")===this.root;if(this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!atRoot){this.fragment=this.getFragment(null,true);this.location.replace(this.root+this.location.search+"#"+this.fragment);return true}else if(this._wantsPushState&&this._hasPushState&&atRoot&&loc.hash){this.fragment=this.getHash().replace(routeStripper,"");this.history.replaceState({},document.title,this.root+this.fragment+loc.search)}if(!this.options.silent)return this.loadUrl()},stop:function(){Backbone.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl);clearInterval(this._checkUrlInterval);History.started=false},route:function(route,callback){this.handlers.unshift({route:route,callback:callback})},checkUrl:function(e){var current=this.getFragment();if(current===this.fragment&&this.iframe){current=this.getFragment(this.getHash(this.iframe))}if(current===this.fragment)return false;if(this.iframe)this.navigate(current);this.loadUrl()||this.loadUrl(this.getHash())},loadUrl:function(fragmentOverride){var fragment=this.fragment=this.getFragment(fragmentOverride);var matched=_.any(this.handlers,function(handler){if(handler.route.test(fragment)){handler.callback(fragment);return true}});return matched},navigate:function(fragment,options){if(!History.started)return false;if(!options||options===true)options={trigger:options};fragment=this.getFragment(fragment||"");if(this.fragment===fragment)return;this.fragment=fragment;var url=this.root+fragment;if(this._hasPushState){this.history[options.replace?"replaceState":"pushState"]({},document.title,url)}else if(this._wantsHashChange){this._updateHash(this.location,fragment,options.replace);if(this.iframe&&fragment!==this.getFragment(this.getHash(this.iframe))){if(!options.replace)this.iframe.document.open().close();this._updateHash(this.iframe.location,fragment,options.replace)}}else{return this.location.assign(url)}if(options.trigger)this.loadUrl(fragment)},_updateHash:function(location,fragment,replace){if(replace){var href=location.href.replace(/(javascript:|#).*$/,"");location.replace(href+"#"+fragment)}else{location.hash="#"+fragment}}});Backbone.history=new History;var extend=function(protoProps,staticProps){var parent=this;var child;if(protoProps&&_.has(protoProps,"constructor")){child=protoProps.constructor}else{child=function(){return parent.apply(this,arguments)}}_.extend(child,parent,staticProps);var Surrogate=function(){this.constructor=child};Surrogate.prototype=parent.prototype;child.prototype=new Surrogate;if(protoProps)_.extend(child.prototype,protoProps);child.__super__=parent.prototype;return child};Model.extend=Collection.extend=Router.extend=View.extend=History.extend=extend;var urlError=function(){throw new Error('A "url" property or function must be specified')};var wrapError=function(model,options){var error=options.error;options.error=function(resp){if(error)error(model,resp,options);model.trigger("error",model,resp,options)}}}).call(this);
-/*
-//@ sourceMappingURL=backbone-min.map
-*/
\ No newline at end of file
+(function(){var t=this;var e=t.Backbone;var i=[];var r=i.push;var s=i.slice;var n=i.splice;var a;if(typeof exports!=="undefined"){a=exports}else{a=t.Backbone={}}a.VERSION="1.1.0";var h=t._;if(!h&&typeof require!=="undefined")h=require("underscore");a.$=t.jQuery||t.Zepto||t.ender||t.$;a.noConflict=function(){t.Backbone=e;return this};a.emulateHTTP=false;a.emulateJSON=false;var o=a.Events={on:function(t,e,i){if(!l(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,i){if(!l(this,"once",t,[e,i])||!e)return this;var r=this;var s=h.once(function(){r.off(t,s);e.apply(this,arguments)});s._callback=e;return this.on(t,s,i)},off:function(t,e,i){var r,s,n,a,o,u,c,f;if(!this._events||!l(this,"off",t,[e,i]))return this;if(!t&&!e&&!i){this._events={};return this}a=t?[t]:h.keys(this._events);for(o=0,u=a.length;o").attr(t);this.setElement(e,false)}else{this.setElement(h.result(this,"el"),false)}}});a.sync=function(t,e,i){var r=T[t];h.defaults(i||(i={}),{emulateHTTP:a.emulateHTTP,emulateJSON:a.emulateJSON});var s={type:r,dataType:"json"};if(!i.url){s.url=h.result(e,"url")||U()}if(i.data==null&&e&&(t==="create"||t==="update"||t==="patch")){s.contentType="application/json";s.data=JSON.stringify(i.attrs||e.toJSON(i))}if(i.emulateJSON){s.contentType="application/x-www-form-urlencoded";s.data=s.data?{model:s.data}:{}}if(i.emulateHTTP&&(r==="PUT"||r==="DELETE"||r==="PATCH")){s.type="POST";if(i.emulateJSON)s.data._method=r;var n=i.beforeSend;i.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",r);if(n)return n.apply(this,arguments)}}if(s.type!=="GET"&&!i.emulateJSON){s.processData=false}if(s.type==="PATCH"&&E){s.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var o=i.xhr=a.ajax(h.extend(s,i));e.trigger("request",e,o,i);return o};var E=typeof window!=="undefined"&&!!window.ActiveXObject&&!(window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent);var T={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};a.ajax=function(){return a.$.ajax.apply(a.$,arguments)};var k=a.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var S=/\((.*?)\)/g;var $=/(\(\?)?:\w+/g;var H=/\*\w+/g;var A=/[\-{}\[\]+?.,\\\^$|#\s]/g;h.extend(k.prototype,o,{initialize:function(){},route:function(t,e,i){if(!h.isRegExp(t))t=this._routeToRegExp(t);if(h.isFunction(e)){i=e;e=""}if(!i)i=this[e];var r=this;a.history.route(t,function(s){var n=r._extractParameters(t,s);i&&i.apply(r,n);r.trigger.apply(r,["route:"+e].concat(n));r.trigger("route",e,n);a.history.trigger("route",r,e,n)});return this},navigate:function(t,e){a.history.navigate(t,e);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=h.result(this,"routes");var t,e=h.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(A,"\\$&").replace(S,"(?:$1)?").replace($,function(t,e){return e?t:"([^/]+)"}).replace(H,"(.*?)");return new RegExp("^"+t+"$")},_extractParameters:function(t,e){var i=t.exec(e).slice(1);return h.map(i,function(t){return t?decodeURIComponent(t):null})}});var I=a.History=function(){this.handlers=[];h.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var N=/^[#\/]|\s+$/g;var O=/^\/+|\/+$/g;var P=/msie [\w.]+/;var C=/\/$/;var j=/[?#].*$/;I.started=false;h.extend(I.prototype,o,{interval:50,getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(t==null){if(this._hasPushState||!this._wantsHashChange||e){t=this.location.pathname;var i=this.root.replace(C,"");if(!t.indexOf(i))t=t.slice(i.length)}else{t=this.getHash()}}return t.replace(N,"")},start:function(t){if(I.started)throw new Error("Backbone.history has already been started");I.started=true;this.options=h.extend({root:"/"},this.options,t);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var e=this.getFragment();var i=document.documentMode;var r=P.exec(navigator.userAgent.toLowerCase())&&(!i||i<=7);this.root=("/"+this.root+"/").replace(O,"/");if(r&&this._wantsHashChange){this.iframe=a.$('').hide().appendTo("body")[0].contentWindow;this.navigate(e)}if(this._hasPushState){a.$(window).on("popstate",this.checkUrl)}else if(this._wantsHashChange&&"onhashchange"in window&&!r){a.$(window).on("hashchange",this.checkUrl)}else if(this._wantsHashChange){this._checkUrlInterval=setInterval(this.checkUrl,this.interval)}this.fragment=e;var s=this.location;var n=s.pathname.replace(/[^\/]$/,"$&/")===this.root;if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!n){this.fragment=this.getFragment(null,true);this.location.replace(this.root+this.location.search+"#"+this.fragment);return true}else if(this._hasPushState&&n&&s.hash){this.fragment=this.getHash().replace(N,"");this.history.replaceState({},document.title,this.root+this.fragment+s.search)}}if(!this.options.silent)return this.loadUrl()},stop:function(){a.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl);clearInterval(this._checkUrlInterval);I.started=false},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe){e=this.getFragment(this.getHash(this.iframe))}if(e===this.fragment)return false;if(this.iframe)this.navigate(e);this.loadUrl()},loadUrl:function(t){t=this.fragment=this.getFragment(t);return h.any(this.handlers,function(e){if(e.route.test(t)){e.callback(t);return true}})},navigate:function(t,e){if(!I.started)return false;if(!e||e===true)e={trigger:!!e};var i=this.root+(t=this.getFragment(t||""));t=t.replace(j,"");if(this.fragment===t)return;this.fragment=t;if(t===""&&i!=="/")i=i.slice(0,-1);if(this._hasPushState){this.history[e.replace?"replaceState":"pushState"]({},document.title,i)}else if(this._wantsHashChange){this._updateHash(this.location,t,e.replace);if(this.iframe&&t!==this.getFragment(this.getHash(this.iframe))){if(!e.replace)this.iframe.document.open().close();this._updateHash(this.iframe.location,t,e.replace)}}else{return this.location.assign(i)}if(e.trigger)return this.loadUrl(t)},_updateHash:function(t,e,i){if(i){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else{t.hash="#"+e}}});a.history=new I;var R=function(t,e){var i=this;var r;if(t&&h.has(t,"constructor")){r=t.constructor}else{r=function(){return i.apply(this,arguments)}}h.extend(r,i,e);var s=function(){this.constructor=r};s.prototype=i.prototype;r.prototype=new s;if(t)h.extend(r.prototype,t);r.__super__=i.prototype;return r};d.extend=v.extend=k.extend=w.extend=I.extend=R;var U=function(){throw new Error('A "url" property or function must be specified')};var M=function(t,e){var i=e.error;e.error=function(r){if(i)i(t,r,e);t.trigger("error",t,r,e)}}}).call(this);
+//# sourceMappingURL=backbone-min.map
\ No newline at end of file
diff --git a/bower_components/backbone/backbone-min.map b/bower_components/backbone/backbone-min.map
index 5d6ad350..b346c290 100644
--- a/bower_components/backbone/backbone-min.map
+++ b/bower_components/backbone/backbone-min.map
@@ -1 +1 @@
-{"version":3,"file":"backbone-min.js","sources":["backbone.js"],"names":["root","this","previousBackbone","Backbone","array","push","slice","splice","exports","VERSION","_","require","$","jQuery","Zepto","ender","noConflict","emulateHTTP","emulateJSON","Events","on","name","callback","context","eventsApi","_events","events","ctx","once","self","off","apply","arguments","_callback","retain","ev","names","i","l","j","k","keys","length","trigger","args","call","allEvents","all","triggerEvents","stopListening","obj","listeners","_listeners","deleteListener","_listenerId","id","eventSplitter","action","rest","key","concat","test","split","a1","a2","a3","listenMethods","listenTo","listenToOnce","each","implementation","method","uniqueId","bind","unbind","extend","Model","attributes","options","defaults","attrs","cid","pick","modelOptions","parse","result","set","changed","initialize","prototype","validationError","idAttribute","toJSON","clone","sync","get","attr","escape","has","val","unset","changes","silent","changing","prev","current","_validate","_changing","_previousAttributes","isEqual","_pending","clear","hasChanged","isEmpty","changedAttributes","diff","old","previous","previousAttributes","fetch","model","success","resp","wrapError","save","xhr","wait","validate","serverAttrs","isObject","isNew","patch","destroy","collection","url","base","urlError","charAt","encodeURIComponent","constructor","isValid","error","modelMethods","unshift","Collection","models","comparator","_reset","reset","setOptions","add","remove","merge","addOptions","map","isArray","index","_byId","indexOf","_removeReference","existing","sort","at","sortable","sortAttr","isString","toAdd","toRemove","modelMap","_prepareModel","_onModelEvent","previousModels","pop","shift","begin","end","where","first","findWhere","Error","sortBy","sortedIndex","value","iterator","isFunction","pluck","invoke","create","event","methods","attributeMethods","View","_configure","_ensureElement","delegateEvents","delegateEventSplitter","viewOptions","tagName","selector","$el","find","render","setElement","element","delegate","undelegateEvents","el","match","eventName","className","type","methodMap","params","dataType","data","contentType","JSON","stringify","_method","beforeSend","setRequestHeader","processData","window","ActiveXObject","external","msActiveXFilteringEnabled","ajax","update","delete","read","Router","routes","_bindRoutes","optionalParam","namedParam","splatParam","escapeRegExp","route","isRegExp","_routeToRegExp","router","history","fragment","_extractParameters","navigate","replace","optional","RegExp","exec","param","decodeURIComponent","History","handlers","bindAll","location","routeStripper","rootStripper","isExplorer","trailingSlash","started","interval","getHash","href","getFragment","forcePushState","_hasPushState","_wantsHashChange","pathname","substr","start","hashChange","_wantsPushState","pushState","docMode","document","documentMode","oldIE","navigator","userAgent","toLowerCase","iframe","hide","appendTo","contentWindow","checkUrl","_checkUrlInterval","setInterval","loc","atRoot","search","hash","replaceState","title","loadUrl","stop","clearInterval","e","fragmentOverride","matched","any","handler","_updateHash","open","close","assign","protoProps","staticProps","parent","child","Surrogate","__super__"],"mappings":"CAOA,WAOE,GAAIA,MAAOC,IAIX,IAAIC,kBAAmBF,KAAKG,QAG5B,IAAIC,SACJ,IAAIC,MAAOD,MAAMC,IACjB,IAAIC,OAAQF,MAAME,KAClB,IAAIC,QAASH,MAAMG,MAInB,IAAIJ,SACJ,UAAWK,WAAY,YAAa,CAClCL,SAAWK,YACN,CACLL,SAAWH,KAAKG,YAIlBA,SAASM,QAAU,OAGnB,IAAIC,GAAIV,KAAKU,CACb,KAAKA,SAAaC,WAAY,YAAcD,EAAIC,QAAQ,aAIxDR,UAASS,EAAIZ,KAAKa,QAAUb,KAAKc,OAASd,KAAKe,OAASf,KAAKY,CAI7DT,UAASa,WAAa,WACpBhB,KAAKG,SAAWD,gBAChB,OAAOD,MAMTE,UAASc,YAAc,KAMvBd,UAASe,YAAc,KAevB,IAAIC,QAAShB,SAASgB,QAIpBC,GAAI,SAASC,KAAMC,SAAUC,SAC3B,IAAKC,UAAUvB,KAAM,KAAMoB,MAAOC,SAAUC,YAAcD,SAAU,MAAOrB,KAC3EA,MAAKwB,UAAYxB,KAAKwB,WACtB,IAAIC,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M+B,YAIhDtB,EAAEiE,OAAOyO,MAAOD,OAAQD,YAIxB,IAAIG,WAAY,WAAYpT,KAAK0I,YAAcyK,MAC/CC,WAAU5N,UAAY0N,OAAO1N,SAC7B2N,OAAM3N,UAAY,GAAI4N,UAItB,IAAIJ,WAAYvS,EAAEiE,OAAOyO,MAAM3N,UAAWwN,WAI1CG,OAAME,UAAYH,OAAO1N,SAEzB,OAAO2N,OAITxO,OAAMD,OAASqE,WAAWrE,OAAS2J,OAAO3J,OAASoH,KAAKpH,OAASgL,QAAQhL,OAASA,MAGlF,IAAI6D,UAAW,WACb,KAAM,IAAI2C,OAAM,kDAIlB,IAAIxD,WAAY,SAAUH,MAAO1C,SAC/B,GAAI+D,OAAQ/D,QAAQ+D,KACpB/D,SAAQ+D,MAAQ,SAASnB,MACvB,GAAImB,MAAOA,MAAMrB,MAAOE,KAAM5C,QAC9B0C,OAAM7E,QAAQ,QAAS6E,MAAOE,KAAM5C,aAIvCjC,KAAK5C"}
\ No newline at end of file
+{"version":3,"file":"backbone-min.js","sources":["backbone.js"],"names":["root","this","previousBackbone","Backbone","array","push","slice","splice","exports","VERSION","_","require","$","jQuery","Zepto","ender","noConflict","emulateHTTP","emulateJSON","Events","on","name","callback","context","eventsApi","_events","events","ctx","once","self","off","apply","arguments","_callback","retain","ev","names","i","l","j","k","keys","length","trigger","args","call","allEvents","all","triggerEvents","stopListening","obj","listeningTo","_listeningTo","remove","_listenId","id","isEmpty","eventSplitter","action","rest","key","concat","test","split","a1","a2","a3","listenMethods","listenTo","listenToOnce","each","implementation","method","uniqueId","bind","unbind","extend","Model","attributes","options","attrs","cid","collection","parse","defaults","result","set","changed","initialize","prototype","validationError","idAttribute","toJSON","clone","sync","get","attr","escape","has","val","unset","changes","silent","changing","prev","current","_validate","_changing","_previousAttributes","isEqual","_pending","clear","hasChanged","changedAttributes","diff","old","previous","previousAttributes","fetch","model","success","resp","wrapError","save","xhr","validate","wait","serverAttrs","isObject","isNew","patch","destroy","url","base","urlError","charAt","encodeURIComponent","constructor","isValid","error","modelMethods","unshift","Collection","models","comparator","_reset","reset","setOptions","add","merge","addOptions","map","singular","isArray","index","_byId","indexOf","_removeReference","existing","sort","at","targetModel","sortable","sortAttr","isString","toAdd","toRemove","modelMap","order","_prepareModel","_onModelEvent","orderedModels","previousModels","pop","shift","where","first","findWhere","Error","sortBy","pluck","invoke","create","event","methods","attributeMethods","value","iterator","isFunction","View","pick","viewOptions","_ensureElement","delegateEvents","delegateEventSplitter","tagName","selector","$el","find","render","setElement","element","delegate","undelegateEvents","el","match","eventName","className","type","methodMap","params","dataType","data","contentType","JSON","stringify","_method","beforeSend","setRequestHeader","processData","noXhrPatch","ActiveXObject","ajax","window","XMLHttpRequest","dispatchEvent","update","delete","read","Router","routes","_bindRoutes","optionalParam","namedParam","splatParam","escapeRegExp","route","isRegExp","_routeToRegExp","router","history","fragment","_extractParameters","navigate","replace","optional","RegExp","exec","param","decodeURIComponent","History","handlers","bindAll","location","routeStripper","rootStripper","isExplorer","trailingSlash","pathStripper","started","interval","getHash","href","getFragment","forcePushState","_hasPushState","_wantsHashChange","pathname","start","hashChange","_wantsPushState","pushState","docMode","document","documentMode","oldIE","navigator","userAgent","toLowerCase","iframe","hide","appendTo","contentWindow","checkUrl","_checkUrlInterval","setInterval","loc","atRoot","search","hash","replaceState","title","loadUrl","stop","clearInterval","e","any","handler","_updateHash","open","close","assign","protoProps","staticProps","parent","child","Surrogate","__super__"],"mappings":"CAQA,WAOE,GAAIA,GAAOC,IAIX,IAAIC,GAAmBF,EAAKG,QAG5B,IAAIC,KACJ,IAAIC,GAAOD,EAAMC,IACjB,IAAIC,GAAQF,EAAME,KAClB,IAAIC,GAASH,EAAMG,MAInB,IAAIJ,EACJ,UAAWK,WAAY,YAAa,CAClCL,EAAWK,YACN,CACLL,EAAWH,EAAKG,YAIlBA,EAASM,QAAU,OAGnB,IAAIC,GAAIV,EAAKU,CACb,KAAKA,SAAaC,WAAY,YAAcD,EAAIC,QAAQ,aA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,EAAOA,EAAMpB,EAAOE,EAAM1C,EAC9BwC,GAAM5E,QAAQ,QAAS4E,EAAOE,EAAM1C,OAIvClC,KAAK5C"}
\ No newline at end of file
diff --git a/bower_components/backbone/backbone.js b/bower_components/backbone/backbone.js
index 3512d42f..f7783c2c 100644
--- a/bower_components/backbone/backbone.js
+++ b/bower_components/backbone/backbone.js
@@ -1,6 +1,7 @@
-// Backbone.js 1.0.0
+// Backbone.js 1.1.0
-// (c) 2010-2013 Jeremy Ashkenas, DocumentCloud Inc.
+// (c) 2010-2011 Jeremy Ashkenas, DocumentCloud Inc.
+// (c) 2011-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Backbone may be freely distributed under the MIT license.
// For all details and documentation:
// http://backbonejs.org
@@ -34,7 +35,7 @@
}
// Current version of the library. Keep in sync with `package.json`.
- Backbone.VERSION = '1.0.0';
+ Backbone.VERSION = '1.1.0';
// Require Underscore, if we're on the server, and it's not already present.
var _ = root._;
@@ -52,7 +53,7 @@
};
// Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option
- // will fake `"PUT"` and `"DELETE"` requests via the `_method` parameter and
+ // will fake `"PATCH"`, `"PUT"` and `"DELETE"` requests via the `_method` parameter and
// set a `X-Http-Method-Override` header.
Backbone.emulateHTTP = false;
@@ -111,7 +112,6 @@
this._events = {};
return this;
}
-
names = name ? [name] : _.keys(this._events);
for (i = 0, l = names.length; i < l; i++) {
name = names[i];
@@ -151,14 +151,15 @@
// Tell this object to stop listening to either specific events ... or
// to every object it's currently listening to.
stopListening: function(obj, name, callback) {
- var listeners = this._listeners;
- if (!listeners) return this;
- var deleteListener = !name && !callback;
- if (typeof name === 'object') callback = this;
- if (obj) (listeners = {})[obj._listenerId] = obj;
- for (var id in listeners) {
- listeners[id].off(name, callback, this);
- if (deleteListener) delete this._listeners[id];
+ var listeningTo = this._listeningTo;
+ if (!listeningTo) return this;
+ var remove = !name && !callback;
+ if (!callback && typeof name === 'object') callback = this;
+ if (obj) (listeningTo = {})[obj._listenId] = obj;
+ for (var id in listeningTo) {
+ obj = listeningTo[id];
+ obj.off(name, callback, this);
+ if (remove || _.isEmpty(obj._events)) delete this._listeningTo[id];
}
return this;
}
@@ -215,10 +216,10 @@
// listening to.
_.each(listenMethods, function(implementation, method) {
Events[method] = function(obj, name, callback) {
- var listeners = this._listeners || (this._listeners = {});
- var id = obj._listenerId || (obj._listenerId = _.uniqueId('l'));
- listeners[id] = obj;
- if (typeof name === 'object') callback = this;
+ var listeningTo = this._listeningTo || (this._listeningTo = {});
+ var id = obj._listenId || (obj._listenId = _.uniqueId('l'));
+ listeningTo[id] = obj;
+ if (!callback && typeof name === 'object') callback = this;
obj[implementation](name, callback, this);
return this;
};
@@ -243,24 +244,18 @@
// Create a new model with the specified attributes. A client id (`cid`)
// is automatically generated and assigned for you.
var Model = Backbone.Model = function(attributes, options) {
- var defaults;
var attrs = attributes || {};
options || (options = {});
this.cid = _.uniqueId('c');
this.attributes = {};
- _.extend(this, _.pick(options, modelOptions));
+ if (options.collection) this.collection = options.collection;
if (options.parse) attrs = this.parse(attrs, options) || {};
- if (defaults = _.result(this, 'defaults')) {
- attrs = _.defaults({}, attrs, defaults);
- }
+ attrs = _.defaults({}, attrs, _.result(this, 'defaults'));
this.set(attrs, options);
this.changed = {};
this.initialize.apply(this, arguments);
};
- // A list of options to be attached directly to the model, if provided.
- var modelOptions = ['url', 'urlRoot', 'collection'];
-
// Attach all inheritable methods to the Model prototype.
_.extend(Model.prototype, Events, {
@@ -456,13 +451,16 @@
(attrs = {})[key] = val;
}
- // If we're not waiting and attributes exist, save acts as `set(attr).save(null, opts)`.
- if (attrs && (!options || !options.wait) && !this.set(attrs, options)) return false;
-
options = _.extend({validate: true}, options);
- // Do not persist invalid models.
- if (!this._validate(attrs, options)) return false;
+ // If we're not waiting and attributes exist, save acts as
+ // `set(attr).save(null, opts)` with validation. Otherwise, check if
+ // the model will be valid when the attributes, if any, are set.
+ if (attrs && !options.wait) {
+ if (!this.set(attrs, options)) return false;
+ } else {
+ if (!this._validate(attrs, options)) return false;
+ }
// Set temporary attributes if `{wait: true}`.
if (attrs && options.wait) {
@@ -563,7 +561,7 @@
attrs = _.extend({}, this.attributes, attrs);
var error = this.validationError = this.validate(attrs, options) || null;
if (!error) return true;
- this.trigger('invalid', this, error, _.extend(options || {}, {validationError: error}));
+ this.trigger('invalid', this, error, _.extend(options, {validationError: error}));
return false;
}
@@ -596,7 +594,6 @@
// its models in sort order, as they're added and removed.
var Collection = Backbone.Collection = function(models, options) {
options || (options = {});
- if (options.url) this.url = options.url;
if (options.model) this.model = options.model;
if (options.comparator !== void 0) this.comparator = options.comparator;
this._reset();
@@ -606,7 +603,7 @@
// Default options for `Collection#set`.
var setOptions = {add: true, remove: true, merge: true};
- var addOptions = {add: true, merge: false, remove: false};
+ var addOptions = {add: true, remove: false};
// Define the Collection's inheritable methods.
_.extend(Collection.prototype, Events, {
@@ -632,16 +629,17 @@
// Add a model, or list of models to the set.
add: function(models, options) {
- return this.set(models, _.defaults(options || {}, addOptions));
+ return this.set(models, _.extend({merge: false}, options, addOptions));
},
// Remove a model, or a list of models from the set.
remove: function(models, options) {
- models = _.isArray(models) ? models.slice() : [models];
+ var singular = !_.isArray(models);
+ models = singular ? [models] : _.clone(models);
options || (options = {});
var i, l, index, model;
for (i = 0, l = models.length; i < l; i++) {
- model = this.get(models[i]);
+ model = models[i] = this.get(models[i]);
if (!model) continue;
delete this._byId[model.id];
delete this._byId[model.cid];
@@ -654,7 +652,7 @@
}
this._removeReference(model);
}
- return this;
+ return singular ? models[0] : models;
},
// Update a collection by `set`-ing a new list of models, adding new ones,
@@ -662,31 +660,45 @@
// already exist in the collection, as necessary. Similar to **Model#set**,
// the core operation for updating the data contained by the collection.
set: function(models, options) {
- options = _.defaults(options || {}, setOptions);
+ options = _.defaults({}, options, setOptions);
if (options.parse) models = this.parse(models, options);
- if (!_.isArray(models)) models = models ? [models] : [];
- var i, l, model, attrs, existing, sort;
+ var singular = !_.isArray(models);
+ models = singular ? (models ? [models] : []) : _.clone(models);
+ var i, l, id, model, attrs, existing, sort;
var at = options.at;
+ var targetModel = this.model;
var sortable = this.comparator && (at == null) && options.sort !== false;
var sortAttr = _.isString(this.comparator) ? this.comparator : null;
var toAdd = [], toRemove = [], modelMap = {};
+ var add = options.add, merge = options.merge, remove = options.remove;
+ var order = !sortable && add && remove ? [] : false;
// Turn bare objects into model references, and prevent invalid models
// from being added.
for (i = 0, l = models.length; i < l; i++) {
- if (!(model = this._prepareModel(models[i], options))) continue;
+ attrs = models[i];
+ if (attrs instanceof Model) {
+ id = model = attrs;
+ } else {
+ id = attrs[targetModel.prototype.idAttribute];
+ }
// If a duplicate is found, prevent it from being added and
// optionally merge it into the existing model.
- if (existing = this.get(model)) {
- if (options.remove) modelMap[existing.cid] = true;
- if (options.merge) {
- existing.set(model.attributes, options);
+ if (existing = this.get(id)) {
+ if (remove) modelMap[existing.cid] = true;
+ if (merge) {
+ attrs = attrs === model ? model.attributes : attrs;
+ if (options.parse) attrs = existing.parse(attrs, options);
+ existing.set(attrs, options);
if (sortable && !sort && existing.hasChanged(sortAttr)) sort = true;
}
+ models[i] = existing;
- // This is a new model, push it to the `toAdd` list.
- } else if (options.add) {
+ // If this is a new, valid model, push it to the `toAdd` list.
+ } else if (add) {
+ model = models[i] = this._prepareModel(attrs, options);
+ if (!model) continue;
toAdd.push(model);
// Listen to added models' events, and index models for lookup by
@@ -695,10 +707,11 @@
this._byId[model.cid] = model;
if (model.id != null) this._byId[model.id] = model;
}
+ if (order) order.push(existing || model);
}
// Remove nonexistent models if appropriate.
- if (options.remove) {
+ if (remove) {
for (i = 0, l = this.length; i < l; ++i) {
if (!modelMap[(model = this.models[i]).cid]) toRemove.push(model);
}
@@ -706,29 +719,35 @@
}
// See if sorting is needed, update `length` and splice in new models.
- if (toAdd.length) {
+ if (toAdd.length || (order && order.length)) {
if (sortable) sort = true;
this.length += toAdd.length;
if (at != null) {
- splice.apply(this.models, [at, 0].concat(toAdd));
+ for (i = 0, l = toAdd.length; i < l; i++) {
+ this.models.splice(at + i, 0, toAdd[i]);
+ }
} else {
- push.apply(this.models, toAdd);
+ if (order) this.models.length = 0;
+ var orderedModels = order || toAdd;
+ for (i = 0, l = orderedModels.length; i < l; i++) {
+ this.models.push(orderedModels[i]);
+ }
}
}
// Silently sort the collection if appropriate.
if (sort) this.sort({silent: true});
- if (options.silent) return this;
-
- // Trigger `add` events.
- for (i = 0, l = toAdd.length; i < l; i++) {
- (model = toAdd[i]).trigger('add', model, this, options);
+ // Unless silenced, it's time to fire all appropriate add/sort events.
+ if (!options.silent) {
+ for (i = 0, l = toAdd.length; i < l; i++) {
+ (model = toAdd[i]).trigger('add', model, this, options);
+ }
+ if (sort || (order && order.length)) this.trigger('sort', this, options);
}
-
- // Trigger `sort` if the collection was sorted.
- if (sort) this.trigger('sort', this, options);
- return this;
+
+ // Return the added (or merged) model (or models).
+ return singular ? models[0] : models;
},
// When you have more items than you want to add or remove individually,
@@ -742,16 +761,14 @@
}
options.previousModels = this.models;
this._reset();
- this.add(models, _.extend({silent: true}, options));
+ models = this.add(models, _.extend({silent: true}, options));
if (!options.silent) this.trigger('reset', this, options);
- return this;
+ return models;
},
// Add a model to the end of the collection.
push: function(model, options) {
- model = this._prepareModel(model, options);
- this.add(model, _.extend({at: this.length}, options));
- return model;
+ return this.add(model, _.extend({at: this.length}, options));
},
// Remove a model from the end of the collection.
@@ -763,9 +780,7 @@
// Add a model to the beginning of the collection.
unshift: function(model, options) {
- model = this._prepareModel(model, options);
- this.add(model, _.extend({at: 0}, options));
- return model;
+ return this.add(model, _.extend({at: 0}, options));
},
// Remove a model from the beginning of the collection.
@@ -776,14 +791,14 @@
},
// Slice out a sub-array of models from the collection.
- slice: function(begin, end) {
- return this.models.slice(begin, end);
+ slice: function() {
+ return slice.apply(this.models, arguments);
},
// Get a model from the set by id.
get: function(obj) {
if (obj == null) return void 0;
- return this._byId[obj.id != null ? obj.id : obj.cid || obj];
+ return this._byId[obj.id] || this._byId[obj.cid] || this._byId[obj];
},
// Get the model at the given index.
@@ -827,16 +842,6 @@
return this;
},
- // Figure out the smallest index at which a model should be inserted so as
- // to maintain order.
- sortedIndex: function(model, value, context) {
- value || (value = this.comparator);
- var iterator = _.isFunction(value) ? value : function(model) {
- return model.get(value);
- };
- return _.sortedIndex(this.models, model, iterator, context);
- },
-
// Pluck an attribute from each model in the collection.
pluck: function(attr) {
return _.invoke(this.models, 'get', attr);
@@ -869,7 +874,7 @@
if (!options.wait) this.add(model, options);
var collection = this;
var success = options.success;
- options.success = function(resp) {
+ options.success = function(model, resp, options) {
if (options.wait) collection.add(model, options);
if (success) success(model, resp, options);
};
@@ -903,14 +908,12 @@
if (!attrs.collection) attrs.collection = this;
return attrs;
}
- options || (options = {});
+ options = options ? _.clone(options) : {};
options.collection = this;
var model = new this.model(attrs, options);
- if (!model._validate(attrs, options)) {
- this.trigger('invalid', this, attrs, options);
- return false;
- }
- return model;
+ if (!model.validationError) return model;
+ this.trigger('invalid', this, model.validationError, options);
+ return false;
},
// Internal method to sever a model's ties to a collection.
@@ -942,8 +945,8 @@
'inject', 'reduceRight', 'foldr', 'find', 'detect', 'filter', 'select',
'reject', 'every', 'all', 'some', 'any', 'include', 'contains', 'invoke',
'max', 'min', 'toArray', 'size', 'first', 'head', 'take', 'initial', 'rest',
- 'tail', 'drop', 'last', 'without', 'indexOf', 'shuffle', 'lastIndexOf',
- 'isEmpty', 'chain'];
+ 'tail', 'drop', 'last', 'without', 'difference', 'indexOf', 'shuffle',
+ 'lastIndexOf', 'isEmpty', 'chain'];
// Mix in each Underscore method as a proxy to `Collection#models`.
_.each(methods, function(method) {
@@ -982,7 +985,8 @@
// if an existing element is not provided...
var View = Backbone.View = function(options) {
this.cid = _.uniqueId('view');
- this._configure(options || {});
+ options || (options = {});
+ _.extend(this, _.pick(options, viewOptions));
this._ensureElement();
this.initialize.apply(this, arguments);
this.delegateEvents();
@@ -1001,7 +1005,7 @@
tagName: 'div',
// jQuery delegate for element lookup, scoped to DOM elements within the
- // current view. This should be prefered to global lookups where possible.
+ // current view. This should be preferred to global lookups where possible.
$: function(selector) {
return this.$el.find(selector);
},
@@ -1041,7 +1045,7 @@
//
// {
// 'mousedown .title': 'edit',
- // 'click .button': 'save'
+ // 'click .button': 'save',
// 'click .open': function(e) { ... }
// }
//
@@ -1079,16 +1083,6 @@
return this;
},
- // Performs the initial configuration of a View with a set of options.
- // Keys with special meaning *(e.g. model, collection, id, className)* are
- // attached directly to the view. See `viewOptions` for an exhaustive
- // list.
- _configure: function(options) {
- if (this.options) options = _.extend({}, _.result(this, 'options'), options);
- _.extend(this, _.pick(options, viewOptions));
- this.options = options;
- },
-
// Ensure that the View has a DOM element to render into.
// If `this.el` is a string, pass it through `$()`, take the first
// matching element, and re-assign it to `el`. Otherwise, create
@@ -1174,8 +1168,7 @@
// If we're sending a `PATCH` request, and we're in an old Internet Explorer
// that still has ActiveX enabled by default, override jQuery to use that
// for XHR instead. Remove this line when jQuery supports `PATCH` on IE8.
- if (params.type === 'PATCH' && window.ActiveXObject &&
- !(window.external && window.external.msActiveXFilteringEnabled)) {
+ if (params.type === 'PATCH' && noXhrPatch) {
params.xhr = function() {
return new ActiveXObject("Microsoft.XMLHTTP");
};
@@ -1187,6 +1180,8 @@
return xhr;
};
+ var noXhrPatch = typeof window !== 'undefined' && !!window.ActiveXObject && !(window.XMLHttpRequest && (new XMLHttpRequest).dispatchEvent);
+
// Map from CRUD to HTTP for our default `Backbone.sync` implementation.
var methodMap = {
'create': 'POST',
@@ -1275,7 +1270,7 @@
_routeToRegExp: function(route) {
route = route.replace(escapeRegExp, '\\$&')
.replace(optionalParam, '(?:$1)?')
- .replace(namedParam, function(match, optional){
+ .replace(namedParam, function(match, optional) {
return optional ? match : '([^\/]+)';
})
.replace(splatParam, '(.*?)');
@@ -1325,6 +1320,9 @@
// Cached regex for removing a trailing slash.
var trailingSlash = /\/$/;
+ // Cached regex for stripping urls of hash and query.
+ var pathStripper = /[?#].*$/;
+
// Has the history handling already been started?
History.started = false;
@@ -1349,7 +1347,7 @@
if (this._hasPushState || !this._wantsHashChange || forcePushState) {
fragment = this.location.pathname;
var root = this.root.replace(trailingSlash, '');
- if (!fragment.indexOf(root)) fragment = fragment.substr(root.length);
+ if (!fragment.indexOf(root)) fragment = fragment.slice(root.length);
} else {
fragment = this.getHash();
}
@@ -1365,7 +1363,7 @@
// Figure out the initial configuration. Do we need an iframe?
// Is pushState desired ... is it available?
- this.options = _.extend({}, {root: '/'}, this.options, options);
+ this.options = _.extend({root: '/'}, this.options, options);
this.root = this.options.root;
this._wantsHashChange = this.options.hashChange !== false;
this._wantsPushState = !!this.options.pushState;
@@ -1398,19 +1396,25 @@
var loc = this.location;
var atRoot = loc.pathname.replace(/[^\/]$/, '$&/') === this.root;
- // If we've started off with a route from a `pushState`-enabled browser,
- // but we're currently in a browser that doesn't support it...
- if (this._wantsHashChange && this._wantsPushState && !this._hasPushState && !atRoot) {
- this.fragment = this.getFragment(null, true);
- this.location.replace(this.root + this.location.search + '#' + this.fragment);
- // Return immediately as browser will do redirect to new url
- return true;
+ // Transition from hashChange to pushState or vice versa if both are
+ // requested.
+ if (this._wantsHashChange && this._wantsPushState) {
+
+ // If we've started off with a route from a `pushState`-enabled
+ // browser, but we're currently in a browser that doesn't support it...
+ if (!this._hasPushState && !atRoot) {
+ this.fragment = this.getFragment(null, true);
+ this.location.replace(this.root + this.location.search + '#' + this.fragment);
+ // Return immediately as browser will do redirect to new url
+ return true;
+
+ // Or if we've started out with a hash-based route, but we're currently
+ // in a browser where it could be `pushState`-based instead...
+ } else if (this._hasPushState && atRoot && loc.hash) {
+ this.fragment = this.getHash().replace(routeStripper, '');
+ this.history.replaceState({}, document.title, this.root + this.fragment + loc.search);
+ }
- // Or if we've started out with a hash-based route, but we're currently
- // in a browser where it could be `pushState`-based instead...
- } else if (this._wantsPushState && this._hasPushState && atRoot && loc.hash) {
- this.fragment = this.getHash().replace(routeStripper, '');
- this.history.replaceState({}, document.title, this.root + this.fragment + loc.search);
}
if (!this.options.silent) return this.loadUrl();
@@ -1439,21 +1443,20 @@
}
if (current === this.fragment) return false;
if (this.iframe) this.navigate(current);
- this.loadUrl() || this.loadUrl(this.getHash());
+ this.loadUrl();
},
// Attempt to load the current URL fragment. If a route succeeds with a
// match, returns `true`. If no defined routes matches the fragment,
// returns `false`.
- loadUrl: function(fragmentOverride) {
- var fragment = this.fragment = this.getFragment(fragmentOverride);
- var matched = _.any(this.handlers, function(handler) {
+ loadUrl: function(fragment) {
+ fragment = this.fragment = this.getFragment(fragment);
+ return _.any(this.handlers, function(handler) {
if (handler.route.test(fragment)) {
handler.callback(fragment);
return true;
}
});
- return matched;
},
// Save a fragment into the hash history, or replace the URL state if the
@@ -1465,11 +1468,18 @@
// you wish to modify the current URL without adding an entry to the history.
navigate: function(fragment, options) {
if (!History.started) return false;
- if (!options || options === true) options = {trigger: options};
- fragment = this.getFragment(fragment || '');
+ if (!options || options === true) options = {trigger: !!options};
+
+ var url = this.root + (fragment = this.getFragment(fragment || ''));
+
+ // Strip the fragment of the query and hash for matching.
+ fragment = fragment.replace(pathStripper, '');
+
if (this.fragment === fragment) return;
this.fragment = fragment;
- var url = this.root + fragment;
+
+ // Don't include a trailing slash on the root.
+ if (fragment === '' && url !== '/') url = url.slice(0, -1);
// If pushState is available, we use it to set the fragment as a real URL.
if (this._hasPushState) {
@@ -1492,7 +1502,7 @@
} else {
return this.location.assign(url);
}
- if (options.trigger) this.loadUrl(fragment);
+ if (options.trigger) return this.loadUrl(fragment);
},
// Update the hash location, either replacing the current entry, or adding
@@ -1560,7 +1570,7 @@
};
// Wrap an optional error callback with a fallback error event.
- var wrapError = function (model, options) {
+ var wrapError = function(model, options) {
var error = options.error;
options.error = function(resp) {
if (error) error(model, resp, options);
diff --git a/bower_components/backbone/docs/backbone.html b/bower_components/backbone/docs/backbone.html
index 7c386485..b971c5d7 100644
--- a/bower_components/backbone/docs/backbone.html
+++ b/bower_components/backbone/docs/backbone.html
@@ -27,9 +27,10 @@ backbone.js
- Backbone.js 1.0.0
+ Backbone.js 1.1.0
-(c) 2010-2013 Jeremy Ashkenas, DocumentCloud Inc.
+(c) 2010-2011 Jeremy Ashkenas, DocumentCloud Inc.
+(c) 2011-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
Backbone may be freely distributed under the MIT license.
For all details and documentation:
http://backbonejs.org
@@ -61,8 +62,7 @@ Initial Setup
¶
Save a reference to the global object (window
in the browser, exports
-on the server).
-
+on the server).
@@ -78,8 +78,7 @@ Initial Setup
¶
Save the previous value of the Backbone
variable, so that it can be
-restored later on, if noConflict
is used.
-
+restored later on, if noConflict
is used.
@@ -94,8 +93,7 @@ Initial Setup
- Create local references to array methods we'll want to use later.
-
+ Create local references to array methods we'll want to use later.
@@ -114,8 +112,7 @@ Initial Setup
¶
The top-level namespace. All public Backbone classes and modules will
-be attached to this. Exported for both the browser and the server.
-
+be attached to this. Exported for both the browser and the server.
@@ -135,12 +132,11 @@ Initial Setup
- Current version of the library. Keep in sync with package.json
.
-
+ Current version of the library. Keep in sync with package.json
.
- Backbone.VERSION = '1.0.0';
+ Backbone.VERSION = '1.1.0';
@@ -151,8 +147,7 @@ Initial Setup
- Require Underscore, if we're on the server, and it's not already present.
-
+ Require Underscore, if we're on the server, and it's not already present.
@@ -169,8 +164,7 @@ Initial Setup
¶
For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns
-the $
variable.
-
+the $
variable.
@@ -186,8 +180,7 @@ Initial Setup
¶
Runs Backbone.js in noConflict mode, returning the Backbone
variable
-to its previous owner. Returns a reference to this Backbone object.
-
+to its previous owner. Returns a reference to this Backbone object.
@@ -206,9 +199,8 @@ Initial Setup
¶
Turn on emulateHTTP
to support legacy HTTP servers. Setting this option
-will fake "PUT"
and "DELETE"
requests via the _method
parameter and
-set a X-Http-Method-Override
header.
-
+will fake "PATCH"
, "PUT"
and "DELETE"
requests via the _method
parameter and
+set a X-Http-Method-Override
header.
@@ -226,8 +218,7 @@ Initial Setup
Turn on emulateJSON
to support legacy servers that can't deal with direct
application/json
requests ... will encode the body as
application/x-www-form-urlencoded
instead and will send the model in a
-form param named model
.
-
+form param named model
.
@@ -258,9 +249,7 @@ Backbone.Events
A module that can be mixed in to any object in order to provide it with
custom events. You may bind with on
or remove with off
callback
functions to an event; trigger
-ing an event fires all callbacks in
-succession.
-
-
+succession.
var object = {};
_.extend(object, Backbone.Events);
object.on('expand', function(){ alert('expanded'); });
@@ -280,8 +269,7 @@ Backbone.Events
¶
Bind an event to a callback
function. Passing "all"
will bind
-the callback to all events fired.
-
+the callback to all events fired.
@@ -303,8 +291,7 @@ Backbone.Events
¶
Bind an event to only be triggered a single time. After the first time
-the callback is invoked, it will be removed.
-
+the callback is invoked, it will be removed.
@@ -331,8 +318,7 @@ Backbone.Events
Remove one or many callbacks. If context
is null, removes all
callbacks with that function. If callback
is null, removes all
callbacks for the event. If name
is null, removes all bound
-callbacks for all events.
-
+callbacks for all events.
@@ -343,7 +329,6 @@ Backbone.Events
this._events = {};
return this;
}
-
names = name ? [name] : _.keys(this._events);
for (i = 0, l = names.length; i < l; i++) {
name = names[i];
@@ -377,8 +362,7 @@ Backbone.Events
Trigger one or many events, firing all bound callbacks. Callbacks are
passed the same arguments as trigger
is, apart from the event name
(unless you're listening on "all"
, which will cause your callback to
-receive the true name of the event as the first argument).
-
+receive the true name of the event as the first argument).
@@ -403,20 +387,20 @@ Backbone.Events
¶
Tell this object to stop listening to either specific events ... or
-to every object it's currently listening to.
-
+to every object it's currently listening to.
stopListening: function(obj, name, callback) {
- var listeners = this._listeners;
- if (!listeners) return this;
- var deleteListener = !name && !callback;
- if (typeof name === 'object') callback = this;
- if (obj) (listeners = {})[obj._listenerId] = obj;
- for (var id in listeners) {
- listeners[id].off(name, callback, this);
- if (deleteListener) delete this._listeners[id];
+ var listeningTo = this._listeningTo;
+ if (!listeningTo) return this;
+ var remove = !name && !callback;
+ if (!callback && typeof name === 'object') callback = this;
+ if (obj) (listeningTo = {})[obj._listenId] = obj;
+ for (var id in listeningTo) {
+ obj = listeningTo[id];
+ obj.off(name, callback, this);
+ if (remove || _.isEmpty(obj._events)) delete this._listeningTo[id];
}
return this;
}
@@ -432,8 +416,7 @@ Backbone.Events
- Regular expression used to split event strings.
-
+ Regular expression used to split event strings.
@@ -450,8 +433,7 @@
Backbone.Events
Implement fancy features of the Events API such as multiple event
names "change blur"
and jQuery-style event maps {change: action}
-in terms of the existing API.
-
+in terms of the existing API.
@@ -467,8 +449,7 @@ Backbone.Events
- Handle event maps.
-
+ Handle event maps.
@@ -488,8 +469,7 @@ Backbone.Events
- Handle space separated event names.
-
+ Handle space separated event names.
@@ -515,8 +495,7 @@ Backbone.Events
A difficult-to-believe, but optimized internal dispatch function for
triggering events. Tries to keep the usual cases speedy (most internal
-Backbone events have 3 arguments).
-
+Backbone events have 3 arguments).
@@ -544,17 +523,16 @@ Backbone.Events
Inversion-of-control versions of on
and once
. Tell this object to
listen to an event in another object ... keeping track of what it's
-listening to.
-
+listening to.
_.each(listenMethods, function(implementation, method) {
Events[method] = function(obj, name, callback) {
- var listeners = this._listeners || (this._listeners = {});
- var id = obj._listenerId || (obj._listenerId = _.uniqueId('l'));
- listeners[id] = obj;
- if (typeof name === 'object') callback = this;
+ var listeningTo = this._listeningTo || (this._listeningTo = {});
+ var id = obj._listenId || (obj._listenId = _.uniqueId('l'));
+ listeningTo[id] = obj;
+ if (!callback && typeof name === 'object') callback = this;
obj[implementation](name, callback, this);
return this;
};
@@ -569,8 +547,7 @@ Backbone.Events
- Aliases for backwards compatibility.
-
+ Aliases for backwards compatibility.
@@ -587,8 +564,7 @@
Backbone.Events
¶
Allow the Backbone
object to serve as a global event bus, for folks who
-want global "pubsub" in a convenient place.
-
+want global "pubsub" in a convenient place.
@@ -619,26 +595,20 @@ Backbone.Model
Backbone Models are the basic data object in the framework --
frequently representing a row in a table in a database on your server.
A discrete chunk of data and a bunch of useful, related methods for
-performing computations and transformations on that data.
-
-
+performing computations and transformations on that data.
Create a new model with the specified attributes. A client id (cid
)
-is automatically generated and assigned for you.
-
+is automatically generated and assigned for you.
var Model = Backbone.Model = function(attributes, options) {
- var defaults;
var attrs = attributes || {};
options || (options = {});
this.cid = _.uniqueId('c');
this.attributes = {};
- _.extend(this, _.pick(options, modelOptions));
+ if (options.collection) this.collection = options.collection;
if (options.parse) attrs = this.parse(attrs, options) || {};
- if (defaults = _.result(this, 'defaults')) {
- attrs = _.defaults({}, attrs, defaults);
- }
+ attrs = _.defaults({}, attrs, _.result(this, 'defaults'));
this.set(attrs, options);
this.changed = {};
this.initialize.apply(this, arguments);
@@ -653,12 +623,11 @@ Backbone.Model
- A list of options to be attached directly to the model, if provided.
-
+ Attach all inheritable methods to the Model prototype.
-
var modelOptions = ['url', 'urlRoot', 'collection'];
+
_.extend(Model.prototype, Events, {
@@ -669,12 +638,11 @@
Backbone.Model
-
Attach all inheritable methods to the Model prototype.
-
+
A hash of attributes whose current and previous value differ.
- _.extend(Model.prototype, Events, {
+
@@ -685,12 +653,11 @@ Backbone.Model
- A hash of attributes whose current and previous value differ.
-
+ The value returned during the last failed validation.
-
+
@@ -701,25 +668,8 @@ Backbone.Model
- The value returned during the last failed validation.
-
-
-
-
-
-
-
-
-
-
-
-
-
The default name for the JSON id
attribute is "id"
. MongoDB and
-CouchDB users may want to set this to "_id"
.
-
+CouchDB users may want to set this to
"_id"
.
@@ -728,15 +678,14 @@ Backbone.Model
-
+
Initialize is an empty function by default. Override it with your own
-initialization logic.
-
+initialization logic.
@@ -745,14 +694,13 @@ Backbone.Model
-
+
-
Return a copy of the model's attributes
object.
-
+
Return a copy of the model's attributes
object.
@@ -763,15 +711,14 @@ Backbone.Model
-
+
Proxy Backbone.sync
by default -- but override this if you need
-custom syncing semantics for this particular model.
-
+custom syncing semantics for
this particular model.
@@ -782,14 +729,13 @@ Backbone.Model
-
+
-
Get the value of an attribute.
-
+
Get the value of an attribute.
@@ -800,14 +746,13 @@ Backbone.Model
-
+
-
Get the HTML-escaped value of an attribute.
-
+
Get the HTML-escaped value of an attribute.
@@ -818,15 +763,14 @@ Backbone.Model
-
+
Returns true
if the attribute contains a value that is not null
-or undefined.
-
+or undefined.
@@ -837,16 +781,15 @@ Backbone.Model
-
+
Set a hash of model attributes on the object, firing "change"
. This is
the core primitive operation of a model, updating the data and notifying
-anyone who needs to know about the change in state. The heart of the beast.
-
+anyone who needs to know about the change in state. The heart of the beast.
@@ -857,14 +800,13 @@ Backbone.Model
-
+
-
Handle both "key", value
and {key: value}
-style arguments.
-
+
Handle both "key", value
and {key: value}
-style arguments.
@@ -880,14 +822,13 @@ Backbone.Model
-
+
-
Run validation.
-
+
Run validation.
@@ -896,14 +837,13 @@ Backbone.Model
-
+
-
Extract attributes and options.
-
+
Extract attributes and options.
@@ -922,14 +862,13 @@ Backbone.Model
-
+
-
Check for changes of id
.
-
+
Check for changes of id
.
@@ -938,14 +877,13 @@ Backbone.Model
-
+
-
For each set
attribute, update or delete the current value.
-
+
For each set
attribute, update or delete the current value.
@@ -963,14 +901,13 @@ Backbone.Model
-
+
-
Trigger all relevant attribute changes.
-
+
Trigger all relevant attribute changes.
@@ -984,15 +921,14 @@ Backbone.Model
-
+
You might be wondering why there's a while
loop here. Changes can
-be recursively nested within "change"
events.
-
+be recursively nested within
"change"
events.
@@ -1011,15 +947,14 @@ Backbone.Model
-
+
Remove an attribute from the model, firing "change"
. unset
is a noop
-if the attribute doesn't exist.
-
+if the attribute doesn't exist.
@@ -1030,14 +965,13 @@ Backbone.Model
-
+
-
Clear all attributes on the model, firing "change"
.
-
+
Clear all attributes on the model, firing "change"
.
@@ -1050,15 +984,14 @@ Backbone.Model
-
+
Determine if the model has changed since the last "change"
event.
-If you specify an attribute name, determine if that attribute has changed.
-
+If you specify an attribute name, determine if that attribute has changed.
@@ -1070,19 +1003,18 @@ Backbone.Model
-
+
Return an object containing all the attributes that have changed, or
false if there are no changed attributes. Useful for determining what
parts of a view need to be updated and/or what attributes need to be
persisted to the server. Unset attributes will be set to undefined.
You can also pass an attributes object to diff against the model,
-determining if there would be a change.
-
+determining if there
would be a change.
@@ -1100,15 +1032,14 @@ Backbone.Model
-
+
Get the previous value of an attribute, recorded at the time the last
-"change"
event was fired.
-
+
"change"
event was fired.
@@ -1120,15 +1051,14 @@ Backbone.Model
-
+
Get all of the attributes of the model at the time of the previous
-"change"
event.
-
+
"change"
event.
@@ -1139,16 +1069,15 @@ Backbone.Model
-
+
Fetch the model from the server. If the server's representation of the
model differs from its current attributes, they will be overridden,
-triggering a "change"
event.
-
+triggering a
"change"
event.
@@ -1169,16 +1098,15 @@ Backbone.Model
-
+
Set a hash of model attributes, and sync the model to the server.
If the server returns an attributes hash that differs, the model's
-state will be set
again.
-
+state will be
set
again.
@@ -1188,14 +1116,13 @@ Backbone.Model
-
+
-
Handle both "key", value
and {key: value}
-style arguments.
-
+
Handle both "key", value
and {key: value}
-style arguments.
@@ -1204,53 +1131,41 @@ Backbone.Model
options = val;
} else {
(attrs = {})[key] = val;
- }
-
-
-
-
-
-
-
-
-
If we're not waiting and attributes exist, save acts as set(attr).save(null, opts)
.
-
-
-
-
- if (attrs && (!options || !options.wait) && !this.set(attrs, options)) return false;
+ }
options = _.extend({validate: true}, options);
-
+
-
Do not persist invalid models.
-
+
If we're not waiting and attributes exist, save acts as
+set(attr).save(null, opts)
with validation. Otherwise, check if
+the model will be valid when the attributes, if any, are set.
- if (!this._validate(attrs, options)) return false;
+ if (attrs && !options.wait) {
+ if (!this.set(attrs, options)) return false;
+ } else {
+ if (!this._validate(attrs, options)) return false;
+ }
-
+
-
Set temporary attributes if {wait: true}
.
-
+
Set temporary attributes if {wait: true}
.
@@ -1261,15 +1176,14 @@ Backbone.Model
-
+
After a successful server-side save, the client is (optionally)
-updated with the server-side state.
-
+updated with the server-side state.
@@ -1281,14 +1195,13 @@ Backbone.Model
-
+
-
Ensure attributes are restored during synchronous saves.
-
+
Ensure attributes are restored during synchronous saves.
@@ -1310,14 +1223,13 @@ Backbone.Model
-
+
-
Restore attributes.
-
+
Restore attributes.
@@ -1329,16 +1241,15 @@ Backbone.Model
-
+
Destroy this model on the server if it was already persisted.
Optimistically removes the model from its collection, if it has one.
-If wait: true
is passed, waits for the server to respond before removal.
-
+If
wait: true
is passed, waits for the server to respond before removal.
@@ -1371,16 +1282,15 @@ Backbone.Model
-
+
Default URL for the model's representation on the server -- if you're
using Backbone's restful methods, override this to change the endpoint
-that will be called.
-
+that will be called.
@@ -1393,15 +1303,14 @@ Backbone.Model
-
+
parse converts a response into the hash of attributes to be set
on
-the model. The default implementation is just to pass the response along.
-
+the model. The default implementation is just to pass the response along.
@@ -1412,14 +1321,13 @@ Backbone.Model
-
+
-
Create a new model with identical attributes to this one.
-
+
Create a new model with identical attributes to this one.
@@ -1430,14 +1338,13 @@ Backbone.Model
-
+
-
A model is new if it has never been saved to the server, and lacks an id.
-
+
A model is new if it has never been saved to the server, and lacks an id.
@@ -1448,14 +1355,13 @@ Backbone.Model
-
+
-
Check if the model is currently in a valid state.
-
+
Check if the model is currently in a valid state.
@@ -1466,15 +1372,14 @@ Backbone.Model
-
+
Run validation against the next complete set of model attributes,
-returning true
if all is well. Otherwise, fire an "invalid"
event.
-
+returning
true
if all is well. Otherwise, fire an
"invalid"
event.
@@ -1483,7 +1388,7 @@ Backbone.Model
attrs = _.extend({}, this.attributes, attrs);
var error = this.validationError = this.validate(attrs, options) || null;
if (!error) return true;
- this.trigger('invalid', this, error, _.extend(options || {}, {validationError: error}));
+ this.trigger('invalid', this, error, _.extend(options, {validationError: error}));
return false;
}
@@ -1492,14 +1397,13 @@ Backbone.Model
-
+
-
Underscore methods that we want to implement on the Model.
-
+
Underscore methods that we want to implement on the Model.
@@ -1508,14 +1412,13 @@ Backbone.Model
-
+
-
Mix in each Underscore method as a proxy to Model#attributes
.
-
+
Mix in each Underscore method as a proxy to Model#attributes
.
@@ -1530,11 +1433,11 @@ Backbone.Model
-
+
Backbone.Collection
@@ -1543,30 +1446,26 @@
Backbone.Collection
-
+
If models tend to represent a single row of data, a Backbone Collection is
more analagous to a table full of data ... or a small slice or page of that
table, or a collection of rows that belong together for a particular reason
-- all of the messages in this particular folder, all of the documents
belonging to this particular author, and so on. Collections maintain
-indexes of their models, both in order, and for lookup by id
.
-
-
+indexes of their models, both in order, and for lookup by
id
.
Create a new Collection, perhaps to contain a specific type of model
.
If a comparator
is specified, the Collection will maintain
-its models in sort order, as they're added and removed.
-
+its models in sort order, as they're added and removed.
var Collection = Backbone.Collection = function(models, options) {
options || (options = {});
- if (options.url) this.url = options.url;
if (options.model) this.model = options.model;
if (options.comparator !== void 0) this.comparator = options.comparator;
this._reset();
@@ -1577,31 +1476,29 @@ Backbone.Collection
-
+
-
Default options for Collection#set
.
-
+
Default options for Collection#set
.
var setOptions = {add: true, remove: true, merge: true};
- var addOptions = {add: true, merge: false, remove: false};
+ var addOptions = {add: true, remove: false};
-
+
-
Define the Collection's inheritable methods.
-
+
Define the Collection's inheritable methods.
@@ -1610,15 +1507,14 @@ Backbone.Collection
-
+
The default model for a collection is just a Backbone.Model.
-This should be overridden in most cases.
-
+This should be overridden in most cases.
@@ -1627,15 +1523,14 @@ Backbone.Collection
-
+
Initialize is an empty function by default. Override it with your own
-initialization logic.
-
+initialization logic.
@@ -1644,15 +1539,14 @@ Backbone.Collection
-
+
The JSON representation of a Collection is an array of the
-models' attributes.
-
+models' attributes.
@@ -1663,14 +1557,13 @@ Backbone.Collection
-
+
-
Proxy Backbone.sync
by default.
-
+
Proxy Backbone.sync
by default.
@@ -1681,41 +1574,40 @@ Backbone.Collection
-
+
-
Add a model, or list of models to the set.
-
+
Add a model, or list of models to the set.
add: function(models, options) {
- return this.set(models, _.defaults(options || {}, addOptions));
+ return this.set(models, _.extend({merge: false}, options, addOptions));
},
-
+
-
Remove a model, or a list of models from the set.
-
+
Remove a model, or a list of models from the set.
remove: function(models, options) {
- models = _.isArray(models) ? models.slice() : [models];
+ var singular = !_.isArray(models);
+ models = singular ? [models] : _.clone(models);
options || (options = {});
var i, l, index, model;
for (i = 0, l = models.length; i < l; i++) {
- model = this.get(models[i]);
+ model = models[i] = this.get(models[i]);
if (!model) continue;
delete this._byId[model.id];
delete this._byId[model.cid];
@@ -1728,105 +1620,114 @@ Backbone.Collection
}
this._removeReference(model);
}
- return this;
+ return singular ? models[0] : models;
},
-
+
Update a collection by set
-ing a new list of models, adding new ones,
removing models that are no longer present, and merging models that
already exist in the collection, as necessary. Similar to Model#set,
-the core operation for updating the data contained by the collection.
-
+the core operation for updating the data contained by the collection.
set: function(models, options) {
- options = _.defaults(options || {}, setOptions);
+ options = _.defaults({}, options, setOptions);
if (options.parse) models = this.parse(models, options);
- if (!_.isArray(models)) models = models ? [models] : [];
- var i, l, model, attrs, existing, sort;
+ var singular = !_.isArray(models);
+ models = singular ? (models ? [models] : []) : _.clone(models);
+ var i, l, id, model, attrs, existing, sort;
var at = options.at;
+ var targetModel = this.model;
var sortable = this.comparator && (at == null) && options.sort !== false;
var sortAttr = _.isString(this.comparator) ? this.comparator : null;
- var toAdd = [], toRemove = [], modelMap = {};
+ var toAdd = [], toRemove = [], modelMap = {};
+ var add = options.add, merge = options.merge, remove = options.remove;
+ var order = !sortable && add && remove ? [] : false;
-
+
Turn bare objects into model references, and prevent invalid models
-from being added.
-
+from being added.
for (i = 0, l = models.length; i < l; i++) {
- if (!(model = this._prepareModel(models[i], options))) continue;
+ attrs = models[i];
+ if (attrs instanceof Model) {
+ id = model = attrs;
+ } else {
+ id = attrs[targetModel.prototype.idAttribute];
+ }
-
+
If a duplicate is found, prevent it from being added and
-optionally merge it into the existing model.
-
+optionally merge it into the existing model.
- if (existing = this.get(model)) {
- if (options.remove) modelMap[existing.cid] = true;
- if (options.merge) {
- existing.set(model.attributes, options);
+ if (existing = this.get(id)) {
+ if (remove) modelMap[existing.cid] = true;
+ if (merge) {
+ attrs = attrs === model ? model.attributes : attrs;
+ if (options.parse) attrs = existing.parse(attrs, options);
+ existing.set(attrs, options);
if (sortable && !sort && existing.hasChanged(sortAttr)) sort = true;
- }
+ }
+ models[i] = existing;
-
+
-
This is a new model, push it to the toAdd
list.
-
+
If this is a new, valid model, push it to the toAdd
list.
- } else if (options.add) {
+ } else if (add) {
+ model = models[i] = this._prepareModel(attrs, options);
+ if (!model) continue;
toAdd.push(model);
-
+
Listen to added models' events, and index models for lookup by
-id
and by cid
.
-
+
id
and by
cid
.
@@ -1834,23 +1735,23 @@ Backbone.Collection
this._byId[model.cid] = model;
if (model.id != null) this._byId[model.id] = model;
}
+ if (order) order.push(existing || model);
}
-
+
-
Remove nonexistent models if appropriate.
-
+
Remove nonexistent models if appropriate.
- if (options.remove) {
+ if (remove) {
for (i = 0, l = this.length; i < l; ++i) {
if (!modelMap[(model = this.models[i]).cid]) toRemove.push(model);
}
@@ -1860,95 +1761,96 @@ Backbone.Collection
-
+
-
See if sorting is needed, update length
and splice in new models.
-
+
See if sorting is needed, update length
and splice in new models.
- if (toAdd.length) {
+ if (toAdd.length || (order && order.length)) {
if (sortable) sort = true;
this.length += toAdd.length;
if (at != null) {
- splice.apply(this.models, [at, 0].concat(toAdd));
+ for (i = 0, l = toAdd.length; i < l; i++) {
+ this.models.splice(at + i, 0, toAdd[i]);
+ }
} else {
- push.apply(this.models, toAdd);
+ if (order) this.models.length = 0;
+ var orderedModels = order || toAdd;
+ for (i = 0, l = orderedModels.length; i < l; i++) {
+ this.models.push(orderedModels[i]);
+ }
}
}
-
+
-
Silently sort the collection if appropriate.
-
+
Silently sort the collection if appropriate.
- if (sort) this.sort({silent: true});
-
- if (options.silent) return this;
+ if (sort) this.sort({silent: true});
-
+
-
Trigger add
events.
-
+
Unless silenced, it's time to fire all appropriate add/sort events.
- for (i = 0, l = toAdd.length; i < l; i++) {
- (model = toAdd[i]).trigger('add', model, this, options);
+ if (!options.silent) {
+ for (i = 0, l = toAdd.length; i < l; i++) {
+ (model = toAdd[i]).trigger('add', model, this, options);
+ }
+ if (sort || (order && order.length)) this.trigger('sort', this, options);
}
-
+
-
Trigger sort
if the collection was sorted.
-
+
Return the added (or merged) model (or models).
- if (sort) this.trigger('sort', this, options);
- return this;
+ return singular ? models[0] : models;
},
-
+
When you have more items than you want to add or remove individually,
you can reset the entire set with a new list of models, without firing
any granular add
or remove
events. Fires reset
when finished.
-Useful for bulk operations and optimizations.
-
+Useful for bulk operations and optimizations.
@@ -1959,42 +1861,38 @@ Backbone.Collection
}
options.previousModels = this.models;
this._reset();
- this.add(models, _.extend({silent: true}, options));
+ models = this.add(models, _.extend({silent: true}, options));
if (!options.silent) this.trigger('reset', this, options);
- return this;
+ return models;
},
-
+
-
Add a model to the end of the collection.
-
+
Add a model to the end of the collection.
push: function(model, options) {
- model = this._prepareModel(model, options);
- this.add(model, _.extend({at: this.length}, options));
- return model;
+ return this.add(model, _.extend({at: this.length}, options));
},
-
+
-
Remove a model from the end of the collection.
-
+
Remove a model from the end of the collection.
@@ -2007,34 +1905,30 @@ Backbone.Collection
-
+
-
Add a model to the beginning of the collection.
-
+
Add a model to the beginning of the collection.
unshift: function(model, options) {
- model = this._prepareModel(model, options);
- this.add(model, _.extend({at: 0}, options));
- return model;
+ return this.add(model, _.extend({at: 0}, options));
},
-
+
-
Remove a model from the beginning of the collection.
-
+
Remove a model from the beginning of the collection.
@@ -2047,51 +1941,48 @@ Backbone.Collection
-
+
-
Slice out a sub-array of models from the collection.
-
+
Slice out a sub-array of models from the collection.
- slice: function(begin, end) {
- return this.models.slice(begin, end);
+ slice: function() {
+ return slice.apply(this.models, arguments);
},
-
+
-
Get a model from the set by id.
-
+
Get a model from the set by id.
get: function(obj) {
if (obj == null) return void 0;
- return this._byId[obj.id != null ? obj.id : obj.cid || obj];
+ return this._byId[obj.id] || this._byId[obj.cid] || this._byId[obj];
},
-
+
-
Get the model at the given index.
-
+
Get the model at the given index.
@@ -2102,15 +1993,14 @@ Backbone.Collection
-
+
Return models with matching attributes. Useful for simple cases of
-filter
.
-
+
filter
.
@@ -2127,15 +2017,14 @@ Backbone.Collection
-
+
Return the first model with matching attributes. Useful for simple cases
-of find
.
-
+of
find
.
@@ -2146,16 +2035,15 @@ Backbone.Collection
-
+
Force the collection to re-sort itself. You don't need to call this under
normal circumstances, as the set will maintain sort order as each item
-is added.
-
+is added.
@@ -2166,14 +2054,13 @@ Backbone.Collection
-
+
-
Run sort based on type of comparator
.
-
+
Run sort based on type of comparator
.
@@ -2190,37 +2077,13 @@ Backbone.Collection
-
-
-
-
-
Figure out the smallest index at which a model should be inserted so as
-to maintain order.
-
-
-
-
- sortedIndex: function(model, value, context) {
- value || (value = this.comparator);
- var iterator = _.isFunction(value) ? value : function(model) {
- return model.get(value);
- };
- return _.sortedIndex(this.models, model, iterator, context);
- },
-
-
-
-
-
+
-
Pluck an attribute from each model in the collection.
-
+
Pluck an attribute from each model in the collection.
@@ -2231,16 +2094,15 @@ Backbone.Collection
-
+
Fetch the default set of models for this collection, resetting the
collection when they arrive. If reset: true
is passed, the response
-data will be passed through the reset
method instead of set
.
-
+data will be passed through the
reset
method instead of
set
.
@@ -2262,16 +2124,15 @@ Backbone.Collection
-
+
Create a new instance of a model in this collection. Add the model to the
collection immediately, unless wait: true
is passed, in which case we
-wait for the server to agree.
-
+wait for the server to agree.
@@ -2281,7 +2142,7 @@ Backbone.Collection
if (!options.wait) this.add(model, options);
var collection = this;
var success = options.success;
- options.success = function(resp) {
+ options.success = function(model, resp, options) {
if (options.wait) collection.add(model, options);
if (success) success(model, resp, options);
};
@@ -2292,15 +2153,14 @@ Backbone.Collection
-
+
parse converts a response into a list of models to be added to the
-collection. The default implementation is just to pass it through.
-
+collection. The default implementation is just to pass it through.
@@ -2311,14 +2171,13 @@ Backbone.Collection
-
+
-
Create a new collection with an identical list of models as this one.
-
+
Create a new collection with an identical list of models as this one.
@@ -2329,15 +2188,14 @@ Backbone.Collection
-
+
Private method to reset all internal state. Called when the collection
-is first initialized or reset.
-
+is first initialized or reset.
@@ -2350,15 +2208,14 @@ Backbone.Collection
-
+
Prepare a hash of attributes (or other model) to be added to this
-collection.
-
+collection.
@@ -2367,27 +2224,24 @@ Backbone.Collection
if (!attrs.collection) attrs.collection = this;
return attrs;
}
- options || (options = {});
+ options = options ? _.clone(options) : {};
options.collection = this;
var model = new this.model(attrs, options);
- if (!model._validate(attrs, options)) {
- this.trigger('invalid', this, attrs, options);
- return false;
- }
- return model;
+ if (!model.validationError) return model;
+ this.trigger('invalid', this, model.validationError, options);
+ return false;
},
-
+
-
Internal method to sever a model's ties to a collection.
-
+
Internal method to sever a model's ties to a collection.
@@ -2399,17 +2253,16 @@ Backbone.Collection
-
+
Internal method called every time a model in the set fires an event.
Sets need to update their indexes when models change ids. All other
events simply proxy through. "add" and "remove" events that originate
-in other collections are ignored.
-
+in other collections are ignored.
@@ -2428,16 +2281,15 @@ Backbone.Collection
-
+
Underscore methods that we want to implement on the Collection.
90% of the core usefulness of Backbone Collections is actually implemented
-right here:
-
+right here:
@@ -2445,20 +2297,19 @@ Backbone.Collection
'inject', 'reduceRight', 'foldr', 'find', 'detect', 'filter', 'select',
'reject', 'every', 'all', 'some', 'any', 'include', 'contains', 'invoke',
'max', 'min', 'toArray', 'size', 'first', 'head', 'take', 'initial', 'rest',
- 'tail', 'drop', 'last', 'without', 'indexOf', 'shuffle', 'lastIndexOf',
- 'isEmpty', 'chain'];
+ 'tail', 'drop', 'last', 'without', 'difference', 'indexOf', 'shuffle',
+ 'lastIndexOf', 'isEmpty', 'chain'];
-
+
-
Mix in each Underscore method as a proxy to Collection#models
.
-
+
Mix in each Underscore method as a proxy to Collection#models
.
@@ -2473,14 +2324,13 @@ Backbone.Collection
-
+
-
Underscore methods that take a property name as an argument.
-
+
Underscore methods that take a property name as an argument.
@@ -2489,14 +2339,13 @@ Backbone.Collection
-
+
-
Use attributes instead of properties.
-
+
Use attributes instead of properties.
@@ -2512,11 +2361,11 @@ Backbone.Collection
-
+
Backbone.View
@@ -2525,11 +2374,11 @@
Backbone.View
-
+
Backbone Views are almost more convention than they are actual code. A View
is simply a JavaScript object that represents a logical chunk of UI in the
@@ -2537,18 +2386,16 @@
Backbone.View
even the surrounding frame which wraps your whole app. Defining a chunk of
UI as a
View allows you to define your DOM events declaratively, without
having to worry about render order ... and makes it easy for the view to
-react to specific changes in the state of your models.
-
-
+react to specific changes in the state of your models.
Creating a Backbone.View creates its initial element outside of the DOM,
-if an existing element is not provided...
-
+if an existing element is not provided...
var View = Backbone.View = function(options) {
this.cid = _.uniqueId('view');
- this._configure(options || {});
+ options || (options = {});
+ _.extend(this, _.pick(options, viewOptions));
this._ensureElement();
this.initialize.apply(this, arguments);
this.delegateEvents();
@@ -2557,14 +2404,13 @@ Backbone.View
-
+
-
Cached regex to split keys for delegate
.
-
+
Cached regex to split keys for delegate
.
@@ -2573,14 +2419,13 @@ Backbone.View
-
+
-
List of view options to be merged as properties.
-
+
List of view options to be merged as properties.
@@ -2589,14 +2434,13 @@ Backbone.View
-
+
-
Set up all inheritable Backbone.View properties and methods.
-
+
Set up all inheritable Backbone.View properties and methods.
@@ -2605,14 +2449,13 @@ Backbone.View
-
+
-
The default tagName
of a View's element is "div"
.
-
+
The default tagName
of a View's element is "div"
.
@@ -2621,15 +2464,14 @@ Backbone.View
-
+
jQuery delegate for element lookup, scoped to DOM elements within the
-current view. This should be prefered to global lookups where possible.
-
+current view. This should be preferred to global lookups where possible.
@@ -2640,15 +2482,14 @@ Backbone.View
-
+
Initialize is an empty function by default. Override it with your own
-initialization logic.
-
+initialization logic.
@@ -2657,16 +2498,15 @@ Backbone.View
-
+
render is the core function that your view should override, in order
to populate its element (this.el
), with the appropriate HTML. The
-convention is for render to always return this
.
-
+convention is for
render to always return
this
.
@@ -2677,15 +2517,14 @@ Backbone.View
-
+
Remove this view by taking the element out of the DOM, and removing any
-applicable Backbone.Events listeners.
-
+applicable Backbone.Events listeners.
@@ -2698,15 +2537,14 @@ Backbone.View
-
+
Change the view's element (this.el
property), including event
-re-delegation.
-
+re-delegation.
@@ -2721,29 +2559,24 @@ Backbone.View
-
+
-
Set callbacks, where this.events
is a hash of
-
-
-
{"event selector": "callback"}
-
-
+
Set callbacks, where this.events
is a hash of
+
{"event selector": "callback"}
{
'mousedown .title': 'edit',
- 'click .button': 'save'
+ 'click .button': 'save',
'click .open': function(e) { ... }
}
pairs. Callbacks will be bound to the view, with this
set properly.
Uses event delegation for efficiency.
Omitting the selector binds the event to this.el
.
This only works for delegate-able events: not focus
, blur
, and
-not change
, submit
, and reset
in Internet Explorer.
-
+not
change
,
submit
, and
reset
in Internet Explorer.
@@ -2771,16 +2604,15 @@ Backbone.View
-
+
Clears all callbacks previously bound to the view with delegateEvents
.
You usually don't need to use this, but may wish to if you have multiple
-Backbone views attached to the same DOM element.
-
+Backbone views attached to the same DOM element.
@@ -2792,40 +2624,16 @@ Backbone.View
-
-
-
-
-
Performs the initial configuration of a View with a set of options.
-Keys with special meaning (e.g. model, collection, id, className) are
-attached directly to the view. See viewOptions
for an exhaustive
-list.
-
-
-
-
- _configure: function(options) {
- if (this.options) options = _.extend({}, _.result(this, 'options'), options);
- _.extend(this, _.pick(options, viewOptions));
- this.options = options;
- },
-
-
-
-
-
+
Ensure that the View has a DOM element to render into.
If this.el
is a string, pass it through $()
, take the first
matching element, and re-assign it to el
. Otherwise, create
-an element from the id
, className
and tagName
properties.
-
+an element from the
id
,
className
and
tagName
properties.
@@ -2846,11 +2654,11 @@ Backbone.View
-
+
Backbone.sync
@@ -2859,18 +2667,16 @@
Backbone.sync
-
+
Override this function to change the manner in which Backbone persists
models to the server. You will be passed the type of request, and the
model in question. By default, makes a RESTful Ajax request
-to the model's url()
. Some possible customizations could be:
-
-
+to the model's
url()
. Some possible customizations could be:
- Use
setTimeout
to batch rapid-fire updates into a single request.
- Send up the models as XML instead of JSON.
@@ -2881,8 +2687,7 @@ Backbone.sync
as well as all requests with the body as application/x-www-form-urlencoded
instead of application/json
with the model in a param named model
.
Useful when interfacing with server-side languages like PHP that make
-it difficult to read the body of PUT
requests.
-
+it difficult to read the body of PUT
requests.
@@ -2892,14 +2697,13 @@ Backbone.sync
-
+
-
Default options, unless specified.
-
+
Default options, unless specified.
@@ -2911,14 +2715,13 @@ Backbone.sync
-
+
-
Default JSON-request options.
-
+
Default JSON-request options.
@@ -2927,14 +2730,13 @@ Backbone.sync
-
+
-
Ensure that we have a URL.
-
+
Ensure that we have a URL.
@@ -2945,14 +2747,13 @@ Backbone.sync
-
+
-
Ensure that we have the appropriate request data.
-
+
Ensure that we have the appropriate request data.
@@ -2964,14 +2765,13 @@ Backbone.sync
-
+
-
For older servers, emulate JSON by encoding the request into an HTML-form.
-
+
For older servers, emulate JSON by encoding the request into an HTML-form.
@@ -2983,15 +2783,14 @@ Backbone.sync
-
+
For older servers, emulate HTTP by mimicking the HTTP method with _method
-And an X-HTTP-Method-Override
header.
-
+And an
X-HTTP-Method-Override
header.
@@ -3008,14 +2807,13 @@ Backbone.sync
-
+
-
Don't process data on a non-GET request.
-
+
Don't process data on a non-GET request.
@@ -3026,21 +2824,19 @@ Backbone.sync
-
+
If we're sending a PATCH
request, and we're in an old Internet Explorer
that still has ActiveX enabled by default, override jQuery to use that
-for XHR instead. Remove this line when jQuery supports PATCH
on IE8.
-
+for XHR instead. Remove this line when jQuery supports
PATCH
on IE8.
- if (params.type === 'PATCH' && window.ActiveXObject &&
- !(window.external && window.external.msActiveXFilteringEnabled)) {
+ if (params.type === 'PATCH' && noXhrPatch) {
params.xhr = function() {
return new ActiveXObject("Microsoft.XMLHTTP");
};
@@ -3049,33 +2845,33 @@ Backbone.sync
-
+
-
Make the request, allowing the user to override any Ajax options.
-
+
Make the request, allowing the user to override any Ajax options.
var xhr = options.xhr = Backbone.ajax(_.extend(params, options));
model.trigger('request', model, xhr, options);
return xhr;
- };
+ };
+
+ var noXhrPatch = typeof window !== 'undefined' && !!window.ActiveXObject && !(window.XMLHttpRequest && (new XMLHttpRequest).dispatchEvent);
-
+
-
Map from CRUD to HTTP for our default Backbone.sync
implementation.
-
+
Map from CRUD to HTTP for our default Backbone.sync
implementation.
@@ -3090,15 +2886,14 @@ Backbone.sync
-
+
Set the default implementation of Backbone.ajax
to proxy through to $
.
-Override this if you'd like to use a different library.
-
+Override this if you'd like to use a different library.
@@ -3109,11 +2904,11 @@ Backbone.sync
-
+
Backbone.Router
@@ -3122,15 +2917,14 @@
Backbone.Router
-
+
Routers map faux-URLs to actions, and fire events when routes are
-matched. Creating a new one sets its routes
hash, if not set statically.
-
+matched. Creating a new one sets its
routes
hash, if not set statically.
@@ -3144,15 +2938,14 @@ Backbone.Router
-
+
Cached regular expressions for matching named param parts and splatted
-parts of route strings.
-
+parts of route strings.
@@ -3164,14 +2957,13 @@ Backbone.Router
-
+
-
Set up all inheritable Backbone.Router properties and methods.
-
+
Set up all inheritable Backbone.Router properties and methods.
@@ -3180,15 +2972,14 @@ Backbone.Router
-
+
Initialize is an empty function by default. Override it with your own
-initialization logic.
-
+initialization logic.
@@ -3197,15 +2988,13 @@ Backbone.Router
-
+
-
Manually bind a single named route to a callback. For example:
-
-
+
Manually bind a single named route to a callback. For example:
this.route('search/:query/p:num', 'search', function(query, num) {
...
});
@@ -3233,14 +3022,13 @@
Backbone.Router
-
+
-
Simple proxy to Backbone.history
to save a fragment into the history.
-
+
Simple proxy to Backbone.history
to save a fragment into the history.
@@ -3252,16 +3040,15 @@ Backbone.Router
-
+
Bind all defined routes to Backbone.history
. We have to reverse the
order of the routes here to support behavior where the most general
-routes can be defined at the bottom of the route map.
-
+routes can be defined at the bottom of the route map.
@@ -3277,22 +3064,21 @@ Backbone.Router
-
+
Convert a route string into a regular expression, suitable for matching
-against the current location hash.
-
+against the current location hash.
_routeToRegExp: function(route) {
route = route.replace(escapeRegExp, '\\$&')
.replace(optionalParam, '(?:$1)?')
- .replace(namedParam, function(match, optional){
+ .replace(namedParam, function(match, optional) {
return optional ? match : '([^\/]+)';
})
.replace(splatParam, '(.*?)');
@@ -3302,16 +3088,15 @@ Backbone.Router
-
+
Given a route, and a URL fragment that it matches, return the array of
extracted decoded parameters. Empty or unmatched parameters will be
-treated as null
to normalize cross-browser behavior.
-
+treated as
null
to normalize cross-browser behavior.
@@ -3327,11 +3112,11 @@ Backbone.Router
-
+
Backbone.History
@@ -3340,18 +3125,17 @@
Backbone.History
-
+
Handles cross-browser history management, based on either
pushState and real URLs, or
onhashchange
and URL fragments. If the browser supports neither (old IE, natch),
-falls back to polling.
-
+falls back to polling.
@@ -3362,14 +3146,13 @@ Backbone.History
-
+
-
Ensure that History
can be used outside of the browser.
-
+
Ensure that History
can be used outside of the browser.
@@ -3382,14 +3165,13 @@ Backbone.History
-
+
-
Cached regex for stripping a leading hash/slash and trailing space.
-
+
Cached regex for stripping a leading hash/slash and trailing space.
@@ -3398,14 +3180,13 @@ Backbone.History
-
+
-
Cached regex for stripping leading and trailing slashes.
-
+
Cached regex for stripping leading and trailing slashes.
@@ -3414,14 +3195,13 @@ Backbone.History
-
+
-
Cached regex for detecting MSIE.
-
+
Cached regex for detecting MSIE.
@@ -3430,14 +3210,13 @@ Backbone.History
-
+
-
Cached regex for removing a trailing slash.
-
+
Cached regex for removing a trailing slash.
@@ -3446,14 +3225,28 @@ Backbone.History
-
+
-
Has the history handling already been started?
-
+
Cached regex for stripping urls of hash and query.
+
+
+
+ var pathStripper = /[?#].*$/;
+
+
+
+
+
+
+
+
+
Has the history handling already been started?
@@ -3462,14 +3255,13 @@ Backbone.History
-
+
-
Set up all inheritable Backbone.History properties and methods.
-
+
Set up all inheritable Backbone.History properties and methods.
@@ -3478,15 +3270,14 @@ Backbone.History
-
+
The default interval to poll for hash changes, if necessary, is
-twenty times a second.
-
+twenty times a second.
@@ -3495,15 +3286,14 @@ Backbone.History
-
+
Gets the true hash value. Cannot use location.hash directly due to bug
-in Firefox where location.hash will always be decoded.
-
+in Firefox where location.hash will always be decoded.
@@ -3515,15 +3305,14 @@ Backbone.History
-
+
Get the cross-browser normalized URL fragment, either from the URL,
-the hash, or the override.
-
+the hash, or the override.
@@ -3532,7 +3321,7 @@ Backbone.History
if (this._hasPushState || !this._wantsHashChange || forcePushState) {
fragment = this.location.pathname;
var root = this.root.replace(trailingSlash, '');
- if (!fragment.indexOf(root)) fragment = fragment.substr(root.length);
+ if (!fragment.indexOf(root)) fragment = fragment.slice(root.length);
} else {
fragment = this.getHash();
}
@@ -3543,15 +3332,14 @@ Backbone.History
-
+
Start the hash change handling, returning true
if the current URL matches
-an existing route, and false
otherwise.
-
+an existing route, and
false
otherwise.
@@ -3562,19 +3350,18 @@ Backbone.History
-
+
Figure out the initial configuration. Do we need an iframe?
-Is pushState desired ... is it available?
-
+Is pushState desired ... is it available?
- this.options = _.extend({}, {root: '/'}, this.options, options);
+ this.options = _.extend({root: '/'}, this.options, options);
this.root = this.options.root;
this._wantsHashChange = this.options.hashChange !== false;
this._wantsPushState = !!this.options.pushState;
@@ -3586,14 +3373,13 @@ Backbone.History
-
+
-
Normalize root to always include a leading and trailing slash.
-
+
Normalize root to always include a leading and trailing slash.
@@ -3607,15 +3393,14 @@ Backbone.History
-
+
Depending on whether we're using pushState or hashes, and whether
-'onhashchange' is supported, determine how we check the URL state.
-
+'onhashchange' is supported, determine how we check the URL state.
@@ -3630,15 +3415,14 @@ Backbone.History
-
+
Determine if we need to change the base url, for a pushState link
-opened by a non-pushState browser.
-
+opened by a non-pushState browser.
@@ -3649,56 +3433,71 @@ Backbone.History
-
+
-
If we've started off with a route from a pushState
-enabled browser,
-but we're currently in a browser that doesn't support it...
-
+
Transition from hashChange to pushState or vice versa if both are
+requested.
- if (this._wantsHashChange && this._wantsPushState && !this._hasPushState && !atRoot) {
- this.fragment = this.getFragment(null, true);
- this.location.replace(this.root + this.location.search + '#' + this.fragment);
+ if (this._wantsHashChange && this._wantsPushState) {
-
+
-
Return immediately as browser will do redirect to new url
-
+
If we've started off with a route from a pushState
-enabled
+browser, but we're currently in a browser that doesn't support it...
-
+ if (!this._hasPushState && !atRoot) {
+ this.fragment = this.getFragment(null, true);
+ this.location.replace(this.root + this.location.search + '#' + this.fragment);
-
+
+
Return immediately as browser will do redirect to new url
+
+
+
+
+
+
+
+
+
+
+
+
Or if we've started out with a hash-based route, but we're currently
-in a browser where it could be pushState
-based instead...
-
+in a browser where it could be
pushState
-based instead...
- } else if (this._wantsPushState && this._hasPushState && atRoot && loc.hash) {
- this.fragment = this.getHash().replace(routeStripper, '');
- this.history.replaceState({}, document.title, this.root + this.fragment + loc.search);
+ } else if (this._hasPushState && atRoot && loc.hash) {
+ this.fragment = this.getHash().replace(routeStripper, '');
+ this.history.replaceState({}, document.title, this.root + this.fragment + loc.search);
+ }
+
}
if (!this.options.silent) return this.loadUrl();
@@ -3707,15 +3506,14 @@ Backbone.History
-
+
Disable Backbone.history, perhaps temporarily. Not useful in a real app,
-but possibly useful for unit testing Routers.
-
+but possibly useful for unit testing Routers.
@@ -3728,15 +3526,14 @@ Backbone.History
-
+
Add a route to be tested when the fragment changes. Routes added later
-may override previous routes.
-
+may override previous routes.
@@ -3747,15 +3544,14 @@ Backbone.History
-
+
Checks the current URL to see if it has changed, and if it has,
-calls loadUrl
, normalizing across the hidden iframe.
-
+calls
loadUrl
, normalizing across the hidden iframe.
@@ -3766,64 +3562,90 @@ Backbone.History
}
if (current === this.fragment) return false;
if (this.iframe) this.navigate(current);
- this.loadUrl() || this.loadUrl(this.getHash());
+ this.loadUrl();
},
-
+
Attempt to load the current URL fragment. If a route succeeds with a
match, returns true
. If no defined routes matches the fragment,
-returns false
.
-
+returns
false
.
- loadUrl: function(fragmentOverride) {
- var fragment = this.fragment = this.getFragment(fragmentOverride);
- var matched = _.any(this.handlers, function(handler) {
+ loadUrl: function(fragment) {
+ fragment = this.fragment = this.getFragment(fragment);
+ return _.any(this.handlers, function(handler) {
if (handler.route.test(fragment)) {
handler.callback(fragment);
return true;
}
});
- return matched;
},
-
+
Save a fragment into the hash history, or replace the URL state if the
'replace' option is passed. You are responsible for properly URL-encoding
-the fragment in advance.
-
-
+the fragment in advance.
The options object can contain trigger: true
if you wish to have the
route callback be fired (not usually desirable), or replace: true
, if
-you wish to modify the current URL without adding an entry to the history.
-
+you wish to modify the current URL without adding an entry to the history.
navigate: function(fragment, options) {
if (!History.started) return false;
- if (!options || options === true) options = {trigger: options};
- fragment = this.getFragment(fragment || '');
+ if (!options || options === true) options = {trigger: !!options};
+
+ var url = this.root + (fragment = this.getFragment(fragment || ''));
+
+
+
+
+
+
+
+
+
Strip the fragment of the query and hash for matching.
+
+
+
+ fragment = fragment.replace(pathStripper, '');
+
if (this.fragment === fragment) return;
- this.fragment = fragment;
- var url = this.root + fragment;
+ this.fragment = fragment;
+
+
+
+
+
+
+
+
+
Don't include a trailing slash on the root.
+
+
+
+ if (fragment === '' && url !== '/') url = url.slice(0, -1);
@@ -3834,8 +3656,7 @@
Backbone.History
-
If pushState is available, we use it to set the fragment as a real URL.
-
+
If pushState is available, we use it to set the fragment as a real URL.
@@ -3852,8 +3673,7 @@
Backbone.History
¶
If hash changes haven't been explicitly disabled, update the hash
-fragment to store history.
-
+fragment to store history.
@@ -3872,8 +3692,7 @@
Backbone.History
Opening and closing the iframe tricks IE7 and earlier to push a
history entry on hash-tag change. When replace is true, we don't
-want this.
-
+want this.
@@ -3891,15 +3710,14 @@
Backbone.History
¶
If you've told us that you explicitly don't want fallback hashchange-
-based history, then navigate
becomes a page refresh.
-
+based history, then navigate
becomes a page refresh.
} else {
return this.location.assign(url);
}
- if (options.trigger) this.loadUrl(fragment);
+ if (options.trigger) return this.loadUrl(fragment);
},
@@ -3912,8 +3730,7 @@
Backbone.History
¶
Update the hash location, either replacing the current entry, or adding
-a new one to the browser history.
-
+a new one to the browser history.
@@ -3932,8 +3749,7 @@ Backbone.History
- Some browsers require that hash
contains a leading #.
-
+ Some browsers require that hash
contains a leading #.
@@ -3952,8 +3768,7 @@ Backbone.History
- Create the default Backbone.history.
-
+ Create the default Backbone.history.
@@ -3983,8 +3798,7 @@ Helpers
Helper function to correctly set up the prototype chain, for subclasses.
Similar to goog.inherits
, but uses a hash of prototype properties and
-class properties to be extended.
-
+class properties to be extended.
@@ -4003,8 +3817,7 @@ Helpers
The constructor function for the new subclass is either defined by you
(the "constructor" property in your extend
definition), or defaulted
-by us to simply call the parent's constructor.
-
+by us to simply call the parent's constructor.
@@ -4023,8 +3836,7 @@
Helpers
-
Add static properties to the constructor function, if supplied.
-
+
Add static properties to the constructor function, if supplied.
@@ -4040,8 +3852,7 @@ Helpers
¶
Set the prototype chain to inherit from parent
, without calling
-parent
's constructor function.
-
+parent
's constructor function.
@@ -4059,8 +3870,7 @@
Helpers
¶
Add prototype properties (instance properties) to the subclass,
-if supplied.
-
+if supplied.
@@ -4076,8 +3886,7 @@
Helpers
¶
Set a convenience property in case the parent's prototype is needed
-later.
-
+later.
@@ -4095,8 +3904,7 @@ Helpers
- Set up inheritance for the model, collection, router, view and history.
-
+ Set up inheritance for the model, collection, router, view and history.
@@ -4111,8 +3919,7 @@ Helpers
- Throw an error when a URL is needed, and none is supplied.
-
+ Throw an error when a URL is needed, and none is supplied.
@@ -4129,12 +3936,11 @@ Helpers
- Wrap an optional error callback with a fallback error event.
-
+ Wrap an optional error callback with a fallback error event.
- var wrapError = function (model, options) {
+ var wrapError = function(model, options) {
var error = options.error;
options.error = function(resp) {
if (error) error(model, resp, options);
diff --git a/bower_components/backbone/docs/backbone.localstorage.html b/bower_components/backbone/docs/backbone.localstorage.html
index ed34b793..214d61b9 100644
--- a/bower_components/backbone/docs/backbone.localstorage.html
+++ b/bower_components/backbone/docs/backbone.localstorage.html
@@ -69,8 +69,7 @@ backbone.localstorage.js
- AMD. Register as an anonymous module.
-
+ AMD. Register as an anonymous module.
@@ -85,8 +84,7 @@
backbone.localstorage.js
-
Use global variables if the locals are undefined.
-
+
Use global variables if the locals are undefined.
@@ -103,8 +101,7 @@ backbone.localstorage.js
- RequireJS isn't being used. Assume underscore and backbone are loaded in
@@ -17,13 +26,5 @@
-
-
-
-