From 6fce8b737cf5b6eed31a394f3ca8181b293c90f2 Mon Sep 17 00:00:00 2001 From: Mila Frerichs Date: Fri, 21 Aug 2015 12:11:17 +0200 Subject: [PATCH 1/5] Update search to follow active pages "pattern" use "minutesAgo" dimension from GA to determine which pageviews are new ones and which search results to display. use pageviews instead of activeusers to streamline the metrics we use. Use handlebars and template helper instead of mustache for faster rendering --- karma.conf.js | 2 + public/index.html | 9 ++ public/javascripts/search.js | 113 +++++++-------------- tests/searchSpec.js | 183 +++++++++++++++++++++++++++++++++++ 4 files changed, 229 insertions(+), 78 deletions(-) create mode 100644 tests/searchSpec.js diff --git a/karma.conf.js b/karma.conf.js index 063ae3c..c0f849d 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -7,6 +7,7 @@ module.exports = function(config) { 'public/javascripts/vendor/handlebars-v3.0.3.js', 'public/javascripts/helper/templateHelper.js', 'public/javascripts/landing-pages.js', + 'public/javascripts/search.js', 'public/javascripts/traffic.js', 'tests/**/*Spec.js', 'tests/fixtures/**/*' @@ -16,6 +17,7 @@ module.exports = function(config) { ], preprocessors: { 'public/javascripts/*.js': ['coverage'], + 'public/javascripts/helper/*.js': ['coverage'], 'tests/**/*.json' : ['json_fixtures'] }, jsonFixturesPreprocessor: { diff --git a/public/index.html b/public/index.html index cc15ca8..1c1be0c 100644 --- a/public/index.html +++ b/public/index.html @@ -103,6 +103,15 @@

Most popular pages

{{/pages}} +