Vulcan/packages/telescope-lib/lib/router.js

42 lines
1 KiB
JavaScript
Raw Normal View History

2015-09-17 14:51:14 +09:00
FlowRouter.addToQueryArray = function (key, value) {
var keyArray = FlowRouter.getQueryParam(key) || [];
keyArray.push(value);
var params = {};
params[key] = keyArray;
FlowRouter.setQueryParams(params);
}
FlowRouter.removeFromQueryArray = function (key, value) {
var keyArray = FlowRouter.getQueryParam(key);
keyArray = _.without(keyArray, value);
var params = {};
params[key] = keyArray;
FlowRouter.setQueryParams(params);
}
Telescope.adminRoutes = FlowRouter.group({
prefix: '/admin',
name: 'admin'
});
FlowRouter.notFound = {
action: function() {
2015-10-21 12:40:01 +09:00
if (Meteor.isClient) {
DocHead.addMeta({
name: "name",
property: "prerender-status-code",
content: "404"
});
DocHead.addMeta({
name: "name",
property: "robots",
content: "noindex, nofollow"
});
}
BlazeLayout.render("layout", {main: "not_found"});
}
};
2015-10-20 11:55:22 +09:00
FlowRouter.triggers.enter([function () {Events.analyticsRequest()}]);
2015-10-21 12:40:01 +09:00
FlowRouter.triggers.exit([function () {Messages.clearSeen()}]);