Skip to content


Subversion checkout URL

You can clone with
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
This comparison is big! We’re only showing the most recent 250 commits
Commits on Oct 07, 2011
@derickbailey derickbailey added a test and code to allow a router to define a route with no cal…
…lback method for the route name
Commits on Oct 29, 2011
@jashkenas upgrading to the latest version of Underscore. 32ae113
@iros iros Merge branch 'master' of f499fc8
@iros iros Reducing the amount of properties we are iterating over by removing t…
…he old properties that already exist in now. To do that, previousAttributes had to be cloned. Changing "void 0" return to "undefined".
@iros iros Adding a _unsetAttributes property on model that stores unset attribu…
…tes and appends them to the changedAttributes object.
@iros iros Setting _unsetAttributes to false in unset rather than changedAttribu…
…tes so that the unset attributes aren't lost on subsequent calls of changedAttributes. Added test to verify this behavior.
@jashkenas Fixes #689, documenting the need to resort collections with comparators. d94cfe5
@jashkenas Merge branch 'master' of b4f680e
@jashkenas Fixes #552 #693, allowing unset to work with changedAttributes() de740f8
@alexgraul alexgraul Fix for adding models with custom set methods to collections, issue #539
@jashkenas Merge branch 'master' of c37e2f9
@jashkenas Needs testing, but fixes #686, fixes #592, and probably others -- all…
…ow you to override any $.ajax options.
@alexgraul alexgraul fix for wrapped errors inside success callbacks on save, issue #690 970ce07
@jashkenas Merge branch 'router_no_callback' of… b2407ef
@jasonm jasonm gitignore vim swapfiles e2f1350
@jasonm jasonm Update QUnit c336e4b
@alexgraul alexgraul better method names 79eea1d
@jasonm jasonm Bump jQuery test suite dependency from 1.5 to 1.6.4 6717e42
@alexgraul alexgraul nicer again afc2d99
@tbranyen tbranyen Merge pull request #698 from alexgraul/master
Fix for Issue #690
@iros iros #673 - Adding index as a property on the options object that gets pas…
…sed when the add/remove callbacks get triggered on a collection.
@tbranyen tbranyen Merge pull request #700 from iros/673
#673 - Adding index as a property on the options object that gets passed
@tbranyen tbranyen Merge pull request #699 from jasonm/jm-bump-qunit
Update QUnit to 1.1.0 (newest stable)
Commits on Oct 30, 2011
@chaplinkyle chaplinkyle Fix Todos example by importing the currently shipped version of jQuer…
…y that is located in /test/vendor.
Commits on Oct 31, 2011
@braddunbar braddunbar implement callbacks as linked list de24305
@braddunbar braddunbar create empty tail as an invariant 6da0683
@jashkenas Merge pull request #705 from oldAdam/master
Fix Todos example
@jashkenas Fixes #659 5ebbeb0
@jashkenas Merge branch 'master' of 39061ff
@jashkenas Merge branch 'events' of 35600be
@jashkenas fixing broken comparison. 18be710
@jashkenas relying on _.escape, and fixing a lint problem. 3392d5f
@jashkenas Adding AudioVroom as an example app. eec7d2a
Commits on Nov 03, 2011
@JustinDrake JustinDrake This means that after unbinding every event, a trigger call will retu…
…rn faster, because !(calls = this._callbacks) will evaluate to true.
Commits on Nov 04, 2011
@jashkenas Merge pull request #717 from JustinDrake/patch-1
Making unbind and trigger more compatible with each other
Tristan McCann Trigger error on originalModel not model
The original model that the 'sync' request was called in should be the
object that is taking the 'error' trigger.

After a 'fetch' request on a collection, 'model' is the jQuery xhr
object, which does not have a 'trigger' method.
@jasonm jasonm Make function definition formatting consistent becb826
@jashkenas Merge pull request #722 from jasonm/jm-format-function-defs
Make function definition formatting consistent for docs
Commits on Nov 08, 2011
@tbranyen tbranyen Merge pull request #721 from TrisMcC/fix-model-trigger
Trigger error on originalModel not model
Commits on Nov 09, 2011
Sam Breed fixing whitespace consistency for #718
	all functions are formatted as such: `function(args) { ...`
