Skip to content

Commit

Permalink
bump v0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
uglymunky committed Feb 28, 2014
1 parent 4d5c2e7 commit b0709d5
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 78 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backbone.siren",
"version": "0.3.0",
"version": "0.3.1",
"dependencies": {
"backbone": "~1.1.0",
"jquery": "~2.0.0",
Expand Down
80 changes: 44 additions & 36 deletions dist/amd/backbone.siren.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Backbone.Siren v0.3.0
* Backbone.Siren v0.3.1
*
* Copyright (c) 2014 Kiva Microfunds
* Licensed under the MIT license.
Expand Down Expand Up @@ -466,6 +466,8 @@ define(['jquery', 'underscore', 'backbone'], function ($, _, Backbone) {


/**
* @todo is this even being used?
*
* Wraps the standard Backbone.ajax()
*
* @param {String} url
Expand Down Expand Up @@ -988,7 +990,7 @@ define(['jquery', 'underscore', 'backbone'], function ($, _, Backbone) {
* @returns {Promise}
*/
, resolve: function (entityPaths, options) {
options = options || {};
options = $.extend({}, this.options, options);
options.store = this.store;

var self = this
Expand Down Expand Up @@ -1055,6 +1057,10 @@ define(['jquery', 'underscore', 'backbone'], function ($, _, Backbone) {
, match: function (filters) {
var matched = true;

if (!filters) {
return matched;
}

if (filters['class']) {
matched = this.hasClass(filters['class']);
}
Expand Down Expand Up @@ -1103,17 +1109,6 @@ define(['jquery', 'underscore', 'backbone'], function ($, _, Backbone) {
/**
*
* @param {String} name
* @param {String} value
*/
, setSecureKey: function (name, value) {
var secureKeys = this.getSecureKeys();
secureKeys.set(name, value);
}


/**
*
* @param {String}
* @returns {*}
*/
, getSecureKey: function (name) {
Expand All @@ -1126,25 +1121,38 @@ define(['jquery', 'underscore', 'backbone'], function ($, _, Backbone) {


/**
* Clears all secure keys.
* We don't want "secure keys" floating around they should be cleared as soon as they are no longer needed
*
* @param {String} name
* @param {String} value
* @returns {Backbone.Model}
*/
, clearSecureKey: function (name) {
return this.getSecureKeys().unset(name);
, setSecureKey: function (name, value) {
return this.getSecureKeys().set(name, value);
}


/**
* Clears all secure keys.
* We don't want "secure keys" floating around they should be cleared as soon as they are no longer needed
*
* @returns {Backbone.Model}
*/
, clearSecureKeys: function () {
return this.getSecureKeys().clear();
}


/**
* Clear a secure key.
*
* @param name
* @returns {Backbone.Model}
*/
, clearSecureKey: function (name) {
return this.getSecureKeys().unset(name);
}


/**
*
* @param {Object} options
Expand All @@ -1154,26 +1162,26 @@ define(['jquery', 'underscore', 'backbone'], function ($, _, Backbone) {
options = options || {};

var actionModel, jqXhr
, attributes = options.attributes// So you can pass in properties that do not exist in the parent.
, actionName = this.name
, parent = this.parent
, presets = {
url: this.href
, actionName: actionName
, success: function (model, resp, options) {
parent.trigger('sync:' + actionName, model, resp, options);
if (parent instanceof Backbone.Model) {
parent.attributes = {};
parent.set(actionModel.attributes);
} else {
// Parent is assumed to be a collection
parent.set(actionModel.models);
}
}
, error: function (model, xhr, options) {
parent.trigger('error:' + actionName, model, xhr, options);
, attributes = options.attributes// So you can pass in properties that do not exist in the parent.
, actionName = this.name
, parent = this.parent
, presets = {
url: this.href
, actionName: actionName
, success: function (model, resp, options) {
parent.trigger('sync:' + actionName, model, resp, options);
if (parent instanceof Backbone.Model) {
parent.attributes = {};
parent.set(actionModel.attributes);
} else {
// Parent is assumed to be a collection
parent.set(actionModel.models);
}
};
}
, error: function (model, xhr, options) {
parent.trigger('error:' + actionName, model, xhr, options);
}
};

delete options.attributes;

Expand Down
4 changes: 2 additions & 2 deletions dist/amd/backbone.siren.min.js

Large diffs are not rendered by default.

80 changes: 44 additions & 36 deletions dist/iife/backbone.siren.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Backbone.Siren v0.3.0
* Backbone.Siren v0.3.1
*
* Copyright (c) 2014 Kiva Microfunds
* Licensed under the MIT license.
Expand Down Expand Up @@ -466,6 +466,8 @@


/**
* @todo is this even being used?
*
* Wraps the standard Backbone.ajax()
*
* @param {String} url
Expand Down Expand Up @@ -988,7 +990,7 @@
* @returns {Promise}
*/
, resolve: function (entityPaths, options) {
options = options || {};
options = $.extend({}, this.options, options);
options.store = this.store;

var self = this
Expand Down Expand Up @@ -1055,6 +1057,10 @@
, match: function (filters) {
var matched = true;

if (!filters) {
return matched;
}

if (filters['class']) {
matched = this.hasClass(filters['class']);
}
Expand Down Expand Up @@ -1103,17 +1109,6 @@
/**
*
* @param {String} name
* @param {String} value
*/
, setSecureKey: function (name, value) {
var secureKeys = this.getSecureKeys();
secureKeys.set(name, value);
}


/**
*
* @param {String}
* @returns {*}
*/
, getSecureKey: function (name) {
Expand All @@ -1126,25 +1121,38 @@


/**
* Clears all secure keys.
* We don't want "secure keys" floating around they should be cleared as soon as they are no longer needed
*
* @param {String} name
* @param {String} value
* @returns {Backbone.Model}
*/
, clearSecureKey: function (name) {
return this.getSecureKeys().unset(name);
, setSecureKey: function (name, value) {
return this.getSecureKeys().set(name, value);
}


/**
* Clears all secure keys.
* We don't want "secure keys" floating around they should be cleared as soon as they are no longer needed
*
* @returns {Backbone.Model}
*/
, clearSecureKeys: function () {
return this.getSecureKeys().clear();
}


/**
* Clear a secure key.
*
* @param name
* @returns {Backbone.Model}
*/
, clearSecureKey: function (name) {
return this.getSecureKeys().unset(name);
}


/**
*
* @param {Object} options
Expand All @@ -1154,26 +1162,26 @@
options = options || {};

var actionModel, jqXhr
, attributes = options.attributes// So you can pass in properties that do not exist in the parent.
, actionName = this.name
, parent = this.parent
, presets = {
url: this.href
, actionName: actionName
, success: function (model, resp, options) {
parent.trigger('sync:' + actionName, model, resp, options);
if (parent instanceof Backbone.Model) {
parent.attributes = {};
parent.set(actionModel.attributes);
} else {
// Parent is assumed to be a collection
parent.set(actionModel.models);
}
}
, error: function (model, xhr, options) {
parent.trigger('error:' + actionName, model, xhr, options);
, attributes = options.attributes// So you can pass in properties that do not exist in the parent.
, actionName = this.name
, parent = this.parent
, presets = {
url: this.href
, actionName: actionName
, success: function (model, resp, options) {
parent.trigger('sync:' + actionName, model, resp, options);
if (parent instanceof Backbone.Model) {
parent.attributes = {};
parent.set(actionModel.attributes);
} else {
// Parent is assumed to be a collection
parent.set(actionModel.models);
}
};
}
, error: function (model, xhr, options) {
parent.trigger('error:' + actionName, model, xhr, options);
}
};

delete options.attributes;

Expand Down
Loading

0 comments on commit b0709d5

Please sign in to comment.