packages/deprecated/backbone/backbone.js
File backbone.js
has 856 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// Backbone.js 0.9.2
// (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
// Backbone may be freely distributed under the MIT license.
// For all details and documentation:
Function save
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
save: function(key, value, options) {
var attrs, current;
// Handle both `("key", value)` and `({key: value})` -style calls.
if (_.isObject(key) || key == null) {
Function start
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
start: function(options) {
if (History.started) throw new Error("Backbone.history has already been started");
// <METEOR>
if (typeof window === 'undefined')
throw new Error("Backbone.History is client-only, can't start on the server");
Function set
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
set: function(key, value, options) {
var attrs, attr, val;
// Handle both `"key", value` and `{key: value}` -style arguments.
if (_.isObject(key) || key == null) {
Function add
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
add: function(models, options) {
var i, index, length, model, cid, id, cids = {}, ids = {}, dups = [];
options || (options = {});
models = _.isArray(models) ? models.slice() : [models];
Function sync
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Backbone.sync = function(method, model, options) {
var type = methodMap[method];
// Default options, unless specified.
options || (options = {});