Skip to content

Commit

Permalink
chore(all): prepare release 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Jan 18, 2019
1 parent 6bc2fbd commit 4bb0610
Show file tree
Hide file tree
Showing 11 changed files with 116 additions and 9 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.2.0",
"version": "1.3.0",
"description": "An implementation of the Aurelia history interface based on standard browser hash change and push state mechanisms.",
"keywords": [
"aurelia",
Expand Down
15 changes: 14 additions & 1 deletion dist/amd/aurelia-history-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ define(['exports', 'aurelia-pal', 'aurelia-history'], function (exports, _aureli
return info;
}

if (target.hasAttribute('download') || target.hasAttribute('router-ignore')) {
if (target.hasAttribute('download') || target.hasAttribute('router-ignore') || target.hasAttribute('data-router-ignore')) {
return info;
}

Expand Down Expand Up @@ -284,6 +284,19 @@ define(['exports', 'aurelia-pal', 'aurelia-history'], function (exports, _aureli
return state[key];
};

BrowserHistory.prototype.getHistoryIndex = function getHistoryIndex() {
var historyIndex = this.getState('HistoryIndex');
if (historyIndex === undefined) {
historyIndex = this.history.length - 1;
this.setState('HistoryIndex', historyIndex);
}
return historyIndex;
};

BrowserHistory.prototype.go = function go(movement) {
this.history.go(movement);
};

BrowserHistory.prototype._getHash = function _getHash() {
return this.location.hash.substr(1);
};
Expand Down
12 changes: 12 additions & 0 deletions dist/aurelia-history-browser.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,16 @@ export declare class BrowserHistory extends History {
* @return The value for the key.
*/
getState(key: string): any;

/**
* Returns the current index in the navigation history.
* @returns The current index.
*/
getHistoryIndex(): number;

/**
* Move to a specific position in the navigation history.
* @param movement The amount of steps, positive or negative, to move.
*/
go(movement: number): void;
}
23 changes: 22 additions & 1 deletion dist/aurelia-history-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class DefaultLinkHandler extends LinkHandler {
return info;
}

if (target.hasAttribute('download') || target.hasAttribute('router-ignore')) {
if (target.hasAttribute('download') || target.hasAttribute('router-ignore') || target.hasAttribute('data-router-ignore')) {
return info;
}

Expand Down Expand Up @@ -347,6 +347,27 @@ export class BrowserHistory extends History {
return state[key];
}

/**
* Returns the current index in the navigation history.
* @returns The current index.
*/
getHistoryIndex(): number {
let historyIndex = this.getState('HistoryIndex');
if (historyIndex === undefined) {
historyIndex = this.history.length - 1;
this.setState('HistoryIndex', historyIndex);
}
return historyIndex;
}

/**
* Move to a specific position in the navigation history.
* @param movement The amount of steps, positive or negative, to move.
*/
go(movement: number): void {
this.history.go(movement);
}

_getHash(): string {
return this.location.hash.substr(1);
}
Expand Down
15 changes: 14 additions & 1 deletion dist/commonjs/aurelia-history-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ var DefaultLinkHandler = exports.DefaultLinkHandler = function (_LinkHandler) {
return info;
}

if (target.hasAttribute('download') || target.hasAttribute('router-ignore')) {
if (target.hasAttribute('download') || target.hasAttribute('router-ignore') || target.hasAttribute('data-router-ignore')) {
return info;
}

Expand Down Expand Up @@ -268,6 +268,19 @@ var BrowserHistory = exports.BrowserHistory = (_temp = _class = function (_Histo
return state[key];
};

BrowserHistory.prototype.getHistoryIndex = function getHistoryIndex() {
var historyIndex = this.getState('HistoryIndex');
if (historyIndex === undefined) {
historyIndex = this.history.length - 1;
this.setState('HistoryIndex', historyIndex);
}
return historyIndex;
};

BrowserHistory.prototype.go = function go(movement) {
this.history.go(movement);
};

BrowserHistory.prototype._getHash = function _getHash() {
return this.location.hash.substr(1);
};
Expand Down
15 changes: 14 additions & 1 deletion dist/es2015/aurelia-history-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export let DefaultLinkHandler = class DefaultLinkHandler extends LinkHandler {
return info;
}

if (target.hasAttribute('download') || target.hasAttribute('router-ignore')) {
if (target.hasAttribute('download') || target.hasAttribute('router-ignore') || target.hasAttribute('data-router-ignore')) {
return info;
}

Expand Down Expand Up @@ -222,6 +222,19 @@ export let BrowserHistory = (_temp = _class = class BrowserHistory extends Histo
return state[key];
}

getHistoryIndex() {
let historyIndex = this.getState('HistoryIndex');
if (historyIndex === undefined) {
historyIndex = this.history.length - 1;
this.setState('HistoryIndex', historyIndex);
}
return historyIndex;
}

go(movement) {
this.history.go(movement);
}

_getHash() {
return this.location.hash.substr(1);
}
Expand Down
15 changes: 14 additions & 1 deletion dist/native-modules/aurelia-history-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export var DefaultLinkHandler = function (_LinkHandler) {
return info;
}

if (target.hasAttribute('download') || target.hasAttribute('router-ignore')) {
if (target.hasAttribute('download') || target.hasAttribute('router-ignore') || target.hasAttribute('data-router-ignore')) {
return info;
}

Expand Down Expand Up @@ -258,6 +258,19 @@ export var BrowserHistory = (_temp = _class = function (_History) {
return state[key];
};

BrowserHistory.prototype.getHistoryIndex = function getHistoryIndex() {
var historyIndex = this.getState('HistoryIndex');
if (historyIndex === undefined) {
historyIndex = this.history.length - 1;
this.setState('HistoryIndex', historyIndex);
}
return historyIndex;
};

BrowserHistory.prototype.go = function go(movement) {
this.history.go(movement);
};

BrowserHistory.prototype._getHash = function _getHash() {
return this.location.hash.substr(1);
};
Expand Down
15 changes: 14 additions & 1 deletion dist/system/aurelia-history-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ System.register(['aurelia-pal', 'aurelia-history'], function (_export, _context)
return info;
}

if (target.hasAttribute('download') || target.hasAttribute('router-ignore')) {
if (target.hasAttribute('download') || target.hasAttribute('router-ignore') || target.hasAttribute('data-router-ignore')) {
return info;
}

Expand Down Expand Up @@ -306,6 +306,19 @@ System.register(['aurelia-pal', 'aurelia-history'], function (_export, _context)
return state[key];
};

BrowserHistory.prototype.getHistoryIndex = function getHistoryIndex() {
var historyIndex = this.getState('HistoryIndex');
if (historyIndex === undefined) {
historyIndex = this.history.length - 1;
this.setState('HistoryIndex', historyIndex);
}
return historyIndex;
};

BrowserHistory.prototype.go = function go(movement) {
this.history.go(movement);
};

BrowserHistory.prototype._getHash = function _getHash() {
return this.location.hash.substr(1);
};
Expand Down
9 changes: 9 additions & 0 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<a name="1.3.0"></a>
# [1.3.0](https://github.com/aurelia/history-browser/compare/1.2.0...1.3.0) (2019-01-18)

### Features

* add support of data-router-ignore attribute ([0d8f7a0](https://github.com/aurelia/history-browser/commit/0d8f7a0))
* Add go method
* Add history index getter

<a name="1.2.0"></a>
# [1.2.0](https://github.com/aurelia/history-browser/compare/1.1.1...1.2.0) (2018-06-13)

Expand Down
Loading

0 comments on commit 4bb0610

Please sign in to comment.