Commit Graph

374 Commits

Author SHA1 Message Date
Edil Kratskih
07ba2d5398 Simple refactoring 2012-01-16 13:10:34 +06:00
Edil Kratskih
32b2f28ba9 Cross domain issue patch for old ie browsers (<=7) 2011-12-21 13:18:57 +06:00
Fábio M. Costa
9e80ca1457 \w still includes \d http://www.regular-expressions.info/charclass.html#shorthand 2011-12-21 01:29:50 -02:00
David Murdoch
6ccdbb3a60 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).
2011-12-20 18:18:08 -05:00
Jeremy Ashkenas
dd83f2057c Fixes #788 2011-12-19 11:20:37 -05:00
Jeremy Ashkenas
c3852b8cd1 unifying property-or-function logic. 2011-12-19 10:54:50 -05:00
Jeremy Ashkenas
d806f7e1f3 fixing commit note bug. 2011-12-16 09:59:06 -05:00
Jeremy Ashkenas
e10525d4d4 Merge pull request #772 from rgieseke/master
Fixes issue 498.
2011-12-05 08:48:49 -08:00
Magnus Holm
67f689df9c 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
   parse:true.

This means that Col.add() also accepts the
parse:true option.
2011-12-04 18:27:36 +01:00
Magnus Holm
bdbcfa9da2 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.
2011-12-04 17:48:47 +01:00
Robert Gieseke
fd78dbf14e Only remove single '#' when getting URL fragment.
Firefox has a bug that auto-decodes the hash fragment
(https://bugzilla.mozilla.org/show_bug.cgi?id=483304), which makes
it impossible to have a hash like '#%23backbone.js'.
2011-12-04 14:31:01 +01:00
Tim Harper
1a06f9a215 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
2011-11-30 13:33:40 -07:00
Jeremy Ashkenas
c785ecb15a Merge pull request #759 from lmp/master
Update remaining call to _updateLocationHash to _updateHash
2011-11-23 14:35:37 -08:00
Jeremy Ashkenas
9fc7443d34 merging in #758 -- although the API leaves something to be desired. 2011-11-23 17:32:04 -05:00
Tim Harper
42ee70e9d9 Update remaining call to _updateLocationHash to _updateHash
(Finish refactoring job from 1332246b8f)
2011-11-23 15:31:58 -07:00
Jeremy Ashkenas
43c815aedb Merge branch 'master' of https://github.com/TMaYaD/backbone 2011-11-23 17:03:44 -05:00
Jeremy Ashkenas
6687cde196 merging in #739 -- a massive simplification. 2011-11-23 16:48:39 -05:00
TMaYaD
2d2198c354 Return the jquery object for el when this.$ is called without argument 2011-11-24 02:38:08 +05:30
Jeremy Ashkenas
bc9fbcbefb Merge branch 'set-unset-clear' of https://github.com/braddunbar/backbone 2011-11-23 15:57:24 -05:00
Jeremy Ashkenas
41853416a7 Fixes #674 -- pass options through to validate() 2011-11-23 15:48:55 -05:00
Jeremy Ashkenas
1332246b8f merging in #750 -- support for replaceSTate 2011-11-23 14:59:14 -05:00
Jeremy Ashkenas
30a89ac5cc Merge branch 'replaceState' of https://github.com/lmp/backbone 2011-11-23 14:03:39 -05:00
Jeremy Ashkenas
cfc5b1f3c0 updating copyright dates 2011-11-23 13:43:37 -05:00
Aidan Feldman and Tim Harper
df7c279dc2 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.
2011-11-17 15:42:29 -07:00
Brad Dunbar
7658021e98 simpler arg parsing 2011-11-16 14:13:15 -05:00
Brad Dunbar
d87144d6cb unset accepts var args 2011-11-11 10:55:36 -05:00
Brad Dunbar
0c08ab8185 bail immediately if !this._changed 2011-11-10 13:47:11 -05:00
Brad Dunbar
12b11410d0 ignore values when unsetting 2011-11-10 09:59:49 -05:00
Brad Dunbar
368953eb3a implement unset/clear in terms of set 2011-11-10 09:33:08 -05:00
Jeremy Ashkenas
478ef5c4b4 Merge pull request #736 from braddunbar/nested-set
Multiple nested calls to set
2011-11-09 11:04:46 -08:00
Brad Dunbar
20a2e3408a set _changing = false only if !alreadyChanging 2011-11-09 13:56:43 -05:00
Jeremy Ashkenas
7ece4ef2fd Revert "fixing whitespace consistency for #718"
This reverts commit a0843bb2ee.
2011-11-08 21:14:38 -05:00
Sam Breed
a0843bb2ee fixing whitespace consistency for #718
all functions are formatted as such: `function(args) { ...`
2011-11-08 17:13:53 -07:00
Tim Branyen
d9f4479845 Merge pull request #721 from TrisMcC/fix-model-trigger
Trigger error on originalModel not model
2011-11-08 11:55:27 -08:00
Jason Morrison
becb826168 Make function definition formatting consistent 2011-11-04 16:22:05 -04:00
Tristan McCann
da51087dbf 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.
2011-11-04 16:02:03 -04:00
Justin
f17747e041 This means that after unbinding every event, a trigger call will return faster, because !(calls = this._callbacks) will evaluate to true. 2011-11-03 22:30:36 +00:00
Jeremy Ashkenas
3392d5fba9 relying on _.escape, and fixing a lint problem. 2011-10-31 12:35:02 -04:00
Jeremy Ashkenas
18be7107c7 fixing broken comparison. 2011-10-31 11:56:53 -04:00
Jeremy Ashkenas
35600be547 Merge branch 'events' of https://github.com/braddunbar/backbone 2011-10-31 11:49:04 -04:00
Jeremy Ashkenas
39061ff48a Merge branch 'master' of github.com:documentcloud/backbone 2011-10-31 11:00:02 -04:00
Jeremy Ashkenas
5ebbeb0ce2 Fixes #659 2011-10-31 10:59:54 -04:00
Brad Dunbar
6da0683605 create empty tail as an invariant 2011-10-31 10:36:30 -04:00
Brad Dunbar
de2430554e implement callbacks as linked list 2011-10-31 07:15:03 -04:00
Tim Branyen
9982e314cb Merge pull request #700 from iros/673
#673 - Adding index as a property on the options object that gets passed
2011-10-29 13:30:58 -07:00
Irene Ros
80769fcf99 #673 - Adding index as a property on the options object that gets passed when the add/remove callbacks get triggered on a collection. 2011-10-29 16:29:18 -04:00
Tim Branyen
fbffb36819 Merge pull request #698 from alexgraul/master
Fix for Issue #690
2011-10-29 13:21:15 -07:00
Alex Graul
afc2d99b46 nicer again 2011-10-29 16:19:04 -04:00
Alex Graul
79eea1dc3c better method names 2011-10-29 16:16:02 -04:00
Jeremy Ashkenas
b2407efb43 Merge branch 'router_no_callback' of https://github.com/derickbailey/backbone 2011-10-29 15:53:32 -04:00