Skip to content

Commit

Permalink
chore(all): prepare release 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Jan 6, 2015
1 parent ce6abe3 commit 86ec316
Show file tree
Hide file tree
Showing 43 changed files with 2,514 additions and 1,154 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.2.1",
"version": "0.3.0",
"description": "A powerful client-side router.",
"keywords": [
"aurelia",
Expand Down
51 changes: 18 additions & 33 deletions dist/amd/activation.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,48 +11,32 @@ define(["exports", "./navigation-plan", "./navigation-commands", "./util"], func
var processPotential = _util.processPotential;
var affirmations = exports.affirmations = ["yes", "ok", "true"];

var CanDeactivatePreviousStep = (function () {
var CanDeactivatePreviousStep = function CanDeactivatePreviousStep() {};
var CanDeactivatePreviousStep = function CanDeactivatePreviousStep() {};

CanDeactivatePreviousStep.prototype.run = function (navigationContext, next) {
return processDeactivatable(navigationContext.plan, "canDeactivate", next);
};

return CanDeactivatePreviousStep;
})();
CanDeactivatePreviousStep.prototype.run = function (navigationContext, next) {
return processDeactivatable(navigationContext.plan, "canDeactivate", next);
};

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

CanActivateNextStep.prototype.run = function (navigationContext, next) {
return processActivatable(navigationContext, "canActivate", next);
};

return CanActivateNextStep;
})();
CanActivateNextStep.prototype.run = function (navigationContext, next) {
return processActivatable(navigationContext, "canActivate", next);
};

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

DeactivatePreviousStep.prototype.run = function (navigationContext, next) {
return processDeactivatable(navigationContext.plan, "deactivate", next, true);
};

return DeactivatePreviousStep;
})();
DeactivatePreviousStep.prototype.run = function (navigationContext, next) {
return processDeactivatable(navigationContext.plan, "deactivate", next, true);
};

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

ActivateNextStep.prototype.run = function (navigationContext, next) {
return processActivatable(navigationContext, "activate", next, true);
};

return ActivateNextStep;
})();
ActivateNextStep.prototype.run = function (navigationContext, next) {
return processActivatable(navigationContext, "activate", next, true);
};

exports.ActivateNextStep = ActivateNextStep;

