From 233d5b6a528df312eb028edb6dea7133a449d311 Mon Sep 17 00:00:00 2001 From: Chris Hallberg <crhallberg@gmail.com> Date: Tue, 31 Mar 2015 14:40:53 -0400 Subject: [PATCH] PubdateVis css extraction: skip rules that don't match the color. --- themes/bootstrap3/js/pubdate_vis.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/themes/bootstrap3/js/pubdate_vis.js b/themes/bootstrap3/js/pubdate_vis.js index 6b3b577e581..de512a5a7d3 100644 --- a/themes/bootstrap3/js/pubdate_vis.js +++ b/themes/bootstrap3/js/pubdate_vis.js @@ -20,17 +20,22 @@ function PadDigits(n, totalDigits) function loadVis(facetFields, searchParams, baseURL, zooming) { // Get colors from CSS var cssColorSettings = { - 'background-color': '#ffffff', // background of box - 'fill': 'rgb(234,234,234)', // fillColor - 'outline-color': '#e8cfac', // selection color - 'stroke': '#265680' // color + 'background-color': '#fff', // background of box + 'fill': '#eee', // box fill color + 'stroke': '#265680', // box outline color + 'outline-color': '#e8cfac' // selection color }; var $dateVisColorSettings = $('#dateVisColorSettings'); for(var rule in cssColorSettings) { if($dateVisColorSettings.css(rule)) { - cssColorSettings[rule] = $dateVisColorSettings.css(rule).match(/rgb[a]?\([^\)]+\)|#[a-fA-F0-9]+/)[0]; + var match = $dateVisColorSettings.css(rule).match(/rgb[a]?\([^\)]+\)|#[a-fA-F0-9]+/); + if(null != match) { + cssColorSettings[rule] = match[0]; + } } } + console.log($dateVisColorSettings); + console.log(cssColorSettings); // options for the graph, TODO: make configurable var options = { series: { -- GitLab