<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[23589] trunk/wp-includes: Update Backbone to 0.9.10.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/23589">23589</a></dd>
<dt>Author</dt> <dd>koopersmith</dd>
<dt>Date</dt> <dd>2013-03-03 07:04:06 +0000 (Sun, 03 Mar 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Update Backbone to 0.9.10. Update media to handle breaking changes.

* When overriding `Backbone.sync()`, ensure the `sync` and `error` events fire consistently.

* `Model#make()` has been removed. Use `$` instead, and be sure to grab the DOM node where necessary (using `<a href="http://core.trac.wordpress.org/changeset/[0]">[0]</a>`).

* `Collection#get()` now accepts `cid`s. `Collection#getByCid()` has been removed.

* When overriding the `State` constructor, bind `change` callbacks after the default `Model` constructor is called, because the `Model` constructor no longer passes the `silent` flag when calling `set()` for the default attributes.

* In 'change' events, `options.changes` was removed. It can now be accessed through `model.changed`. Check if any attributes have changed by calling `model.hasChanged()`. Also, don't mess with `model.changed`; it persists beyond the scope of a single event.

* `options.index` is no longer be set in the `add` event callback. Use `collection.indexOf(model)` can be used to retrieve the index of a model instead.

props gcorne. fixes <a href="http://core.trac.wordpress.org/ticket/23262">#23262</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesjsbackboneminjs">trunk/wp-includes/js/backbone.min.js</a></li>
<li><a href="#trunkwpincludesjsmediamodelsjs">trunk/wp-includes/js/media-models.js</a></li>
<li><a href="#trunkwpincludesjsmediaviewsjs">trunk/wp-includes/js/media-views.js</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesjsbackboneminjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/backbone.min.js (23588 => 23589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/backbone.min.js        2013-03-03 03:00:34 UTC (rev 23588)
+++ trunk/wp-includes/js/backbone.min.js        2013-03-03 07:04:06 UTC (rev 23589)
</span><span class="lines">@@ -1,38 +1,42 @@
</span><del>-// Backbone.js 0.9.2
</del><ins>+// Backbone.js 0.9.10
</ins><span class="cx"> 
</span><span class="cx"> // (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
</span><span class="cx"> // Backbone may be freely distributed under the MIT license.
</span><span class="cx"> // For all details and documentation:
</span><span class="cx"> // http://backbonejs.org
</span><del>-(function(){var l=this,y=l.Backbone,z=Array.prototype.slice,A=Array.prototype.splice,g;g=&quot;undefined&quot;!==typeof exports?exports:l.Backbone={};g.VERSION=&quot;0.9.2&quot;;var f=l._;!f&amp;&amp;&quot;undefined&quot;!==typeof require&amp;&amp;(f=require(&quot;underscore&quot;));var i=l.jQuery||l.Zepto||l.ender;g.setDomLibrary=function(a){i=a};g.noConflict=function(){l.Backbone=y;return this};g.emulateHTTP=!1;g.emulateJSON=!1;var p=/\s+/,k=g.Events={on:function(a,b,c){var d,e,f,g,j;if(!b)return this;a=a.split(p);for(d=this._callbacks||(this._callbacks=
-{});e=a.shift();)f=(j=d[e])?j.tail:{},f.next=g={},f.context=c,f.callback=b,d[e]={tail:g,next:j?j.next:f};return this},off:function(a,b,c){var d,e,h,g,j,q;if(e=this._callbacks){if(!a&amp;&amp;!b&amp;&amp;!c)return delete this._callbacks,this;for(a=a?a.split(p):f.keys(e);d=a.shift();)if(h=e[d],delete e[d],h&amp;&amp;(b||c))for(g=h.tail;(h=h.next)!==g;)if(j=h.callback,q=h.context,b&amp;&amp;j!==b||c&amp;&amp;q!==c)this.on(d,j,q);return this}},trigger:function(a){var b,c,d,e,f,g;if(!(d=this._callbacks))return this;f=d.all;a=a.split(p);for(g=
-z.call(arguments,1);b=a.shift();){if(c=d[b])for(e=c.tail;(c=c.next)!==e;)c.callback.apply(c.context||this,g);if(c=f){e=c.tail;for(b=[b].concat(g);(c=c.next)!==e;)c.callback.apply(c.context||this,b)}}return this}};k.bind=k.on;k.unbind=k.off;var o=g.Model=function(a,b){var c;a||(a={});b&amp;&amp;b.parse&amp;&amp;(a=this.parse(a));if(c=n(this,&quot;defaults&quot;))a=f.extend({},c,a);b&amp;&amp;b.collection&amp;&amp;(this.collection=b.collection);this.attributes={};this._escapedAttributes={};this.cid=f.uniqueId(&quot;c&quot;);this.changed={};this._silent=
-{};this._pending={};this.set(a,{silent:!0});this.changed={};this._silent={};this._pending={};this._previousAttributes=f.clone(this.attributes);this.initialize.apply(this,arguments)};f.extend(o.prototype,k,{changed:null,_silent:null,_pending:null,idAttribute:&quot;id&quot;,initialize:function(){},toJSON:function(){return f.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;b=this.get(a);return this._escapedAttributes[a]=f.escape(null==
-b?&quot;&quot;:&quot;&quot;+b)},has:function(a){return null!=this.get(a)},set:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c||(c={});if(!d)return this;d instanceof o&amp;&amp;(d=d.attributes);if(c.unset)for(e in d)d[e]=void 0;if(!this._validate(d,c))return!1;this.idAttribute in d&amp;&amp;(this.id=d[this.idAttribute]);var b=c.changes={},h=this.attributes,g=this._escapedAttributes,j=this._previousAttributes||{};for(e in d){a=d[e];if(!f.isEqual(h[e],a)||c.unset&amp;&amp;f.has(h,e))delete g[e],(c.silent?this._silent:
-b)[e]=!0;c.unset?delete h[e]:h[e]=a;!f.isEqual(j[e],a)||f.has(h,e)!=f.has(j,e)?(this.changed[e]=a,c.silent||(this._pending[e]=!0)):(delete this.changed[e],delete this._pending[e])}c.silent||this.change(c);return this},unset:function(a,b){(b||(b={})).unset=!0;return this.set(a,null,b)},clear:function(a){(a||(a={})).unset=!0;return this.set(f.clone(this.attributes),a)},fetch:function(a){var a=a?f.clone(a):{},b=this,c=a.success;a.success=function(d,e,f){if(!b.set(b.parse(d,f),a))return!1;c&amp;&amp;c(b,d)};
-a.error=g.wrapError(a.error,b,a);return(this.sync||g.sync).call(this,&quot;read&quot;,this,a)},save:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c=c?f.clone(c):{};if(c.wait){if(!this._validate(d,c))return!1;e=f.clone(this.attributes)}a=f.extend({},c,{silent:!0});if(d&amp;&amp;!this.set(d,c.wait?a:c))return!1;var h=this,i=c.success;c.success=function(a,b,e){b=h.parse(a,e);if(c.wait){delete c.wait;b=f.extend(d||{},b)}if(!h.set(b,c))return false;i?i(h,a):h.trigger(&quot;sync&quot;,h,a,c)};c.error=g.wrapError(c.error,
-h,c);b=this.isNew()?&quot;create&quot;:&quot;update&quot;;b=(this.sync||g.sync).call(this,b,this,c);c.wait&amp;&amp;this.set(e,a);return b},destroy:function(a){var a=a?f.clone(a):{},b=this,c=a.success,d=function(){b.trigger(&quot;destroy&quot;,b,b.collection,a)};if(this.isNew())return d(),!1;a.success=function(e){a.wait&amp;&amp;d();c?c(b,e):b.trigger(&quot;sync&quot;,b,e,a)};a.error=g.wrapError(a.error,b,a);var e=(this.sync||g.sync).call(this,&quot;delete&quot;,this,a);a.wait||d();return e},url:function(){var a=n(this,&quot;urlRoot&quot;)||n(this.collection,&quot;url&quot;)||t();
-return this.isNew()?a:a+(&quot;/&quot;==a.charAt(a.length-1)?&quot;&quot;:&quot;/&quot;)+encodeURIComponent(this.id)},parse:function(a){return a},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},change:function(a){a||(a={});var b=this._changing;this._changing=!0;for(var c in this._silent)this._pending[c]=!0;var d=f.extend({},a.changes,this._silent);this._silent={};for(c in d)this.trigger(&quot;change:&quot;+c,this,this.get(c),a);if(b)return this;for(;!f.isEmpty(this._pending);){this._pending=
-{};this.trigger(&quot;change&quot;,this,a);for(c in this.changed)!this._pending[c]&amp;&amp;!this._silent[c]&amp;&amp;delete this.changed[c];this._previousAttributes=f.clone(this.attributes)}this._changing=!1;return this},hasChanged:function(a){return!arguments.length?!f.isEmpty(this.changed):f.has(this.changed,a)},changedAttributes:function(a){if(!a)return this.hasChanged()?f.clone(this.changed):!1;var b,c=!1,d=this._previousAttributes,e;for(e in a)if(!f.isEqual(d[e],b=a[e]))(c||(c={}))[e]=b;return c},previous:function(a){return!arguments.length||
-!this._previousAttributes?null:this._previousAttributes[a]},previousAttributes:function(){return f.clone(this._previousAttributes)},isValid:function(){return!this.validate(this.attributes)},_validate:function(a,b){if(b.silent||!this.validate)return!0;var a=f.extend({},this.attributes,a),c=this.validate(a,b);if(!c)return!0;b&amp;&amp;b.error?b.error(this,c,b):this.trigger(&quot;error&quot;,this,c,b);return!1}});var r=g.Collection=function(a,b){b||(b={});b.model&amp;&amp;(this.model=b.model);b.comparator&amp;&amp;(this.comparator=b.comparator);
-this._reset();this.initialize.apply(this,arguments);a&amp;&amp;this.reset(a,{silent:!0,parse:b.parse})};f.extend(r.prototype,k,{model:o,initialize:function(){},toJSON:function(a){return this.map(function(b){return b.toJSON(a)})},add:function(a,b){var c,d,e,g,i,j={},k={},l=[];b||(b={});a=f.isArray(a)?a.slice():[a];c=0;for(d=a.length;c&lt;d;c++){if(!(e=a[c]=this._prepareModel(a[c],b)))throw Error(&quot;Can't add an invalid model to a collection&quot;);g=e.cid;i=e.id;j[g]||this._byCid[g]||null!=i&amp;&amp;(k[i]||this._byId[i])?
-l.push(c):j[g]=k[i]=e}for(c=l.length;c--;)a.splice(l[c],1);c=0;for(d=a.length;c&lt;d;c++)(e=a[c]).on(&quot;all&quot;,this._onModelEvent,this),this._byCid[e.cid]=e,null!=e.id&amp;&amp;(this._byId[e.id]=e);this.length+=d;A.apply(this.models,[null!=b.at?b.at:this.models.length,0].concat(a));this.comparator&amp;&amp;this.sort({silent:!0});if(b.silent)return this;c=0;for(d=this.models.length;c&lt;d;c++)if(j[(e=this.models[c]).cid])b.index=c,e.trigger(&quot;add&quot;,e,this,b);return this},remove:function(a,b){var c,d,e,g;b||(b={});a=f.isArray(a)?
-a.slice():[a];c=0;for(d=a.length;c&lt;d;c++)if(g=this.getByCid(a[c])||this.get(a[c]))delete this._byId[g.id],delete this._byCid[g.cid],e=this.indexOf(g),this.models.splice(e,1),this.length--,b.silent||(b.index=e,g.trigger(&quot;remove&quot;,g,this,b)),this._removeReference(g);return this},push:function(a,b){a=this._prepareModel(a,b);this.add(a,b);return a},pop:function(a){var b=this.at(this.length-1);this.remove(b,a);return b},unshift:function(a,b){a=this._prepareModel(a,b);this.add(a,f.extend({at:0},b));return a},
-shift:function(a){var b=this.at(0);this.remove(b,a);return b},get:function(a){return null==a?void 0:this._byId[null!=a.id?a.id:a]},getByCid:function(a){return a&amp;&amp;this._byCid[a.cid||a]},at:function(a){return this.models[a]},where:function(a){return f.isEmpty(a)?[]:this.filter(function(b){for(var c in a)if(a[c]!==b.get(c))return!1;return!0})},sort:function(a){a||(a={});if(!this.comparator)throw Error(&quot;Cannot sort a set without a comparator&quot;);var b=f.bind(this.comparator,this);1==this.comparator.length?
-this.models=this.sortBy(b):this.models.sort(b);a.silent||this.trigger(&quot;reset&quot;,this,a);return this},pluck:function(a){return f.map(this.models,function(b){return b.get(a)})},reset:function(a,b){a||(a=[]);b||(b={});for(var c=0,d=this.models.length;c&lt;d;c++)this._removeReference(this.models[c]);this._reset();this.add(a,f.extend({silent:!0},b));b.silent||this.trigger(&quot;reset&quot;,this,b);return this},fetch:function(a){a=a?f.clone(a):{};void 0===a.parse&amp;&amp;(a.parse=!0);var b=this,c=a.success;a.success=function(d,
-e,f){b[a.add?&quot;add&quot;:&quot;reset&quot;](b.parse(d,f),a);c&amp;&amp;c(b,d)};a.error=g.wrapError(a.error,b,a);return(this.sync||g.sync).call(this,&quot;read&quot;,this,a)},create:function(a,b){var c=this,b=b?f.clone(b):{},a=this._prepareModel(a,b);if(!a)return!1;b.wait||c.add(a,b);var d=b.success;b.success=function(e,f){b.wait&amp;&amp;c.add(e,b);d?d(e,f):e.trigger(&quot;sync&quot;,a,f,b)};a.save(null,b);return a},parse:function(a){return a},chain:function(){return f(this.models).chain()},_reset:function(){this.length=0;this.models=[];this._byId=
-{};this._byCid={}},_prepareModel:function(a,b){b||(b={});a instanceof o?a.collection||(a.collection=this):(b.collection=this,a=new this.model(a,b),a._validate(a.attributes,b)||(a=!1));return a},_removeReference:function(a){this==a.collection&amp;&amp;delete a.collection;a.off(&quot;all&quot;,this._onModelEvent,this)},_onModelEvent:function(a,b,c,d){(&quot;add&quot;==a||&quot;remove&quot;==a)&amp;&amp;c!=this||(&quot;destroy&quot;==a&amp;&amp;this.remove(b,d),b&amp;&amp;a===&quot;change:&quot;+b.idAttribute&amp;&amp;(delete this._byId[b.previous(b.idAttribute)],this._byId[b.id]=b),this.trigger.apply(this,
-arguments))}});f.each(&quot;forEach,each,map,reduce,reduceRight,find,detect,filter,select,reject,every,all,some,any,include,contains,invoke,max,min,sortBy,sortedIndex,toArray,size,first,initial,rest,last,without,indexOf,shuffle,lastIndexOf,isEmpty,groupBy&quot;.split(&quot;,&quot;),function(a){r.prototype[a]=function(){return f[a].apply(f,[this.models].concat(f.toArray(arguments)))}});var u=g.Router=function(a){a||(a={});a.routes&amp;&amp;(this.routes=a.routes);this._bindRoutes();this.initialize.apply(this,arguments)},B=/:\w+/g,
-C=/\*\w+/g,D=/[-[\]{}()+?.,\\^$|#\s]/g;f.extend(u.prototype,k,{initialize:function(){},route:function(a,b,c){g.history||(g.history=new m);f.isRegExp(a)||(a=this._routeToRegExp(a));c||(c=this[b]);g.history.route(a,f.bind(function(d){d=this._extractParameters(a,d);c&amp;&amp;c.apply(this,d);this.trigger.apply(this,[&quot;route:&quot;+b].concat(d));g.history.trigger(&quot;route&quot;,this,b,d)},this));return this},navigate:function(a,b){g.history.navigate(a,b)},_bindRoutes:function(){if(this.routes){var a=[],b;for(b in this.routes)a.unshift([b,
-this.routes[b]]);b=0;for(var c=a.length;b&lt;c;b++)this.route(a[b][0],a[b][1],this[a[b][1]])}},_routeToRegExp:function(a){a=a.replace(D,&quot;\\$&amp;&quot;).replace(B,&quot;([^/]+)&quot;).replace(C,&quot;(.*?)&quot;);return RegExp(&quot;^&quot;+a+&quot;$&quot;)},_extractParameters:function(a,b){return a.exec(b).slice(1)}});var m=g.History=function(){this.handlers=[];f.bindAll(this,&quot;checkUrl&quot;)},s=/^[#\/]/,E=/msie [\w.]+/;m.started=!1;f.extend(m.prototype,k,{interval:50,getHash:function(a){return(a=(a?a.location:window.location).href.match(/#(.*)$/))?a[1]:
-&quot;&quot;},getFragment:function(a,b){if(null==a)if(this._hasPushState||b){var a=window.location.pathname,c=window.location.search;c&amp;&amp;(a+=c)}else a=this.getHash();a.indexOf(this.options.root)||(a=a.substr(this.options.root.length));return a.replace(s,&quot;&quot;)},start:function(a){if(m.started)throw Error(&quot;Backbone.history has already been started&quot;);m.started=!0;this.options=f.extend({},{root:&quot;/&quot;},this.options,a);this._wantsHashChange=!1!==this.options.hashChange;this._wantsPushState=!!this.options.pushState;this._hasPushState=
-!(!this.options.pushState||!window.history||!window.history.pushState);var a=this.getFragment(),b=document.documentMode;if(b=E.exec(navigator.userAgent.toLowerCase())&amp;&amp;(!b||7&gt;=b))this.iframe=i('&lt;iframe src=&quot;javascript:0&quot; tabindex=&quot;-1&quot; /&gt;').hide().appendTo(&quot;body&quot;)[0].contentWindow,this.navigate(a);this._hasPushState?i(window).bind(&quot;popstate&quot;,this.checkUrl):this._wantsHashChange&amp;&amp;&quot;onhashchange&quot;in window&amp;&amp;!b?i(window).bind(&quot;hashchange&quot;,this.checkUrl):this._wantsHashChange&amp;&amp;(this._checkUrlInterval=setInterval(this.checkUrl,
-this.interval));this.fragment=a;a=window.location;b=a.pathname==this.options.root;if(this._wantsHashChange&amp;&amp;this._wantsPushState&amp;&amp;!this._hasPushState&amp;&amp;!b)return this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+&quot;#&quot;+this.fragment),!0;this._wantsPushState&amp;&amp;this._hasPushState&amp;&amp;b&amp;&amp;a.hash&amp;&amp;(this.fragment=this.getHash().replace(s,&quot;&quot;),window.history.replaceState({},document.title,a.protocol+&quot;//&quot;+a.host+this.options.root+this.fragment));if(!this.options.silent)return this.loadUrl()},
-stop:function(){i(window).unbind(&quot;popstate&quot;,this.checkUrl).unbind(&quot;hashchange&quot;,this.checkUrl);clearInterval(this._checkUrlInterval);m.started=!1},route:function(a,b){this.handlers.unshift({route:a,callback:b})},checkUrl:function(){var a=this.getFragment();a==this.fragment&amp;&amp;this.iframe&amp;&amp;(a=this.getFragment(this.getHash(this.iframe)));if(a==this.fragment)return!1;this.iframe&amp;&amp;this.navigate(a);this.loadUrl()||this.loadUrl(this.getHash())},loadUrl:function(a){var b=this.fragment=this.getFragment(a);return f.any(this.handlers,
-function(a){if(a.route.test(b))return a.callback(b),!0})},navigate:function(a,b){if(!m.started)return!1;if(!b||!0===b)b={trigger:b};var c=(a||&quot;&quot;).replace(s,&quot;&quot;);this.fragment!=c&amp;&amp;(this._hasPushState?(0!=c.indexOf(this.options.root)&amp;&amp;(c=this.options.root+c),this.fragment=c,window.history[b.replace?&quot;replaceState&quot;:&quot;pushState&quot;]({},document.title,c)):this._wantsHashChange?(this.fragment=c,this._updateHash(window.location,c,b.replace),this.iframe&amp;&amp;c!=this.getFragment(this.getHash(this.iframe))&amp;&amp;(b.replace||
-this.iframe.document.open().close(),this._updateHash(this.iframe.location,c,b.replace))):window.location.assign(this.options.root+a),b.trigger&amp;&amp;this.loadUrl(a))},_updateHash:function(a,b,c){c?a.replace(a.toString().replace(/(javascript:|#).*$/,&quot;&quot;)+&quot;#&quot;+b):a.hash=b}});var v=g.View=function(a){this.cid=f.uniqueId(&quot;view&quot;);this._configure(a||{});this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()},F=/^(\S+)\s*(.*)$/,w=&quot;model,collection,el,id,attributes,className,tagName&quot;.split(&quot;,&quot;);
-f.extend(v.prototype,k,{tagName:&quot;div&quot;,$:function(a){return this.$el.find(a)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();return this},make:function(a,b,c){a=document.createElement(a);b&amp;&amp;i(a).attr(b);c&amp;&amp;i(a).html(c);return a},setElement:function(a,b){this.$el&amp;&amp;this.undelegateEvents();this.$el=a instanceof i?a:i(a);this.el=this.$el[0];!1!==b&amp;&amp;this.delegateEvents();return this},delegateEvents:function(a){if(a||(a=n(this,&quot;events&quot;))){this.undelegateEvents();
-for(var b in a){var c=a[b];f.isFunction(c)||(c=this[a[b]]);if(!c)throw Error('Method &quot;'+a[b]+'&quot; does not exist');var d=b.match(F),e=d[1],d=d[2],c=f.bind(c,this),e=e+(&quot;.delegateEvents&quot;+this.cid);&quot;&quot;===d?this.$el.bind(e,c):this.$el.delegate(d,e,c)}}},undelegateEvents:function(){this.$el.unbind(&quot;.delegateEvents&quot;+this.cid)},_configure:function(a){this.options&amp;&amp;(a=f.extend({},this.options,a));for(var b=0,c=w.length;b&lt;c;b++){var d=w[b];a[d]&amp;&amp;(this[d]=a[d])}this.options=a},_ensureElement:function(){if(this.el)this.setElement(this.el,
-!1);else{var a=n(this,&quot;attributes&quot;)||{};this.id&amp;&amp;(a.id=this.id);this.className&amp;&amp;(a[&quot;class&quot;]=this.className);this.setElement(this.make(this.tagName,a),!1)}}});o.extend=r.extend=u.extend=v.extend=function(a,b){var c=G(this,a,b);c.extend=this.extend;return c};var H={create:&quot;POST&quot;,update:&quot;PUT&quot;,&quot;delete&quot;:&quot;DELETE&quot;,read:&quot;GET&quot;};g.sync=function(a,b,c){var d=H[a];c||(c={});var e={type:d,dataType:&quot;json&quot;};c.url||(e.url=n(b,&quot;url&quot;)||t());if(!c.data&amp;&amp;b&amp;&amp;(&quot;create&quot;==a||&quot;update&quot;==a))e.contentType=&quot;application/json&quot;,
-e.data=JSON.stringify(b.toJSON());g.emulateJSON&amp;&amp;(e.contentType=&quot;application/x-www-form-urlencoded&quot;,e.data=e.data?{model:e.data}:{});if(g.emulateHTTP&amp;&amp;(&quot;PUT&quot;===d||&quot;DELETE&quot;===d))g.emulateJSON&amp;&amp;(e.data._method=d),e.type=&quot;POST&quot;,e.beforeSend=function(a){a.setRequestHeader(&quot;X-HTTP-Method-Override&quot;,d)};&quot;GET&quot;!==e.type&amp;&amp;!g.emulateJSON&amp;&amp;(e.processData=!1);return i.ajax(f.extend(e,c))};g.wrapError=function(a,b,c){return function(d,e){e=d===b?e:d;a?a(b,e,c):b.trigger(&quot;error&quot;,b,e,c)}};var x=function(){},G=function(a,
-b,c){var d;d=b&amp;&amp;b.hasOwnProperty(&quot;constructor&quot;)?b.constructor:function(){a.apply(this,arguments)};f.extend(d,a);x.prototype=a.prototype;d.prototype=new x;b&amp;&amp;f.extend(d.prototype,b);c&amp;&amp;f.extend(d,c);d.prototype.constructor=d;d.__super__=a.prototype;return d},n=function(a,b){return!a||!a[b]?null:f.isFunction(a[b])?a[b]():a[b]},t=function(){throw Error('A &quot;url&quot; property or function must be specified');}}).call(this);
</del><ins>+(function(){var n=this,B=n.Backbone,h=[],C=h.push,u=h.slice,D=h.splice,g;g=&quot;undefined&quot;!==typeof exports?exports:n.Backbone={};g.VERSION=&quot;0.9.10&quot;;var f=n._;!f&amp;&amp;&quot;undefined&quot;!==typeof require&amp;&amp;(f=require(&quot;underscore&quot;));g.$=n.jQuery||n.Zepto||n.ender;g.noConflict=function(){n.Backbone=B;return this};g.emulateHTTP=!1;g.emulateJSON=!1;var v=/\s+/,q=function(a,b,c,d){if(!c)return!0;if(&quot;object&quot;===typeof c)for(var e in c)a[b].apply(a,[e,c[e]].concat(d));else if(v.test(c)){c=c.split(v);e=0;for(var f=c.length;e&lt;
+f;e++)a[b].apply(a,[c[e]].concat(d))}else return!0},w=function(a,b){var c,d=-1,e=a.length;switch(b.length){case 0:for(;++d&lt;e;)(c=a[d]).callback.call(c.ctx);break;case 1:for(;++d&lt;e;)(c=a[d]).callback.call(c.ctx,b[0]);break;case 2:for(;++d&lt;e;)(c=a[d]).callback.call(c.ctx,b[0],b[1]);break;case 3:for(;++d&lt;e;)(c=a[d]).callback.call(c.ctx,b[0],b[1],b[2]);break;default:for(;++d&lt;e;)(c=a[d]).callback.apply(c.ctx,b)}},h=g.Events={on:function(a,b,c){if(!q(this,&quot;on&quot;,a,[b,c])||!b)return this;this._events||(this._events=
+{});(this._events[a]||(this._events[a]=[])).push({callback:b,context:c,ctx:c||this});return this},once:function(a,b,c){if(!q(this,&quot;once&quot;,a,[b,c])||!b)return this;var d=this,e=f.once(function(){d.off(a,e);b.apply(this,arguments)});e._callback=b;this.on(a,e,c);return this},off:function(a,b,c){var d,e,t,g,j,l,k,h;if(!this._events||!q(this,&quot;off&quot;,a,[b,c]))return this;if(!a&amp;&amp;!b&amp;&amp;!c)return this._events={},this;g=a?[a]:f.keys(this._events);j=0;for(l=g.length;j&lt;l;j++)if(a=g[j],d=this._events[a]){t=[];if(b||
+c){k=0;for(h=d.length;k&lt;h;k++)e=d[k],(b&amp;&amp;b!==e.callback&amp;&amp;b!==e.callback._callback||c&amp;&amp;c!==e.context)&amp;&amp;t.push(e)}this._events[a]=t}return this},trigger:function(a){if(!this._events)return this;var b=u.call(arguments,1);if(!q(this,&quot;trigger&quot;,a,b))return this;var c=this._events[a],d=this._events.all;c&amp;&amp;w(c,b);d&amp;&amp;w(d,arguments);return this},listenTo:function(a,b,c){var d=this._listeners||(this._listeners={}),e=a._listenerId||(a._listenerId=f.uniqueId(&quot;l&quot;));d[e]=a;a.on(b,&quot;object&quot;===typeof b?this:c,this);
+return this},stopListening:function(a,b,c){var d=this._listeners;if(d){if(a)a.off(b,&quot;object&quot;===typeof b?this:c,this),!b&amp;&amp;!c&amp;&amp;delete d[a._listenerId];else{&quot;object&quot;===typeof b&amp;&amp;(c=this);for(var e in d)d[e].off(b,c,this);this._listeners={}}return this}}};h.bind=h.on;h.unbind=h.off;f.extend(g,h);var r=g.Model=function(a,b){var c,d=a||{};this.cid=f.uniqueId(&quot;c&quot;);this.attributes={};b&amp;&amp;b.collection&amp;&amp;(this.collection=b.collection);b&amp;&amp;b.parse&amp;&amp;(d=this.parse(d,b)||{});if(c=f.result(this,&quot;defaults&quot;))d=f.defaults({},
+d,c);this.set(d,b);this.changed={};this.initialize.apply(this,arguments)};f.extend(r.prototype,h,{changed:null,idAttribute:&quot;id&quot;,initialize:function(){},toJSON:function(){return f.clone(this.attributes)},sync:function(){return g.sync.apply(this,arguments)},get:function(a){return this.attributes[a]},escape:function(a){return f.escape(this.get(a))},has:function(a){return null!=this.get(a)},set:function(a,b,c){var d,e,g,p,j,l,k;if(null==a)return this;&quot;object&quot;===typeof a?(e=a,c=b):(e={})[a]=b;c||(c={});
+if(!this._validate(e,c))return!1;g=c.unset;p=c.silent;a=[];j=this._changing;this._changing=!0;j||(this._previousAttributes=f.clone(this.attributes),this.changed={});k=this.attributes;l=this._previousAttributes;this.idAttribute in e&amp;&amp;(this.id=e[this.idAttribute]);for(d in e)b=e[d],f.isEqual(k[d],b)||a.push(d),f.isEqual(l[d],b)?delete this.changed[d]:this.changed[d]=b,g?delete k[d]:k[d]=b;if(!p){a.length&amp;&amp;(this._pending=!0);b=0;for(d=a.length;b&lt;d;b++)this.trigger(&quot;change:&quot;+a[b],this,k[a[b]],c)}if(j)return this;
+if(!p)for(;this._pending;)this._pending=!1,this.trigger(&quot;change&quot;,this,c);this._changing=this._pending=!1;return this},unset:function(a,b){return this.set(a,void 0,f.extend({},b,{unset:!0}))},clear:function(a){var b={},c;for(c in this.attributes)b[c]=void 0;return this.set(b,f.extend({},a,{unset:!0}))},hasChanged:function(a){return null==a?!f.isEmpty(this.changed):f.has(this.changed,a)},changedAttributes:function(a){if(!a)return this.hasChanged()?f.clone(this.changed):!1;var b,c=!1,d=this._changing?
+this._previousAttributes:this.attributes,e;for(e in a)if(!f.isEqual(d[e],b=a[e]))(c||(c={}))[e]=b;return c},previous:function(a){return null==a||!this._previousAttributes?null:this._previousAttributes[a]},previousAttributes:function(){return f.clone(this._previousAttributes)},fetch:function(a){a=a?f.clone(a):{};void 0===a.parse&amp;&amp;(a.parse=!0);var b=a.success;a.success=function(a,d,e){if(!a.set(a.parse(d,e),e))return!1;b&amp;&amp;b(a,d,e)};return this.sync(&quot;read&quot;,this,a)},save:function(a,b,c){var d,e,g=this.attributes;
+null==a||&quot;object&quot;===typeof a?(d=a,c=b):(d={})[a]=b;if(d&amp;&amp;(!c||!c.wait)&amp;&amp;!this.set(d,c))return!1;c=f.extend({validate:!0},c);if(!this._validate(d,c))return!1;d&amp;&amp;c.wait&amp;&amp;(this.attributes=f.extend({},g,d));void 0===c.parse&amp;&amp;(c.parse=!0);e=c.success;c.success=function(a,b,c){a.attributes=g;var k=a.parse(b,c);c.wait&amp;&amp;(k=f.extend(d||{},k));if(f.isObject(k)&amp;&amp;!a.set(k,c))return!1;e&amp;&amp;e(a,b,c)};a=this.isNew()?&quot;create&quot;:c.patch?&quot;patch&quot;:&quot;update&quot;;&quot;patch&quot;===a&amp;&amp;(c.attrs=d);a=this.sync(a,this,c);d&amp;&amp;c.wait&amp;&amp;(this.attributes=
+g);return a},destroy:function(a){a=a?f.clone(a):{};var b=this,c=a.success,d=function(){b.trigger(&quot;destroy&quot;,b,b.collection,a)};a.success=function(a,b,e){(e.wait||a.isNew())&amp;&amp;d();c&amp;&amp;c(a,b,e)};if(this.isNew())return a.success(this,null,a),!1;var e=this.sync(&quot;delete&quot;,this,a);a.wait||d();return e},url:function(){var a=f.result(this,&quot;urlRoot&quot;)||f.result(this.collection,&quot;url&quot;)||x();return this.isNew()?a:a+(&quot;/&quot;===a.charAt(a.length-1)?&quot;&quot;:&quot;/&quot;)+encodeURIComponent(this.id)},parse:function(a){return a},clone:function(){return new this.constructor(this.attributes)},
+isNew:function(){return null==this.id},isValid:function(a){return!this.validate||!this.validate(this.attributes,a)},_validate:function(a,b){if(!b.validate||!this.validate)return!0;a=f.extend({},this.attributes,a);var c=this.validationError=this.validate(a,b)||null;if(!c)return!0;this.trigger(&quot;invalid&quot;,this,c,b||{});return!1}});var s=g.Collection=function(a,b){b||(b={});b.model&amp;&amp;(this.model=b.model);void 0!==b.comparator&amp;&amp;(this.comparator=b.comparator);this.models=[];this._reset();this.initialize.apply(this,
+arguments);a&amp;&amp;this.reset(a,f.extend({silent:!0},b))};f.extend(s.prototype,h,{model:r,initialize:function(){},toJSON:function(a){return this.map(function(b){return b.toJSON(a)})},sync:function(){return g.sync.apply(this,arguments)},add:function(a,b){a=f.isArray(a)?a.slice():[a];b||(b={});var c,d,e,g,p,j,l,k,h,m;l=[];k=b.at;h=this.comparator&amp;&amp;null==k&amp;&amp;!1!=b.sort;m=f.isString(this.comparator)?this.comparator:null;c=0;for(d=a.length;c&lt;d;c++)(e=this._prepareModel(g=a[c],b))?(p=this.get(e))?b.merge&amp;&amp;(p.set(g===
+e?e.attributes:g,b),h&amp;&amp;(!j&amp;&amp;p.hasChanged(m))&amp;&amp;(j=!0)):(l.push(e),e.on(&quot;all&quot;,this._onModelEvent,this),this._byId[e.cid]=e,null!=e.id&amp;&amp;(this._byId[e.id]=e)):this.trigger(&quot;invalid&quot;,this,g,b);l.length&amp;&amp;(h&amp;&amp;(j=!0),this.length+=l.length,null!=k?D.apply(this.models,[k,0].concat(l)):C.apply(this.models,l));j&amp;&amp;this.sort({silent:!0});if(b.silent)return this;c=0;for(d=l.length;c&lt;d;c++)(e=l[c]).trigger(&quot;add&quot;,e,this,b);j&amp;&amp;this.trigger(&quot;sort&quot;,this,b);return this},remove:function(a,b){a=f.isArray(a)?a.slice():[a];
+b||(b={});var c,d,e,g;c=0;for(d=a.length;c&lt;d;c++)if(g=this.get(a[c]))delete this._byId[g.id],delete this._byId[g.cid],e=this.indexOf(g),this.models.splice(e,1),this.length--,b.silent||(b.index=e,g.trigger(&quot;remove&quot;,g,this,b)),this._removeReference(g);return this},push:function(a,b){a=this._prepareModel(a,b);this.add(a,f.extend({at:this.length},b));return a},pop:function(a){var b=this.at(this.length-1);this.remove(b,a);return b},unshift:function(a,b){a=this._prepareModel(a,b);this.add(a,f.extend({at:0},
+b));return a},shift:function(a){var b=this.at(0);this.remove(b,a);return b},slice:function(a,b){return this.models.slice(a,b)},get:function(a){if(null!=a)return this._idAttr||(this._idAttr=this.model.prototype.idAttribute),this._byId[a.id||a.cid||a[this._idAttr]||a]},at:function(a){return this.models[a]},where:function(a){return f.isEmpty(a)?[]:this.filter(function(b){for(var c in a)if(a[c]!==b.get(c))return!1;return!0})},sort:function(a){if(!this.comparator)throw Error(&quot;Cannot sort a set without a comparator&quot;);
+a||(a={});f.isString(this.comparator)||1===this.comparator.length?this.models=this.sortBy(this.comparator,this):this.models.sort(f.bind(this.comparator,this));a.silent||this.trigger(&quot;sort&quot;,this,a);return this},pluck:function(a){return f.invoke(this.models,&quot;get&quot;,a)},update:function(a,b){b=f.extend({add:!0,merge:!0,remove:!0},b);b.parse&amp;&amp;(a=this.parse(a,b));var c,d,e,g,h=[],j=[],l={};f.isArray(a)||(a=a?[a]:[]);if(b.add&amp;&amp;!b.remove)return this.add(a,b);d=0;for(e=a.length;d&lt;e;d++)c=a[d],g=this.get(c),
+b.remove&amp;&amp;g&amp;&amp;(l[g.cid]=!0),(b.add&amp;&amp;!g||b.merge&amp;&amp;g)&amp;&amp;h.push(c);if(b.remove){d=0;for(e=this.models.length;d&lt;e;d++)c=this.models[d],l[c.cid]||j.push(c)}j.length&amp;&amp;this.remove(j,b);h.length&amp;&amp;this.add(h,b);return this},reset:function(a,b){b||(b={});b.parse&amp;&amp;(a=this.parse(a,b));for(var c=0,d=this.models.length;c&lt;d;c++)this._removeReference(this.models[c]);b.previousModels=this.models.slice();this._reset();a&amp;&amp;this.add(a,f.extend({silent:!0},b));b.silent||this.trigger(&quot;reset&quot;,this,b);return this},fetch:function(a){a=
+a?f.clone(a):{};void 0===a.parse&amp;&amp;(a.parse=!0);var b=a.success;a.success=function(a,d,e){a[e.update?&quot;update&quot;:&quot;reset&quot;](d,e);b&amp;&amp;b(a,d,e)};return this.sync(&quot;read&quot;,this,a)},create:function(a,b){b=b?f.clone(b):{};if(!(a=this._prepareModel(a,b)))return!1;b.wait||this.add(a,b);var c=this,d=b.success;b.success=function(a,b,f){f.wait&amp;&amp;c.add(a,f);d&amp;&amp;d(a,b,f)};a.save(null,b);return a},parse:function(a){return a},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0;this.models.length=
+0;this._byId={}},_prepareModel:function(a,b){if(a instanceof r)return a.collection||(a.collection=this),a;b||(b={});b.collection=this;var c=new this.model(a,b);return!c._validate(a,b)?!1:c},_removeReference:function(a){this===a.collection&amp;&amp;delete a.collection;a.off(&quot;all&quot;,this._onModelEvent,this)},_onModelEvent:function(a,b,c,d){(&quot;add&quot;===a||&quot;remove&quot;===a)&amp;&amp;c!==this||(&quot;destroy&quot;===a&amp;&amp;this.remove(b,d),b&amp;&amp;a===&quot;change:&quot;+b.idAttribute&amp;&amp;(delete this._byId[b.previous(b.idAttribute)],null!=b.id&amp;&amp;(this._byId[b.id]=
+b)),this.trigger.apply(this,arguments))},sortedIndex:function(a,b,c){b||(b=this.comparator);var d=f.isFunction(b)?b:function(a){return a.get(b)};return f.sortedIndex(this.models,a,d,c)}});f.each(&quot;forEach each map collect reduce foldl 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&quot;.split(&quot; &quot;),function(a){s.prototype[a]=function(){var b=
+u.call(arguments);b.unshift(this.models);return f[a].apply(f,b)}});f.each([&quot;groupBy&quot;,&quot;countBy&quot;,&quot;sortBy&quot;],function(a){s.prototype[a]=function(b,c){var d=f.isFunction(b)?b:function(a){return a.get(b)};return f[a](this.models,d,c)}});var y=g.Router=function(a){a||(a={});a.routes&amp;&amp;(this.routes=a.routes);this._bindRoutes();this.initialize.apply(this,arguments)},E=/\((.*?)\)/g,F=/(\(\?)?:\w+/g,G=/\*\w+/g,H=/[\-{}\[\]+?.,\\\^$|#\s]/g;f.extend(y.prototype,h,{initialize:function(){},route:function(a,b,c){f.isRegExp(a)||
+(a=this._routeToRegExp(a));c||(c=this[b]);g.history.route(a,f.bind(function(d){d=this._extractParameters(a,d);c&amp;&amp;c.apply(this,d);this.trigger.apply(this,[&quot;route:&quot;+b].concat(d));this.trigger(&quot;route&quot;,b,d);g.history.trigger(&quot;route&quot;,this,b,d)},this));return this},navigate:function(a,b){g.history.navigate(a,b);return this},_bindRoutes:function(){if(this.routes)for(var a,b=f.keys(this.routes);null!=(a=b.pop());)this.route(a,this.routes[a])},_routeToRegExp:function(a){a=a.replace(H,&quot;\\$&amp;&quot;).replace(E,&quot;(?:$1)?&quot;).replace(F,
+function(a,c){return c?a:&quot;([^/]+)&quot;}).replace(G,&quot;(.*?)&quot;);return RegExp(&quot;^&quot;+a+&quot;$&quot;)},_extractParameters:function(a,b){return a.exec(b).slice(1)}});var m=g.History=function(){this.handlers=[];f.bindAll(this,&quot;checkUrl&quot;);&quot;undefined&quot;!==typeof window&amp;&amp;(this.location=window.location,this.history=window.history)},z=/^[#\/]|\s+$/g,I=/^\/+|\/+$/g,J=/msie [\w.]+/,K=/\/$/;m.started=!1;f.extend(m.prototype,h,{interval:50,getHash:function(a){return(a=(a||this).location.href.match(/#(.*)$/))?a[1]:&quot;&quot;},getFragment:function(a,
+b){if(null==a)if(this._hasPushState||!this._wantsHashChange||b){a=this.location.pathname;var c=this.root.replace(K,&quot;&quot;);a.indexOf(c)||(a=a.substr(c.length))}else a=this.getHash();return a.replace(z,&quot;&quot;)},start:function(a){if(m.started)throw Error(&quot;Backbone.history has already been started&quot;);m.started=!0;this.options=f.extend({},{root:&quot;/&quot;},this.options,a);this.root=this.options.root;this._wantsHashChange=!1!==this.options.hashChange;this._wantsPushState=!!this.options.pushState;this._hasPushState=!(!this.options.pushState||
+!this.history||!this.history.pushState);a=this.getFragment();var b=document.documentMode,b=J.exec(navigator.userAgent.toLowerCase())&amp;&amp;(!b||7&gt;=b);this.root=(&quot;/&quot;+this.root+&quot;/&quot;).replace(I,&quot;/&quot;);b&amp;&amp;this._wantsHashChange&amp;&amp;(this.iframe=g.$('&lt;iframe src=&quot;javascript:0&quot; tabindex=&quot;-1&quot; /&gt;').hide().appendTo(&quot;body&quot;)[0].contentWindow,this.navigate(a));if(this._hasPushState)g.$(window).on(&quot;popstate&quot;,this.checkUrl);else if(this._wantsHashChange&amp;&amp;&quot;onhashchange&quot;in window&amp;&amp;!b)g.$(window).on(&quot;hashchange&quot;,this.checkUrl);
+else this._wantsHashChange&amp;&amp;(this._checkUrlInterval=setInterval(this.checkUrl,this.interval));this.fragment=a;a=this.location;b=a.pathname.replace(/[^\/]$/,&quot;$&amp;/&quot;)===this.root;if(this._wantsHashChange&amp;&amp;this._wantsPushState&amp;&amp;!this._hasPushState&amp;&amp;!b)return this.fragment=this.getFragment(null,!0),this.location.replace(this.root+this.location.search+&quot;#&quot;+this.fragment),!0;this._wantsPushState&amp;&amp;(this._hasPushState&amp;&amp;b&amp;&amp;a.hash)&amp;&amp;(this.fragment=this.getHash().replace(z,&quot;&quot;),this.history.replaceState({},document.title,
+this.root+this.fragment+a.search));if(!this.options.silent)return this.loadUrl()},stop:function(){g.$(window).off(&quot;popstate&quot;,this.checkUrl).off(&quot;hashchange&quot;,this.checkUrl);clearInterval(this._checkUrlInterval);m.started=!1},route:function(a,b){this.handlers.unshift({route:a,callback:b})},checkUrl:function(){var a=this.getFragment();a===this.fragment&amp;&amp;this.iframe&amp;&amp;(a=this.getFragment(this.getHash(this.iframe)));if(a===this.fragment)return!1;this.iframe&amp;&amp;this.navigate(a);this.loadUrl()||this.loadUrl(this.getHash())},
+loadUrl:function(a){var b=this.fragment=this.getFragment(a);return f.any(this.handlers,function(a){if(a.route.test(b))return a.callback(b),!0})},navigate:function(a,b){if(!m.started)return!1;if(!b||!0===b)b={trigger:b};a=this.getFragment(a||&quot;&quot;);if(this.fragment!==a){this.fragment=a;var c=this.root+a;if(this._hasPushState)this.history[b.replace?&quot;replaceState&quot;:&quot;pushState&quot;]({},document.title,c);else if(this._wantsHashChange)this._updateHash(this.location,a,b.replace),this.iframe&amp;&amp;a!==this.getFragment(this.getHash(this.iframe))&amp;&amp;
+(b.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,a,b.replace));else return this.location.assign(c);b.trigger&amp;&amp;this.loadUrl(a)}},_updateHash:function(a,b,c){c?(c=a.href.replace(/(javascript:|#).*$/,&quot;&quot;),a.replace(c+&quot;#&quot;+b)):a.hash=&quot;#&quot;+b}});g.history=new m;var A=g.View=function(a){this.cid=f.uniqueId(&quot;view&quot;);this._configure(a||{});this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()},L=/^(\S+)\s*(.*)$/,M=&quot;model collection el id attributes className tagName events&quot;.split(&quot; &quot;);
+f.extend(A.prototype,h,{tagName:&quot;div&quot;,$:function(a){return this.$el.find(a)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();this.stopListening();return this},setElement:function(a,b){this.$el&amp;&amp;this.undelegateEvents();this.$el=a instanceof g.$?a:g.$(a);this.el=this.$el[0];!1!==b&amp;&amp;this.delegateEvents();return this},delegateEvents:function(a){if(a||(a=f.result(this,&quot;events&quot;))){this.undelegateEvents();for(var b in a){var c=a[b];f.isFunction(c)||(c=this[a[b]]);
+if(!c)throw Error('Method &quot;'+a[b]+'&quot; does not exist');var d=b.match(L),e=d[1],d=d[2],c=f.bind(c,this),e=e+(&quot;.delegateEvents&quot;+this.cid);if(&quot;&quot;===d)this.$el.on(e,c);else this.$el.on(e,d,c)}}},undelegateEvents:function(){this.$el.off(&quot;.delegateEvents&quot;+this.cid)},_configure:function(a){this.options&amp;&amp;(a=f.extend({},f.result(this,&quot;options&quot;),a));f.extend(this,f.pick(a,M));this.options=a},_ensureElement:function(){if(this.el)this.setElement(f.result(this,&quot;el&quot;),!1);else{var a=f.extend({},f.result(this,&quot;attributes&quot;));
+this.id&amp;&amp;(a.id=f.result(this,&quot;id&quot;));this.className&amp;&amp;(a[&quot;class&quot;]=f.result(this,&quot;className&quot;));a=g.$(&quot;&lt;&quot;+f.result(this,&quot;tagName&quot;)+&quot;&gt;&quot;).attr(a);this.setElement(a,!1)}}});var N={create:&quot;POST&quot;,update:&quot;PUT&quot;,patch:&quot;PATCH&quot;,&quot;delete&quot;:&quot;DELETE&quot;,read:&quot;GET&quot;};g.sync=function(a,b,c){var d=N[a];f.defaults(c||(c={}),{emulateHTTP:g.emulateHTTP,emulateJSON:g.emulateJSON});var e={type:d,dataType:&quot;json&quot;};c.url||(e.url=f.result(b,&quot;url&quot;)||x());if(null==c.data&amp;&amp;b&amp;&amp;(&quot;create&quot;===a||&quot;update&quot;===a||&quot;patch&quot;===a))e.contentType=&quot;application/json&quot;,
+e.data=JSON.stringify(c.attrs||b.toJSON(c));c.emulateJSON&amp;&amp;(e.contentType=&quot;application/x-www-form-urlencoded&quot;,e.data=e.data?{model:e.data}:{});if(c.emulateHTTP&amp;&amp;(&quot;PUT&quot;===d||&quot;DELETE&quot;===d||&quot;PATCH&quot;===d)){e.type=&quot;POST&quot;;c.emulateJSON&amp;&amp;(e.data._method=d);var h=c.beforeSend;c.beforeSend=function(a){a.setRequestHeader(&quot;X-HTTP-Method-Override&quot;,d);if(h)return h.apply(this,arguments)}}&quot;GET&quot;!==e.type&amp;&amp;!c.emulateJSON&amp;&amp;(e.processData=!1);var m=c.success;c.success=function(a){m&amp;&amp;m(b,a,c);b.trigger(&quot;sync&quot;,b,a,c)};
+var j=c.error;c.error=function(a){j&amp;&amp;j(b,a,c);b.trigger(&quot;error&quot;,b,a,c)};a=c.xhr=g.ajax(f.extend(e,c));b.trigger(&quot;request&quot;,b,a,c);return a};g.ajax=function(){return g.$.ajax.apply(g.$,arguments)};r.extend=s.extend=y.extend=A.extend=m.extend=function(a,b){var c=this,d;d=a&amp;&amp;f.has(a,&quot;constructor&quot;)?a.constructor:function(){return c.apply(this,arguments)};f.extend(d,c,b);var e=function(){this.constructor=d};e.prototype=c.prototype;d.prototype=new e;a&amp;&amp;f.extend(d.prototype,a);d.__super__=c.prototype;return d};
+var x=function(){throw Error('A &quot;url&quot; property or function must be specified');}}).call(this);
</ins></span></pre></div>
<a id="trunkwpincludesjsmediamodelsjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/media-models.js (23588 => 23589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/media-models.js        2013-03-03 03:00:34 UTC (rev 23588)
+++ trunk/wp-includes/js/media-models.js        2013-03-03 07:04:06 UTC (rev 23589)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> window.wp = window.wp || {};
</span><span class="cx"> 
</span><span class="cx"> (function($){
</span><del>-        var Attachment, Attachments, Query, compare, l10n, media;
</del><ins>+        var Attachment, Attachments, Query, compare, l10n, media, bindSyncEvents;
</ins><span class="cx"> 
</span><span class="cx">         /**
</span><span class="cx">          * wp.media( attributes )
</span><span class="lines">@@ -67,6 +67,27 @@
</span><span class="cx">                         return a &gt; b ? -1 : 1;
</span><span class="cx">         };
</span><span class="cx"> 
</span><ins>+        // Ensures the 'sync' and 'error' events are always
+        // correctly triggered when overloading `Backbone.sync`.
+        bindSyncEvents = function( model, options ) {
+                var success = options.success,
+                        error = options.error;
+
+                options.success = function( resp ) {
+                        if ( success )
+                                success( model, resp, options );
+                        model.trigger( 'sync', model, resp, options );
+                };
+
+                options.error = function( xhr ) {
+                        if ( error )
+                                error( model, xhr, options );
+                        model.trigger( 'error', model, xhr, options );
+                };
+
+                return options;
+        };
+
</ins><span class="cx">         _.extend( media, {
</span><span class="cx">                 /**
</span><span class="cx">                  * media.template( id )
</span><span class="lines">@@ -241,6 +262,7 @@
</span><span class="cx">                                         action: 'get-attachment',
</span><span class="cx">                                         id: this.id
</span><span class="cx">                                 });
</span><ins>+                                bindSyncEvents( model, options );
</ins><span class="cx">                                 return media.ajax( options );
</span><span class="cx"> 
</span><span class="cx">                         // Overload the `update` request so properties can be saved.
</span><span class="lines">@@ -261,15 +283,15 @@
</span><span class="cx">                                 });
</span><span class="cx"> 
</span><span class="cx">                                 // Record the values of the changed attributes.
</span><del>-                                if ( options.changes ) {
-                                        _.each( options.changes, function( value, key ) {
-                                                options.changes[ key ] = this.get( key );
</del><ins>+                                if ( model.hasChanged() ) {
+                                        options.data.changes = {};
+
+                                        _.each( model.changed, function( value, key ) {
+                                                options.data.changes[ key ] = this.get( key );
</ins><span class="cx">                                         }, this );
</span><del>-
-                                        options.data.changes = options.changes;
-                                        delete options.changes;
</del><span class="cx">                                 }
</span><span class="cx"> 
</span><ins>+                                bindSyncEvents( model, options );
</ins><span class="cx">                                 return media.ajax( options );
</span><span class="cx"> 
</span><span class="cx">                         // Overload the `delete` request so attachments can be removed.
</span><span class="lines">@@ -287,11 +309,16 @@
</span><span class="cx">                                         _wpnonce: this.get('nonces')['delete']
</span><span class="cx">                                 });
</span><span class="cx"> 
</span><ins>+                                bindSyncEvents( model, options );
</ins><span class="cx">                                 return media.ajax( options ).done( function() {
</span><span class="cx">                                         this.destroyed = true;
</span><span class="cx">                                 }).fail( function() {
</span><span class="cx">                                         this.destroyed = false;
</span><span class="cx">                                 });
</span><ins>+
+                        // Otherwise, fall back to `Backbone.sync()`.
+                        } else {
+                                return Backbone.Model.prototype.sync.apply( this, arguments );
</ins><span class="cx">                         }
</span><span class="cx">                 },
</span><span class="cx"> 
</span><span class="lines">@@ -392,7 +419,7 @@
</span><span class="cx">                         if ( this.props.get('query') )
</span><span class="cx">                                 return;
</span><span class="cx"> 
</span><del>-                        var changed = _.chain( options.changes ).map( function( t, prop ) {
</del><ins>+                        var changed = _.chain( model.changed ).map( function( t, prop ) {
</ins><span class="cx">                                 var filter = Attachments.filters[ prop ],
</span><span class="cx">                                         term = model.get( prop );
</span><span class="cx"> 
</span><span class="lines">@@ -434,7 +461,7 @@
</span><span class="cx"> 
</span><span class="cx">                 validate: function( attachment, options ) {
</span><span class="cx">                         var valid = this.validator( attachment ),
</span><del>-                                hasAttachment = !! this.getByCid( attachment.cid );
</del><ins>+                                hasAttachment = !! this.get( attachment.cid );
</ins><span class="cx"> 
</span><span class="cx">                         if ( ! valid &amp;&amp; hasAttachment )
</span><span class="cx">                                 this.remove( attachment, options );
</span><span class="lines">@@ -746,6 +773,7 @@
</span><span class="cx">                                         args.paged = Math.floor( this.length / args.posts_per_page ) + 1;
</span><span class="cx"> 
</span><span class="cx">                                 options.data.query = args;
</span><ins>+                                bindSyncEvents( model, options );
</ins><span class="cx">                                 return media.ajax( options );
</span><span class="cx"> 
</span><span class="cx">                         // Otherwise, fall back to Backbone.sync()
</span><span class="lines">@@ -876,7 +904,7 @@
</span><span class="cx">                                 this._single = model;
</span><span class="cx"> 
</span><span class="cx">                         // If the single model isn't in the selection, remove it.
</span><del>-                        if ( this._single &amp;&amp; ! this.getByCid( this._single.cid ) )
</del><ins>+                        if ( this._single &amp;&amp; ! this.get( this._single.cid ) )
</ins><span class="cx">                                 delete this._single;
</span><span class="cx"> 
</span><span class="cx">                         this._single = this._single || this.last();
</span><span class="lines">@@ -888,7 +916,7 @@
</span><span class="cx"> 
</span><span class="cx">                                         // If the model was already removed, trigger the collection
</span><span class="cx">                                         // event manually.
</span><del>-                                        if ( ! this.getByCid( previous.cid ) )
</del><ins>+                                        if ( ! this.get( previous.cid ) )
</ins><span class="cx">                                                 this.trigger( 'selection:unsingle', previous, this );
</span><span class="cx">                                 }
</span><span class="cx">                                 if ( this._single )
</span></span></pre></div>
<a id="trunkwpincludesjsmediaviewsjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/media-views.js (23588 => 23589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/media-views.js        2013-03-03 03:00:34 UTC (rev 23588)
+++ trunk/wp-includes/js/media-views.js        2013-03-03 07:04:06 UTC (rev 23589)
</span><span class="lines">@@ -223,10 +223,8 @@
</span><span class="cx">                         this.on( 'reset', this.reset, this );
</span><span class="cx">                         this.on( 'ready', this._ready, this );
</span><span class="cx">                         this.on( 'ready', this.ready, this );
</span><del>-
-                        this.on( 'change:menu', this._updateMenu, this );
-
</del><span class="cx">                         Backbone.Model.apply( this, arguments );
</span><ins>+                        this.on( 'change:menu', this._updateMenu, this );
</ins><span class="cx">                 },
</span><span class="cx"> 
</span><span class="cx">                 ready: function() {},
</span><span class="lines">@@ -658,7 +656,7 @@
</span><span class="cx">                         // Accepts attachments that exist in the original library and
</span><span class="cx">                         // that do not exist in gallery's library.
</span><span class="cx">                         library.validator = function( attachment ) {
</span><del>-                                return !! this.mirroring.getByCid( attachment.cid ) &amp;&amp; ! edit.getByCid( attachment.cid ) &amp;&amp; media.model.Selection.prototype.validator.apply( this, arguments );
</del><ins>+                                return !! this.mirroring.get( attachment.cid ) &amp;&amp; ! edit.get( attachment.cid ) &amp;&amp; media.model.Selection.prototype.validator.apply( this, arguments );
</ins><span class="cx">                         };
</span><span class="cx"> 
</span><span class="cx">                         // Reset the library to ensure that all attachments are re-added
</span><span class="lines">@@ -701,8 +699,8 @@
</span><span class="cx">                         // Overload the library's comparator to push items that are not in
</span><span class="cx">                         // the mirrored query to the front of the aggregate collection.
</span><span class="cx">                         library.comparator = function( a, b ) {
</span><del>-                                var aInQuery = !! this.mirroring.getByCid( a.cid ),
-                                        bInQuery = !! this.mirroring.getByCid( b.cid );
</del><ins>+                                var aInQuery = !! this.mirroring.get( a.cid ),
+                                        bInQuery = !! this.mirroring.get( b.cid );
</ins><span class="cx"> 
</span><span class="cx">                                 if ( ! aInQuery &amp;&amp; bInQuery )
</span><span class="cx">                                         return -1;
</span><span class="lines">@@ -3007,7 +3005,7 @@
</span><span class="cx">                 selected: function() {
</span><span class="cx">                         var selection = this.options.selection;
</span><span class="cx">                         if ( selection )
</span><del>-                                return !! selection.getByCid( this.model.cid );
</del><ins>+                                return !! selection.get( this.model.cid );
</ins><span class="cx">                 },
</span><span class="cx"> 
</span><span class="cx">                 select: function( model, collection ) {
</span><span class="lines">@@ -3234,7 +3232,7 @@
</span><span class="cx"> 
</span><span class="cx">                         this.collection.on( 'add', function( attachment, attachments, options ) {
</span><span class="cx">                                 this.views.add( this.createAttachmentView( attachment ), {
</span><del>-                                        at: options.index
</del><ins>+                                        at: this.collection.indexOf( attachment )
</ins><span class="cx">                                 });
</span><span class="cx">                         }, this );
</span><span class="cx"> 
</span><span class="lines">@@ -3469,7 +3467,7 @@
</span><span class="cx">                         // Build `&lt;option&gt;` elements.
</span><span class="cx">                         this.$el.html( _.chain( this.filters ).map( function( filter, value ) {
</span><span class="cx">                                 return {
</span><del>-                                        el: this.make( 'option', { value: value }, filter.text ),
</del><ins>+                                        el: $('&lt;option&gt;&lt;/option&gt;').val(value).text(filter.text)[0],
</ins><span class="cx">                                         priority: filter.priority || 50
</span><span class="cx">                                 };
</span><span class="cx">                         }, this ).sortBy('priority').pluck('el').value() );
</span><span class="lines">@@ -3964,8 +3962,8 @@
</span><span class="cx">                 },
</span><span class="cx"> 
</span><span class="cx">                 updateChanges: function( model, options ) {
</span><del>-                        if ( options.changes )
-                                _( options.changes ).chain().keys().each( this.update, this );
</del><ins>+                        if ( model.hasChanged() )
+                                _( model.changed ).chain().keys().each( this.update, this );
</ins><span class="cx">                 }
</span><span class="cx">         });
</span><span class="cx"> 
</span><span class="lines">@@ -4236,16 +4234,10 @@
</span><span class="cx">                 },
</span><span class="cx"> 
</span><span class="cx">                 initialize: function() {
</span><del>-                        this.input = this.make( 'input', {
-                                type:  'text',
-                                value: this.model.get('url') || ''
-                        });
</del><ins>+                        this.$input = $('&lt;input/&gt;').attr( 'type', 'text' ).val( this.model.get('url') );
+                        this.input = this.$input[0];
</ins><span class="cx"> 
</span><del>-                        this.spinner = this.make( 'span', {
-                                'class': 'spinner'
-                        });
-
-                        this.$input = $( this.input );
</del><ins>+                        this.spinner = $('&lt;span class=&quot;spinner&quot; /&gt;')[0];
</ins><span class="cx">                         this.$el.append([ this.input, this.spinner ]);
</span><span class="cx"> 
</span><span class="cx">                         this.model.on( 'change:url', this.render, this );
</span><span class="lines">@@ -4302,4 +4294,4 @@
</span><span class="cx">                         this.$('img').attr( 'src', this.model.get('url') );
</span><span class="cx">                 }
</span><span class="cx">         });
</span><del>-}(jQuery));
</del><ins>+}(jQuery));
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (23588 => 23589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2013-03-03 03:00:34 UTC (rev 23588)
+++ trunk/wp-includes/script-loader.php        2013-03-03 07:04:06 UTC (rev 23589)
</span><span class="lines">@@ -271,7 +271,7 @@
</span><span class="cx"> 
</span><span class="cx">         $scripts-&gt;add( 'underscore', '/wp-includes/js/underscore.min.js', array(), '1.4.4', 1 );
</span><span class="cx">         $scripts-&gt;add( 'template', &quot;/wp-includes/js/template$suffix.js&quot;, array('underscore'), '1.4.4', 1 );
</span><del>-        $scripts-&gt;add( 'backbone', '/wp-includes/js/backbone.min.js', array('underscore','jquery', 'template'), '0.9.2', 1 );
</del><ins>+        $scripts-&gt;add( 'backbone', '/wp-includes/js/backbone.min.js', array('underscore','jquery', 'template'), '0.9.10', 1 );
</ins><span class="cx"> 
</span><span class="cx">         $scripts-&gt;add( 'revisions', &quot;/wp-admin/js/revisions$suffix.js&quot;, array( 'backbone', 'jquery-ui-slider' ), false, 1 );
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>