Allow to change readme link (for custom service)
This commit is contained in:
parent
e1fbad4a33
commit
d2a9417d66
20
README.md
20
README.md
|
|
@ -119,3 +119,23 @@ tarteaucitron.init({
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# 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
|
||||||
|
}
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
@ -413,12 +413,17 @@ var tarteaucitron = {
|
||||||
html += ' <div class="tarteaucitronName">';
|
html += ' <div class="tarteaucitronName">';
|
||||||
html += ' <b>' + service.name + '</b><br/>';
|
html += ' <b>' + service.name + '</b><br/>';
|
||||||
html += ' <span id="tacCL' + service.key + '" class="tarteaucitronListCookies"></span><br/>';
|
html += ' <span id="tacCL' + service.key + '" class="tarteaucitronListCookies"></span><br/>';
|
||||||
if(service.readmore !== undefined && service.readmore === false) {
|
var link = 'https://opt-out.ferank.eu/service/' + service.key + '/';
|
||||||
html += ' <a href="https://opt-out.ferank.eu/service/' + service.key + '/" target="_blank" rel="noopener">';
|
if (service.readmoreLink !== undefined && service.readmoreLink !== '') {
|
||||||
html += ' ' + tarteaucitron.lang.more;
|
link = service.readmoreLink;
|
||||||
html += ' </a>';
|
|
||||||
html += ' - ';
|
|
||||||
}
|
}
|
||||||
|
if (tarteaucitron.parameters.readmoreLink !== undefined && tarteaucitron.parameters.readmoreLink !== '') {
|
||||||
|
link = tarteaucitron.parameters.readmoreLink;
|
||||||
|
}
|
||||||
|
html += ' <a href="' + link + '" target="_blank" rel="noopener">';
|
||||||
|
html += ' ' + tarteaucitron.lang.more;
|
||||||
|
html += ' </a>';
|
||||||
|
html += ' - ';
|
||||||
html += ' <a href="' + service.uri + '" target="_blank" rel="noopener">';
|
html += ' <a href="' + service.uri + '" target="_blank" rel="noopener">';
|
||||||
html += ' ' + tarteaucitron.lang.source;
|
html += ' ' + tarteaucitron.lang.source;
|
||||||
html += ' </a>';
|
html += ' </a>';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue