Skip to content
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

HD-22392 Added Osano cookie consent #155

Merged
merged 6 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion _resource/overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
{# Import the theme's layout. #}
{% extends "base.html" %}


{% block scripts %}
<script src="https://cmp.osano.com/Azqe5vTyLOSbN3OuT/49ad85b5-0418-4794-ab81-7599dddd534c/osano.js"></script>
{{ super() }}
{% endblock %}

{% block extrahead %}
{{ super() }}
{% set title = config.site_name %}
Expand Down
3 changes: 2 additions & 1 deletion _resource/overrides/partials/copyright.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
-#}
<div class="md-copyright">
<div class="md-copyright__highlight">
<a href='https://percona.com' target='_blank'>Percona LLC and/or its affiliates, </a> &copy; {{ build_date_utc.strftime('%Y') }}
<a href='https://percona.com' target='_blank'>Percona LLC and/or its affiliates, </a> &copy; {{ build_date_utc.strftime('%Y') }}
— <a href="#" onclick="Osano.cm.showDrawer('osano-cm-dom-info-dialog-open')">Cookie Preferences</a>
</div>
{% if not config.extra.generator == false %}
Made with
Expand Down
206 changes: 206 additions & 0 deletions docs/css/osano.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
/* General styling */

.osano-cm-window {
font-family: "Roboto", Arial, Helvetica, sans-serif;
font-size: 20px;
}
.osano-cm-dialog--type_bar {
justify-content: center;
color: #000;
background: #fff;
box-shadow: 0 0 0 100vmax rgba(0,0,0,0.66)
}

.osano-cm-dialog {
font-size: 0.75em;
padding: 2em 1em;
color: var(--md-typeset-color);
background: var(--md-footer-bg-color--dark);
}
.osano-cm-header,
.osano-cm-info-dialog-header {
background: var(--md-default-bg-color);
}
.osano-cm-link,
.osano-cm-disclosure__toggle,
.osano-cm-expansion-panel__toggle {
color: var(--md-typeset-a-color);
}
.osano-cm-link:hover,
.osano-cm-link:active,
.osano-cm-disclosure__toggle:hover,
.osano-cm-disclosure__toggle:active,
.osano-cm-disclosure__toggle:focus,
.osano-cm-expansion-panel__toggle:hover,
.osano-cm-expansion-panel__toggle:active,
.osano-cm-expansion-panel__toggle:focus {
color: var(--md-accent-fg-color);
}
.osano-cm-drawer-links {
display: inline-block;
}
.osano-cm-link.osano-cm-storage-policy {
margin-right: 0.5em;
}
.osano-cm-description {
font-weight: 400;
}
.osano-cm-info {
color: var(--md-typeset-color);
background: var(--md-default-bg-color);
box-shadow: unset;
}
.osano-cm-dialog--hidden,
.osano-cm-info-dialog--hidden {
transition-delay: 0ms, 0ms;
}
.osano-cm-disclosure {
padding-top: 0;
}
.osano-cm-disclosure--collapse {
border-color: var(--md-default-fg-color--lightest);
}

/* Closing button */

.osano-cm-dialog__close,
.osano-cm-dialog__close:hover,
.osano-cm-dialog__close:focus,
.osano-cm-dialog__close:focus:hover {
color: var(--md-typeset-color);
stroke: var(--md-typeset-color);
border-color: transparent;
outline: initial;
}
.osano-cm-dialog__close:focus {
background-color: var(--md-default-fg-color--lightest);
}
.osano-cm-close {
padding: 0.25em;
margin: 0.5em;
stroke-width: 2px;
border-width: 2px;
opacity: 0.4;
}
.osano-cm-close:focus,
.osano-cm-close:hover {
stroke-width: 2px;
opacity: 1;
}
.osano-cm-info-dialog-header__close:focus {
background-color: var(--md-typeset-color);
}

/* Switch buttons */

.osano-cm-toggle__switch {
background-color: var(--md-default-fg-color--lightest);
transition: all 0.1s ease-out;
}
.osano-cm-toggle__input:hover + .osano-cm-toggle__switch {
background-color: var(--md-default-fg-color--light);
border-color: transparent;
}
.osano-cm-toggle__input:focus + .osano-cm-toggle__switch {
background-color: var(--md-default-fg-color--lightest);
border-color: transparent;
}
.osano-cm-toggle__input:focus + .osano-cm-toggle__switch::before {
border-color: var(--md-accent-fg-color);
}
.osano-cm-toggle__input:focus:hover + .osano-cm-toggle__switch {
background-color: var(--md-default-fg-color--light);
border-color: transparent;
}
.osano-cm-toggle__input:checked + .osano-cm-toggle__switch,
.osano-cm-toggle__input:disabled:checked + .osano-cm-toggle__switch {
background-color: var(--md-primary-fg-color);
border-color: var(--md-primary-fg-color);
}
.osano-cm-toggle__input:checked:hover + .osano-cm-toggle__switch,
.osano-cm-toggle__input:disabled:checked:hover + .osano-cm-toggle__switch {
background-color: var(--md-accent-fg-color);
border-color: var(--md-accent-fg-color);
}
.osano-cm-toggle__input:checked:focus + .osano-cm-toggle__switch,
.osano-cm-toggle__input:disabled:checked:focus + .osano-cm-toggle__switch {
background-color: var(--md-primary-fg-color);
border-color: var(--md-primary-fg-color);
}
.osano-cm-toggle__input:checked:focus + .osano-cm-toggle__switch::before {
border-color: var(--md-accent-fg-color);
}
.osano-cm-toggle__input:checked:focus:hover + .osano-cm-toggle__switch {
background-color: var(--md-accent-fg-color);
border-color: var(--md-accent-fg-color);
}
.osano-cm-toggle__input:disabled:checked + .osano-cm-toggle__switch,
.osano-cm-toggle__input:disabled:checked:focus + .osano-cm-toggle__switch,
.osano-cm-toggle__input:disabled:checked:hover + .osano-cm-toggle__switch {
opacity: 0.3;
cursor: not-allowed;
}
.osano-cm-toggle__input + .osano-cm-toggle__switch::after {
background-color: var(--md-default-bg-color) !important;
}
.osano-cm-toggle__input:checked + .osano-cm-toggle__switch::before {
border-color: transparent;
}
.osano-cm-list {
gap: 0.75em;
}

/* CTA Buttons */

.osano-cm-dialog__buttons {
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
gap: 0.5em 0.75em;
}
.osano-cm-button {
font-family: var(--fHeading);
flex: 1 1 20em;
color: var(--md-primary-fg-color);
background-color: transparent;
border-width: 2px;
border-color: var(--md-primary-fg-color);
border-radius: 20em;
}
.osano-cm-button:hover {
color: var(--md-accent-fg-color);
background-color: transparent;
border-color: var(--md-accent-fg-color);
}

/* Widget */

.osano-cm-widget {
display: none;
opacity: 0.5;
border-radius: 10em;
bottom: 3em;
}
.osano-cm-widget:focus {
outline-offset: 0.125em;
outline-color: var(--md-default-fg-color--lighter);
outline-width: 0.1875em;
}
.osano-cm-widget__outline {
fill: transparent;
stroke: var(--md-typeset-color);
}
.osano-cm-widget__dot {
fill: var(--md-typeset-color);
}

/* Media conditions */

@media screen and (min-width: 768px) {
.osano-cm-dialog--type_bar .osano-cm-dialog__content {
max-width: 50em;
}
.osano-cm-dialog--type_bar .osano-cm-dialog__buttons {
max-width: 20em;
}
}
1 change: 0 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* A variety of [supported storage types](details/storage-configuration.md) means no vendor lock-in
* Open source solution with [enterprise-grade features](features/comparison.md)

<div data-grid markdown><div data-banner markdown>

Check failure on line 19 in docs/index.md

View workflow job for this annotation

GitHub Actions / runner / vale

Inline HTML

docs/index.md:19:1 MD033/no-inline-html Inline HTML [Element: div] https://github.com/DavidAnson/markdownlint/blob/v0.28.2/doc/md033.md

Check failure on line 19 in docs/index.md

View workflow job for this annotation

GitHub Actions / runner / vale

Inline HTML

docs/index.md:19:25 MD033/no-inline-html Inline HTML [Element: div] https://github.com/DavidAnson/markdownlint/blob/v0.28.2/doc/md033.md

## :material-progress-download: Installation guides { .title }

Expand All @@ -24,7 +24,7 @@

[Quickstart guides :material-arrow-right:](installation.md){ .md-button }

</div><div data-banner markdown>

Check failure on line 27 in docs/index.md

View workflow job for this annotation

GitHub Actions / runner / vale

Inline HTML

docs/index.md:27:7 MD033/no-inline-html Inline HTML [Element: div] https://github.com/DavidAnson/markdownlint/blob/v0.28.2/doc/md033.md

### :material-backup-restore: Backup management { .title }

Expand All @@ -32,14 +32,14 @@

[Backup management :material-arrow-right:](usage/start-backup.md){ .md-button }

</div><div data-banner markdown>

Check failure on line 35 in docs/index.md

View workflow job for this annotation

GitHub Actions / runner / vale

Inline HTML

docs/index.md:35:7 MD033/no-inline-html Inline HTML [Element: div] https://github.com/DavidAnson/markdownlint/blob/v0.28.2/doc/md033.md

### :fontawesome-solid-gears: Administration { .title }

Tweak PBM to effectively perform your day-to-day operations.

[Administration :material-arrow-right:](manage/overview.md){.md-button}
</div><div data-banner markdown>

Check failure on line 42 in docs/index.md

View workflow job for this annotation

GitHub Actions / runner / vale

Inline HTML

docs/index.md:42:7 MD033/no-inline-html Inline HTML [Element: div] https://github.com/DavidAnson/markdownlint/blob/v0.28.2/doc/md033.md

### :material-frequently-asked-questions: Diagnostics and FAQ { .title }

Expand All @@ -52,4 +52,3 @@




6 changes: 6 additions & 0 deletions docs/js/consent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var consent = __md_get("__consent")
if (consent && consent.custom) {
/* The user accepted the cookie */
} else {
/* The user rejected the cookie */
}
11 changes: 0 additions & 11 deletions docs/js/feedback.js

This file was deleted.

35 changes: 18 additions & 17 deletions mkdocs-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ site_name: Percona Backup for MongoDB
site_description: documentation
site_author: Percona LLC
copyright: >
<a href="https://www.percona.com/about">Percona LLC</a> and/or its affiliates © 2023 — <a href="#__consent">Cookie Consent</a>


<a href="https://www.percona.com/about">Percona LLC</a> and/or its affiliates © 2024
— <a href="#" onclick="Osano.cm.showDrawer('osano-cm-dom-info-dialog-open')">Cookie Preferences</a>
repo_name: percona/pbm-docs
repo_url: https://github.com/percona/pbm-docs
edit_uri: edit/main/docs/
Expand Down Expand Up @@ -52,10 +51,11 @@ extra_css:
- css/percona.css
- css/extra.css
- css/design.css
- css/osano.css

extra_javascript:
- js/promptremover.js
- js/feedback.js
- js/consent.js

markdown_extensions:
abbr: {}
Expand Down Expand Up @@ -137,19 +137,20 @@ plugins:
extra:
homepage:
https://docs.percona.com
consent:
title: Cookie consent
description: >-
We use cookies to recognize your repeated visits and preferences, as well
as to measure the effectiveness of our documentation and whether users
find what they're searching for. With your consent, you're helping us to
make our documentation better. Read more about <a class="reference external" href="https://www.percona.com/20180524-cookie-policy" target="_blank">Percona Cookie Policy</a>.
cookies:
analytics: Google Analytics
github: Github
actions:
- manage
- accept
# consent:
# title: Cookie consent
# description: >-
# We use cookies to recognize your repeated visits and preferences, as well
# as to measure the effectiveness of our documentation and whether users
# find what they're searching for. With your consent, you're helping us to
# make our documentation better. Read more about <a class="reference external" href="https://www.percona.com/20180524-cookie-policy" target="_blank">Percona Cookie Policy</a>.
# cookies:
# analytics: Google Analytics
# github: Github
# custom: Osano
# actions:
# - manage
# - accept

nav:
- Home: index.md
Expand Down
Loading