@tbranyen tbranyen Merge pull request #733 from wookiehangover/whitespace
fixing whitespace consistency for #718
@jashkenas Revert "fixing whitespace consistency for #718"
This reverts commit a0843bb.
@braddunbar braddunbar set _changing = false only if !alreadyChanging 20a2e34
@jashkenas Merge pull request #736 from braddunbar/nested-set
Multiple nested calls to set
@braddunbar braddunbar assert that change is only triggered once 3f00419
Commits on Nov 10, 2011
@braddunbar braddunbar implement unset/clear in terms of set 368953e
@braddunbar braddunbar ignore values when unsetting 12b1141
@braddunbar braddunbar unit test for ignore values when unsetting 66d209d
@braddunbar braddunbar add tests for #730 and #565 93ad86c
@braddunbar braddunbar bail immediately if !this._changed 0c08ab8
Commits on Nov 11, 2011
@braddunbar braddunbar unset accepts var args d87144d
Commits on Nov 14, 2011
@jashkenas Adding as an example app. 06e0826
@jashkenas removing the ol' upgrading section from the docs. 49b532b
@jashkenas merging in the new backbone.js logo 1d41b45
Commits on Nov 16, 2011
@braddunbar braddunbar simpler arg parsing 7658021
Commits on Nov 17, 2011
@afeld afeld Navigate learns to change the route without adding a history entry
Also, instead of accepting a single boolean for trigger, the navigate
method now accepts an options object, with the following options:

- replace
- trigger

If you pass true instead of an options object, it's interpreted as
{trigger: true}

* pushState support - Aidan Feldman
* hashtag support and IE7 support - Tim Harper
* Tests were a joint effort.
Commits on Nov 18, 2011
@jashkenas adding foursquare as an example app, plus new logo 4f9cf93
Commits on Nov 21, 2011
@jashkenas Adding as an example app 61246a7
@jashkenas Adding Slavery Footprint as a Backbone.js example app da93529
@jashkenas tweaking link fa96a37
Commits on Nov 22, 2011
@alonsogarciapablo alonsogarciapablo Fix typo in Backbone.Collection documentation 9cbf87e
@jashkenas Merge pull request #755 from alonsogarciapablo/master
Fix typo in Backbone.Collection documentation
@jashkenas Update index.html b2cf0dc
Commits on Nov 23, 2011
@jashkenas Upgrading our Underscore.js test dep to 1.2.2 66800f5
@jashkenas Merge branch 'master' of 7f80359
@jashkenas updating copyright dates cfc5b1f
@jashkenas hardlining the sidebar line for Lion. f5acb6d
@jashkenas Merge branch 'replaceState' of 30a89ac
@jashkenas merging in #750 -- support for replaceSTate 1332246
@jashkenas Fixes #674 -- pass options through to validate() 4185341
@jashkenas Merge branch 'set-unset-clear' of
@TMaYaD TMaYaD Return the jquery object for el when this.$ is called without argument 2d2198c
@jashkenas merging in #739 -- a massive simplification. 6687cde
@jashkenas Merge branch 'master' of 43c815a
@timcharper timcharper Update remaining call to _updateLocationHash to _updateHash
(Finish refactoring job from 1332246)
@jashkenas merging in #758 -- although the API leaves something to be desired. 9fc7443
@jashkenas Merge pull request #759 from lmp/master
Update remaining call to _updateLocationHash to _updateHash
Commits on Nov 24, 2011
@d2s d2s Update two links at index.html to latest URLs
- Link to Jake was broken.
- PhantomJS has official website with better information.
@jashkenas Merge pull request #761 from d2s/master
Update two links at index.html to latest URLs
Commits on Nov 30, 2011
@timcharper timcharper Bugfix: replace hash should not append hash mark to javascript:0
It's invalid to do so. Instead it should replace the entire URL,
javascript:0 included.

