Skip to content

Commit

Permalink
chore(all): prepare release 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Sep 29, 2017
1 parent 6824523 commit c53d1a2
Show file tree
Hide file tree
Showing 11 changed files with 100 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-history-browser",
"version": "1.0.0",
"version": "1.1.0",
"description": "An implementation of the Aurelia history interface based on standard browser hash change and push state mechanisms.",
"keywords": [
"aurelia",
Expand Down
11 changes: 11 additions & 0 deletions dist/amd/aurelia-history-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,17 @@ define(['exports', 'aurelia-pal', 'aurelia-history'], function (exports, _aureli
_aureliaPal.DOM.title = title;
};

BrowserHistory.prototype.setState = function setState(key, value) {
var state = Object.assign({}, this.history.state);
state[key] = value;
this.history.replaceState(state, null, null);
};

BrowserHistory.prototype.getState = function getState(key) {
var state = Object.assign({}, this.history.state);
return state[key];
};

BrowserHistory.prototype._getHash = function _getHash() {
return this.location.hash.substr(1);
};
Expand Down
14 changes: 14 additions & 0 deletions dist/aurelia-history-browser.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,18 @@ export declare class BrowserHistory extends History {
* Sets the document title.
*/
setTitle(title: string): void;

/**
* Sets a key in the history page state.
* @param key The key for the value.
* @param value The value to set.
*/
setState(key: string, value: any): void;

/**
* Gets a key in the history page state.
* @param key The key for the value.
* @return The value for the key.
*/
getState(key: string): any;
}
21 changes: 21 additions & 0 deletions dist/aurelia-history-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,27 @@ export class BrowserHistory extends History {
DOM.title = title;
}

/**
* Sets a key in the history page state.
* @param key The key for the value.
* @param value The value to set.
*/
setState(key: string, value: any): void {
let state = Object.assign({}, this.history.state);
state[key] = value;
this.history.replaceState(state, null, null);
}

/**
* Gets a key in the history page state.
* @param key The key for the value.
* @return The value for the key.
*/
getState(key: string): any {
let state = Object.assign({}, this.history.state);
return state[key];
}

_getHash(): string {
return this.location.hash.substr(1);
}
Expand Down
11 changes: 11 additions & 0 deletions dist/commonjs/aurelia-history-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,17 @@ var BrowserHistory = exports.BrowserHistory = (_temp = _class = function (_Histo
_aureliaPal.DOM.title = title;
};

BrowserHistory.prototype.setState = function setState(key, value) {
var state = Object.assign({}, this.history.state);
state[key] = value;
this.history.replaceState(state, null, null);
};

BrowserHistory.prototype.getState = function getState(key) {
var state = Object.assign({}, this.history.state);
return state[key];
};

BrowserHistory.prototype._getHash = function _getHash() {
return this.location.hash.substr(1);
};
Expand Down
11 changes: 11 additions & 0 deletions dist/es2015/aurelia-history-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,17 @@ export let BrowserHistory = (_temp = _class = class BrowserHistory extends Histo
DOM.title = title;
}

setState(key, value) {
let state = Object.assign({}, this.history.state);
state[key] = value;
this.history.replaceState(state, null, null);
}

getState(key) {
let state = Object.assign({}, this.history.state);
return state[key];
}

_getHash() {
return this.location.hash.substr(1);
}
Expand Down
11 changes: 11 additions & 0 deletions dist/native-modules/aurelia-history-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,17 @@ export var BrowserHistory = (_temp = _class = function (_History) {
DOM.title = title;
};

BrowserHistory.prototype.setState = function setState(key, value) {
var state = Object.assign({}, this.history.state);
state[key] = value;
this.history.replaceState(state, null, null);
};

BrowserHistory.prototype.getState = function getState(key) {
var state = Object.assign({}, this.history.state);
return state[key];
};

BrowserHistory.prototype._getHash = function _getHash() {
return this.location.hash.substr(1);
};
Expand Down
11 changes: 11 additions & 0 deletions dist/system/aurelia-history-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,17 @@ System.register(['aurelia-pal', 'aurelia-history'], function (_export, _context)
DOM.title = title;
};

BrowserHistory.prototype.setState = function setState(key, value) {
var state = Object.assign({}, this.history.state);
state[key] = value;
this.history.replaceState(state, null, null);
};

BrowserHistory.prototype.getState = function getState(key) {
var state = Object.assign({}, this.history.state);
return state[key];
};

BrowserHistory.prototype._getHash = function _getHash() {
return this.location.hash.substr(1);
};
Expand Down
7 changes: 7 additions & 0 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<a name="1.1.0"></a>
# [1.1.0](https://github.com/aurelia/history-browser/compare/1.0.0...v1.1.0) (2017-09-29)

#### Features

* **history-browser:** add getState and setState

<a name="1.0.0"></a>
# [1.0.0](https://github.com/aurelia/history-browser/compare/1.0.0-rc.1.0.0...v1.0.0) (2016-07-27)

Expand Down
2 changes: 1 addition & 1 deletion doc/api.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-history-browser",
"version": "1.0.0",
"version": "1.1.0",
"description": "An implementation of the Aurelia history interface based on standard browser hash change and push state mechanisms.",
"keywords": [
"aurelia",
Expand Down

0 comments on commit c53d1a2

Please sign in to comment.