File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 11/**
2- * @description create link <a> to BNF mirror
2+ * @description create link <a> to a mirror
33 * @param {string } AUTH_URL_MEDIAPART
4+ * @param {string } name
45 */
5- async function createLink ( AUTH_URL_MEDIAPART ) {
6+ async function createLink ( AUTH_URL_MEDIAPART , name ) {
67 const span = document . createElement ( "span" ) ;
7- span . textContent = "Lire avec BNF" ;
8+ span . textContent = "Lire avec " + name ;
89
910 const a = document . createElement ( "a" ) ;
1011 a . href = new URL ( window . location ) ;
@@ -54,13 +55,13 @@ async function handleMediapart(config) {
5455 if ( ! reserve ) return ;
5556
5657 for ( const balise of reserve ) {
57- balise . appendChild ( await createLink ( config . AUTH_URL_MEDIAPART ) ) ;
58+ balise . appendChild ( await createLink ( config . AUTH_URL_MEDIAPART , config . name ) ) ;
5859 }
5960}
6061
6162/**@description check for users with mediapart access. If yes, create link button */
6263async function onLoad ( ) {
63- const config = await configurationsSpecifiques ( [ "BNF" ] ) ;
64+ const config = await configurationsSpecifiques ( [ "BNF" , "Bibliotheque nationale et universitaire de Strasbourg" ] ) ;
6465 if ( ! config ) return ;
6566 const currentPage = new URL ( window . location ) ;
6667 if ( currentPage . host == config . AUTH_URL_MEDIAPART ) {
Original file line number Diff line number Diff line change 316316 {
317317 "matches" : [
318318 " https://www.mediapart.fr/*" ,
319- " https://www-mediapart-fr.bnf.idm.oclc.org/*"
319+ " https://www-mediapart-fr.bnf.idm.oclc.org/*" ,
320+ " https://www-mediapart-fr.acces-distant.bnu.fr/*"
320321 ],
321322 "js" : [
322323 " content_scripts/config.js" ,
851852 },
852853 {
853854 "name" : " Bibliotheque nationale et universitaire de Strasbourg" ,
854- "AUTH_URL" : " https://acces-distant.bnu.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=bnus"
855+ "AUTH_URL" : " https://acces-distant.bnu.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=bnus" ,
856+ "AUTH_URL_MEDIAPART" : " www-mediapart-fr.acces-distant.bnu.fr"
855857 },
856858 {
857859 "name" : " Bibliotheque municipale de Lyon" ,
You can’t perform that action at this time.
0 commit comments