aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md3
-rw-r--r--pollymer.js13
2 files changed, 14 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index eefc904..a07a04c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,4 +3,5 @@ Pollymer Changelog
v. 1.0.0 (01-31-2013) - Initial Release.
v. 1.1.0 (04-28-2014) - Support for RequireJS (AMD).
-v. 1.1.1 (05-10-2014) - Fixed crashing issue when abort() called on fresh object. \ No newline at end of file
+v. 1.1.1 (05-10-2014) - Fixed crashing issue when abort() called on fresh object.
+v. 1.1.2 (05-10-2014) - Adding access to "lastRequest" info. \ No newline at end of file
diff --git a/pollymer.js b/pollymer.js
index dd5da75..05d3189 100644
--- a/pollymer.js
+++ b/pollymer.js
@@ -1,5 +1,5 @@
/**
- * Pollymer JavaScript Library v1.1.1
+ * Pollymer JavaScript Library v1.1.2
* Copyright 2013-2014 Fanout, Inc.
* Released under the MIT license (see COPYING file in source distribution)
*/
@@ -228,6 +228,8 @@
this.timeout = 60000;
this.errorCodes = '500-599';
+ this.lastRequest = null;
+
if (arguments.length > 0) {
var config = arguments[0];
if ("transport" in config) {
@@ -308,6 +310,7 @@
};
Request.prototype._initiate = function (delayMsecs) {
var self = this;
+ self.lastRequest = null;
self._timer = window.setTimeout(function () { self._startConnect(); }, delayMsecs);
};
Request.prototype._startConnect = function () {
@@ -326,6 +329,14 @@
// cleanup would be a no-no)
this._transport = chooseTransport(this.transport, url);
+ self.lastRequest = {
+ method: method,
+ uri: url,
+ headers: headers,
+ body: body,
+ transport: this._transport
+ };
+
switch (this._transport) {
case transportTypes.Xhr:
consoleInfo("pollymer: Using XHR transport.");