diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index da2e8ce..d467b08 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -241,50 +241,3 @@ } }); })(); - -function generateScreenshot() { - var css = ''; - var svgs = document.getElementsByTagName('svg'); - for (var i = 0; i < document.styleSheets.length; i++) { - if (document.styleSheets[i].href && !document.styleSheets[i].href.match(/web\-fonts/)) { - var rules = document.styleSheets[i].rules || document.styleSheets[i].cssRules; - for (var j = 0; j < rules.length; j++) { - cssText = rules[j].cssText; - if (rules[j].selectorText) { - if (rules[j].selectorText.match(/(^|\s)svg[^\w]/) || cssText.match(/\s(fill|stroke(\-width)?):/)) { - css += cssText; - } - } - } - } - } - for (var i = 0; i < svgs.length; i++) { - var svg = svgs[i]; - // svg.innerHTML = '' + svg.innerHTML; - svg.innerHTML = '' + svg.innerHTML; - svg.setAttribute('height', svg.clientHeight); - svg.setAttribute('width', svg.clientWidth); - var canvas = document.createElement('canvas'); - canvg(canvas, svg.outerHTML); - console.log(svg.outerHTML); - svg.style.backgroundImage = 'url(' + encodeURI(canvas.toDataURL('image/png')) + ')'; - } - - html2canvas(document.body, { - logging: true, - profile: true, - useCORS: true}).then(function(canvas) { - var data = canvas.toDataURL('image/jpeg', 0.9); - var src = encodeURI(data); - - window.open(src, '_blank'); - - // reset the svg height and width - for (var i = 0; i < svgs.length; i++) { - var svg = svgs[i]; - svg.removeAttribute('height'); - svg.removeAttribute('width'); - svg.removeAttribute('style'); - } - }); -} diff --git a/app/assets/javascripts/map.js b/app/assets/javascripts/map.js index 588f543..b0dd9bb 100644 --- a/app/assets/javascripts/map.js +++ b/app/assets/javascripts/map.js @@ -70,7 +70,7 @@ var annualConferences = container.append('g').attr('filter', 'url(#svg-gooey-filter)').attr('class', 'cities annual-conferences'); function mouseover(e) { - c = document.getElementById('conference-' + event.target.getAttribute('data-c')); + c = document.getElementById('conference-' + d3.event.target.getAttribute('data-c')); tooltip.innerHTML = '