This gets rid of a javascript error that was emitted in IE7 every time
navigate was used with replace: true
Commits on Dec 01, 2011
@jashkenas Merge pull request #769 from lmp/master
Bugfix: replace hash should not append hash mark to javascript:0
Commits on Dec 04, 2011
@rgieseke rgieseke Only remove single '#' when getting URL fragment.
Firefox has a bug that auto-decodes the hash fragment
(, which makes
it impossible to have a hash like '#%23backbone.js'.
@judofyr judofyr parse:true runs the attributes through parse():
`new Model(attr, {parse:true})` will now call
Model.prototype.parse(attr). This is useful if
you want to create a model out of an object
structure from an external server.
@judofyr judofyr Col.fetch() should create models with parse:true:
This is done in two steps:

1. Col.fetch() now defaults to parse:true
2. Col.reset() and _prepareModel now passes along

This means that Col.add() also accepts the
parse:true option.
Commits on Dec 05, 2011
@jashkenas Merge pull request #773 from judofyr/model-parse
Collection.reset/add should invoke Model's parse function (with tests)
@jashkenas Merge pull request #772 from rgieseke/master
Fixes issue 498.
@aitorciki aitorciki Add Ducksboard as an example app. 14dd201
Commits on Dec 06, 2011
@jashkenas merging in ducksboard. 64d8fd6
@jashkenas Fixes #734 1626fa7
@jashkenas Fixes #732 1400eea
Commits on Dec 16, 2011
@jashkenas Fixes #792 a50b714
@jashkenas fixing commit note bug. d806f7e
Commits on Dec 19, 2011
@jashkenas unifying property-or-function logic. c3852b8
@jashkenas Fixes #788 dd83f20
Commits on Dec 20, 2011
@jashkenas Adding Posterous Spaces as an example app cda555a
@davidmurdoch davidmurdoch Optimize regular expressions. The capture groups aren't needed/used; …
…the character classes will do the job just fine.

Also, normalize the use of quotation-marks (change `"` to `'`' where appropriate).
@jashkenas Merge pull request #804 from davidmurdoch/patch-1
Optimize regular expressions.
Commits on Dec 21, 2011
Fábio M. Costa \w still includes \d… 9e80ca1
@jashkenas Merge pull request #805 from fabiomcosta/patch-1
\w still includes \d
@ekratskih ekratskih Cross domain issue patch for old ie browsers (<=7) 32b2f28
Commits on Dec 22, 2011
@iros iros Forcing quint test execution order. 9d145ab
@tbranyen tbranyen Merge pull request #807 from iros/qunit.force.order
Force quint test execution order.
Commits on Dec 23, 2011
= A model's urlRoot can now be a function allowing definition at runtime. b4e650b
= Merge branch 'urlrootasfunction' 9374fe5
= Use getValue to interpret urlRoot instead. 93a3911
Commits on Dec 25, 2011
Zack Owens allowing view events to be functions instead of simply names of prope…
…rties on a view
Commits on Dec 26, 2011
@jashkenas Merge pull request #809 from islandr/master
Allow Model.urlRoot to be a function
@jashkenas Fixes #818 ee305c4
@jashkenas Merge branch 'master' of 4226d58
@iros iros #819 documenting idAttribute. Also requested on pull req #210. 5701569
@tbranyen tbranyen Merge pull request #820 from iros/819.idAttribute
documenting idAttribute
@iros iros Added navigation link 1591c42
@tbranyen tbranyen Merge pull request #821 from iros/819.idAttribute
Added idAttribute navigation link to sidebar
Commits on Dec 30, 2011
@jashkenas streamlining idAttribute documentation. 9a56d52
@jashkenas Adding Picplum as an example app d06e8a6
Commits on Jan 06, 2012
@braddunbar braddunbar hasChanged/set should use the same comparison
When setting a value, if hasChanged and set disagree
about equality then hasChanged will return true without
firing a 'changed:*' event (or vice versa).  Using the
same comparison (_.isEqual) solves this problem.
@jashkenas Merge pull request #842 from braddunbar/hasChanged-comparison
hasChanged/set should use the same comparison
@jashkenas being a bit stricter about comment wrapping at 80 chars. 44bb57a
@jashkenas Fixes #9, Backbone comparators can now be either sort() or sortBy() i…
@jashkenas Fixes #81 -- optimize for addition of large arrays of models, not for…
… individual inserts.
Commits on Jan 07, 2012
@braddunbar braddunbar only call splice once instead of on each add 1ffae59
Zack Owens view events can now be a function that returns an events object b081fe8
Zack Owens adding docs for events function cd18a96
Commits on Jan 08, 2012
@jashkenas Adding Diaspora as an example app. 780ddd3
Commits on Jan 09, 2012
Mickey Reiss Switched order of delegateEvents and initialize in Backbone.View cons…
…tructor in order to allow for explicit setting of this.el in initialize (and ensure that events are bound correctly).
Commits on Jan 10, 2012
@braddunbar braddunbar no need to _.bindAll _onModelEvent 61b2779
@jashkenas Merge pull request #852 from braddunbar/no-bindall
No need to _.bindAll _onModelEvent
@braddunbar braddunbar collection.add should not alter models array c8919c4
Commits on Jan 11, 2012
@jashkenas Documentation request in #599 df71650
@jashkenas Merge branch 'master' of 1675e76
@jashkenas Merge pull request #851 from mickeyreiss/master
Switch order of delegateEvents and initialize in View constructor
@jashkenas adding a test to ensure that routes aren't triggered multiple times. #… 2312b90
@jashkenas merging in #846 eb868b6
@jashkenas nice refactor. removed _add and _remove and moved 'em in to the publi…
…c API.
@jashkenas clarifying paragraph for #843 3cbd790
@jashkenas Fixes #839 d3ae0aa
@jashkenas fixes #838 -- allow View#attributes to be defined as a function, as w…
…ell as a value.
@jashkenas Fixes #836, Fixes #708 -- going back to previous stance: two models w…
…ith the same id can't be added to the same collection.
@braddunbar braddunbar only increment length once f329cbf
@braddunbar braddunbar more descriptive variable name 4dd506c
Commits on Jan 12, 2012
@jashkenas Merge pull request #854 from braddunbar/inline-add-remove
Only Increment Length Once
@jashkenas binding the comparator function before using it, so that you can rely…
… on properties of your collection within it.
@jashkenas Fixes #841, adding upgrading jquery, classname --> class in the docs. 4719659
@jashkenas Fixes #826 -- expose Backbone.wrapError. cee62e6
@jashkenas Fixes #823, mention 'attributes' 4d29dfc
@jashkenas Fixes #822, change comment to avoid 'confusing' reference to super 88e6b32
@jashkenas Merge pull request #815 from zowens/master
View Event Callbacks as Functions
@jashkenas removing overzealous events setting API. 93cb997
@jashkenas fixes #814 -- load initial models after Collection#initialize, not be…
@jashkenas Fixes #811 -- allow you to pass a context when unbinding events as well. a49bb4f
@jashkenas Fixes #803, allows you to opt-out of hashchange, while opting-in to p…
…ush state, using full-page refreshes for old browsers.
@jashkenas Fixes #786 (and others) -- leading slashes should never be defined as…
… routes, or passed to navigate ... so strip 'em out proactively.
Commits on Jan 13, 2012
@braddunbar braddunbar (un)bind does not alter callback list during trigger 47e1f7e
@jashkenas Fixes #783 -- adds a 'sync' event, fired whenever a successful call h…
…as been made to update the server.
@jashkenas Merge pull request #723 from braddunbar/bind-during-trigger
(un)bind does not alter callback list during trigger
@jashkenas lint/style tweaks to prev commit. 837f774
@jashkenas Fixes #720, document 'constructor' a881ba6
@jashkenas adding a favicon 7c7f550
@jashkenas Fixes #714, assign model.collection early, so that those overriding s…
…et() can use it from the get-go.
@jashkenas Fixes #702: adds 'initial' and 'shuffle' to Backbone collections. a78be62
@jashkenas Fixes #419 -- add a global 'route' event, on Bacckbone.history. 5b43cd9
@jashkenas fixes #651 -- always clone options. b28a242
@jashkenas Fixes #641 -- on and off are now the preferred names for bind and unb…
…ind, following jQuery.
@jashkenas Fixes #640 -- adds the ability to bind/unbind/trigger (on/off/trigger…
…) multiple, space separated events, after jQuery.
@jashkenas allow the passing of any number of arguments to Model#initialize 4316b04
@jashkenas Fixes #634, documentation of emulateHTTP 32e5ab7
@jashkenas Fixes #629, documents how easy it is to make event dispatching objects. 9c62b26
@jashkenas Fixes #593 -- pass complete options to model constructor on create() 3f0979f
@jashkenas Fixes #582, fixes #425, run a second loop to trigger change:attribute…
… events after all changes have been made.
@braddunbar braddunbar Documentation for Backbone.Events 920d047
@jashkenas Adding options.index to Collection#add and #remove. 2dce413
@jashkenas Merge pull request #857 from braddunbar/events-documentation
Documentation for Backbone.Events
@braddunbar braddunbar trigger all for each event 9df6387
Commits on Jan 14, 2012
@jashkenas Merge pull request #858 from braddunbar/trigger-multiple
trigger all for each event
Commits on Jan 16, 2012
@ekratskih ekratskih Simple refactoring 07ba2d5
Commits on Jan 17, 2012
@jashkenas Merge pull request #859 from ekratskih/master
Cross domain issue patch for old ie browsers (<=7)
@jashkenas reverting previous change (#859) ff176ac
@jashkenas Fixes #574, clone 'models' before removing, so as to allow collection…
@jashkenas Fixes #861, better error message for adding invalid models to a colle…
@jashkenas expanding the section in the FAQ explaining why Backbone doesn't mode…
…l associations / nested documents for you.
@jashkenas removing erroneous console.log 09110a6
@jashkenas Fixes #570, supports Model#save(key, value) 42d321f
@braddunbar braddunbar use implicit callback if none provided 57ef218
@jashkenas Fixes #567 ... Adds a view. for the jQuery cached reference to a view…
…'s element ... and this.setElement() as a way to easily change it, redelegating events.
@jashkenas Merge pull request #862 from braddunbar/implicit-callback
Router: Use implicit callback if none provided
@jashkenas removing redundant attributes check. b5875ac
@jashkenas DRY-ing up setElement() a bit. cdce2ec
@braddunbar braddunbar docs for #862 29c512c
@jashkenas Fixes #563. Initial draft of 'wait: true' for pessimistic instead of …
…optimistic save() create() and destroy(). Makes it easier to have your asynchronous UI and eat it too.
@jashkenas Merge pull request #863 from braddunbar/route-docs
docs for #862
@jashkenas Fixes #555 -- don't return the parent constructor's value. f417ddd
Commits on Jan 18, 2012
@braddunbar braddunbar `added`/`removed` should be `add`/`remove` b2a2d6f
@jashkenas Merge pull request #865 from braddunbar/add-remove-docs
`added`/`removed` should be `add`/`remove`
@braddunbar braddunbar `equals` is deprecated; use `equal` instead 397d11e
@braddunbar braddunbar Collection#add tweaks
* leave collection in a consistent state after throw
* correct indices
@jashkenas Merge pull request #867 from braddunbar/equal
`equals` is deprecated;  use `equal` instead
@jashkenas Merge pull request #866 from braddunbar/add-tweaks
Collection#add tweaks
@braddunbar braddunbar fix #871 - calling set with 'attributes' property b05deb5
@vlazzle vlazzle fixed typo in test for (presumably) equality c7c7b3c
Commits on Jan 20, 2012
@braddunbar braddunbar setting undefined attributes
* undefined attrs should still be set
* unset triggers change for undefined attrs
* values are set regardless of change/equality
@jashkenas Merge pull request #879 from braddunbar/set
Setting Undefined Attributes
@braddunbar braddunbar Model.constructor only take attrs, not models.
As per discussion in #873.
@jashkenas Merge pull request #881 from braddunbar/ctor-args
Model.constructor only take attrs, not models.
Commits on Jan 22, 2012
@jashkenas making method colon style consistent -- no space before the colon. efa58fd
@jashkenas resolved merge 04c2d10
@jashkenas changing README to Markdown to make the new GitHub CSS happy. 5962efa
@jashkenas trying new ASCII 4c1b247
@jashkenas linking to directly a9a3499
@jashkenas Merge pull request #872 from vovik/master
fixed typo in test for (presumably) equality
Commits on Jan 23, 2012
@jashkenas Fixes #538 -- adds Backbone.history.stop() for unit testers. 96a7274
@jashkenas Fixes #490 -- named, but not splatted params, must match at least one…
… character.
@jashkenas Fixes #886, pass through options.parse when creating a new collection. 3e5f713
@jashkenas moving the methodMap inside of the Backbone.sync section. 71641fb
@nhajratw nhajratw updated date 94333d2
@jashkenas Merge pull request #887 from nhajratw/master
Just updated the Copyright date
@jashkenas Overhauling 'validate' -- Receives the computed new state of the attr…
…s, not just the delta. Now runs on model create, raising an exception if you try to 'new' and invalid model ... also runs even if changed silently.
@jashkenas Merge branch 'master' of 3cf646b
Commits on Jan 24, 2012
@jashkenas Fixes #117 -- adds a section to the FAQ about Rails' preference to na…
…mespace/wrap JSON.
Commits on Jan 25, 2012
@jashkenas fixing accidental global 'l' in loop. c5ddc6b
@jashkenas comments++ 67a6092
@jashkenas adding pretty download link/buttons da25d46
@jashkenas bumping up the size of the section headers... e63fdc6
@jashkenas re-wording the intro 'graf, adding links. 9ad7b6a
@jashkenas spacing out the headers a bit more 028771f
Commits on Jan 27, 2012
@braddunbar braddunbar Fire `'change:attr'` from `change` 0d6e5f3
@braddunbar braddunbar documentation for #893 db12a23
Commits on Jan 29, 2012
@dcneiner dcneiner Made minor optimization to scoped jQuery/Zepto method $ on the Backbo…
@dcneiner dcneiner Updated context find (`.$`) to use new cached, wrapped `this.$el`. 018c19a
@ckorhonen ckorhonen Added Animoto to Examples ecd4e5a
Commits on Jan 30, 2012
@braddunbar braddunbar cache changed attributes 2f654d2
@braddunbar braddunbar use `_.has` for Object proto props 2a6624c
@jashkenas Merge pull request #893 from braddunbar/change
Fire `'change:attr'` from `change`
@jashkenas Merge pull request #897 from dcneiner/jquery-zepto-context
Made minor optimization to scoped jQuery/Zepto method $ on the Backbone.View
@jashkenas tweaking font-sizes / spacing a bit. 8df28fd
@jashkenas fixes #64 -- mention that POST and PUT are complete in docs. e08ff14
@jashkenas Merge pull request #898 from ckorhonen/master
Documentation - Added Animoto to Examples Section
@jashkenas adding as an example app. 0bbff7d
@jashkenas trying to fix animoto.png ecba0ec
@jashkenas Adding Stripe and Code School as example apps. 00b2551
@jashkenas Fixes #892 ... make .route() chainable. ac580ca
@jashkenas adding a section to the Backbone FAQ on extending... a2ab3b1
@jashkenas missed an API regression in model.changedAttributes(), reimplementing…
… in the same way as the original.
@braddunbar braddunbar factor away else branch ef9d40a
@braddunbar braddunbar one more refactor... fb97ef1
@braddunbar braddunbar check for duplicate models/ids 50e8103
@jashkenas Merge pull request #901 from braddunbar/add-duplicate
Check for Duplicate models/ids
@tomasztunik tomasztunik Fixed small leak introduced by #901 f52ef8c
@braddunbar braddunbar Merge pull request #902 from tomasztunik/master
Fixed variable leak to global scope
@braddunbar braddunbar leaked global 8ce8753
@jashkenas Backbone.js 0.9.0 5ce976b