mirror of https://github.com/dapr/docs.git
Merge branch 'v1.5' into cot
This commit is contained in:
commit
95338f06a4
|
@ -201,6 +201,10 @@ url_latest_version = "https://docs.dapr.io"
|
||||||
sidebar_menu_compact = true
|
sidebar_menu_compact = true
|
||||||
navbar_logo = true
|
navbar_logo = true
|
||||||
sidebar_search_disable = true
|
sidebar_search_disable = true
|
||||||
|
[params.ui.feedback]
|
||||||
|
enable = true
|
||||||
|
yes = '<b>Glad to hear it!</b> Please <a href="https://github.com/dapr/docs/issues/new/choose">tell us how we can improve</a>.'
|
||||||
|
no = '<b>Sorry to hear that.</b> Please <a href="https://github.com/dapr/docs/issues/new/choose">tell us how we can improve</a>.'
|
||||||
|
|
||||||
# Links
|
# Links
|
||||||
## End user relevant links. These will show up on left side of footer and in the community page if you have one.
|
## End user relevant links. These will show up on left side of footer and in the community page if you have one.
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
<style>
|
||||||
|
.feedback--title {
|
||||||
|
margin-top: 3rem;
|
||||||
|
}
|
||||||
|
.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">Feedback</h2>
|
||||||
|
<p class="feedback--question">Was this page helpful?</p>
|
||||||
|
<button class="btn btn-primary mb-4 feedback--answer feedback--answer-yes">Yes</button>
|
||||||
|
<button class="btn btn-primary mb-4 feedback--answer feedback--answer-no">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>
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"globalHeaders": {
|
||||||
|
"X-Frame-Options": "DENY"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue