Skip to content

Commit

Permalink
Updated demo configs
Browse files Browse the repository at this point in the history
They are now clearer and more focused.
  • Loading branch information
felixgirault committed Aug 8, 2022
1 parent d22b520 commit 38556d1
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 58 deletions.
71 changes: 47 additions & 24 deletions dist/dsfr.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ <h1>

<ul class="fr-btns-group fr-btns-group--inline">
<li>
<button class="fr-btn" data-orejime-open data-orejime-preload>
<button
class="fr-btn"
data-orejime-open
data-orejime-preload
>
Configurer
</button>
</li>
Expand Down Expand Up @@ -181,48 +185,67 @@ <h1>
theme: 'dsfr',
appElement: '#app',
privacyPolicyUrl: '#privacyPolicy',
lang: 'fr',
forceBanner: true,
translations: {
modal: {
description:
"Voici un exemple d'Orejime pour le système de design de l'État.\n" +
'Tous les trackers ci-dessous sont factices pour les besoins de la demonstration, ' +
'ils ne collecteront aucune information sensible même si vous y consentez.\n'
}
},
purposes: [
{
id: 'advertising',
title: 'Advertising',
description: 'Things related to advertising.',
id: 'mandatory',
title: 'Cookies techniques',
description:
'Ces cookies ne peuvent être désactivés car ils sont nécéssaires au bon fonctionnement du site.',
isMandatory: true
},
{
id: 'group',
title: 'Suivi tiers',
description:
"Différents trackers peuvent être regroupés pour y apposer une description et laisser l'usager les accepter ou les refuser tous d'un seul coup.",
purposes: [
{
id: 'inline-tracker',
name: 'inline-tracker',
title: 'Inline Tracker',
description:
"Un script inclus dans la page qui ajoute un cookie d'exemple.",
cookies: ['inline-tracker']
},
{
id: 'external-tracker',
name: 'external-tracker',
title: 'External Tracker',
cookies: ['external-tracker'],
isMandatory: true
description:
"Un script externe qui ajoute un cookie d'exemple.",
cookies: ['external-tracker']
}
]
},
{
id: 'disabled-by-default',
name: 'disabled-by-default',
title: 'Something disabled by default',
description:
'This <a href="http://example.com">example</a> app will not set any cookie',
default: false
},
{
id: 'always-on',
name: 'always-on',
title: 'Required app',
description: 'This example app will not set any cookie',
isMandatory: true
}
]
};
</script>

<script type="module" src="orejime.js"></script>
<script src="example-assets/buttons.js"></script>
<script src="example-assets/setCookie.js"></script>

<script
type="opt-in"
data-src="example-assets/external-tracker.js"
data-type="application/javascript"
data-purpose="external-tracker"
></script>

<script
type="opt-in"
data-type="application/javascript"
data-purpose="inline-tracker"
>
console.log("This is an example of an inline tracking script.")
setCookie("inline-tracker", "foo", 120)
</script>
</body>
</html>
62 changes: 28 additions & 34 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,61 +132,55 @@ <h2 class="Inset-title">They're using Orejime</h2>
<script>
// see the annotated config in the README for details on how everything works
window.orejimeConfig = {
appElement: "#app",
privacyPolicyUrl: "#privacyPolicy",
appElement: '#app',
privacyPolicyUrl: '#privacyPolicy',
forceBanner: true,
translations: {
modal: {
description: "Here is an example of Orejime. View the source code to see how everything is done.",
description:
'Here is an example of Orejime.\n' +
'All trackers below are fake ones for demonstration purpose, ' +
"they won't collect any sensitive information even if you consent to them.\n"
}
},
purposes: [
{
id: 'example',
title: 'Example group',
description: 'Purposes can be grouped to help users better understand their use.',
purposes: [
{
id: "inline-tracker",
title: "Inline Tracker",
description: "Example of an inline tracking script that sets a dummy cookie",
cookies: ["inline-tracker"]
},
{
id: "disabled-by-default",
title: "Something disabled by default",
description: "This example app will not set any cookie",
default: false
}
]
id: 'mandatory',
title: 'Technical cookies',
description:
"This can't be disabled as it is required for the website to function properly.",
isMandatory: true
},
{
id: 'third-party',
title: 'Third-party purposes',
description: 'These are fake third-party purposes.',
id: 'group',
title: 'Third-party tracking',
description:
'Cookies that are related to each other can be grouped so they can be described as a whole and let the user accept or decline all of them easily.',
purposes: [
{
id: "external-tracker",
title: "External Tracker",
description: "Example of an external tracking script that sets a dummy cookie",
cookies: ["external-tracker"],
id: 'inline-tracker',
title: 'Inline Tracker',
description:
'An inline script that sets a dummy cookie.',
cookies: ['inline-tracker']
},
{
id: "always-on",
title: "Required app",
description: "This <a href=\"http://example.com\">example</a> app will not set any cookie",
isMandatory: true
id: 'external-tracker',
title: 'External Tracker',
description:
'An external script that sets a dummy cookie.',
cookies: ['external-tracker']
}
]
}
]
}
};

document.addEventListener('orejime.loaded', function(event) {
document.addEventListener('orejime.loaded', function (event) {
console.log('Orejime has loaded.', event.detail);
});
</script>

<!-- since there is a orejimeConfig global variable in index.js, a window.orejime instance will be initiated when including the lib -->
<script src="orejime.js"></script>
<script src="example-assets/buttons.js"></script>
<script src="example-assets/setCookie.js"></script>
Expand Down

0 comments on commit 38556d1

Please sign in to comment.