From 9469ef0fd7f27362546362e20db29e0642e88616 Mon Sep 17 00:00:00 2001 From: Ben Reinhart Date: Mon, 16 Jun 2014 18:03:49 -0500 Subject: [PATCH] Make default size and earliest date config vars --- components/search/grammar.jison | 5 +++-- core/config/index.example.json | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/components/search/grammar.jison b/components/search/grammar.jison index 283c7a5..5e6ef02 100644 --- a/components/search/grammar.jison +++ b/components/search/grammar.jison @@ -5,13 +5,14 @@ %{ var slice = [].slice , hasOwn = {}.hasOwnProperty + , config = requireRoot('core/config').search , DateUtils = requireRoot('core/lib/utils/date') , canonicalDate$ = DateUtils.canonicalDate , incDate$ = DateUtils.increment , parseDate$ = DateUtils.parse; - const DEFAULT_SIZE = 10; - const EARLIEST_DATE = '1983-01-01'; + const DEFAULT_SIZE = config.DEFAULT_SIZE; + const EARLIEST_DATE = config.EARLIEST_DATE; function extend(first){ var i, ref, prop diff --git a/core/config/index.example.json b/core/config/index.example.json index 2920d1c..a4eace9 100644 --- a/core/config/index.example.json +++ b/core/config/index.example.json @@ -2,10 +2,20 @@ "development": { "port": 1983 + , "search": + { + "DEFAULT_SIZE": "10" + , "EARLIEST_DATE": "1983-01-01" + } } , "production": { "port": 80 + , "search": + { + "DEFAULT_SIZE": "10" + , "EARLIEST_DATE": "1983-01-01" + } } }