diff --git a/app/assets/javascripts/initializers/initializeBaseTracking.js.erb b/app/assets/javascripts/initializers/initializeBaseTracking.js.erb index 6864bb1a2..44f3d50e5 100644 --- a/app/assets/javascripts/initializers/initializeBaseTracking.js.erb +++ b/app/assets/javascripts/initializers/initializeBaseTracking.js.erb @@ -27,6 +27,7 @@ function initializeBaseTracking() { } }, 25); facebookTrackingScript(); + eventListening(); } //This function is cromulent @@ -79,3 +80,14 @@ function facebookTrackingScript() { fbTrack(); } } + + +function eventListening(){ + var registerNowButt = document.getElementById("cta-comment-register-now-link"); + if (registerNowButt) { + registerNowButt.onclick = function(){ + ga('send', 'event', 'click', 'register-now-click', null, null); + } + } + +} \ No newline at end of file diff --git a/app/assets/javascripts/initializers/initializeCommentsPage.js.erb b/app/assets/javascripts/initializers/initializeCommentsPage.js.erb index 3ccb3e034..859e858c2 100644 --- a/app/assets/javascripts/initializers/initializeCommentsPage.js.erb +++ b/app/assets/javascripts/initializers/initializeCommentsPage.js.erb @@ -38,7 +38,8 @@ function initializeCommentsPage() { if (allNodes[i].dataset.commentAuthorId == responseObj.current_user.id) { allNodes[i].dataset.currentUserComment = "true"; var userActionsEl = allNodes[i].children[0].children[2].children[0]; - if (userActionsEl) { + var buttEl = document.getElementById('button-for-comment-' + allNodes[i].dataset.commentId); + if (userActionsEl && buttEl) { userActionsEl.className = 'current-user-actions'; userActionsEl.style.display = 'inline-block'; document.getElementById('button-for-comment-' + allNodes[i].dataset.commentId).classList.add('reacted'); diff --git a/app/assets/stylesheets/comments.scss b/app/assets/stylesheets/comments.scss index 48016ed81..4b1c7dd67 100644 --- a/app/assets/stylesheets/comments.scss +++ b/app/assets/stylesheets/comments.scss @@ -711,6 +711,14 @@ a.header-link{ opacity:1; } } + a.register-now-cta{ + font-size:1.4em; + background: $green; + color: $black; + padding: 3px 10px; + margin-right:5px; + line-height:1.8em; + } .current-user-actions{ .hidden{ display:none; diff --git a/app/views/comments/_login_cta_comment.html.erb b/app/views/comments/_login_cta_comment.html.erb index b7bb9af3f..cf176c310 100644 --- a/app/views/comments/_login_cta_comment.html.erb +++ b/app/views/comments/_login_cta_comment.html.erb @@ -2,30 +2,32 @@
- Dear lurker, this message is for you. + Hey there, we see you aren't signed in.
Please consider creating an account on dev.to. It literally takes a few seconds and we'd appreciate the support so much. ❤️
-