You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sn...@apache.org on 2014/03/13 16:20:58 UTC
[10/17] git commit: rebuilding artifacts after merge
rebuilding artifacts after merge
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/13ab2bd2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/13ab2bd2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/13ab2bd2
Branch: refs/pull/71/head
Commit: 13ab2bd2e770543c1f35e6243ea5c732fa3d6a4e
Parents: 55462ea
Author: ryan bridges <rb...@apigee.com>
Authored: Thu Mar 13 10:30:32 2014 -0400
Committer: ryan bridges <rb...@apigee.com>
Committed: Thu Mar 13 10:30:32 2014 -0400
----------------------------------------------------------------------
sdks/html5-javascript/usergrid.js | 24 ++++++++++++++++++++++--
sdks/html5-javascript/usergrid.min.js | 6 +++---
2 files changed, 25 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/13ab2bd2/sdks/html5-javascript/usergrid.js
----------------------------------------------------------------------
diff --git a/sdks/html5-javascript/usergrid.js b/sdks/html5-javascript/usergrid.js
index 517908f..cb83d0c 100644
--- a/sdks/html5-javascript/usergrid.js
+++ b/sdks/html5-javascript/usergrid.js
@@ -1,4 +1,4 @@
-/*! usergrid@0.10.8 2014-03-05 */
+/*! usergrid@0.10.8 2014-03-13 */
var UsergridEventable = function() {
throw Error("'UsergridEventable' is not intended to be invoked directly");
};
@@ -293,6 +293,19 @@ function extend(subClass, superClass) {
return subClass;
}
+function propCopy(from, to) {
+ for (var prop in from) {
+ if (from.hasOwnProperty(prop)) {
+ if ("object" === typeof from[prop] && "object" === typeof to[prop]) {
+ to[prop] = propCopy(from[prop], to[prop]);
+ } else {
+ to[prop] = from[prop];
+ }
+ }
+ }
+ return to;
+}
+
function NOOP() {}
//Usergrid namespace encapsulates this SDK
@@ -563,6 +576,9 @@ function doCallback(callback, params, context) {
if (options.appName) {
this.set("appName", options.appName);
}
+ if (options.qs) {
+ this.setObject("default_qs", options.qs);
+ }
//other options
this.buildCurl = options.buildCurl || false;
this.logging = options.logging || false;
@@ -598,6 +614,7 @@ function doCallback(callback, params, context) {
//is this a query to the management endpoint?
var orgName = this.get("orgName");
var appName = this.get("appName");
+ var default_qs = this.getObject("default_qs");
var uri;
var logoutCallback = function() {
if (typeof this.logoutCallback === "function") {
@@ -615,6 +632,9 @@ function doCallback(callback, params, context) {
if (this.getToken()) {
qs.access_token = this.getToken();
}
+ if (default_qs) {
+ qs = propCopy(qs, default_qs);
+ }
var req = new Usergrid.Request(method, uri, qs, body, function(err, response) {
if ([ "auth_expired_session_token", "auth_missing_credentials", "auth_unverified_oath", "expired_token", "unauthorized", "auth_invalid" ].indexOf(response.error) !== -1) {
return logoutCallback();
@@ -767,7 +787,7 @@ function doCallback(callback, params, context) {
*/
Usergrid.Client.prototype.createCollection = function(options, callback) {
options.client = this;
- var collection = new Usergrid.Collection(options, function(err, data) {
+ new Usergrid.Collection(options, function(err, data, collection) {
doCallback(callback, [ err, collection, data ]);
});
};