-
-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from julessanglier/insa
Ajout du support pour l'INSA Lyon et compléments
- Loading branch information
Showing
5 changed files
with
72 additions
and
8 deletions.
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
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
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 |
---|---|---|
|
@@ -2,4 +2,8 @@ | |
color: black; | ||
margin-left: 7px; | ||
z-index: 10; | ||
} | ||
|
||
#js-message-register{ | ||
display: none; | ||
} |
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,38 @@ | ||
async function makeEuropresseUrl(lemondeUrl) { | ||
const keywords = extractKeywords(); | ||
return await makeOphirofoxReadingLink(keywords); | ||
} | ||
|
||
function extractKeywords() { | ||
return extractKeywordsFromTitle(); | ||
} | ||
|
||
function extractArticleNumber(){ | ||
let url = window.location.pathname; | ||
let parameters = url.split('/'); | ||
return parameters[parameters.length - 1]; | ||
} | ||
|
||
function extractKeywordsFromTitle() { | ||
const titleElem = document.getElementsByClassName("crayon article-titre-" + extractArticleNumber() + " h1")[0].innerHTML; | ||
return titleElem; | ||
} | ||
|
||
async function createLink() { | ||
const a = document.createElement("a"); | ||
a.textContent = "Lire sur Europresse"; | ||
a.className = "btn btn--premium ophirofox-europresse"; | ||
a.href = await makeEuropresseUrl(new URL(window.location)); | ||
return a; | ||
} | ||
|
||
async function onLoad() { | ||
const payArticle = document.querySelector('.promo_dispo_article'); | ||
if (!payArticle) return; | ||
|
||
const actionElem = document.querySelector(".actions-article"); | ||
if (!actionElem) return; | ||
actionElem.appendChild(await createLink()); | ||
} | ||
|
||
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