Lines Matching +full:add +full:- +full:matcher

3 //     (c) 2010-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
37 // -------------
62 // set a `X-Http-Method-Override` header.
67 // `application/x-www-form-urlencoded` instead and will send the model in a
113 var matcher = _.matches(attrs);
115 return matcher(model.attributes);
120 // ---------------
124 // remove with `off`; `trigger`-ing an event fires all callbacks in
138 // space-separated events `"change blur", callback` and jQuery-style event
149 // Handle space-separated event names by delegating them individually.
182 // Inversion-of-control versions of `on`. Tell *this* object to listen to
287 if (listening && --listening.count === 0) {
306 // are passed in using the space-separated syntax, the handler will fire
315 // Inversion-of-control versions of `once`.
342 var length = Math.max(0, arguments.length - 1);
362 // A difficult-to-believe, but optimized internal dispatch function for
366 var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];
385 // --------------
387 // Backbone **Models** are the basic data object in the framework --
439 // Proxy `Backbone.sync` by default -- but override this if you need
450 // Get the HTML-escaped value of an attribute.
461 // Special-cased proxy to underscore's `_.matches` method.
472 // Handle both `"key", value` and `{key: value}` -style arguments.
613 // Handle both `"key", value` and `{key: value}` -style arguments.
634 // After a successful server-side save, the client is (optionally)
635 // updated with the server-side state.
694 // Default URL for the model's representation on the server -- if you're
750 // -------------------
755 // -- all of the messages in this particular folder, all of the documents
773 var setOptions = {add: true, remove: true, merge: true}; property
774 var addOptions = {add: true, remove: false}; property
779 var tail = Array(array.length - at);
814 // Add a model, or list of models to the set. `models` may be Backbone
817 add: function(models, options) { method
834 // Update a collection by `set`-ing a new list of models, adding new ones,
860 var add = options.add;
892 } else if (add) {
914 var replace = !sortable && add && remove;
931 // Unless silenced, it's time to fire all appropriate add/sort/update events.
936 model.trigger('add', model, this, options);
953 // When you have more items than you want to add or remove individually,
955 // any granular `add` or `remove` events. Fires `reset` when finished.
964 models = this.add(models, _.extend({silent: true}, options));
969 // Add a model to the end of the collection.
971 return this.add(model, _.extend({at: this.length}, options));
976 var model = this.at(this.length - 1);
980 // Add a model to the beginning of the collection.
982 return this.add(model, _.extend({at: 0}, options));
991 // Slice out a sub-array of models from the collection.
1028 // Force the collection to re-sort itself. You don't need to call this under
1071 // Create a new instance of a model in this collection. Add the model to the
1079 if (!wait) this.add(model, options);
1083 if (wait) collection.add(m, callbackOpts);
1141 this.length--;
1185 // events simply proxy through. "add" and "remove" events that originate
1189 if ((event === 'add' || event === 'remove') && collection !== this) return;
1221 // -------------
1289 // Change the view's element (`this.el` property) and re-delegate the
1335 // Add a single event listener to the view's element (or a child element
1336 // using `selector`). This only works for delegate-able events: not `focus`,
1351 // A finer-grained `undelegateEvents` for removing a single delegated event.
1366 // matching element, and re-assign it to `el`. Otherwise, create
1389 // -------------
1396 // * Use `setTimeout` to batch rapid-fire updates into a single request.
1402 // as well as all requests with the body as `application/x-www-form-urlencoded`
1404 // Useful when interfacing with server-side languages like **PHP** that make
1415 // Default JSON-request options.
1429 // For older servers, emulate JSON by encoding the request into an HTML-form.
1431 params.contentType = 'application/x-www-form-urlencoded';
1436 // And an `X-HTTP-Method-Override` header.
1442 xhr.setRequestHeader('X-HTTP-Method-Override', type);
1447 // Don't process data on a non-GET request.
1482 // ---------------
1484 // Routers map faux-URLs to actions, and fire events when routes are
1499 var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g;
1538 // excellent place to do pre-route setup or post-route cleanup.
1575 // treated as `null` to normalize cross-browser behavior.
1580 if (i === params.length - 1) return param || null;
1588 // ----------------
1590 // Handles cross-browser history management, based on either
1592 // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)
1634 var rootPath = path.slice(0, this.root.length - 1) + '/';
1663 ).slice(this.root.length - 1);
1667 // Get the cross-browser normalized URL fragment from the path or hash.
1704 // If we've started off with a route from a `pushState`-enabled
1707 var rootPath = this.root.slice(0, -1) || '/';
1712 // Or if we've started out with a hash-based route, but we're currently
1713 // in a browser where it could be `pushState`-based instead...
1727 this.iframe.tabIndex = -1;
1736 // Add a cross-platform `addEventListener` shim for older browsers.
1757 // Add a cross-platform `removeEventListener` shim for older browsers.
1780 // Add a route to be tested when the fragment changes. Routes added later
1818 // 'replace' option is passed. You are responsible for properly URL-encoding
1834 rootPath = rootPath.slice(0, -1) || '/';
1859 // history entry on hash-tag change. When replace is true, we don't
1869 // If you've told us that you explicitly don't want fallback hashchange-
1895 // -------
1913 // Add static properties to the constructor function, if supplied.
1917 // `parent`'s constructor function and add the prototype properties.