This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add user feedback widget to python docs site
- Loading branch information
Showing
3 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
.feedback-container { | ||
text-align: center; | ||
} | ||
|
||
.feedback-answer-container { | ||
display: inline-block; | ||
} | ||
|
||
.feedback-question { | ||
display: inline-block; | ||
padding: 0.5em 1em 0.5em 1em; | ||
} | ||
|
||
.feedback-answer { | ||
display: inline-block; | ||
padding: 0.5em 1em 0.5em 1em; | ||
color: #048ccc; | ||
cursor: pointer; | ||
} | ||
|
||
.feedback-answer:hover { | ||
color: #ffffff; | ||
background-color: #048ccc; | ||
} | ||
|
||
.feedback-thank-you { | ||
display: none; | ||
padding: 0.5em 1em 0.5em 1em; | ||
} | ||
|
||
.feedback-hr-top { | ||
margin-top: 50px; | ||
} | ||
|
||
.feedback-hr-bottom { | ||
margin-bottom: 30px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
$(document).ready(function() { | ||
$(".feedback-answer").on("click", function () { | ||
$(".feedback-question").remove(); | ||
$(".feedback-answer-container").remove(); | ||
$(".feedback-thank-you").show(); | ||
ga("send", { | ||
hitType: "event", | ||
eventCategory: "Did this page help you?", | ||
eventAction: $(this).attr("data-response"), | ||
eventLabel: window.location.pathname || "unknown", | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters