Skip to content

Commit

Permalink
0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
danielstjules committed Dec 10, 2014
1 parent 30afdb8 commit fbf662a
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 33 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cross-storage",
"version": "0.4.0",
"version": "0.5.0",
"description": "Cross domain local storage",
"license": "Apache-2.0",
"authors": [
Expand Down
11 changes: 0 additions & 11 deletions dist/client-0.4.1.min.js

This file was deleted.

12 changes: 9 additions & 3 deletions dist/client-0.4.1.js → dist/client.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* cross-storage - Cross domain local storage
*
* @version 0.4.1
* @version 0.5.0
* @link https://github.com/zendesk/cross-storage
* @author Daniel St. Jules <[email protected]>
* @copyright Zendesk
Expand Down Expand Up @@ -207,8 +207,14 @@ CrossStorageClient.prototype.del = function() {
return this._request('del', {keys: args});
};

CrossStorageClient.prototype.clear = function (params) {
return this._request('clear', params);
/**
* Returns a promise that, when resolved, indicates that all localStorage
* data has been cleared.
*
* @returns {Promise} A promise that is settled on hub response or timeout
*/
CrossStorageClient.prototype.clear = function() {
return this._request('clear');
};

/**
Expand Down
11 changes: 11 additions & 0 deletions dist/client.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 0 additions & 11 deletions dist/hub-0.4.1.min.js

This file was deleted.

16 changes: 10 additions & 6 deletions dist/hub-0.4.1.js → dist/hub.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* cross-storage - Cross domain local storage
*
* @version 0.4.1
* @version 0.5.0
* @link https://github.com/zendesk/cross-storage
* @author Daniel St. Jules <[email protected]>
* @copyright Zendesk
Expand All @@ -15,8 +15,8 @@ var CrossStorageHub = {};
* of origin is expected to be a RegExp, and allow, an array of strings.
* The cross storage hub is then initialized to accept requests from any of
* the matching origins, allowing access to the associated lists of methods.
* Methods may include any of: get, set, del, and getKeys. A 'ready' message
* is sent to the parent window once complete.
* Methods may include any of: get, set, del, getKeys and clear. A 'ready'
* message is sent to the parent window once complete.
*
* @example
* // Subdomain can get, but only root domain can set and del
Expand All @@ -39,7 +39,11 @@ CrossStorageHub.init = function(permissions) {
}

if (!available) {
return window.parent.postMessage('unavailable', '*');
try {
return window.parent.postMessage('unavailable', '*');
} catch (e) {
return;
}
}

CrossStorageHub._permissions = permissions || [];
Expand Down Expand Up @@ -199,9 +203,9 @@ CrossStorageHub._del = function(params) {
};

/**
* Clears the local storage
* Clears localStorage.
*/
CrossStorageHub._clear = function () {
CrossStorageHub._clear = function() {
window.localStorage.clear();
};

Expand Down
11 changes: 11 additions & 0 deletions dist/hub.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cross-storage",
"version": "0.4.1",
"version": "0.5.0",
"description": "Cross domain local storage",
"keywords": [
"local",
Expand Down

0 comments on commit fbf662a

Please sign in to comment.