-
-
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.
Ajout des sites L'Humanite, LaMontagne et Le point (#21)
* Ajout du site LaMontagne * Ajout du site L'Humanité * Harmonisations tabs/spaces * Harmonisations tabs/spaces * Ajout du site Le Point Modification Readme pour ajouter L'Humanité, La Montagne et Le Point.
- Loading branch information
1 parent
e241469
commit bf8f4a0
Showing
7 changed files
with
135 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
async function makeEuropresseUrl() { | ||
const keywords = extractKeywords(); | ||
return await makeOphirofoxReadingLink(keywords); | ||
} | ||
|
||
function extractKeywords() { | ||
return document.querySelector("h1").textContent; | ||
} | ||
|
||
async function createLink() { | ||
const a = document.createElement("a"); | ||
a.href = await makeEuropresseUrl(new URL(window.location)); | ||
a.textContent = "Lire sur Europresse"; | ||
|
||
const div = document.createElement("div"); | ||
div.className = "field-name-field-news-auteur ophirofox-europresse"; | ||
|
||
div.appendChild(a); | ||
|
||
return div; | ||
} | ||
|
||
async function onLoad() { | ||
const reserve = document.querySelector(".qiota_reserve"); | ||
if (!reserve) return; | ||
|
||
const auteurElem = document.querySelector(".group-ft-auteur-date-media"); | ||
if (!auteurElem) return; | ||
|
||
auteurElem.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.ophirofox-europresse { | ||
padding: 10px !important; | ||
} |
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,30 @@ | ||
async function makeEuropresseUrl() { | ||
const keywords = extractKeywords(); | ||
return await makeOphirofoxReadingLink(keywords); | ||
} | ||
|
||
function extractKeywords() { | ||
return document.querySelector("h1").textContent; | ||
} | ||
|
||
async function createLink() { | ||
const span = document.createElement("span"); | ||
span.textContent = "Lire sur Europresse"; | ||
span.className = "premium-message ophirofox-europresse"; | ||
|
||
const a = document.createElement("a"); | ||
a.href = await makeEuropresseUrl(new URL(window.location)); | ||
|
||
a.appendChild(span); | ||
|
||
return a; | ||
} | ||
|
||
async function onLoad() { | ||
const reserve = document.querySelector(".premium-message"); | ||
if (!reserve) return; | ||
|
||
reserve.parentElement.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.ophirofox-europresse { | ||
margin-left: 10px; | ||
} |
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,30 @@ | ||
async function makeEuropresseUrl() { | ||
const keywords = extractKeywords(); | ||
return await makeOphirofoxReadingLink(keywords); | ||
} | ||
|
||
function extractKeywords() { | ||
return document.querySelector("h1").textContent; | ||
} | ||
|
||
async function createLink() { | ||
const a = document.createElement("a"); | ||
a.textContent = "Lire sur Europresse"; | ||
a.href = await makeEuropresseUrl(new URL(window.location)); | ||
|
||
const span = document.createElement("span"); | ||
span.className = "ophirofox-europresse"; | ||
|
||
span.appendChild(a); | ||
|
||
return span; | ||
} | ||
|
||
async function onLoad() { | ||
const reserve = document.querySelector(".ArticleHeader > .subscribers-only"); | ||
if (!reserve) return; | ||
|
||
reserve.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