diff --git a/README.md b/README.md index 6b229d4..01a6e25 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,28 @@ tarteaucitron.init({ "useExternalCss": false /* If false, the tarteaucitron.css file will be loaded */ //"cookieDomain": ".my-multisite-domaine.fr" /* Shared cookie for subdomain website */ + + "readmoreLink": "/cookiespolicy" /* Change the default readmore link pointing to opt-out.ferank.eu */ }); ``` + +# Create custom service +```js +tarteaucitron.services.mycustomservice = { + "key": "mycustomservice", + "type": "social|analytic|ads|video|support", + "name": "MyCustomService", + "needConsent": true, + "cookies": ['cookie', 'cookie2'], + "readmoreLink": "/custom_read_more", // If you want to change readmore link + "js": function () { + "use strict"; + // When user allow cookie + }, + "fallback": function () { + "use strict"; + // when use deny cookie + } +}; +``` \ No newline at end of file diff --git a/tarteaucitron.js b/tarteaucitron.js index 60800cc..7bd60d0 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -521,8 +521,17 @@ var tarteaucitron = { html += '
'; html += ' ' + service.name + ''; html += '
'; + if (tarteaucitron.parameters.moreInfoLink == true) { - html += ' '; + + var link = 'https://opt-out.ferank.eu/service/' + service.key + '/'; + if (service.readmoreLink !== undefined && service.readmoreLink !== '') { + link = service.readmoreLink; + } + if (tarteaucitron.parameters.readmoreLink !== undefined && tarteaucitron.parameters.readmoreLink !== '') { + link = tarteaucitron.parameters.readmoreLink; + } + html += ' '; html += ' ' + tarteaucitron.lang.more; html += ' '; html += ' - '; @@ -530,6 +539,7 @@ var tarteaucitron = { html += ' ' + tarteaucitron.lang.source; html += ' '; } + html += '
'; html += '
'; html += '