-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[hi] L10n of Feedback section #665
Conversation
Shivansh-yadav13
commented
Mar 29, 2022
- Related issue: L10n of "Feedback" section #470
✅ Deploy Preview for cncfglossary ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Preview: https://deploy-preview-665--cncfglossary.netlify.app/hi/devops/ To take effect, please add Sorry for the previous insufficient guide 😅 [ <style>
.feedback--answer {
display: inline-block;
}
.feedback--answer-no {
margin-left: 1em;
}
.feedback--response {
display: none;
margin-top: 1em;
}
.feedback--response__visible {
display: block;
}
</style>
<div class="d-print-none">
<h2 class="feedback--title">{{ T "feedback_title" }}</h2>
<p class="feedback--question">{{ T "feedback_question" }}</p>
<button class="btn btn-primary mb-4 feedback--answer feedback--answer-yes">{{ T "feedback_answer_yes" }}</button>
<button class="btn btn-primary mb-4 feedback--answer feedback--answer-no">{{ T "feedback_answer_no" }}</button>
<p class="feedback--response feedback--response-yes">
{{ .yes | safeHTML }}
</p>
<p class="feedback--response feedback--response-no">
{{ .no | safeHTML }}
</p>
</div>
<script>
const yesButton = document.querySelector('.feedback--answer-yes');
const noButton = document.querySelector('.feedback--answer-no');
const yesResponse = document.querySelector('.feedback--response-yes');
const noResponse = document.querySelector('.feedback--response-no');
const disableButtons = () => {
yesButton.disabled = true;
noButton.disabled = true;
};
const sendFeedback = (value) => {
if (typeof ga !== 'function') return;
const args = {
command: 'send',
hitType: 'event',
category: 'Helpful',
action: 'click',
label: window.location.pathname,
value: value
};
ga(args.command, args.hitType, args.category, args.action, args.label, args.value);
};
yesButton.addEventListener('click', () => {
yesResponse.classList.add('feedback--response__visible');
disableButtons();
sendFeedback(1);
});
noButton.addEventListener('click', () => {
noResponse.classList.add('feedback--response__visible');
disableButtons();
sendFeedback(0);
});
</script> |
@jihoon-seo I was adding it previously but I wasn't sure to add it after referencing the #519, it might already exist there mb 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Garima-Negi @sayantani11 @anubha-v-ardhan @jayesh-srivastava Please review this PR, and perform merge if looks good. 😊
Preview: https://deploy-preview-665--cncfglossary.netlify.app/hi/devops/
- Recommended merge method: 'Squash and merge'
LGTM! |