-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
4,414 additions
and
4,481 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
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 |
---|---|---|
@@ -1,9 +1,24 @@ | ||
<?php | ||
/******************************************************************************* | ||
Entête commun pages | ||
Version 20050507 | ||
*******************************************************************************/ | ||
?> | ||
|
||
|
||
|
||
<script src="<?= $RelBasePath ?>communs/tools"></script> | ||
<script> | ||
<? // Utilisation onDomReady https://github.com/tubalmartin/ondomready ?> | ||
onDomReady(writeCSSRespImg); | ||
onDomReady(addPermalinkToHeadings); | ||
</script> | ||
|
||
</head> | ||
|
||
<body> | ||
|
||
|
||
|
||
<? | ||
require_once($RelBasePath . 'communs/menu.inc.php'); | ||
?> |
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
<details id="toc" class="toolbox"> | ||
<details id="toc" class="toolbox" open> | ||
<summary>Table des matières</summary> | ||
<a id="toc-open" onClick="toggleToc()">+</a> | ||
<a id="toc-close" onClick="toggleToc()">X</a> | ||
</details> |
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 |
---|---|---|
@@ -1,70 +1,87 @@ | ||
/*------------------------------------------------------------------------------------------- | ||
Fonctions utilitaires CSS | ||
/!\ à insérer en tête de page /!\ | ||
Version 20140813 | ||
-------------------------------------------------------------------------------------------*/ | ||
|
||
|
||
|
||
|
||
/****************************** | ||
Modifie les images avec l'attribut "data-responsive-img" : | ||
- ajoute le dimensionnement en css | ||
- supprime les attributs width / height du tag img | ||
- ajoute du css pour basculer en width: 98% si le max-device-width est > width + 5 | ||
******************************/ | ||
function writeCSSRespImg() | ||
{ | ||
var elements = document.getElementsByTagName("img"), | ||
image, | ||
width, | ||
height, | ||
cssClassName, | ||
cssClasses, | ||
cssCode, | ||
style, | ||
maxWidth; | ||
for (i = 0; i <= elements.length - 1; i++) { | ||
image = elements[i]; | ||
if (image.hasAttribute("data-responsive-img")) { | ||
// Récup width / height | ||
width = parseInt(image.getAttribute("width")); | ||
height = parseInt(image.getAttribute("height")); | ||
|
||
// Ajoute classe | ||
cssClassName = "responsive-img-" + i; | ||
cssClasses = image.className; | ||
if (cssClasses != "") { | ||
cssClasses += " "; | ||
} else { | ||
cssClasses = ""; | ||
} | ||
cssClasses += cssClassName; | ||
image.className = cssClasses; | ||
|
||
// Ecriture du CSS | ||
cssCode = ""; | ||
style = document.createElement("style"); | ||
maxWidth = width + 5; | ||
cssCode = "\nimg." + cssClassName + "\n\ | ||
{\n\ | ||
width: " + width + "px;\n\ | ||
height: " + height + "px;\n\ | ||
}\n\ | ||
@media screen and (max-device-width: " + maxWidth + "px)\n\ | ||
{\n\ | ||
img." + cssClassName + "\n\ | ||
{\n\ | ||
width: 98%;\n\ | ||
height: auto;\n\ | ||
}\n\ | ||
}\n"; | ||
style.appendChild(document.createTextNode(cssCode)); | ||
document.head.appendChild(style); | ||
|
||
// Suppression des attributs du tag img | ||
image.removeAttribute("width"); | ||
image.removeAttribute("height"); | ||
} | ||
} | ||
} | ||
/*------------------------------------------------------------------------------------------- | ||
Fonctions utilitaires CSS | ||
/!\ à insérer en tête de page /!\ | ||
-------------------------------------------------------------------------------------------*/ | ||
|
||
|
||
|
||
|
||
/****************************** | ||
Modifie les images avec l'attribut "data-responsive-img" : | ||
- ajoute le dimensionnement en css | ||
- supprime les attributs width / height du tag img | ||
- ajoute du css pour basculer en width: 98% si le max-device-width est > width + 5 | ||
******************************/ | ||
function writeCSSRespImg() { | ||
var elements = document.getElementsByTagName("img"), | ||
image, | ||
width, | ||
height, | ||
cssClassName, | ||
cssClasses, | ||
cssCode, | ||
style, | ||
maxWidth; | ||
for (i = 0; i <= elements.length - 1; i++) { | ||
image = elements[i]; | ||
if (image.hasAttribute("data-responsive-img")) { | ||
// Récup width / height | ||
width = parseInt(image.getAttribute("width")); | ||
height = parseInt(image.getAttribute("height")); | ||
|
||
// Ajoute classe | ||
cssClassName = "responsive-img-" + i; | ||
cssClasses = image.className; | ||
if (cssClasses != "") { | ||
cssClasses += " "; | ||
} else { | ||
cssClasses = ""; | ||
} | ||
cssClasses += cssClassName; | ||
image.className = cssClasses; | ||
|
||
// Ecriture du CSS | ||
cssCode = ""; | ||
style = document.createElement("style"); | ||
maxWidth = width + 5; | ||
cssCode = "\nimg." + cssClassName + "\n\ | ||
{\n\ | ||
width: " + width + "px;\n\ | ||
height: " + height + "px;\n\ | ||
}\n\ | ||
@media screen and (max-device-width: " + maxWidth + "px)\n\ | ||
{\n\ | ||
img." + cssClassName + "\n\ | ||
{\n\ | ||
width: 98%;\n\ | ||
height: auto;\n\ | ||
}\n\ | ||
}\n"; | ||
style.appendChild(document.createTextNode(cssCode)); | ||
document.head.appendChild(style); | ||
|
||
// Suppression des attributs du tag img | ||
image.removeAttribute("width"); | ||
image.removeAttribute("height"); | ||
} | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
function addPermalinkToHeadings() { | ||
if (document.querySelector(".permalink")) { | ||
return; | ||
} | ||
|
||
const HEADINGS_SELECTOR = "h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]"; | ||
let headingNodes = document.querySelectorAll(HEADINGS_SELECTOR); | ||
|
||
for (let i = 0; i < headingNodes.length; i++) { | ||
let headingNodeCurrent = headingNodes[i]; | ||
let nodeId = headingNodeCurrent.getAttribute("id"); | ||
headingNodeCurrent.insertAdjacentHTML("beforeend", `<span class="permalink"> <a href="#${nodeId}">#</a></span>`); | ||
} | ||
} | ||
|
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Oops, something went wrong.