Skip to content
This repository has been archived by the owner on Jul 6, 2020. It is now read-only.

Commit

Permalink
Merge pull request #5 from MSNexploder/master
Browse files Browse the repository at this point in the history
updated backbone to 0.5.3
  • Loading branch information
aflatter committed Nov 2, 2011
2 parents df49916 + df6fbef commit c0bb9bb
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions vendor/assets/javascripts/backbone.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Backbone.js 0.5.2
// Backbone.js 0.5.3
// (c) 2010 Jeremy Ashkenas, DocumentCloud Inc.
// Backbone may be freely distributed under the MIT license.
// For all details and documentation:
Expand All @@ -25,7 +25,7 @@
}

// Current version of the library. Keep in sync with `package.json`.
Backbone.VERSION = '0.5.2';
Backbone.VERSION = '0.5.3';

// Require Underscore, if we're on the server, and it's not already present.
var _ = root._;
Expand All @@ -41,7 +41,7 @@
return this;
};

// Turn on `emulateHTTP` to use support legacy HTTP servers. Setting this option will
// Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option will
// fake `"PUT"` and `"DELETE"` requests via the `_method` parameter and set a
// `X-Http-Method-Override` header.
Backbone.emulateHTTP = false;
Expand Down Expand Up @@ -641,7 +641,7 @@
var methods = ['forEach', 'each', 'map', 'reduce', 'reduceRight', 'find', 'detect',
'filter', 'select', 'reject', 'every', 'all', 'some', 'any', 'include',
'contains', 'invoke', 'max', 'min', 'sortBy', 'sortedIndex', 'toArray', 'size',
'first', 'rest', 'last', 'without', 'indexOf', 'lastIndexOf', 'isEmpty'];
'first', 'rest', 'last', 'without', 'indexOf', 'lastIndexOf', 'isEmpty', 'groupBy'];

// Mix in each Underscore method as a proxy to `Collection#models`.
_.each(methods, function(method) {
Expand Down Expand Up @@ -766,7 +766,7 @@
fragment = window.location.hash;
}
}
return fragment.replace(hashStrip, '');
return decodeURIComponent(fragment.replace(hashStrip, ''));
},

// Start the hash change handling, returning `true` if the current URL matches
Expand Down Expand Up @@ -812,7 +812,10 @@
this.fragment = loc.hash.replace(hashStrip, '');
window.history.replaceState({}, document.title, loc.protocol + '//' + loc.host + this.options.root + this.fragment);
}
return this.loadUrl();

if (!this.options.silent) {
return this.loadUrl();
}
},

// Add a route to be tested when the fragment changes. Routes added later may
Expand Down Expand Up @@ -949,6 +952,7 @@
// not `change`, `submit`, and `reset` in Internet Explorer.
delegateEvents : function(events) {
if (!(events || (events = this.events))) return;
if (_.isFunction(events)) events = events.call(this);
$(this.el).unbind('.delegateEvents' + this.cid);
for (var key in events) {
var method = this[events[key]];
Expand Down Expand Up @@ -1070,7 +1074,7 @@
}

// Don't process data on a non-GET request.
if (params.type !== 'GET') {
if (params.type !== 'GET' && !Backbone.emulateJSON) {
params.processData = false;
}

Expand Down Expand Up @@ -1151,4 +1155,4 @@
return string.replace(/&(?!\w+;|#\d+;|#x[\da-f]+;)/gi, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#x27;').replace(/\//g,'&#x2F;');
};

}).call(this);
}).call(this);

0 comments on commit c0bb9bb

Please sign in to comment.