Expand Down Expand Up @@ -146,8 +130,9 @@ define(["exports", "./navigation-plan", "./navigation-commands", "./util"], func

if (i < length) {
try {
var _current$controller;
var current = infos[i];
var result = current.controller[callbackName].apply(current.controller, _toArray(current.lifecycleArgs));
var result = (_current$controller = current.controller)[callbackName].apply(_current$controller, _toArray(current.lifecycleArgs));
return processPotential(result, function (val) {
return inspect(val, current.router);
}, next.cancel);
Expand Down
24 changes: 14 additions & 10 deletions dist/amd/app-router.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
define(["exports", "aurelia-history", "./router", "./pipeline-provider", "./navigation-commands"], function (exports, _aureliaHistory, _router, _pipelineProvider, _navigationCommands) {
"use strict";

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

var History = _aureliaHistory.History;
var Router = _router.Router;
var PipelineProvider = _pipelineProvider.PipelineProvider;
var isNavigationCommand = _navigationCommands.isNavigationCommand;
var AppRouter = (function (Router) {
var AppRouter = (function () {
var _Router = Router;
var AppRouter = function AppRouter(history, pipelineProvider) {
Router.call(this, history);
_Router.call(this, history);
this.pipelineProvider = pipelineProvider;
document.addEventListener("click", handleLinkClick.bind(this), true);
};

_extends(AppRouter, Router);
_inherits(AppRouter, _Router);

AppRouter.inject = function () {
return [History, PipelineProvider];
Expand Down Expand Up @@ -125,13 +129,13 @@ define(["exports", "aurelia-history", "./router", "./pipeline-provider", "./navi
};

AppRouter.prototype.reset = function () {
Router.prototype.reset.call(this);
_Router.prototype.reset.call(this);
this.queue = [];
delete this.options;
};

return AppRouter;
})(Router);
})();

exports.AppRouter = AppRouter;

Expand All @@ -150,7 +154,7 @@ define(["exports", "aurelia-history", "./router", "./pipeline-provider", "./navi
if (!evt.altKey && !evt.ctrlKey && !evt.metaKey && !evt.shiftKey && targetIsThisWindow(target)) {
var href = target.getAttribute("href");

if (href !== null && !(href.charAt(0) === "#" || (/^[a-z]+:/i).test(href))) {
if (href !== null && !(href.charAt(0) === "#" || /^[a-z]+:/i.test(href))) {
evt.preventDefault();
this.history.navigate(href);
}
Expand All @@ -161,6 +165,6 @@ define(["exports", "aurelia-history", "./router", "./pipeline-provider", "./navi
function targetIsThisWindow(target) {
var targetWindow = target.getAttribute("target");

return !targetWindow || targetWindow === window.name || targetWindow === "_self" || (targetWindow === "top" && window === window.top);
return !targetWindow || targetWindow === window.name || targetWindow === "_self" || targetWindow === "top" && window === window.top;
}
});
12 changes: 4 additions & 8 deletions dist/amd/model-binding.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
define(["exports"], function (exports) {
"use strict";

var ApplyModelBindersStep = (function () {
var ApplyModelBindersStep = function ApplyModelBindersStep() {};
var ApplyModelBindersStep = function ApplyModelBindersStep() {};

ApplyModelBindersStep.prototype.run = function (navigationContext, next) {
return next();
};

return ApplyModelBindersStep;
})();
ApplyModelBindersStep.prototype.run = function (navigationContext, next) {
return next();
};

exports.ApplyModelBindersStep = ApplyModelBindersStep;
});
18 changes: 7 additions & 11 deletions dist/amd/navigation-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@ define(["exports"], function (exports) {
return obj && typeof obj.navigate === "function";
}

var Redirect = (function () {
var Redirect = function Redirect(url) {
this.url = url;
this.shouldContinueProcessing = false;
};
var Redirect = function Redirect(url) {
this.url = url;
this.shouldContinueProcessing = false;
};

Redirect.prototype.navigate = function (appRouter) {
(this.router || appRouter).navigate(this.url, { trigger: true, replace: true });
};

return Redirect;
})();
Redirect.prototype.navigate = function (appRouter) {
(this.router || appRouter).navigate(this.url, { trigger: true, replace: true });
};

exports.Redirect = Redirect;
});
112 changes: 52 additions & 60 deletions dist/amd/navigation-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,88 +2,80 @@ define(["exports", "./navigation-plan"], function (exports, _navigationPlan) {
"use strict";

var REPLACE = _navigationPlan.REPLACE;
var NavigationContext = (function () {
var NavigationContext = function NavigationContext(router, nextInstruction) {
this.router = router;
this.nextInstruction = nextInstruction;
this.currentInstruction = router.currentInstruction;
this.prevInstruction = router.currentInstruction;
};
var NavigationContext = function NavigationContext(router, nextInstruction) {
this.router = router;
this.nextInstruction = nextInstruction;
this.currentInstruction = router.currentInstruction;
this.prevInstruction = router.currentInstruction;
};

NavigationContext.prototype.commitChanges = function () {
var next = this.nextInstruction, prev = this.prevInstruction, viewPortInstructions = next.viewPortInstructions, router = this.router;
NavigationContext.prototype.commitChanges = function () {
var next = this.nextInstruction, prev = this.prevInstruction, viewPortInstructions = next.viewPortInstructions, router = this.router;

router.currentInstruction = next;
router.currentInstruction = next;

if (prev) {
prev.config.navModel.isActive = false;
}
if (prev) {
prev.config.navModel.isActive = false;
}

next.config.navModel.isActive = true;
next.config.navModel.isActive = true;

router.refreshBaseUrl();
router.refreshNavigation();
router.refreshBaseUrl();
router.refreshNavigation();

for (var viewPortName in viewPortInstructions) {
var viewPortInstruction = viewPortInstructions[viewPortName];
var viewPort = router.viewPorts[viewPortName];
for (var viewPortName in viewPortInstructions) {
var viewPortInstruction = viewPortInstructions[viewPortName];
var viewPort = router.viewPorts[viewPortName];

if (viewPortInstruction.strategy === REPLACE) {
viewPort.process(viewPortInstruction);
}
if (viewPortInstruction.strategy === REPLACE) {
viewPort.process(viewPortInstruction);
}

if ("childNavigationContext" in viewPortInstruction) {
viewPortInstruction.childNavigationContext.commitChanges();
}
if ("childNavigationContext" in viewPortInstruction) {
viewPortInstruction.childNavigationContext.commitChanges();
}
};
}
};

NavigationContext.prototype.buildTitle = function (separator) {
if (separator === undefined) separator = " | ";
var next = this.nextInstruction, title = next.config.navModel.title || "", viewPortInstructions = next.viewPortInstructions, childTitles = [];
NavigationContext.prototype.buildTitle = function () {
var separator = arguments[0] === undefined ? " | " : arguments[0];
var next = this.nextInstruction, title = next.config.navModel.title || "", viewPortInstructions = next.viewPortInstructions, childTitles = [];

for (var viewPortName in viewPortInstructions) {
var viewPortInstruction = viewPortInstructions[viewPortName];
for (var viewPortName in viewPortInstructions) {
var viewPortInstruction = viewPortInstructions[viewPortName];

if ("childNavigationContext" in viewPortInstruction) {
var childTitle = viewPortInstruction.childNavigationContext.buildTitle(separator);
if (childTitle) {
childTitles.push(childTitle);
}
if ("childNavigationContext" in viewPortInstruction) {
var childTitle = viewPortInstruction.childNavigationContext.buildTitle(separator);
if (childTitle) {
childTitles.push(childTitle);
}
}
}

if (childTitles.length) {
title = childTitles.join(separator) + (title ? separator : "") + title;
}
if (childTitles.length) {
title = childTitles.join(separator) + (title ? separator : "") + title;
}

if (this.router.title) {
title += (title ? separator : "") + this.router.title;
}

return title;
};
if (this.router.title) {
title += (title ? separator : "") + this.router.title;
}

return NavigationContext;
})();
return title;
};

exports.NavigationContext = NavigationContext;
var CommitChangesStep = (function () {
var CommitChangesStep = function CommitChangesStep() {};
var CommitChangesStep = function CommitChangesStep() {};

CommitChangesStep.prototype.run = function (navigationContext, next) {
navigationContext.commitChanges();

var title = navigationContext.buildTitle();
if (title) {
document.title = title;
}
CommitChangesStep.prototype.run = function (navigationContext, next) {
navigationContext.commitChanges();

return next();
};
var title = navigationContext.buildTitle();
if (title) {
document.title = title;
}

return CommitChangesStep;
})();
return next();
};

exports.CommitChangesStep = CommitChangesStep;
});
Loading

0 comments on commit 86ec316

Please sign in to comment.