From debefb6f77ed55b446123e42358bdb044a760345 Mon Sep 17 00:00:00 2001 From: Amauri CHAMPEAUX Date: Wed, 22 Dec 2021 11:19:51 +0100 Subject: [PATCH] Add Gallica --- tarteaucitron.services.js | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index 48febf0..61e0d6e 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -5008,7 +5008,7 @@ tarteaucitron.services.archive = { "name": "Internet Archive", "uri": "https://archive.org/about/terms.php", "needConsent": true, - "cookies": ['abtest-identifier','donation-identifier','PHPSESSID','search-inside-XXX'], + "cookies": ['abtest-identifier','donation-identifier'], "js": function () { "use strict"; tarteaucitron.fallback(['archive_player'], function (x) { @@ -5046,3 +5046,35 @@ tarteaucitron.services.archive = { }); } }; + +// Gallica +tarteaucitron.services.gallica = { + "key": "gallica", + "type": "other", + "name": "Gallica", + "uri": "https://gallica.bnf.fr/edit/und/conditions-dutilisation-des-contenus-de-gallica", + "needConsent": true, + "cookies": ['dtCookie', 'dtLatC', 'dtPC', 'dtSa', 'rxVisitor', 'rxvt', 'xtvrn'], + "js": function () { + "use strict"; + tarteaucitron.fallback(['gallica_player'], function (x) { + var src = tarteaucitron.getElemAttr(x, "data-src"), + style = tarteaucitron.getElemAttr(x, "data-style"), + frame; + if (src === undefined) { + return ""; + } + frame = ''; + return frame; + }); + }, + "fallback": function () { + "use strict"; + var id = 'gallica'; + tarteaucitron.fallback(['gallica_player'], function (elem) { + elem.style = elem.getAttribute('data-style'); + return tarteaucitron.engage(id); + }); + } +}; +