775 lines
128 KiB
Diff
775 lines
128 KiB
Diff
diff --git a/node_modules/backbone/backbone-min.js b/node_modules/backbone/backbone-min.js
|
|
deleted file mode 100644
|
|
index 9bcce86..0000000
|
|
--- a/node_modules/backbone/backbone-min.js
|
|
+++ /dev/null
|
|
@@ -1,2 +0,0 @@
|
|
-(function(r){var n=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global;if(typeof define==="function"&&define.amd){define(["underscore","jquery","exports"],function(t,e,i){n.Backbone=r(n,i,t,e)})}else if(typeof exports!=="undefined"){var t=require("underscore"),e;try{e=require("jquery")}catch(t){}r(n,exports,t,e)}else{n.Backbone=r(n,{},n._,n.jQuery||n.Zepto||n.ender||n.$)}})(function(t,h,x,e){var i=t.Backbone;var a=Array.prototype.slice;h.VERSION="1.6.0";h.$=e;h.noConflict=function(){t.Backbone=i;return this};h.emulateHTTP=false;h.emulateJSON=false;var r=h.Events={};var o=/\s+/;var l;var u=function(t,e,i,r,n){var s=0,a;if(i&&typeof i==="object"){if(r!==void 0&&"context"in n&&n.context===void 0)n.context=r;for(a=x.keys(i);s<a.length;s++){e=u(t,e,a[s],i[a[s]],n)}}else if(i&&o.test(i)){for(a=i.split(o);s<a.length;s++){e=t(e,a[s],r,n)}}else{e=t(e,i,r,n)}return e};r.on=function(t,e,i){this._events=u(n,this._events||{},t,e,{context:i,ctx:this,listening:l});if(l){var r=this._listeners||(this._listeners={});r[l.id]=l;l.interop=false}return this};r.listenTo=function(t,e,i){if(!t)return this;var r=t._listenId||(t._listenId=x.uniqueId("l"));var n=this._listeningTo||(this._listeningTo={});var s=l=n[r];if(!s){this._listenId||(this._listenId=x.uniqueId("l"));s=l=n[r]=new p(this,t)}var a=c(t,e,i,this);l=void 0;if(a)throw a;if(s.interop)s.on(e,i);return this};var n=function(t,e,i,r){if(i){var n=t[e]||(t[e]=[]);var s=r.context,a=r.ctx,o=r.listening;if(o)o.count++;n.push({callback:i,context:s,ctx:s||a,listening:o})}return t};var c=function(t,e,i,r){try{t.on(e,i,r)}catch(t){return t}};r.off=function(t,e,i){if(!this._events)return this;this._events=u(s,this._events,t,e,{context:i,listeners:this._listeners});return this};r.stopListening=function(t,e,i){var r=this._listeningTo;if(!r)return this;var n=t?[t._listenId]:x.keys(r);for(var s=0;s<n.length;s++){var a=r[n[s]];if(!a)break;a.obj.off(e,i,this);if(a.interop)a.off(e,i)}if(x.isEmpty(r))this._listeningTo=void 0;return this};var s=function(t,e,i,r){if(!t)return;var n=r.context,s=r.listeners;var a=0,o;if(!e&&!n&&!i){for(o=x.keys(s);a<o.length;a++){s[o[a]].cleanup()}return}o=e?[e]:x.keys(t);for(;a<o.length;a++){e=o[a];var h=t[e];if(!h)break;var l=[];for(var u=0;u<h.length;u++){var c=h[u];if(i&&i!==c.callback&&i!==c.callback._callback||n&&n!==c.context){l.push(c)}else{var f=c.listening;if(f)f.off(e,i)}}if(l.length){t[e]=l}else{delete t[e]}}return t};r.once=function(t,e,i){var r=u(f,{},t,e,this.off.bind(this));if(typeof t==="string"&&i==null)e=void 0;return this.on(r,e,i)};r.listenToOnce=function(t,e,i){var r=u(f,{},e,i,this.stopListening.bind(this,t));return this.listenTo(t,r)};var f=function(t,e,i,r){if(i){var n=t[e]=x.once(function(){r(e,n);i.apply(this,arguments)});n._callback=i}return t};r.trigger=function(t){if(!this._events)return this;var e=Math.max(0,arguments.length-1);var i=Array(e);for(var r=0;r<e;r++)i[r]=arguments[r+1];u(d,this._events,t,void 0,i);return this};var d=function(t,e,i,r){if(t){var n=t[e];var s=t.all;if(n&&s)s=s.slice();if(n)v(n,r);if(s)v(s,[e].concat(r))}return t};var v=function(t,e){var i,r=-1,n=t.length,s=e[0],a=e[1],o=e[2];switch(e.length){case 0:while(++r<n)(i=t[r]).callback.call(i.ctx);return;case 1:while(++r<n)(i=t[r]).callback.call(i.ctx,s);return;case 2:while(++r<n)(i=t[r]).callback.call(i.ctx,s,a);return;case 3:while(++r<n)(i=t[r]).callback.call(i.ctx,s,a,o);return;default:while(++r<n)(i=t[r]).callback.apply(i.ctx,e);return}};var p=function(t,e){this.id=t._listenId;this.listener=t;this.obj=e;this.interop=true;this.count=0;this._events=void 0};p.prototype.on=r.on;p.prototype.off=function(t,e){var i;if(this.interop){this._events=u(s,this._events,t,e,{context:void 0,listeners:void 0});i=!this._events}else{this.count--;i=this.count===0}if(i)this.cleanup()};p.prototype.cleanup=function(){delete this.listener._listeningTo[this.obj._listenId];if(!this.interop)delete this.obj._listeners[this.id]};r.bind=r.on;r.unbind=r.off;x.extend(h,r);var g=h.Model=function(t,e){var i=t||{};e||(e={});this.preinitialize.apply(this,arguments);this.cid=x.uniqueId(this.cidPrefix);this.attributes={};if(e.collection)this.collection=e.collection;if(e.parse)i=this.parse(i,e)||{};var r=x.result(this,"defaults");i=x.defaults(x.extend({},r,i),r);this.set(i,e);this.changed={};this.initialize.apply(this,arguments)};x.extend(g.prototype,r,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",preinitialize:function(){},initialize:function(){},toJSON:function(t){return x.clone(this.attributes)},sync:function(){return h.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return x.escape(this.get(t))},has:function(t){return this.get(t)!=null},matches:function(t){return!!x.iteratee(t,this)(this.attributes)},set:function(t,e,i){if(t==null)return this;var r;if(typeof t==="object"){r=t;i=e}else{(r={})[t]=e}i||(i={});if(!this._validate(r,i))return false;var n=i.unset;var s=i.silent;var a=[];var o=this._changing;this._changing=true;if(!o){this._previousAttributes=x.clone(this.attributes);this.changed={}}var h=this.attributes;var l=this.changed;var u=this._previousAttributes;for(var c in r){e=r[c];if(!x.isEqual(h[c],e))a.push(c);if(!x.isEqual(u[c],e)){l[c]=e}else{delete l[c]}n?delete h[c]:h[c]=e}if(this.idAttribute in r){var f=this.id;this.id=this.get(this.idAttribute);this.trigger("changeId",this,f,i)}if(!s){if(a.length)this._pending=i;for(var d=0;d<a.length;d++){this.trigger("change:"+a[d],this,h[a[d]],i)}}if(o)return this;if(!s){while(this._pending){i=this._pending;this._pending=false;this.trigger("change",this,i)}}this._pending=false;this._changing=false;return this},unset:function(t,e){return this.set(t,void 0,x.extend({},e,{unset:true}))},clear:function(t){var e={};for(var i in this.attributes)e[i]=void 0;return this.set(e,x.extend({},t,{unset:true}))},hasChanged:function(t){if(t==null)return!x.isEmpty(this.changed);return x.has(this.changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?x.clone(this.changed):false;var e=this._changing?this._previousAttributes:this.attributes;var i={};var r;for(var n in t){var s=t[n];if(x.isEqual(e[n],s))continue;i[n]=s;r=true}return r?i:false},previous:function(t){if(t==null||!this._previousAttributes)return null;return this._previousAttributes[t]},previousAttributes:function(){return x.clone(this._previousAttributes)},fetch:function(i){i=x.extend({parse:true},i);var r=this;var n=i.success;i.success=function(t){var e=i.parse?r.parse(t,i):t;if(!r.set(e,i))return false;if(n)n.call(i.context,r,t,i);r.trigger("sync",r,t,i)};G(this,i);return this.sync("read",this,i)},save:function(t,e,i){var r;if(t==null||typeof t==="object"){r=t;i=e}else{(r={})[t]=e}i=x.extend({validate:true,parse:true},i);var n=i.wait;if(r&&!n){if(!this.set(r,i))return false}else if(!this._validate(r,i)){return false}var s=this;var a=i.success;var o=this.attributes;i.success=function(t){s.attributes=o;var e=i.parse?s.parse(t,i):t;if(n)e=x.extend({},r,e);if(e&&!s.set(e,i))return false;if(a)a.call(i.context,s,t,i);s.trigger("sync",s,t,i)};G(this,i);if(r&&n)this.attributes=x.extend({},o,r);var h=this.isNew()?"create":i.patch?"patch":"update";if(h==="patch"&&!i.attrs)i.attrs=r;var l=this.sync(h,this,i);this.attributes=o;return l},destroy:function(e){e=e?x.clone(e):{};var i=this;var r=e.success;var n=e.wait;var s=function(){i.stopListening();i.trigger("destroy",i,i.collection,e)};e.success=function(t){if(n)s();if(r)r.call(e.context,i,t,e);if(!i.isNew())i.trigger("sync",i,t,e)};var t=false;if(this.isNew()){x.defer(e.success)}else{G(this,e);t=this.sync("delete",this,e)}if(!n)s();return t},url:function(){var t=x.result(this,"urlRoot")||x.result(this.collection,"url")||V();if(this.isNew())return t;var e=this.get(this.idAttribute);return t.replace(/[^\/]$/,"$&/")+encodeURIComponent(e)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},x.extend({},t,{validate:true}))},_validate:function(t,e){if(!e.validate||!this.validate)return true;t=x.extend({},this.attributes,t);var i=this.validationError=this.validate(t,e)||null;if(!i)return true;this.trigger("invalid",this,i,x.extend(e,{validationError:i}));return false}});var m=h.Collection=function(t,e){e||(e={});this.preinitialize.apply(this,arguments);if(e.model)this.model=e.model;if(e.comparator!==void 0)this.comparator=e.comparator;this._reset();this.initialize.apply(this,arguments);if(t)this.reset(t,x.extend({silent:true},e))};var w={add:true,remove:true,merge:true};var _={add:true,remove:false};var E=function(t,e,i){i=Math.min(Math.max(i,0),t.length);var r=Array(t.length-i);var n=e.length;var s;for(s=0;s<r.length;s++)r[s]=t[s+i];for(s=0;s<n;s++)t[s+i]=e[s];for(s=0;s<r.length;s++)t[s+n+i]=r[s]};x.extend(m.prototype,r,{model:g,preinitialize:function(){},initialize:function(){},toJSON:function(e){return this.map(function(t){return t.toJSON(e)})},sync:function(){return h.sync.apply(this,arguments)},add:function(t,e){return this.set(t,x.extend({merge:false},e,_))},remove:function(t,e){e=x.extend({},e);var i=!x.isArray(t);t=i?[t]:t.slice();var r=this._removeModels(t,e);if(!e.silent&&r.length){e.changes={added:[],merged:[],removed:r};this.trigger("update",this,e)}return i?r[0]:r},set:function(t,e){if(t==null)return;e=x.extend({},w,e);if(e.parse&&!this._isModel(t)){t=this.parse(t,e)||[]}var i=!x.isArray(t);t=i?[t]:t.slice();var r=e.at;if(r!=null)r=+r;if(r>this.length)r=this.length;if(r<0)r+=this.length+1;var n=[];var s=[];var a=[];var o=[];var h={};var l=e.add;var u=e.merge;var c=e.remove;var f=false;var d=this.comparator&&r==null&&e.sort!==false;var v=x.isString(this.comparator)?this.comparator:null;var p,g;for(g=0;g<t.length;g++){p=t[g];var m=this.get(p);if(m){if(u&&p!==m){var _=this._isModel(p)?p.attributes:p;if(e.parse)_=m.parse(_,e);m.set(_,e);a.push(m);if(d&&!f)f=m.hasChanged(v)}if(!h[m.cid]){h[m.cid]=true;n.push(m)}t[g]=m}else if(l){p=t[g]=this._prepareModel(p,e);if(p){s.push(p);this._addReference(p,e);h[p.cid]=true;n.push(p)}}}if(c){for(g=0;g<this.length;g++){p=this.models[g];if(!h[p.cid])o.push(p)}if(o.length)this._removeModels(o,e)}var y=false;var b=!d&&l&&c;if(n.length&&b){y=this.length!==n.length||x.some(this.models,function(t,e){return t!==n[e]});this.models.length=0;E(this.models,n,0);this.length=this.models.length}else if(s.length){if(d)f=true;E(this.models,s,r==null?this.length:r);this.length=this.models.length}if(f)this.sort({silent:true});if(!e.silent){for(g=0;g<s.length;g++){if(r!=null)e.index=r+g;p=s[g];p.trigger("add",p,this,e)}if(f||y)this.trigger("sort",this,e);if(s.length||o.length||a.length){e.changes={added:s,removed:o,merged:a};this.trigger("update",this,e)}}return i?t[0]:t},reset:function(t,e){e=e?x.clone(e):{};for(var i=0;i<this.models.length;i++){this._removeReference(this.models[i],e)}e.previousModels=this.models;this._reset();t=this.add(t,x.extend({silent:true},e));if(!e.silent)this.trigger("reset",this,e);return t},push:function(t,e){return this.add(t,x.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,x.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t)},slice:function(){return a.apply(this.models,arguments)},get:function(t){if(t==null)return void 0;return this._byId[t]||this._byId[this.modelId(this._isModel(t)?t.attributes:t,t.idAttribute)]||t.cid&&this._byId[t.cid]},has:function(t){return this.get(t)!=null},at:function(t){if(t<0)t+=this.length;return this.models[t]},where:function(t,e){return this[e?"find":"filter"](t)},findWhere:function(t){return this.where(t,true)},sort:function(t){var e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t||(t={});var i=e.length;if(x.isFunction(e))e=e.bind(this);if(i===1||x.isString(e)){this.models=this.sortBy(e)}else{this.models.sort(e)}if(!t.silent)this.trigger("sort",this,t);return this},pluck:function(t){return this.map(t+"")},fetch:function(i){i=x.extend({parse:true},i);var r=i.success;var n=this;i.success=function(t){var e=i.reset?"reset":"set";n[e](t,i);if(r)r.call(i.context,n,t,i);n.trigger("sync",n,t,i)};G(this,i);return this.sync("read",this,i)},create:function(t,e){e=e?x.clone(e):{};var r=e.wait;t=this._prepareModel(t,e);if(!t)return false;if(!r)this.add(t,e);var n=this;var s=e.success;e.success=function(t,e,i){if(r){t.off("error",n._forwardPristineError,n);n.add(t,i)}if(s)s.call(i.context,t,e,i)};if(r){t.once("error",this._forwardPristineError,this)}t.save(null,e);return t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t,e){return t[e||this.model.prototype.idAttribute||"id"]},values:function(){return new b(this,S)},keys:function(){return new b(this,I)},entries:function(){return new b(this,k)},_reset:function(){this.length=0;this.models=[];this._byId={}},_prepareModel:function(t,e){if(this._isModel(t)){if(!t.collection)t.collection=this;return t}e=e?x.clone(e):{};e.collection=this;var i;if(this.model.prototype){i=new this.model(t,e)}else{i=this.model(t,e)}if(!i.validationError)return i;this.trigger("invalid",this,i.validationError,e);return false},_removeModels:function(t,e){var i=[];for(var r=0;r<t.length;r++){var n=this.get(t[r]);if(!n)continue;var s=this.indexOf(n);this.models.splice(s,1);this.length--;delete this._byId[n.cid];var a=this.modelId(n.attributes,n.idAttribute);if(a!=null)delete this._byId[a];if(!e.silent){e.index=s;n.trigger("remove",n,this,e)}i.push(n);this._removeReference(n,e)}if(t.length>0&&!e.silent)delete e.index;return i},_isModel:function(t){return t instanceof g},_addReference:function(t,e){this._byId[t.cid]=t;var i=this.modelId(t.attributes,t.idAttribute);if(i!=null)this._byId[i]=t;t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){delete this._byId[t.cid];var i=this.modelId(t.attributes,t.idAttribute);if(i!=null)delete this._byId[i];if(this===t.collection)delete t.collection;t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,r){if(e){if((t==="add"||t==="remove")&&i!==this)return;if(t==="destroy")this.remove(e,r);if(t==="changeId"){var n=this.modelId(e.previousAttributes(),e.idAttribute);var s=this.modelId(e.attributes,e.idAttribute);if(n!=null)delete this._byId[n];if(s!=null)this._byId[s]=e}}this.trigger.apply(this,arguments)},_forwardPristineError:function(t,e,i){if(this.has(t))return;this._onModelEvent("error",t,e,i)}});var y=typeof Symbol==="function"&&Symbol.iterator;if(y){m.prototype[y]=m.prototype.values}var b=function(t,e){this._collection=t;this._kind=e;this._index=0};var S=1;var I=2;var k=3;if(y){b.prototype[y]=function(){return this}}b.prototype.next=function(){if(this._collection){if(this._index<this._collection.length){var t=this._collection.at(this._index);this._index++;var e;if(this._kind===S){e=t}else{var i=this._collection.modelId(t.attributes,t.idAttribute);if(this._kind===I){e=i}else{e=[i,t]}}return{value:e,done:false}}this._collection=void 0}return{value:void 0,done:true}};var A=h.View=function(t){this.cid=x.uniqueId("view");this.preinitialize.apply(this,arguments);x.extend(this,x.pick(t,T));this._ensureElement();this.initialize.apply(this,arguments)};var P=/^(\S+)\s*(.*)$/;var T=["model","collection","el","id","attributes","className","tagName","events"];x.extend(A.prototype,r,{tagName:"div",$:function(t){return this.$el.find(t)},preinitialize:function(){},initialize:function(){},render:function(){return this},remove:function(){this._removeElement();this.stopListening();return this},_removeElement:function(){this.$el.remove()},setElement:function(t){this.undelegateEvents();this._setElement(t);this.delegateEvents();return this},_setElement:function(t){this.$el=t instanceof h.$?t:h.$(t);this.el=this.$el[0]},delegateEvents:function(t){t||(t=x.result(this,"events"));if(!t)return this;this.undelegateEvents();for(var e in t){var i=t[e];if(!x.isFunction(i))i=this[i];if(!i)continue;var r=e.match(P);this.delegate(r[1],r[2],i.bind(this))}return this},delegate:function(t,e,i){this.$el.on(t+".delegateEvents"+this.cid,e,i);return this},undelegateEvents:function(){if(this.$el)this.$el.off(".delegateEvents"+this.cid);return this},undelegate:function(t,e,i){this.$el.off(t+".delegateEvents"+this.cid,e,i);return this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){if(!this.el){var t=x.extend({},x.result(this,"attributes"));if(this.id)t.id=x.result(this,"id");if(this.className)t["class"]=x.result(this,"className");this.setElement(this._createElement(x.result(this,"tagName")));this._setAttributes(t)}else{this.setElement(x.result(this,"el"))}},_setAttributes:function(t){this.$el.attr(t)}});var H=function(r,t,n,s){switch(t){case 1:return function(){return r[n](this[s])};case 2:return function(t){return r[n](this[s],t)};case 3:return function(t,e){return r[n](this[s],C(t,this),e)};case 4:return function(t,e,i){return r[n](this[s],C(t,this),e,i)};default:return function(){var t=a.call(arguments);t.unshift(this[s]);return r[n].apply(r,t)}}};var $=function(i,r,t,n){x.each(t,function(t,e){if(r[e])i.prototype[e]=H(r,t,e,n)})};var C=function(e,t){if(x.isFunction(e))return e;if(x.isObject(e)&&!t._isModel(e))return R(e);if(x.isString(e))return function(t){return t.get(e)};return e};var R=function(t){var e=x.matches(t);return function(t){return e(t.attributes)}};var M={forEach:3,each:3,map:3,collect:3,reduce:0,foldl:0,inject:0,reduceRight:0,foldr:0,find:3,detect:3,filter:3,select:3,reject:3,every:3,all:3,some:3,any:3,include:3,includes:3,contains:3,invoke:0,max:3,min:3,toArray:1,size:1,first:3,head:3,take:3,initial:3,rest:3,tail:3,drop:3,last:3,without:0,difference:0,indexOf:3,shuffle:1,lastIndexOf:3,isEmpty:1,chain:1,sample:3,partition:3,groupBy:3,countBy:3,sortBy:3,indexBy:3,findIndex:3,findLastIndex:3};var N={keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1};x.each([[m,M,"models"],[g,N,"attributes"]],function(t){var i=t[0],e=t[1],r=t[2];i.mixin=function(t){var e=x.reduce(x.functions(t),function(t,e){t[e]=0;return t},{});$(i,t,e,r)};$(i,x,e,r)});h.sync=function(t,e,r){var i=j[t];x.defaults(r||(r={}),{emulateHTTP:h.emulateHTTP,emulateJSON:h.emulateJSON});var n={type:i,dataType:"json"};if(!r.url){n.url=x.result(e,"url")||V()}if(r.data==null&&e&&(t==="create"||t==="update"||t==="patch")){n.contentType="application/json";n.data=JSON.stringify(r.attrs||e.toJSON(r))}if(r.emulateJSON){n.contentType="application/x-www-form-urlencoded";n.data=n.data?{model:n.data}:{}}if(r.emulateHTTP&&(i==="PUT"||i==="DELETE"||i==="PATCH")){n.type="POST";if(r.emulateJSON)n.data._method=i;var s=r.beforeSend;r.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",i);if(s)return s.apply(this,arguments)}}if(n.type!=="GET"&&!r.emulateJSON){n.processData=false}var a=r.error;r.error=function(t,e,i){r.textStatus=e;r.errorThrown=i;if(a)a.call(r.context,t,e,i)};var o=r.xhr=h.ajax(x.extend(n,r));e.trigger("request",e,o,r);return o};var j={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};h.ajax=function(){return h.$.ajax.apply(h.$,arguments)};var O=h.Router=function(t){t||(t={});this.preinitialize.apply(this,arguments);if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var U=/\((.*?)\)/g;var z=/(\(\?)?:\w+/g;var q=/\*\w+/g;var F=/[\-{}\[\]+?.,\\\^$|#\s]/g;x.extend(O.prototype,r,{preinitialize:function(){},initialize:function(){},route:function(i,r,n){if(!x.isRegExp(i))i=this._routeToRegExp(i);if(x.isFunction(r)){n=r;r=""}if(!n)n=this[r];var s=this;h.history.route(i,function(t){var e=s._extractParameters(i,t);if(s.execute(n,e,r)!==false){s.trigger.apply(s,["route:"+r].concat(e));s.trigger("route",r,e);h.history.trigger("route",s,r,e)}});return this},execute:function(t,e,i){if(t)t.apply(this,e)},navigate:function(t,e){h.history.navigate(t,e);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=x.result(this,"routes");var t,e=x.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(F,"\\$&").replace(U,"(?:$1)?").replace(z,function(t,e){return e?t:"([^/?]+)"}).replace(q,"([^?]*?)");return new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var i=t.exec(e).slice(1);return x.map(i,function(t,e){if(e===i.length-1)return t||null;return t?decodeURIComponent(t):null})}});var B=h.History=function(){this.handlers=[];this.checkUrl=this.checkUrl.bind(this);if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var J=/^[#\/]|\s+$/g;var L=/^\/+|\/+$/g;var W=/#.*$/;B.started=false;x.extend(B.prototype,r,{interval:50,atRoot:function(){var t=this.location.pathname.replace(/[^\/]$/,"$&/");return t===this.root&&!this.getSearch()},matchRoot:function(){var t=this.decodeFragment(this.location.pathname);var e=t.slice(0,this.root.length-1)+"/";return e===this.root},decodeFragment:function(t){return decodeURI(t.replace(/%25/g,"%2525"))},getSearch:function(){var t=this.location.href.replace(/#.*/,"").match(/\?.+/);return t?t[0]:""},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getPath:function(){var t=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return t.charAt(0)==="/"?t.slice(1):t},getFragment:function(t){if(t==null){if(this._usePushState||!this._wantsHashChange){t=this.getPath()}else{t=this.getHash()}}return t.replace(J,"")},start:function(t){if(B.started)throw new Error("Backbone.history has already been started");B.started=true;this.options=x.extend({root:"/"},this.options,t);this.root=this.options.root;this._trailingSlash=this.options.trailingSlash;this._wantsHashChange=this.options.hashChange!==false;this._hasHashChange="onhashchange"in window&&(document.documentMode===void 0||document.documentMode>7);this._useHashChange=this._wantsHashChange&&this._hasHashChange;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.history&&this.history.pushState);this._usePushState=this._wantsPushState&&this._hasPushState;this.fragment=this.getFragment();this.root=("/"+this.root+"/").replace(L,"/");if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";this.location.replace(e+"#"+this.getPath());return true}else if(this._hasPushState&&this.atRoot()){this.navigate(this.getHash(),{replace:true})}}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe");this.iframe.src="javascript:0";this.iframe.style.display="none";this.iframe.tabIndex=-1;var i=document.body;var r=i.insertBefore(this.iframe,i.firstChild).contentWindow;r.document.open();r.document.close();r.location.hash="#"+this.fragment}var n=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState){n("popstate",this.checkUrl,false)}else if(this._useHashChange&&!this.iframe){n("hashchange",this.checkUrl,false)}else if(this._wantsHashChange){this._checkUrlInterval=setInterval(this.checkUrl,this.interval)}if(!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};if(this._usePushState){t("popstate",this.checkUrl,false)}else if(this._useHashChange&&!this.iframe){t("hashchange",this.checkUrl,false)}if(this.iframe){document.body.removeChild(this.iframe);this.iframe=null}if(this._checkUrlInterval)clearInterval(this._checkUrlInterval);B.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.getHash(this.iframe.contentWindow)}if(e===this.fragment){if(!this.matchRoot())return this.notfound();return false}if(this.iframe)this.navigate(e);this.loadUrl()},loadUrl:function(e){if(!this.matchRoot())return this.notfound();e=this.fragment=this.getFragment(e);return x.some(this.handlers,function(t){if(t.route.test(e)){t.callback(e);return true}})||this.notfound()},notfound:function(){this.trigger("notfound");return false},navigate:function(t,e){if(!B.started)return false;if(!e||e===true)e={trigger:!!e};t=this.getFragment(t||"");var i=this.root;if(!this._trailingSlash&&(t===""||t.charAt(0)==="?")){i=i.slice(0,-1)||"/"}var r=i+t;t=t.replace(W,"");var n=this.decodeFragment(t);if(this.fragment===n)return;this.fragment=n;if(this._usePushState){this.history[e.replace?"replaceState":"pushState"]({},document.title,r)}else if(this._wantsHashChange){this._updateHash(this.location,t,e.replace);if(this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var s=this.iframe.contentWindow;if(!e.replace){s.document.open();s.document.close()}this._updateHash(s.location,t,e.replace)}}else{return this.location.assign(r)}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}}});h.history=new B;var D=function(t,e){var i=this;var r;if(t&&x.has(t,"constructor")){r=t.constructor}else{r=function(){return i.apply(this,arguments)}}x.extend(r,i,e);r.prototype=x.create(i.prototype,t);r.prototype.constructor=r;r.__super__=i.prototype;return r};g.extend=m.extend=O.extend=A.extend=B.extend=D;var V=function(){throw new Error('A "url" property or function must be specified')};var G=function(e,i){var r=i.error;i.error=function(t){if(r)r.call(i.context,e,t,i);e.trigger("error",e,t,i)}};h._debug=function(){return{root:t,_:x}};return h});
|
|
-//# sourceMappingURL=backbone-min.js.map
|
|
\ No newline at end of file
|
|
diff --git a/node_modules/backbone/backbone-min.js.map b/node_modules/backbone/backbone-min.js.map
|
|
deleted file mode 100644
|
|
index 2ba6c35..0000000
|
|
--- a/node_modules/backbone/backbone-min.js.map
|
|
+++ /dev/null
|
|
@@ -1 +0,0 @@
|
|
-{"version":3,"sources":["backbone.js"],"names":["factory","root","self","global","define","amd","_","$","exports","Backbone","require","e","jQuery","Zepto","ender","previousBackbone","slice","Array","prototype","VERSION","noConflict","this","emulateHTTP","emulateJSON","Events","eventSplitter","_listening","eventsApi","iteratee","events","name","callback","opts","i","names","context","keys","length","test","split","on","_events","onApi","ctx","listening","listeners","_listeners","id","interop","listenTo","obj","_listenId","uniqueId","listeningTo","_listeningTo","Listening","error","tryCatchOn","options","handlers","count","push","off","offApi","stopListening","ids","isEmpty","cleanup","remaining","j","handler","_callback","once","onceMap","bind","listenToOnce","map","offer","apply","arguments","trigger","Math","max","args","triggerApi","objEvents","allEvents","all","triggerEvents","concat","ev","l","a1","a2","a3","call","listener","unbind","extend","Model","attributes","attrs","preinitialize","cid","cidPrefix","collection","parse","defaults","result","set","changed","initialize","validationError","idAttribute","toJSON","clone","sync","get","attr","escape","has","matches","key","val","_validate","unset","silent","changes","changing","_changing","_previousAttributes","current","prev","isEqual","prevId","_pending","clear","hasChanged","changedAttributes","diff","old","previous","previousAttributes","fetch","model","success","resp","serverAttrs","wrapError","save","validate","wait","method","isNew","patch","xhr","destroy","defer","url","base","urlError","replace","encodeURIComponent","constructor","isValid","Collection","models","comparator","_reset","reset","setOptions","add","remove","merge","addOptions","splice","array","insert","at","min","tail","singular","isArray","removed","_removeModels","added","merged","_isModel","toAdd","toMerge","toRemove","modelMap","sort","sortable","sortAttr","isString","existing","_prepareModel","_addReference","orderChanged","some","m","index","_removeReference","previousModels","pop","unshift","shift","_byId","modelId","where","first","findWhere","Error","isFunction","sortBy","pluck","create","callbackOpts","_forwardPristineError","values","CollectionIterator","ITERATOR_VALUES","ITERATOR_KEYS","entries","ITERATOR_KEYSVALUES","indexOf","_onModelEvent","event","$$iterator","Symbol","iterator","kind","_collection","_kind","_index","next","value","done","View","pick","viewOptions","_ensureElement","delegateEventSplitter","tagName","selector","$el","find","render","_removeElement","setElement","element","undelegateEvents","_setElement","delegateEvents","el","match","delegate","eventName","undelegate","_createElement","document","createElement","className","_setAttributes","addMethod","attribute","cb","defaultVal","addUnderscoreMethods","Class","methods","each","instance","isObject","modelMatcher","matcher","collectionMethods","forEach","collect","reduce","foldl","inject","reduceRight","foldr","detect","filter","select","reject","every","any","include","includes","contains","invoke","toArray","size","head","take","initial","rest","drop","last","without","difference","shuffle","lastIndexOf","chain","sample","partition","groupBy","countBy","indexBy","findIndex","findLastIndex","modelMethods","pairs","invert","omit","config","Base","mixin","mappings","functions","memo","type","methodMap","params","dataType","data","contentType","JSON","stringify","_method","beforeSend","setRequestHeader","processData","textStatus","errorThrown","ajax","update","delete","read","Router","routes","_bindRoutes","optionalParam","namedParam","splatParam","escapeRegExp","route","isRegExp","_routeToRegExp","router","history","fragment","_extractParameters","execute","navigate","optional","RegExp","exec","param","decodeURIComponent","History","checkUrl","window","location","routeStripper","rootStripper","pathStripper","started","interval","atRoot","path","pathname","getSearch","matchRoot","decodeFragment","rootPath","decodeURI","href","getHash","getPath","charAt","getFragment","_usePushState","_wantsHashChange","start","_trailingSlash","trailingSlash","hashChange","_hasHashChange","documentMode","_useHashChange","_wantsPushState","pushState","_hasPushState","iframe","src","style","display","tabIndex","body","iWindow","insertBefore","firstChild","contentWindow","open","close","hash","addEventListener","attachEvent","_checkUrlInterval","setInterval","loadUrl","stop","removeEventListener","detachEvent","removeChild","clearInterval","notfound","decodedFragment","title","_updateHash","assign","protoProps","staticProps","parent","child","__super__","_debug"],"mappings":"CAOA,SAAUA,GAIR,IAAIC,SAAcC,MAAQ,UAAYA,KAAKA,OAASA,MAAQA,aAC3CC,QAAU,UAAYA,OAAOA,SAAWA,QAAUA,OAGnE,UAAWC,SAAW,YAAcA,OAAOC,IAAK,CAC9CD,OAAO,CAAC,aAAc,SAAU,WAAY,SAASE,EAAGC,EAAGC,GAGzDP,EAAKQ,SAAWT,EAAQC,EAAMO,EAASF,EAAGC,UAIvC,UAAWC,UAAY,YAAa,CACzC,IAAIF,EAAII,QAAQ,cAAeH,EAC/B,IAAMA,EAAIG,QAAQ,UAAa,MAAOC,IACtCX,EAAQC,EAAMO,QAASF,EAAGC,OAGrB,CACLN,EAAKQ,SAAWT,EAAQC,EAAM,GAAIA,EAAKK,EAAGL,EAAKW,QAAUX,EAAKY,OAASZ,EAAKa,OAASb,EAAKM,KAvB9F,CA0BG,SAASN,EAAMQ,EAAUH,EAAGC,GAO7B,IAAIQ,EAAmBd,EAAKQ,SAG5B,IAAIO,EAAQC,MAAMC,UAAUF,MAG5BP,EAASU,QAAU,QAInBV,EAASF,EAAIA,EAIbE,EAASW,WAAa,WACpBnB,EAAKQ,SAAWM,EAChB,OAAOM,MAMTZ,EAASa,YAAc,MAMvBb,EAASc,YAAc,MAevB,IAAIC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AGA,IAGzB,OAAOG"}
|
|
\ No newline at end of file
|
|
diff --git a/node_modules/backbone/backbone-min.map b/node_modules/backbone/backbone-min.map
|
|
deleted file mode 100644
|
|
index 2ba6c35..0000000
|
|
--- a/node_modules/backbone/backbone-min.map
|
|
+++ /dev/null
|
|
@@ -1 +0,0 @@
|
|
-{"version":3,"sources":["backbone.js"],"names":["factory","root","self","global","define","amd","_","$","exports","Backbone","require","e","jQuery","Zepto","ender","previousBackbone","slice","Array","prototype","VERSION","noConflict","this","emulateHTTP","emulateJSON","Events","eventSplitter","_listening","eventsApi","iteratee","events","name","callback","opts","i","names","context","keys","length","test","split","on","_events","onApi","ctx","listening","listeners","_listeners","id","interop","listenTo","obj","_listenId","uniqueId","listeningTo","_listeningTo","Listening","error","tryCatchOn","options","handlers","count","push","off","offApi","stopListening","ids","isEmpty","cleanup","remaining","j","handler","_callback","once","onceMap","bind","listenToOnce","map","offer","apply","arguments","trigger","Math","max","args","triggerApi","objEvents","allEvents","all","triggerEvents","concat","ev","l","a1","a2","a3","call","listener","unbind","extend","Model","attributes","attrs","preinitialize","cid","cidPrefix","collection","parse","defaults","result","set","changed","initialize","validationError","idAttribute","toJSON","clone","sync","get","attr","escape","has","matches","key","val","_validate","unset","silent","changes","changing","_changing","_previousAttributes","current","prev","isEqual","prevId","_pending","clear","hasChanged","changedAttributes","diff","old","previous","previousAttributes","fetch","model","success","resp","serverAttrs","wrapError","save","validate","wait","method","isNew","patch","xhr","destroy","defer","url","base","urlError","replace","encodeURIComponent","constructor","isValid","Collection","models","comparator","_reset","reset","setOptions","add","remove","merge","addOptions","splice","array","insert","at","min","tail","singular","isArray","removed","_removeModels","added","merged","_isModel","toAdd","toMerge","toRemove","modelMap","sort","sortable","sortAttr","isString","existing","_prepareModel","_addReference","orderChanged","some","m","index","_removeReference","previousModels","pop","unshift","shift","_byId","modelId","where","first","findWhere","Error","isFunction","sortBy","pluck","create","callbackOpts","_forwardPristineError","values","CollectionIterator","ITERATOR_VALUES","ITERATOR_KEYS","entries","ITERATOR_KEYSVALUES","indexOf","_onModelEvent","event","$$iterator","Symbol","iterator","kind","_collection","_kind","_index","next","value","done","View","pick","viewOptions","_ensureElement","delegateEventSplitter","tagName","selector","$el","find","render","_removeElement","setElement","element","undelegateEvents","_setElement","delegateEvents","el","match","delegate","eventName","undelegate","_createElement","document","createElement","className","_setAttributes","addMethod","attribute","cb","defaultVal","addUnderscoreMethods","Class","methods","each","instance","isObject","modelMatcher","matcher","collectionMethods","forEach","collect","reduce","foldl","inject","reduceRight","foldr","detect","filter","select","reject","every","any","include","includes","contains","invoke","toArray","size","head","take","initial","rest","drop","last","without","difference","shuffle","lastIndexOf","chain","sample","partition","groupBy","countBy","indexBy","findIndex","findLastIndex","modelMethods","pairs","invert","omit","config","Base","mixin","mappings","functions","memo","type","methodMap","params","dataType","data","contentType","JSON","stringify","_method","beforeSend","setRequestHeader","processData","textStatus","errorThrown","ajax","update","delete","read","Router","routes","_bindRoutes","optionalParam","namedParam","splatParam","escapeRegExp","route","isRegExp","_routeToRegExp","router","history","fragment","_extractParameters","execute","navigate","optional","RegExp","exec","param","decodeURIComponent","History","checkUrl","window","location","routeStripper","rootStripper","pathStripper","started","interval","atRoot","path","pathname","getSearch","matchRoot","decodeFragment","rootPath","decodeURI","href","getHash","getPath","charAt","getFragment","_usePushState","_wantsHashChange","start","_trailingSlash","trailingSlash","hashChange","_hasHashChange","documentMode","_useHashChange","_wantsPushState","pushState","_hasPushState","iframe","src","style","display","tabIndex","body","iWindow","insertBefore","firstChild","contentWindow","open","close","hash","addEventListener","attachEvent","_checkUrlInterval","setInterval","loadUrl","stop","removeEventListener","detachEvent","removeChild","clearInterval","notfound","decodedFragment","title","_updateHash","assign","protoProps","staticProps","parent","child","__super__","_debug"],"mappings":"CAOA,SAAUA,GAIR,IAAIC,SAAcC,MAAQ,UAAYA,KAAKA,OAASA,MAAQA,aAC3CC,QAAU,UAAYA,OAAOA,SAAWA,QAAUA,OAGnE,UAAWC,SAAW,Y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,WAAY,OAAOD,EAAO9V,MAAMzD,KAAM0D,YAIhDzE,EAAE4F,OAAO2U,EAAOD,EAAQD,GAIxBE,EAAM3Z,UAAYZ,EAAEmN,OAAOmN,EAAO1Z,UAAWwZ,GAC7CG,EAAM3Z,UAAUiJ,YAAc0Q,EAI9BA,EAAMC,UAAYF,EAAO1Z,UAEzB,OAAO2Z,GAIT1U,EAAMD,OAASmE,EAAWnE,OAASqP,EAAOrP,OAAS6I,EAAK7I,OAAS0Q,EAAQ1Q,OAASA,EAGlF,IAAI8D,EAAW,WACb,MAAM,IAAIqD,MAAM,mDAIlB,IAAIjE,EAAY,SAASJ,EAAOtF,GAC9B,IAAIF,EAAQE,EAAQF,MACpBE,EAAQF,MAAQ,SAAS0F,GACvB,GAAI1F,EAAOA,EAAMuC,KAAKrC,EAAQvB,QAAS6G,EAAOE,EAAMxF,GACpDsF,EAAMhE,QAAQ,QAASgE,EAAOE,EAAMxF,KAOxCjD,EAASsa,OAAS,WAChB,MAAO,CAAC9a,KAAMA,EAAMK,EAAGA,IAGzB,OAAOG"}
|
|
\ No newline at end of file
|
|
diff --git a/node_modules/backbone/backbone.js b/node_modules/backbone/backbone.js
|
|
index aa36f1e..9dfedbb 100644
|
|
--- a/node_modules/backbone/backbone.js
|
|
+++ b/node_modules/backbone/backbone.js
|
|
@@ -12,24 +12,8 @@
|
|
var root = typeof self == 'object' && self.self === self && self ||
|
|
typeof global == 'object' && global.global === global && global;
|
|
|
|
- // Set up Backbone appropriately for the environment. Start with AMD.
|
|
- if (typeof define === 'function' && define.amd) {
|
|
- define(['underscore', 'jquery', 'exports'], function(_, $, exports) {
|
|
- // Export global even in AMD case in case this script is loaded with
|
|
- // others that may still expect a global Backbone.
|
|
- root.Backbone = factory(root, exports, _, $);
|
|
- });
|
|
-
|
|
- // Next for Node.js or CommonJS. jQuery may not be needed as a module.
|
|
- } else if (typeof exports !== 'undefined') {
|
|
- var _ = require('underscore'), $;
|
|
- try { $ = require('jquery'); } catch (e) {}
|
|
- factory(root, exports, _, $);
|
|
-
|
|
- // Finally, as a browser global.
|
|
- } else {
|
|
- root.Backbone = factory(root, {}, root._, root.jQuery || root.Zepto || root.ender || root.$);
|
|
- }
|
|
+ var _ = require('lodash'), $;
|
|
+ factory(root, exports, _, $);
|
|
|
|
})(function(root, Backbone, _, $) {
|
|
|
|
@@ -46,10 +30,6 @@
|
|
// Current version of the library. Keep in sync with `package.json`.
|
|
Backbone.VERSION = '1.6.0';
|
|
|
|
- // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns
|
|
- // the `$` variable.
|
|
- Backbone.$ = $;
|
|
-
|
|
// Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable
|
|
// to its previous owner. Returns a reference to this Backbone object.
|
|
Backbone.noConflict = function() {
|
|
@@ -1319,174 +1299,6 @@
|
|
return {value: void 0, done: true};
|
|
};
|
|
|
|
- // 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
|
|
- // DOM. This might be a single item, an entire list, a sidebar or panel, or
|
|
- // 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.
|
|
-
|
|
- // Creating a Backbone.View creates its initial element outside of the DOM,
|
|
- // if an existing element is not provided...
|
|
- var View = Backbone.View = function(options) {
|
|
- this.cid = _.uniqueId('view');
|
|
- this.preinitialize.apply(this, arguments);
|
|
- _.extend(this, _.pick(options, viewOptions));
|
|
- this._ensureElement();
|
|
- this.initialize.apply(this, arguments);
|
|
- };
|
|
-
|
|
- // Cached regex to split keys for `delegate`.
|
|
- var delegateEventSplitter = /^(\S+)\s*(.*)$/;
|
|
-
|
|
- // List of view options to be set as properties.
|
|
- var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];
|
|
-
|
|
- // Set up all inheritable **Backbone.View** properties and methods.
|
|
- _.extend(View.prototype, Events, {
|
|
-
|
|
- // The default `tagName` of a View's element is `"div"`.
|
|
- tagName: 'div',
|
|
-
|
|
- // jQuery delegate for element lookup, scoped to DOM elements within the
|
|
- // current view. This should be preferred to global lookups where possible.
|
|
- $: function(selector) {
|
|
- return this.$el.find(selector);
|
|
- },
|
|
-
|
|
- // preinitialize is an empty function by default. You can override it with a function
|
|
- // or object. preinitialize will run before any instantiation logic is run in the View
|
|
- preinitialize: function(){},
|
|
-
|
|
- // Initialize is an empty function by default. Override it with your own
|
|
- // initialization logic.
|
|
- initialize: function(){},
|
|
-
|
|
- // **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`.
|
|
- render: function() {
|
|
- return this;
|
|
- },
|
|
-
|
|
- // Remove this view by taking the element out of the DOM, and removing any
|
|
- // applicable Backbone.Events listeners.
|
|
- remove: function() {
|
|
- this._removeElement();
|
|
- this.stopListening();
|
|
- return this;
|
|
- },
|
|
-
|
|
- // Remove this view's element from the document and all event listeners
|
|
- // attached to it. Exposed for subclasses using an alternative DOM
|
|
- // manipulation API.
|
|
- _removeElement: function() {
|
|
- this.$el.remove();
|
|
- },
|
|
-
|
|
- // Change the view's element (`this.el` property) and re-delegate the
|
|
- // view's events on the new element.
|
|
- setElement: function(element) {
|
|
- this.undelegateEvents();
|
|
- this._setElement(element);
|
|
- this.delegateEvents();
|
|
- return this;
|
|
- },
|
|
-
|
|
- // Creates the `this.el` and `this.$el` references for this view using the
|
|
- // given `el`. `el` can be a CSS selector or an HTML string, a jQuery
|
|
- // context or an element. Subclasses can override this to utilize an
|
|
- // alternative DOM manipulation API and are only required to set the
|
|
- // `this.el` property.
|
|
- _setElement: function(el) {
|
|
- this.$el = el instanceof Backbone.$ ? el : Backbone.$(el);
|
|
- this.el = this.$el[0];
|
|
- },
|
|
-
|
|
- // Set callbacks, where `this.events` is a hash of
|
|
- //
|
|
- // *{"event selector": "callback"}*
|
|
- //
|
|
- // {
|
|
- // 'mousedown .title': 'edit',
|
|
- // '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`.
|
|
- delegateEvents: function(events) {
|
|
- events || (events = _.result(this, 'events'));
|
|
- if (!events) return this;
|
|
- this.undelegateEvents();
|
|
- for (var key in events) {
|
|
- var method = events[key];
|
|
- if (!_.isFunction(method)) method = this[method];
|
|
- if (!method) continue;
|
|
- var match = key.match(delegateEventSplitter);
|
|
- this.delegate(match[1], match[2], method.bind(this));
|
|
- }
|
|
- return this;
|
|
- },
|
|
-
|
|
- // Add a single event listener to the view's element (or a child element
|
|
- // using `selector`). This only works for delegate-able events: not `focus`,
|
|
- // `blur`, and not `change`, `submit`, and `reset` in Internet Explorer.
|
|
- delegate: function(eventName, selector, listener) {
|
|
- this.$el.on(eventName + '.delegateEvents' + this.cid, selector, listener);
|
|
- return this;
|
|
- },
|
|
-
|
|
- // Clears all callbacks previously bound to the view by `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.
|
|
- undelegateEvents: function() {
|
|
- if (this.$el) this.$el.off('.delegateEvents' + this.cid);
|
|
- return this;
|
|
- },
|
|
-
|
|
- // A finer-grained `undelegateEvents` for removing a single delegated event.
|
|
- // `selector` and `listener` are both optional.
|
|
- undelegate: function(eventName, selector, listener) {
|
|
- this.$el.off(eventName + '.delegateEvents' + this.cid, selector, listener);
|
|
- return this;
|
|
- },
|
|
-
|
|
- // Produces a DOM element to be assigned to your view. Exposed for
|
|
- // subclasses using an alternative DOM manipulation API.
|
|
- _createElement: function(tagName) {
|
|
- return document.createElement(tagName);
|
|
- },
|
|
-
|
|
- // 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.
|
|
- _ensureElement: function() {
|
|
- if (!this.el) {
|
|
- var attrs = _.extend({}, _.result(this, 'attributes'));
|
|
- if (this.id) attrs.id = _.result(this, 'id');
|
|
- if (this.className) attrs['class'] = _.result(this, 'className');
|
|
- this.setElement(this._createElement(_.result(this, 'tagName')));
|
|
- this._setAttributes(attrs);
|
|
- } else {
|
|
- this.setElement(_.result(this, 'el'));
|
|
- }
|
|
- },
|
|
-
|
|
- // Set attributes from a hash on this view's element. Exposed for
|
|
- // subclasses using an alternative DOM manipulation API.
|
|
- _setAttributes: function(attributes) {
|
|
- this.$el.attr(attributes);
|
|
- }
|
|
-
|
|
- });
|
|
-
|
|
// Proxy Backbone class methods to Underscore functions, wrapping the model's
|
|
// `attributes` object or collection's `models` array behind the scenes.
|
|
//
|
|
@@ -1575,523 +1387,6 @@
|
|
addUnderscoreMethods(Base, _, methods, attribute);
|
|
});
|
|
|
|
- // 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:
|
|
- //
|
|
- // * Use `setTimeout` to batch rapid-fire updates into a single request.
|
|
- // * Send up the models as XML instead of JSON.
|
|
- // * Persist models via WebSockets instead of Ajax.
|
|
- //
|
|
- // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests
|
|
- // as `POST`, with a `_method` parameter containing the true HTTP method,
|
|
- // 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.
|
|
- Backbone.sync = function(method, model, options) {
|
|
- var type = methodMap[method];
|
|
-
|
|
- // Default options, unless specified.
|
|
- _.defaults(options || (options = {}), {
|
|
- emulateHTTP: Backbone.emulateHTTP,
|
|
- emulateJSON: Backbone.emulateJSON
|
|
- });
|
|
-
|
|
- // Default JSON-request options.
|
|
- var params = {type: type, dataType: 'json'};
|
|
-
|
|
- // Ensure that we have a URL.
|
|
- if (!options.url) {
|
|
- params.url = _.result(model, 'url') || urlError();
|
|
- }
|
|
-
|
|
- // Ensure that we have the appropriate request data.
|
|
- if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
|
|
- params.contentType = 'application/json';
|
|
- params.data = JSON.stringify(options.attrs || model.toJSON(options));
|
|
- }
|
|
-
|
|
- // For older servers, emulate JSON by encoding the request into an HTML-form.
|
|
- if (options.emulateJSON) {
|
|
- params.contentType = 'application/x-www-form-urlencoded';
|
|
- params.data = params.data ? {model: params.data} : {};
|
|
- }
|
|
-
|
|
- // For older servers, emulate HTTP by mimicking the HTTP method with `_method`
|
|
- // And an `X-HTTP-Method-Override` header.
|
|
- 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);
|
|
- };
|
|
- }
|
|
-
|
|
- // Don't process data on a non-GET request.
|
|
- if (params.type !== 'GET' && !options.emulateJSON) {
|
|
- params.processData = false;
|
|
- }
|
|
-
|
|
- // Pass along `textStatus` and `errorThrown` from jQuery.
|
|
- var error = options.error;
|
|
- options.error = function(xhr, textStatus, errorThrown) {
|
|
- options.textStatus = textStatus;
|
|
- options.errorThrown = errorThrown;
|
|
- if (error) error.call(options.context, xhr, textStatus, errorThrown);
|
|
- };
|
|
-
|
|
- // 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;
|
|
- };
|
|
-
|
|
- // Map from CRUD to HTTP for our default `Backbone.sync` implementation.
|
|
- var methodMap = {
|
|
- 'create': 'POST',
|
|
- 'update': 'PUT',
|
|
- 'patch': 'PATCH',
|
|
- 'delete': 'DELETE',
|
|
- 'read': 'GET'
|
|
- };
|
|
-
|
|
- // Set the default implementation of `Backbone.ajax` to proxy through to `$`.
|
|
- // Override this if you'd like to use a different library.
|
|
- Backbone.ajax = function() {
|
|
- return Backbone.$.ajax.apply(Backbone.$, arguments);
|
|
- };
|
|
-
|
|
- // 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.
|
|
- var Router = Backbone.Router = function(options) {
|
|
- options || (options = {});
|
|
- this.preinitialize.apply(this, arguments);
|
|
- if (options.routes) this.routes = options.routes;
|
|
- this._bindRoutes();
|
|
- this.initialize.apply(this, arguments);
|
|
- };
|
|
-
|
|
- // Cached regular expressions for matching named param parts and splatted
|
|
- // parts of route strings.
|
|
- var optionalParam = /\((.*?)\)/g;
|
|
- var namedParam = /(\(\?)?:\w+/g;
|
|
- var splatParam = /\*\w+/g;
|
|
- var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g;
|
|
-
|
|
- // Set up all inheritable **Backbone.Router** properties and methods.
|
|
- _.extend(Router.prototype, Events, {
|
|
-
|
|
- // preinitialize is an empty function by default. You can override it with a function
|
|
- // or object. preinitialize will run before any instantiation logic is run in the Router.
|
|
- preinitialize: function(){},
|
|
-
|
|
- // Initialize is an empty function by default. Override it with your own
|
|
- // initialization logic.
|
|
- initialize: function(){},
|
|
-
|
|
- // Manually bind a single named route to a callback. For example:
|
|
- //
|
|
- // this.route('search/:query/p:num', 'search', function(query, num) {
|
|
- // ...
|
|
- // });
|
|
- //
|
|
- 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);
|
|
- if (router.execute(callback, args, name) !== false) {
|
|
- router.trigger.apply(router, ['route:' + name].concat(args));
|
|
- router.trigger('route', name, args);
|
|
- Backbone.history.trigger('route', router, name, args);
|
|
- }
|
|
- });
|
|
- return this;
|
|
- },
|
|
-
|
|
- // Execute a route handler with the provided parameters. This is an
|
|
- // excellent place to do pre-route setup or post-route cleanup.
|
|
- execute: function(callback, args, name) {
|
|
- if (callback) callback.apply(this, args);
|
|
- },
|
|
-
|
|
- // Simple proxy to `Backbone.history` to save a fragment into the history.
|
|
- navigate: function(fragment, options) {
|
|
- Backbone.history.navigate(fragment, options);
|
|
- return this;
|
|
- },
|
|
-
|
|
- // 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.
|
|
- _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]);
|
|
- }
|
|
- },
|
|
-
|
|
- // Convert a route string into a regular expression, suitable for matching
|
|
- // against the current location hash.
|
|
- _routeToRegExp: function(route) {
|
|
- route = route.replace(escapeRegExp, '\\$&')
|
|
- .replace(optionalParam, '(?:$1)?')
|
|
- .replace(namedParam, function(match, optional) {
|
|
- return optional ? match : '([^/?]+)';
|
|
- })
|
|
- .replace(splatParam, '([^?]*?)');
|
|
- return new RegExp('^' + route + '(?:\\?([\\s\\S]*))?$');
|
|
- },
|
|
-
|
|
- // 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.
|
|
- _extractParameters: function(route, fragment) {
|
|
- var params = route.exec(fragment).slice(1);
|
|
- return _.map(params, function(param, i) {
|
|
- // Don't decode the search params.
|
|
- if (i === params.length - 1) return param || null;
|
|
- return param ? decodeURIComponent(param) : null;
|
|
- });
|
|
- }
|
|
-
|
|
- });
|
|
-
|
|
- // Backbone.History
|
|
- // ----------------
|
|
-
|
|
- // Handles cross-browser history management, based on either
|
|
- // [pushState](http://diveintohtml5.info/history.html) and real URLs, or
|
|
- // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)
|
|
- // and URL fragments. If the browser supports neither (old IE, natch),
|
|
- // falls back to polling.
|
|
- var History = Backbone.History = function() {
|
|
- this.handlers = [];
|
|
- this.checkUrl = this.checkUrl.bind(this);
|
|
-
|
|
- // Ensure that `History` can be used outside of the browser.
|
|
- if (typeof window !== 'undefined') {
|
|
- this.location = window.location;
|
|
- this.history = window.history;
|
|
- }
|
|
- };
|
|
-
|
|
- // Cached regex for stripping a leading hash/slash and trailing space.
|
|
- var routeStripper = /^[#\/]|\s+$/g;
|
|
-
|
|
- // Cached regex for stripping leading and trailing slashes.
|
|
- var rootStripper = /^\/+|\/+$/g;
|
|
-
|
|
- // Cached regex for stripping urls of hash.
|
|
- var pathStripper = /#.*$/;
|
|
-
|
|
- // Has the history handling already been started?
|
|
- History.started = false;
|
|
-
|
|
- // Set up all inheritable **Backbone.History** properties and methods.
|
|
- _.extend(History.prototype, Events, {
|
|
-
|
|
- // The default interval to poll for hash changes, if necessary, is
|
|
- // twenty times a second.
|
|
- interval: 50,
|
|
-
|
|
- // Are we at the app root?
|
|
- atRoot: function() {
|
|
- var path = this.location.pathname.replace(/[^\/]$/, '$&/');
|
|
- return path === this.root && !this.getSearch();
|
|
- },
|
|
-
|
|
- // Does the pathname match the root?
|
|
- matchRoot: function() {
|
|
- var path = this.decodeFragment(this.location.pathname);
|
|
- var rootPath = path.slice(0, this.root.length - 1) + '/';
|
|
- return rootPath === this.root;
|
|
- },
|
|
-
|
|
- // Unicode characters in `location.pathname` are percent encoded so they're
|
|
- // decoded for comparison. `%25` should not be decoded since it may be part
|
|
- // of an encoded parameter.
|
|
- decodeFragment: function(fragment) {
|
|
- return decodeURI(fragment.replace(/%25/g, '%2525'));
|
|
- },
|
|
-
|
|
- // In IE6, the hash fragment and search params are incorrect if the
|
|
- // fragment contains `?`.
|
|
- getSearch: function() {
|
|
- var match = this.location.href.replace(/#.*/, '').match(/\?.+/);
|
|
- return match ? match[0] : '';
|
|
- },
|
|
-
|
|
- // Gets the true hash value. Cannot use location.hash directly due to bug
|
|
- // in Firefox where location.hash will always be decoded.
|
|
- getHash: function(window) {
|
|
- var match = (window || this).location.href.match(/#(.*)$/);
|
|
- return match ? match[1] : '';
|
|
- },
|
|
-
|
|
- // Get the pathname and search params, without the root.
|
|
- getPath: function() {
|
|
- var path = this.decodeFragment(
|
|
- this.location.pathname + this.getSearch()
|
|
- ).slice(this.root.length - 1);
|
|
- return path.charAt(0) === '/' ? path.slice(1) : path;
|
|
- },
|
|
-
|
|
- // Get the cross-browser normalized URL fragment from the path or hash.
|
|
- getFragment: function(fragment) {
|
|
- if (fragment == null) {
|
|
- if (this._usePushState || !this._wantsHashChange) {
|
|
- fragment = this.getPath();
|
|
- } else {
|
|
- fragment = this.getHash();
|
|
- }
|
|
- }
|
|
- return fragment.replace(routeStripper, '');
|
|
- },
|
|
-
|
|
- // Start the hash change handling, returning `true` if the current URL matches
|
|
- // an existing route, and `false` otherwise.
|
|
- start: function(options) {
|
|
- if (History.started) throw new Error('Backbone.history has already been started');
|
|
- History.started = true;
|
|
-
|
|
- // Figure out the initial configuration. Do we need an iframe?
|
|
- // Is pushState desired ... is it available?
|
|
- this.options = _.extend({root: '/'}, this.options, options);
|
|
- this.root = this.options.root;
|
|
- this._trailingSlash = this.options.trailingSlash;
|
|
- this._wantsHashChange = this.options.hashChange !== false;
|
|
- this._hasHashChange = 'onhashchange' in window && (document.documentMode === void 0 || document.documentMode > 7);
|
|
- this._useHashChange = this._wantsHashChange && this._hasHashChange;
|
|
- this._wantsPushState = !!this.options.pushState;
|
|
- this._hasPushState = !!(this.history && this.history.pushState);
|
|
- this._usePushState = this._wantsPushState && this._hasPushState;
|
|
- this.fragment = this.getFragment();
|
|
-
|
|
- // Normalize root to always include a leading and trailing slash.
|
|
- this.root = ('/' + this.root + '/').replace(rootStripper, '/');
|
|
-
|
|
- // 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 && !this.atRoot()) {
|
|
- var rootPath = this.root.slice(0, -1) || '/';
|
|
- this.location.replace(rootPath + '#' + this.getPath());
|
|
- // 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 && this.atRoot()) {
|
|
- this.navigate(this.getHash(), {replace: true});
|
|
- }
|
|
-
|
|
- }
|
|
-
|
|
- // Proxy an iframe to handle location events if the browser doesn't
|
|
- // support the `hashchange` event, HTML5 history, or the user wants
|
|
- // `hashChange` but not `pushState`.
|
|
- if (!this._hasHashChange && this._wantsHashChange && !this._usePushState) {
|
|
- this.iframe = document.createElement('iframe');
|
|
- this.iframe.src = 'javascript:0';
|
|
- this.iframe.style.display = 'none';
|
|
- this.iframe.tabIndex = -1;
|
|
- var body = document.body;
|
|
- // Using `appendChild` will throw on IE < 9 if the document is not ready.
|
|
- var iWindow = body.insertBefore(this.iframe, body.firstChild).contentWindow;
|
|
- iWindow.document.open();
|
|
- iWindow.document.close();
|
|
- iWindow.location.hash = '#' + this.fragment;
|
|
- }
|
|
-
|
|
- // Add a cross-platform `addEventListener` shim for older browsers.
|
|
- var addEventListener = window.addEventListener || function(eventName, listener) {
|
|
- return attachEvent('on' + eventName, listener);
|
|
- };
|
|
-
|
|
- // Depending on whether we're using pushState or hashes, and whether
|
|
- // 'onhashchange' is supported, determine how we check the URL state.
|
|
- if (this._usePushState) {
|
|
- addEventListener('popstate', this.checkUrl, false);
|
|
- } else if (this._useHashChange && !this.iframe) {
|
|
- addEventListener('hashchange', this.checkUrl, false);
|
|
- } else if (this._wantsHashChange) {
|
|
- this._checkUrlInterval = setInterval(this.checkUrl, this.interval);
|
|
- }
|
|
-
|
|
- if (!this.options.silent) return this.loadUrl();
|
|
- },
|
|
-
|
|
- // Disable Backbone.history, perhaps temporarily. Not useful in a real app,
|
|
- // but possibly useful for unit testing Routers.
|
|
- stop: function() {
|
|
- // Add a cross-platform `removeEventListener` shim for older browsers.
|
|
- var removeEventListener = window.removeEventListener || function(eventName, listener) {
|
|
- return detachEvent('on' + eventName, listener);
|
|
- };
|
|
-
|
|
- // Remove window listeners.
|
|
- if (this._usePushState) {
|
|
- removeEventListener('popstate', this.checkUrl, false);
|
|
- } else if (this._useHashChange && !this.iframe) {
|
|
- removeEventListener('hashchange', this.checkUrl, false);
|
|
- }
|
|
-
|
|
- // Clean up the iframe if necessary.
|
|
- if (this.iframe) {
|
|
- document.body.removeChild(this.iframe);
|
|
- this.iframe = null;
|
|
- }
|
|
-
|
|
- // Some environments will throw when clearing an undefined interval.
|
|
- if (this._checkUrlInterval) clearInterval(this._checkUrlInterval);
|
|
- History.started = false;
|
|
- },
|
|
-
|
|
- // Add a route to be tested when the fragment changes. Routes added later
|
|
- // may override previous routes.
|
|
- route: function(route, callback) {
|
|
- this.handlers.unshift({route: route, callback: callback});
|
|
- },
|
|
-
|
|
- // Checks the current URL to see if it has changed, and if it has,
|
|
- // calls `loadUrl`, normalizing across the hidden iframe.
|
|
- checkUrl: function(e) {
|
|
- var current = this.getFragment();
|
|
-
|
|
- // If the user pressed the back button, the iframe's hash will have
|
|
- // changed and we should use that for comparison.
|
|
- if (current === this.fragment && this.iframe) {
|
|
- current = this.getHash(this.iframe.contentWindow);
|
|
- }
|
|
-
|
|
- if (current === this.fragment) {
|
|
- if (!this.matchRoot()) return this.notfound();
|
|
- return false;
|
|
- }
|
|
- if (this.iframe) this.navigate(current);
|
|
- 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(fragment) {
|
|
- // If the root doesn't match, no routes can match either.
|
|
- if (!this.matchRoot()) return this.notfound();
|
|
- fragment = this.fragment = this.getFragment(fragment);
|
|
- return _.some(this.handlers, function(handler) {
|
|
- if (handler.route.test(fragment)) {
|
|
- handler.callback(fragment);
|
|
- return true;
|
|
- }
|
|
- }) || this.notfound();
|
|
- },
|
|
-
|
|
- // When no route could be matched, this method is called internally to
|
|
- // trigger the `'notfound'` event. It returns `false` so that it can be used
|
|
- // in tail position.
|
|
- notfound: function() {
|
|
- this.trigger('notfound');
|
|
- return false;
|
|
- },
|
|
-
|
|
- // 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 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.
|
|
- navigate: function(fragment, options) {
|
|
- if (!History.started) return false;
|
|
- if (!options || options === true) options = {trigger: !!options};
|
|
-
|
|
- // Normalize the fragment.
|
|
- fragment = this.getFragment(fragment || '');
|
|
-
|
|
- // Strip trailing slash on the root unless _trailingSlash is true
|
|
- var rootPath = this.root;
|
|
- if (!this._trailingSlash && (fragment === '' || fragment.charAt(0) === '?')) {
|
|
- rootPath = rootPath.slice(0, -1) || '/';
|
|
- }
|
|
- var url = rootPath + fragment;
|
|
-
|
|
- // Strip the fragment of the query and hash for matching.
|
|
- fragment = fragment.replace(pathStripper, '');
|
|
-
|
|
- // Decode for matching.
|
|
- var decodedFragment = this.decodeFragment(fragment);
|
|
-
|
|
- if (this.fragment === decodedFragment) return;
|
|
- this.fragment = decodedFragment;
|
|
-
|
|
- // If pushState is available, we use it to set the fragment as a real URL.
|
|
- if (this._usePushState) {
|
|
- this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url);
|
|
-
|
|
- // If hash changes haven't been explicitly disabled, update the hash
|
|
- // fragment to store history.
|
|
- } else if (this._wantsHashChange) {
|
|
- this._updateHash(this.location, fragment, options.replace);
|
|
- if (this.iframe && fragment !== this.getHash(this.iframe.contentWindow)) {
|
|
- var iWindow = this.iframe.contentWindow;
|
|
-
|
|
- // 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.
|
|
- if (!options.replace) {
|
|
- iWindow.document.open();
|
|
- iWindow.document.close();
|
|
- }
|
|
-
|
|
- this._updateHash(iWindow.location, fragment, options.replace);
|
|
- }
|
|
-
|
|
- // If you've told us that you explicitly don't want fallback hashchange-
|
|
- // based history, then `navigate` becomes a page refresh.
|
|
- } else {
|
|
- return this.location.assign(url);
|
|
- }
|
|
- if (options.trigger) return this.loadUrl(fragment);
|
|
- },
|
|
-
|
|
- // Update the hash location, either replacing the current entry, or adding
|
|
- // a new one to the browser history.
|
|
- _updateHash: function(location, fragment, replace) {
|
|
- if (replace) {
|
|
- var href = location.href.replace(/(javascript:|#).*$/, '');
|
|
- location.replace(href + '#' + fragment);
|
|
- } else {
|
|
- // Some browsers require that `hash` contains a leading #.
|
|
- location.hash = '#' + fragment;
|
|
- }
|
|
- }
|
|
-
|
|
- });
|
|
-
|
|
- // Create the default Backbone.history.
|
|
- Backbone.history = new History;
|
|
|
|
// Helpers
|
|
// -------
|
|
@@ -2128,7 +1423,7 @@
|
|
};
|
|
|
|
// Set up inheritance for the model, collection, router, view and history.
|
|
- Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;
|
|
+ Model.extend = Collection.extend = extend;
|
|
|
|
// Throw an error when a URL is needed, and none is supplied.
|
|
var urlError = function() {
|