New function : convertMarkdown
This commit is contained in:
@ -202,6 +202,19 @@ $(function () {
|
||||
}
|
||||
});
|
||||
|
||||
if (chemin === "/views/function-views/convertMarkdown.php" && localStorage.getItem('convertedHTML') && localStorage.getItem('texteMarkdown')) {
|
||||
$('.results').html(localStorage.getItem('convertedHTML'));
|
||||
$('#texteMarkdown').val(localStorage.getItem('texteMarkdown'));
|
||||
}
|
||||
|
||||
$("#texteMarkdown").bind("keyup change", () => {
|
||||
const textMarkdown = $('#texteMarkdown').val();
|
||||
const convertedHTML = marked(textMarkdown);
|
||||
localStorage.setItem("convertedHTML", convertedHTML);
|
||||
localStorage.setItem("texteMarkdown", textMarkdown);
|
||||
$('.results').html(convertedHTML);
|
||||
});
|
||||
|
||||
/* Changement du texte accueil (exemples de fonction) */
|
||||
if(chemin === "/" || chemin === '/index.php') {
|
||||
let index=-1;
|
||||
|
@ -19,6 +19,7 @@ texteFonctionChange = [
|
||||
'<a href="/views/function-views/convertRomanArabicNumbers.php">convertir des nombres arabes en nombres romains</a>',
|
||||
`<a href="/views/function-views/armstrongNumber.php">vérifier si un nombre fait partie des nombres d'Armstrong</a>`,
|
||||
`<a href="/views/function-views/heapAlgorithm.php">génèrer toutes les permutations uniques possibles d'une chaîne de caractère</a>`,
|
||||
'<a href="/views/function-views/convertMarkdown.php">convertir du Markdown en HTML</a>',
|
||||
'<a href="/views/function-views/weatherRequest.php">connaître la météo</a>'
|
||||
];
|
||||
|
||||
|
Reference in New Issue
Block a user