Merge branch 'Add-Parsedown-Support' of https://gitlab.com/bluekay/shopping-list into Add-Parsedown-Support

This commit is contained in:
Krehan Tim 2018-10-26 11:41:30 +02:00
commit b4e407adc1
3 changed files with 2067 additions and 6 deletions

View file

@ -2,11 +2,12 @@
<script src="/bin/recipe.js" charset="utf-8"></script>
<?php
include $_SESSION["docroot"].'/php/classes.recipe.php';
include $_SESSION["docroot"].'/php/classes.parsedown.php';
$book = new cookbook;
$book->getRecipe($_GET["number"]);
$recipe = $book->sites[0];
echo "<h1 data-recipeid='$recipe->ID'>$recipe->Name</h1>";
echo "<h1 id='recipeHeader' data-recipeid='$recipe->ID'>$recipe->Name</h1>";
echo "<h2>Zutaten</h2>";
echo "<button id='addToListButton' class='button'>Zur Einkaufsliste hinzufügen</button>";
echo "<div id='ingredients'>";
@ -17,9 +18,8 @@
}
echo "</div>";
echo "<h2>Zubereitung</h2>";
foreach(explode("\r\n", $recipe->Beschreibung) as $paragraph){
echo "<p>$paragraph</p>";
}
$parsedown = new Parsedown;
echo $parsedown->text($recipe->Beschreibung);
?>
<div id="editingMenu"></div>
<div id="editingMenuOpen">

1980
php/classes.parsedown.php Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,19 +1,98 @@
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,800');
html {
transition: .6s;
font-family: 'Open Sans', sans-serif;
background-color: #c3c3c3;
}
h1 {
font-size: 3em;
text-align: center;
color: #333;
text-transform: uppercase;
}
h2 {
color: #333;
text-transform: uppercase;
}
h3 {
color: #444;
text-transform: capitalize;
}
h4 {
color: #444;
text-transform: capitalize;
}
h5 {
color: #555;
text-transform: lowercase;
font-weight: normal;
}
h6 {
color: #555;
text-transform: lowercase;
font-weight: normal;
}
table {
border-collapse: collapse;
border: 1px solid black;
margin: 1em 0;
}
th {
background-color: #63bf3c;
color: white;
}
td, th {
/* border: 1px solid black; */
padding: .2em .5em;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
button {
display: block;
border: 1px solid #777777;
padding: .5em 1em;
margin: 1em .25em;
}
pre {
max-height: calc(50vh - 9em);
background: #f4f4f4;
border: 1px solid #ddd;
border-left: 3px solid #a0c391;
color: #666;
page-break-inside: avoid;
font-family: monospace;
font-size: 15px;
line-height: 1.6;
margin-bottom: 1.6em;
max-width: 100%;
overflow: auto;
padding: 1em 1.5em;
display: block;
word-wrap: break-word;
}
.even {
background-color: #000;
}
.odd {
background-color: #5f5f5f;
}
.search {
background-image: url('/pic/search.png');
background-position: 10px 12px;
@ -22,6 +101,7 @@ h1 {
padding: 12px 20px 12px 40px;
border: 1px solid #ddd;
}
.button {
-webkit-appearance: none;
border: none;
@ -33,7 +113,8 @@ h1 {
background-color: #4CAF50;
color: white;
}
.hover:hover {
background-color: #4CAF50;
cursor: pointer;
background-color: #4CAF50;
cursor: pointer;
}