Skip to content

Commit

Permalink
chore(all): prepare release 0.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Jan 30, 2015
1 parent fe3c964 commit 68b498e
Show file tree
Hide file tree
Showing 44 changed files with 274 additions and 687 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-router",
"version": "0.5.2",
"version": "0.5.3",
"description": "A powerful client-side router.",
"keywords": [
"aurelia",
Expand Down
60 changes: 22 additions & 38 deletions dist/amd/activation.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
define(["exports", "./navigation-plan", "./navigation-commands", "./util"], function (exports, _navigationPlan, _navigationCommands, _util) {
"use strict";

var _toArray = function (arr) {
return Array.isArray(arr) ? arr : Array.from(arr);
};
var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); };

var _prototypeProperties = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};
var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); };

var INVOKE_LIFECYCLE = _navigationPlan.INVOKE_LIFECYCLE;
var REPLACE = _navigationPlan.REPLACE;
var isNavigationCommand = _navigationCommands.isNavigationCommand;
var processPotential = _util.processPotential;
var affirmations = exports.affirmations = ["yes", "ok", "true"];

var CanDeactivatePreviousStep = (function () {
var CanDeactivatePreviousStep = exports.CanDeactivatePreviousStep = (function () {
function CanDeactivatePreviousStep() {}

_prototypeProperties(CanDeactivatePreviousStep, null, {
Expand All @@ -25,16 +20,13 @@ define(["exports", "./navigation-plan", "./navigation-commands", "./util"], func
return processDeactivatable(navigationContext.plan, "canDeactivate", next);
},
writable: true,
enumerable: true,
configurable: true
}
});

return CanDeactivatePreviousStep;
})();

exports.CanDeactivatePreviousStep = CanDeactivatePreviousStep;
var CanActivateNextStep = (function () {
var CanActivateNextStep = exports.CanActivateNextStep = (function () {
function CanActivateNextStep() {}

_prototypeProperties(CanActivateNextStep, null, {
Expand All @@ -43,16 +35,13 @@ define(["exports", "./navigation-plan", "./navigation-commands", "./util"], func
return processActivatable(navigationContext, "canActivate", next);
},
writable: true,
enumerable: true,
configurable: true
}
});

return CanActivateNextStep;
})();

exports.CanActivateNextStep = CanActivateNextStep;
var DeactivatePreviousStep = (function () {
var DeactivatePreviousStep = exports.DeactivatePreviousStep = (function () {
function DeactivatePreviousStep() {}

_prototypeProperties(DeactivatePreviousStep, null, {
Expand All @@ -61,16 +50,13 @@ define(["exports", "./navigation-plan", "./navigation-commands", "./util"], func
return processDeactivatable(navigationContext.plan, "deactivate", next, true);
},
writable: true,
enumerable: true,
configurable: true
}
});

return DeactivatePreviousStep;
})();

exports.DeactivatePreviousStep = DeactivatePreviousStep;
var ActivateNextStep = (function () {
var ActivateNextStep = exports.ActivateNextStep = (function () {
function ActivateNextStep() {}

_prototypeProperties(ActivateNextStep, null, {
Expand All @@ -79,27 +65,27 @@ define(["exports", "./navigation-plan", "./navigation-commands", "./util"], func
return processActivatable(navigationContext, "activate", next, true);
},
writable: true,
enumerable: true,
configurable: true
}
});

return ActivateNextStep;
})();

exports.ActivateNextStep = ActivateNextStep;


function processDeactivatable(plan, callbackName, next, ignoreResult) {
var inspect = function (val) {
var infos = findDeactivatable(plan, callbackName),
i = infos.length;

function inspect(val) {
if (ignoreResult || shouldContinue(val)) {
return iterate();
} else {
return next.cancel(val);
}
};
}

var iterate = function () {
function iterate() {
if (i--) {
try {
var controller = infos[i];
Expand All @@ -111,10 +97,7 @@ define(["exports", "./navigation-plan", "./navigation-commands", "./util"], func
} else {
return next();
}
};

var infos = findDeactivatable(plan, callbackName),
i = infos.length;
}

return iterate();
}
Expand Down Expand Up @@ -165,15 +148,19 @@ define(["exports", "./navigation-plan", "./navigation-commands", "./util"], func
}

function processActivatable(navigationContext, callbackName, next, ignoreResult) {
var inspect = function (val, router) {
var infos = findActivatable(navigationContext, callbackName),
length = infos.length,
i = -1;

function inspect(val, router) {
if (ignoreResult || shouldContinue(val, router)) {
return iterate();
} else {
return next.cancel(val);
}
};
}

var iterate = function () {
function iterate() {
i++;

if (i < length) {
Expand All @@ -190,11 +177,7 @@ define(["exports", "./navigation-plan", "./navigation-commands", "./util"], func
} else {
return next();
}
};

var infos = findActivatable(navigationContext, callbackName),
length = infos.length,
i = -1;
}

return iterate();
}
Expand Down Expand Up @@ -246,4 +229,5 @@ define(["exports", "./navigation-plan", "./navigation-commands", "./util"], func

return output;
}
exports.__esModule = true;
});
79 changes: 17 additions & 62 deletions dist/amd/app-router.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,18 @@
define(["exports", "aurelia-dependency-injection", "aurelia-history", "./router", "./pipeline-provider", "./navigation-commands"], function (exports, _aureliaDependencyInjection, _aureliaHistory, _router, _pipelineProvider, _navigationCommands) {
"use strict";

var _prototypeProperties = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};
var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); };

var _get = function get(object, property, receiver) {
var desc = Object.getOwnPropertyDescriptor(object, property);
var _get = function get(object, property, receiver) { var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc && desc.writable) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };

if (desc === undefined) {
var parent = Object.getPrototypeOf(object);

if (parent === null) {
return undefined;
} else {
return get(parent, property, receiver);
}
} else if ("value" in desc && desc.writable) {
return desc.value;
} else {
var getter = desc.get;
if (getter === undefined) {
return undefined;
}
return getter.call(receiver);
}
};

var _inherits = function (subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) subClass.__proto__ = superClass;
};
var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; };

var Container = _aureliaDependencyInjection.Container;
var History = _aureliaHistory.History;
var Router = _router.Router;
var PipelineProvider = _pipelineProvider.PipelineProvider;
var isNavigationCommand = _navigationCommands.isNavigationCommand;
var AppRouter = (function (Router) {
var AppRouter = exports.AppRouter = (function (Router) {
function AppRouter(container, history, pipelineProvider) {
_get(Object.getPrototypeOf(AppRouter.prototype), "constructor", this).call(this, container, history);
this.pipelineProvider = pipelineProvider;
Expand All @@ -63,7 +27,6 @@ define(["exports", "aurelia-dependency-injection", "aurelia-history", "./router"
return [Container, History, PipelineProvider];
},
writable: true,
enumerable: true,
configurable: true
}
}, {
Expand All @@ -81,25 +44,23 @@ define(["exports", "aurelia-dependency-injection", "aurelia-history", "./router"
});
},
writable: true,
enumerable: true,
configurable: true
},
queueInstruction: {
value: function queueInstruction(instruction) {
var _this2 = this;
var _this = this;
return new Promise(function (resolve) {
instruction.resolve = resolve;
_this2.queue.unshift(instruction);
_this2.dequeueInstruction();
_this.queue.unshift(instruction);
_this.dequeueInstruction();
});
},
writable: true,
enumerable: true,
configurable: true
},
dequeueInstruction: {
value: function dequeueInstruction() {
var _this3 = this;
var _this = this;
if (this.isNavigating) {
return;
}
Expand All @@ -117,42 +78,41 @@ define(["exports", "aurelia-dependency-injection", "aurelia-history", "./router"
var pipeline = this.pipelineProvider.createPipeline(context);

pipeline.run(context).then(function (result) {
_this3.isNavigating = false;
_this.isNavigating = false;

if (result.completed) {
_this3.history.previousFragment = instruction.fragment;
_this.history.previousFragment = instruction.fragment;
}

if (result.output instanceof Error) {
console.error(result.output);
}

if (isNavigationCommand(result.output)) {
result.output.navigate(_this3);
} else if (!result.completed && _this3.history.previousFragment) {
_this3.navigate(_this3.history.previousFragment, false);
result.output.navigate(_this);
} else if (!result.completed && _this.history.previousFragment) {
_this.navigate(_this.history.previousFragment, false);
}

instruction.resolve(result);
_this3.dequeueInstruction();
_this.dequeueInstruction();
})["catch"](function (error) {
console.error(error);
});
},
writable: true,
enumerable: true,
configurable: true
},
registerViewPort: {
value: function registerViewPort(viewPort, name) {
var _this4 = this;
var _this = this;
_get(Object.getPrototypeOf(AppRouter.prototype), "registerViewPort", this).call(this, viewPort, name);

if (!this.isActive) {
if ("configureRouter" in this.container.viewModel) {
var result = this.container.viewModel.configureRouter() || Promise.resolve();
return result.then(function () {
return _this4.activate();
return _this.activate();
});
} else {
this.activate();
Expand All @@ -162,7 +122,6 @@ define(["exports", "aurelia-dependency-injection", "aurelia-history", "./router"
}
},
writable: true,
enumerable: true,
configurable: true
},
activate: {
Expand All @@ -177,7 +136,6 @@ define(["exports", "aurelia-dependency-injection", "aurelia-history", "./router"
this.dequeueInstruction();
},
writable: true,
enumerable: true,
configurable: true
},
deactivate: {
Expand All @@ -186,7 +144,6 @@ define(["exports", "aurelia-dependency-injection", "aurelia-history", "./router"
this.history.deactivate();
},
writable: true,
enumerable: true,
configurable: true
},
reset: {
Expand All @@ -196,16 +153,13 @@ define(["exports", "aurelia-dependency-injection", "aurelia-history", "./router"
this.options = null;
},
writable: true,
enumerable: true,
configurable: true
}
});

return AppRouter;
})(Router);

exports.AppRouter = AppRouter;


function handleLinkClick(evt) {
if (!this.isActive) {
Expand Down Expand Up @@ -234,4 +188,5 @@ define(["exports", "aurelia-dependency-injection", "aurelia-history", "./router"

return !targetWindow || targetWindow === window.name || targetWindow === "_self" || targetWindow === "top" && window === window.top;
}
exports.__esModule = true;
});
1 change: 1 addition & 0 deletions dist/amd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ define(["exports", "./router", "./app-router", "./pipeline-provider", "./navigat
exports.NO_CHANGE = _navigationPlan.NO_CHANGE;
exports.INVOKE_LIFECYCLE = _navigationPlan.INVOKE_LIFECYCLE;
exports.REPLACE = _navigationPlan.REPLACE;
exports.__esModule = true;
});
Loading

0 comments on commit 68b498e

Please sign in to comment.