-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BNF only : accès à pressreader (#287)
- Loading branch information
1 parent
c47a808
commit b12416b
Showing
3 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.ophirofox-europresse { | ||
visibility: visible !important; | ||
position: fixed; | ||
text-align: center; | ||
width: 100%; | ||
top: 0px; | ||
left: 0px; | ||
z-index: 50; | ||
} | ||
.ophirofox-europresse > a { | ||
color: #fff !important; | ||
padding: 1px 20px; | ||
font-weight: 600; | ||
background-color: #2bc48c; | ||
border-radius: 25px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
async function createLink(AUTH_URL) { | ||
const div = document.createElement("div"); | ||
div.className = "ophirofox-europresse" | ||
const a = document.createElement("a"); | ||
a.textContent = "Cliquez pour lire avec BNF" | ||
var newUrl = new URL(window.location);//current page | ||
newUrl.host = AUTH_URL //change only the domain name | ||
a.href = newUrl; | ||
|
||
div.appendChild(a); | ||
return div; | ||
} | ||
|
||
/** | ||
* @description website navigation without window reload. | ||
*/ | ||
async function onLoad() { | ||
const config = await configurationsSpecifiques(['BNF']) | ||
if(!config) return; | ||
//too much js dom updates everywere to choose a more specific DOM.element. | ||
const element = document.querySelector('body'); | ||
if (!element) return; | ||
element.insertAdjacentElement('beforeend', await createLink(config.AUTH_URL_PRESSREADER)); | ||
} | ||
|
||
onLoad().catch(console.error) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters