Permalink
Browse files

Use http://marijnhaverbeke.nl/uglifyjs to minify

  • Loading branch information...
1 parent e837a20 commit e5d3d08c0798e86d9b9e10f3564944aba8ca8b1b @mcordingley mcordingley committed Mar 7, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 ajax/libs/backbone.obscura/0.1.6/backbone.obscura.min.js
View
2 ajax/libs/backbone.obscura/0.1.6/backbone.obscura.min.js
@@ -1 +1 @@
-(function(e,t){if(typeof exports==="object"){module.exports=t(require("underscore"),require("backbone"))}else if(typeof define==="function"&&define.amd){define(["underscore","backbone"],t)}else{e.Backbone.Obscura=t(e._,e.Backbone)}})(this,function(e,t){var n=function(n){return{backbone:t,underscore:e}[n]};n=function r(e,t,i){function s(u,a){if(!t[u]){if(!e[u]){var f=typeof n=="function"&&n;if(!a&&f)return f(u,!0);if(o)return o(u,!0);throw new Error("Cannot find module '"+u+"'")}var l=t[u]={exports:{}};e[u][0].call(l.exports,function(t){var n=e[u][1][t];return s(n?n:t)},l,l.exports,r,e,t,i)}return t[u].exports}var o=typeof n=="function"&&n;for(var u=0;u<i.length;u++)s(i[u]);return s}({HusaU0:[function(e,t,n){function l(e,t){this._superset=e;this._filtered=new s(e,t);this._sorted=new o(this._filtered,t);this._paginated=new u(this._sorted,t);a(this._paginated,this);f.call(this,this._filtered,p);f.call(this,this._sorted,v);f.call(this,this._paginated,g)}var r=e("underscore");var i=e("backbone");var s=e("backbone-filtered-collection");var o=e("backbone-sorted-collection");var u=e("backbone-paginated-collection");var a=e("backbone-collection-proxy");var f=e("./src/proxy-events.js");var c={superset:function(){return this._superset},getFilteredLength:function(){return this._filtered.length},removeTransforms:function(){this._filtered.resetFilters();this._sorted.removeSort();this._paginated.removePagination();return this},destroy:function(){this.stopListening();this._filtered.destroy();this._sorted.destroy();this._paginated.destroy();this.length=0;this.trigger("obscura:destroy")}};var h=["filterBy","removeFilter","resetFilters","refilter","hasFilter","getFilters"];var p=["filtered:add","filtered:remove","filtered:reset"];var d=["setSort","reverseSort","removeSort"];var v=["sorted:add","sorted:remove"];var m=["setPerPage","setPage","getPerPage","getNumPages","getPage","hasNextPage","hasPrevPage","nextPage","prevPage","movePage","removePagination","firstPage","lastPage"];var g=["paginated:change:perPage","paginated:change:page","paginated:change:numPages"];r.each(h,function(e){c[e]=function(){var t=s.prototype[e].apply(this._filtered,arguments);return t===this._filtered?this:t}});r.each(m,function(e){c[e]=function(){var t=u.prototype[e].apply(this._paginated,arguments);return t===this._paginated?this:t}});r.each(d,function(e){c[e]=function(){var t=o.prototype[e].apply(this._sorted,arguments);return t===this._sorted?this:t}});r.extend(l.prototype,c,i.Events);l.FilteredCollection=s;l.SortedCollection=o;l.PaginatedCollection=u;t.exports=l},{"./src/proxy-events.js":9,backbone:false,"backbone-collection-proxy":3,"backbone-filtered-collection":4,"backbone-paginated-collection":6,"backbone-sorted-collection":7,underscore:false}],obscura:[function(e,t,n){t.exports=e("HusaU0")},{}],3:[function(e,t,n){function u(e,t){function n(){t.length=e.length}function u(n){var i=r.toArray(arguments);var s=n==="change"||n.slice(0,7)==="change:";if(n==="reset"){t.models=e.models}if(r.contains(o,n)){if(r.contains(["add","remove","destory"],n)){i[2]=t}else if(r.contains(["reset","sort"],n)){i[1]=t}t.trigger.apply(this,i)}else if(s){if(t.contains(i[1])){t.trigger.apply(this,i)}}}var a={};r.each(r.functions(i.Collection.prototype),function(t){if(!r.contains(s,t)){a[t]=function(){return e[t].apply(e,arguments)}}});r.extend(t,i.Events,a);t.listenTo(e,"all",n);t.listenTo(e,"all",u);t.models=e.models;n();return t}var r=e("underscore");var i=e("backbone");var s=["_onModelEvent","_prepareModel","_removeReference","_reset","add","initialize","sync","remove","reset","set","push","pop","unshift","shift","sort","parse","fetch","create","model","off","on","listenTo","listenToOnce","bind","trigger","once","stopListening"];var o=["add","remove","reset","sort","destroy"];t.exports=u},{backbone:false,underscore:false}],4:[function(e,t,n){function u(){this._filterResultCache={}}function a(e){for(var t in this._filterResultCache){if(this._filterResultCache.hasOwnProperty(t)){delete this._filterResultCache[t][e]}}}function f(e,t){if(this._filters[e]){a.call(this,e)}this._filters[e]=t;this.trigger("filtered:add",e)}function l(e){delete this._filters[e];a.call(this,e);this.trigger("filtered:remove",e)}function c(e){if(!this._filterResultCache[e.cid]){this._filterResultCache[e.cid]={}}var t=this._filterResultCache[e.cid];for(var n in this._filters){if(this._filters.hasOwnProperty(n)){if(!t.hasOwnProperty(n)){t[n]=this._filters[n].fn(e)}if(!t[n]){return false}}}return true}function h(){var e=[];if(this._superset){e=this._superset.filter(r.bind(c,this))}this._collection.reset(e);this.length=this._collection.length}function p(e){this._filterResultCache[e.cid]={};if(c.call(this,e)){if(!this._collection.get(e.cid)){var t=this.superset().indexOf(e);var n=null;for(var r=t-1;r>=0;r-=1){if(this.contains(this.superset().at(r))){n=this.indexOf(this.superset().at(r))+1;break}}n=n||0;this._collection.add(e,{at:n})}}else{if(this._collection.get(e.cid)){this._collection.remove(e)}}this.length=this._collection.length}function d(e){this._filterResultCache[e.cid]={};if(!c.call(this,e)){if(this._collection.get(e.cid)){this._collection.remove(e)}}}function v(e,t,n){if(e.slice(0,7)==="change:"){d.call(this,arguments[1])}}function m(e){if(this.contains(e)){this._collection.remove(e)}this.length=this._collection.length}function g(e){this._superset=e;this._collection=new i.Collection(e.toArray());s(this._collection,this);this.resetFilters();this.listenTo(this._superset,"reset sort",h);this.listenTo(this._superset,"add change",p);this.listenTo(this._superset,"remove",m);this.listenTo(this._superset,"all",v)}var r=e("underscore");var i=e("backbone");var s=e("backbone-collection-proxy");var o=e("./src/create-filter.js");var y={defaultFilterName:"__default",filterBy:function(e,t){if(!t){t=e;e=this.defaultFilterName}f.call(this,e,o(t));h.call(this);return this},removeFilter:function(e){if(!e){e=this.defaultFilterName}l.call(this,e);h.call(this);return this},resetFilters:function(){this._filters={};u.call(this);this.trigger("filtered:reset");h.call(this);return this},superset:function(){return this._superset},refilter:function(e){if(typeof e==="object"&&e.cid){p.call(this,e)}else{u.call(this);h.call(this)}return this},getFilters:function(){return r.keys(this._filters)},hasFilter:function(e){return r.contains(this.getFilters(),e)},destroy:function(){this.stopListening();this._collection.reset([]);this._superset=this._collection;this.length=0;this.trigger("filtered:destroy")}};r.extend(g.prototype,y,i.Events);t.exports=g},{"./src/create-filter.js":5,backbone:false,"backbone-collection-proxy":3,underscore:false}],5:[function(e,t,n){function i(e,t){return function(n){return n.get(e)===t}}function s(e,t){return function(n){return t(n.get(e))}}function o(e,t){if(!r.isArray(t)){t=null}return{fn:e,keys:t}}function u(e){var t=r.keys(e);var n=r.map(t,function(t){var n=e[t];if(r.isFunction(n)){return s(t,n)}return i(t,n)});var u=function(e){for(var t=0;t<n.length;t++){if(!n[t](e)){return false}}return true};return o(u,t)}function a(e,t){if(r.isFunction(e)){return o(e,t)}if(r.isObject(e)){return u(e)}}var r=e("underscore");t.exports=a},{underscore:false}],6:[function(e,t,n){function o(){var e=this.getPage()*this.getPerPage();var t=e+this.getPerPage();return[e,t]}function u(){var e=o.call(this);this._collection.reset(this.superset().slice(e[0],e[1]))}function a(){var e=this._totalPages;var t=this.superset().length;var n=this.getPerPage();var r=t%n===0?t/n:Math.floor(t/n)+1;var i=this._totalPages!==r;this._totalPages=r;if(i){this.trigger("paginated:change:numPages",{numPages:r})}if(this.getPage()>=r){this.setPage(r-1);return true}}function f(){if(a.call(this)){return}u.call(this)}function l(e,t){var n=r.max([e.length,t.length]);for(var i=0,s=0;i<n;i+=1,s+=1){if(e[i]!==t[s]){if(t[i-1]===e[i]){s-=1}else if(t[i+1]===e[i]){s+=1}else{return e[i]}}}}function c(e,t,n){if(a.call(this)){return}var r=o.call(this);var i=r[0],s=r[1];var u=l(this.superset().slice(i,s),this._collection.toArray());var f=l(this._collection.toArray(),this.superset().slice(i,s));if(f){this._collection.remove(f)}if(u){this._collection.add(u,{at:this.superset().indexOf(u)-i})}}function h(e,t){this._superset=e;this._collection=new i.Collection(e.toArray());this._page=0;this.setPerPage(t&&t.perPage?t.perPage:null);s(this._collection,this);this.listenTo(this._superset,"add remove",c);this.listenTo(this._superset,"reset sort",f)}var r=e("underscore");var i=e("backbone");var s=e("backbone-collection-proxy");var p={removePagination:function(){this.setPerPage(null);return this},setPerPage:function(e){this._perPage=e;f.call(this);this.setPage(0);this.trigger("paginated:change:perPage",{perPage:e,numPages:this.getNumPages()});return this},setPage:function(e){var t=0;var n=this.getNumPages()-1;e=e>t?e:t;e=e<n?e:n;e=e<0?0:e;this._page=e;u.call(this);this.trigger("paginated:change:page",{page:e});return this},getPerPage:function(){return this._perPage||this.superset().length||1},getNumPages:function(){return this._totalPages},getPage:function(){return this._page},hasNextPage:function(){return this.getPage()<this.getNumPages()-1},hasPrevPage:function(){return this.getPage()>0},nextPage:function(){this.movePage(1);return this},prevPage:function(){this.movePage(-1);return this},firstPage:function(){this.setPage(0)},lastPage:function(){this.setPage(this.getNumPages()-1)},movePage:function(e){this.setPage(this.getPage()+e);return this},superset:function(){return this._superset},destroy:function(){this.stopListening();this._collection.reset([]);this._superset=this._collection;this._page=0;this._totalPages=0;this.length=0;this.trigger("paginated:destroy")}};r.extend(h.prototype,p,i.Events);t.exports=h},{backbone:false,"backbone-collection-proxy":3,underscore:false}],7:[function(e,t,n){function u(e){return r.isFunction(e)?e:function(t){return t.get(e)}}function a(e){if(!this._comparator){return this._superset.indexOf(e)}else{if(!this._reverse){return r.sortedIndex(this._collection.toArray(),e,u(this._comparator))}else{return o(this._collection.toArray(),e,u(this._comparator))}}}function f(e){var t=a.call(this,e);this._collection.add(e,{at:t})}function l(e){if(this.contains(e)){this._collection.remove(e)}}function c(e){if(this.contains(e)&&this._collection.indexOf(e)!==a.call(this,e)){this._collection.remove(e);f.call(this,e)}}function h(){if(!this._comparator){this._collection.reset(this._superset.toArray());return}var e=this._superset.sortBy(this._comparator);this._collection.reset(this._reverse?e.reverse():e)}function p(e){this._superset=e;this._reverse=false;this._comparator=null;this._collection=new i.Collection(e.toArray());s(this._collection,this);this.listenTo(this._superset,"add",f);this.listenTo(this._superset,"remove",l);this.listenTo(this._superset,"change",c);this.listenTo(this._superset,"reset",h)}var r=e("underscore");var i=e("backbone");var s=e("backbone-collection-proxy");var o=e("./src/reverse-sorted-index.js");var d={setSort:function(e,t){this._reverse=t==="desc"?true:false;this._comparator=e;h.call(this);if(!e){this.trigger("sorted:remove")}else{this.trigger("sorted:add")}return this},reverseSort:function(){this._reverse=!this._reverse;h.call(this);return this},removeSort:function(){this.setSort();return this},superset:function(){return this._superset},destroy:function(){this.stopListening();this._collection.reset([]);this._superset=this._collection;this.length=0;this.trigger("sorted:destroy")}};r.extend(p.prototype,d,i.Events);t.exports=p},{"./src/reverse-sorted-index.js":8,backbone:false,"backbone-collection-proxy":3,underscore:false}],8:[function(e,t,n){function i(e){return r.isFunction(e)?e:function(t){return t[e]}}function s(e,t,n,s){n=n==null?r.identity:i(n);var o=n.call(s,t);var u=0,a=e.length;while(u<a){var f=u+a>>>1;n.call(s,e[f])<o?a=f:u=f+1}return u}var r=e("underscore");t.exports=s},{underscore:false}],9:[function(e,t,n){function i(e,t){r.each(t,function(t){this.listenTo(e,t,function(){var e=r.toArray(arguments);e.unshift(t);this.trigger.apply(this,e)})},this)}var r=e("underscore");t.exports=i},{underscore:false}]},{},[]);return n("obscura")})
+!function(a,b){"object"==typeof exports?module.exports=b(require("underscore"),require("backbone")):"function"==typeof define&&define.amd?define(["underscore","backbone"],b):a.Backbone.Obscura=b(a._,a.Backbone)}(this,function(a,b){var c=function(c){return{backbone:b,underscore:a}[c]};return c=function d(a,b,e){function f(h,i){if(!b[h]){if(!a[h]){var j="function"==typeof c&&c;if(!i&&j)return j(h,!0);if(g)return g(h,!0);throw new Error("Cannot find module '"+h+"'")}var k=b[h]={exports:{}};a[h][0].call(k.exports,function(b){var c=a[h][1][b];return f(c?c:b)},k,k.exports,d,a,b,e)}return b[h].exports}for(var g="function"==typeof c&&c,h=0;h<e.length;h++)f(e[h]);return f}({HusaU0:[function(a,b){function k(a,b){this._superset=a,this._filtered=new f(a,b),this._sorted=new g(this._filtered,b),this._paginated=new h(this._sorted,b),i(this._paginated,this),j.call(this,this._filtered,n),j.call(this,this._sorted,p),j.call(this,this._paginated,r)}var d=a("underscore"),e=a("backbone"),f=a("backbone-filtered-collection"),g=a("backbone-sorted-collection"),h=a("backbone-paginated-collection"),i=a("backbone-collection-proxy"),j=a("./src/proxy-events.js"),l={superset:function(){return this._superset},getFilteredLength:function(){return this._filtered.length},removeTransforms:function(){return this._filtered.resetFilters(),this._sorted.removeSort(),this._paginated.removePagination(),this},destroy:function(){this.stopListening(),this._filtered.destroy(),this._sorted.destroy(),this._paginated.destroy(),this.length=0,this.trigger("obscura:destroy")}},m=["filterBy","removeFilter","resetFilters","refilter","hasFilter","getFilters"],n=["filtered:add","filtered:remove","filtered:reset"],o=["setSort","reverseSort","removeSort"],p=["sorted:add","sorted:remove"],q=["setPerPage","setPage","getPerPage","getNumPages","getPage","hasNextPage","hasPrevPage","nextPage","prevPage","movePage","removePagination","firstPage","lastPage"],r=["paginated:change:perPage","paginated:change:page","paginated:change:numPages"];d.each(m,function(a){l[a]=function(){var b=f.prototype[a].apply(this._filtered,arguments);return b===this._filtered?this:b}}),d.each(q,function(a){l[a]=function(){var b=h.prototype[a].apply(this._paginated,arguments);return b===this._paginated?this:b}}),d.each(o,function(a){l[a]=function(){var b=g.prototype[a].apply(this._sorted,arguments);return b===this._sorted?this:b}}),d.extend(k.prototype,l,e.Events),k.FilteredCollection=f,k.SortedCollection=g,k.PaginatedCollection=h,b.exports=k},{"./src/proxy-events.js":9,backbone:!1,"backbone-collection-proxy":3,"backbone-filtered-collection":4,"backbone-paginated-collection":6,"backbone-sorted-collection":7,underscore:!1}],obscura:[function(a,b){b.exports=a("HusaU0")},{}],3:[function(a,b){function h(a,b){function c(){b.length=a.length}function h(c){var e=d.toArray(arguments),f="change"===c||"change:"===c.slice(0,7);"reset"===c&&(b.models=a.models),d.contains(g,c)?(d.contains(["add","remove","destory"],c)?e[2]=b:d.contains(["reset","sort"],c)&&(e[1]=b),b.trigger.apply(this,e)):f&&b.contains(e[1])&&b.trigger.apply(this,e)}var i={};return d.each(d.functions(e.Collection.prototype),function(b){d.contains(f,b)||(i[b]=function(){return a[b].apply(a,arguments)})}),d.extend(b,e.Events,i),b.listenTo(a,"all",c),b.listenTo(a,"all",h),b.models=a.models,c(),b}var d=a("underscore"),e=a("backbone"),f=["_onModelEvent","_prepareModel","_removeReference","_reset","add","initialize","sync","remove","reset","set","push","pop","unshift","shift","sort","parse","fetch","create","model","off","on","listenTo","listenToOnce","bind","trigger","once","stopListening"],g=["add","remove","reset","sort","destroy"];b.exports=h},{backbone:!1,underscore:!1}],4:[function(a,b){function h(){this._filterResultCache={}}function i(a){for(var b in this._filterResultCache)this._filterResultCache.hasOwnProperty(b)&&delete this._filterResultCache[b][a]}function j(a,b){this._filters[a]&&i.call(this,a),this._filters[a]=b,this.trigger("filtered:add",a)}function k(a){delete this._filters[a],i.call(this,a),this.trigger("filtered:remove",a)}function l(a){this._filterResultCache[a.cid]||(this._filterResultCache[a.cid]={});var b=this._filterResultCache[a.cid];for(var c in this._filters)if(this._filters.hasOwnProperty(c)&&(b.hasOwnProperty(c)||(b[c]=this._filters[c].fn(a)),!b[c]))return!1;return!0}function m(){var a=[];this._superset&&(a=this._superset.filter(d.bind(l,this))),this._collection.reset(a),this.length=this._collection.length}function n(a){if(this._filterResultCache[a.cid]={},l.call(this,a)){if(!this._collection.get(a.cid)){for(var b=this.superset().indexOf(a),c=null,d=b-1;d>=0;d-=1)if(this.contains(this.superset().at(d))){c=this.indexOf(this.superset().at(d))+1;break}c=c||0,this._collection.add(a,{at:c})}}else this._collection.get(a.cid)&&this._collection.remove(a);this.length=this._collection.length}function o(a){this._filterResultCache[a.cid]={},l.call(this,a)||this._collection.get(a.cid)&&this._collection.remove(a)}function p(a){"change:"===a.slice(0,7)&&o.call(this,arguments[1])}function q(a){this.contains(a)&&this._collection.remove(a),this.length=this._collection.length}function r(a){this._superset=a,this._collection=new e.Collection(a.toArray()),f(this._collection,this),this.resetFilters(),this.listenTo(this._superset,"reset sort",m),this.listenTo(this._superset,"add change",n),this.listenTo(this._superset,"remove",q),this.listenTo(this._superset,"all",p)}var d=a("underscore"),e=a("backbone"),f=a("backbone-collection-proxy"),g=a("./src/create-filter.js"),s={defaultFilterName:"__default",filterBy:function(a,b){return b||(b=a,a=this.defaultFilterName),j.call(this,a,g(b)),m.call(this),this},removeFilter:function(a){return a||(a=this.defaultFilterName),k.call(this,a),m.call(this),this},resetFilters:function(){return this._filters={},h.call(this),this.trigger("filtered:reset"),m.call(this),this},superset:function(){return this._superset},refilter:function(a){return"object"==typeof a&&a.cid?n.call(this,a):(h.call(this),m.call(this)),this},getFilters:function(){return d.keys(this._filters)},hasFilter:function(a){return d.contains(this.getFilters(),a)},destroy:function(){this.stopListening(),this._collection.reset([]),this._superset=this._collection,this.length=0,this.trigger("filtered:destroy")}};d.extend(r.prototype,s,e.Events),b.exports=r},{"./src/create-filter.js":5,backbone:!1,"backbone-collection-proxy":3,underscore:!1}],5:[function(a,b){function e(a,b){return function(c){return c.get(a)===b}}function f(a,b){return function(c){return b(c.get(a))}}function g(a,b){return d.isArray(b)||(b=null),{fn:a,keys:b}}function h(a){var b=d.keys(a),c=d.map(b,function(b){var c=a[b];return d.isFunction(c)?f(b,c):e(b,c)}),h=function(a){for(var b=0;b<c.length;b++)if(!c[b](a))return!1;return!0};return g(h,b)}function i(a,b){return d.isFunction(a)?g(a,b):d.isObject(a)?h(a):void 0}var d=a("underscore");b.exports=i},{underscore:!1}],6:[function(a,b){function g(){var a=this.getPage()*this.getPerPage(),b=a+this.getPerPage();return[a,b]}function h(){var a=g.call(this);this._collection.reset(this.superset().slice(a[0],a[1]))}function i(){this._totalPages;var b=this.superset().length,c=this.getPerPage(),d=0===b%c?b/c:Math.floor(b/c)+1,e=this._totalPages!==d;return this._totalPages=d,e&&this.trigger("paginated:change:numPages",{numPages:d}),this.getPage()>=d?(this.setPage(d-1),!0):void 0}function j(){i.call(this)||h.call(this)}function k(a,b){for(var c=d.max([a.length,b.length]),e=0,f=0;c>e;e+=1,f+=1)if(a[e]!==b[f])if(b[e-1]===a[e])f-=1;else{if(b[e+1]!==a[e])return a[e];f+=1}}function l(){if(!i.call(this)){var d=g.call(this),e=d[0],f=d[1],h=k(this.superset().slice(e,f),this._collection.toArray()),j=k(this._collection.toArray(),this.superset().slice(e,f));j&&this._collection.remove(j),h&&this._collection.add(h,{at:this.superset().indexOf(h)-e})}}function m(a,b){this._superset=a,this._collection=new e.Collection(a.toArray()),this._page=0,this.setPerPage(b&&b.perPage?b.perPage:null),f(this._collection,this),this.listenTo(this._superset,"add remove",l),this.listenTo(this._superset,"reset sort",j)}var d=a("underscore"),e=a("backbone"),f=a("backbone-collection-proxy"),n={removePagination:function(){return this.setPerPage(null),this},setPerPage:function(a){return this._perPage=a,j.call(this),this.setPage(0),this.trigger("paginated:change:perPage",{perPage:a,numPages:this.getNumPages()}),this},setPage:function(a){var b=0,c=this.getNumPages()-1;return a=a>b?a:b,a=c>a?a:c,a=0>a?0:a,this._page=a,h.call(this),this.trigger("paginated:change:page",{page:a}),this},getPerPage:function(){return this._perPage||this.superset().length||1},getNumPages:function(){return this._totalPages},getPage:function(){return this._page},hasNextPage:function(){return this.getPage()<this.getNumPages()-1},hasPrevPage:function(){return this.getPage()>0},nextPage:function(){return this.movePage(1),this},prevPage:function(){return this.movePage(-1),this},firstPage:function(){this.setPage(0)},lastPage:function(){this.setPage(this.getNumPages()-1)},movePage:function(a){return this.setPage(this.getPage()+a),this},superset:function(){return this._superset},destroy:function(){this.stopListening(),this._collection.reset([]),this._superset=this._collection,this._page=0,this._totalPages=0,this.length=0,this.trigger("paginated:destroy")}};d.extend(m.prototype,n,e.Events),b.exports=m},{backbone:!1,"backbone-collection-proxy":3,underscore:!1}],7:[function(a,b){function h(a){return d.isFunction(a)?a:function(b){return b.get(a)}}function i(a){return this._comparator?this._reverse?g(this._collection.toArray(),a,h(this._comparator)):d.sortedIndex(this._collection.toArray(),a,h(this._comparator)):this._superset.indexOf(a)}function j(a){var b=i.call(this,a);this._collection.add(a,{at:b})}function k(a){this.contains(a)&&this._collection.remove(a)}function l(a){this.contains(a)&&this._collection.indexOf(a)!==i.call(this,a)&&(this._collection.remove(a),j.call(this,a))}function m(){if(!this._comparator)return this._collection.reset(this._superset.toArray()),void 0;var a=this._superset.sortBy(this._comparator);this._collection.reset(this._reverse?a.reverse():a)}function n(a){this._superset=a,this._reverse=!1,this._comparator=null,this._collection=new e.Collection(a.toArray()),f(this._collection,this),this.listenTo(this._superset,"add",j),this.listenTo(this._superset,"remove",k),this.listenTo(this._superset,"change",l),this.listenTo(this._superset,"reset",m)}var d=a("underscore"),e=a("backbone"),f=a("backbone-collection-proxy"),g=a("./src/reverse-sorted-index.js"),o={setSort:function(a,b){return this._reverse="desc"===b?!0:!1,this._comparator=a,m.call(this),a?this.trigger("sorted:add"):this.trigger("sorted:remove"),this},reverseSort:function(){return this._reverse=!this._reverse,m.call(this),this},removeSort:function(){return this.setSort(),this},superset:function(){return this._superset},destroy:function(){this.stopListening(),this._collection.reset([]),this._superset=this._collection,this.length=0,this.trigger("sorted:destroy")}};d.extend(n.prototype,o,e.Events),b.exports=n},{"./src/reverse-sorted-index.js":8,backbone:!1,"backbone-collection-proxy":3,underscore:!1}],8:[function(a,b){function e(a){return d.isFunction(a)?a:function(b){return b[a]}}function f(a,b,c,f){c=null==c?d.identity:e(c);for(var g=c.call(f,b),h=0,i=a.length;i>h;){var j=h+i>>>1;c.call(f,a[j])<g?i=j:h=j+1}return h}var d=a("underscore");b.exports=f},{underscore:!1}],9:[function(a,b){function e(a,b){d.each(b,function(b){this.listenTo(a,b,function(){var a=d.toArray(arguments);a.unshift(b),this.trigger.apply(this,a)})},this)}var d=a("underscore");b.exports=e},{underscore:!1}]},{},[]),c("obscura")});

0 comments on commit e5d3d08

Please sign in to comment.