Skip to content

Commit 75b3c73

Browse files
committed
Python Materialien aus Markdown laden
1 parent a87321b commit 75b3c73

File tree

4 files changed

+131
-273
lines changed

4 files changed

+131
-273
lines changed

css/coderdojoka.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,18 @@ li {
4141
}
4242
}
4343

44+
td, th {
45+
font-size: 18px;
46+
}
47+
48+
4449
p {
4550
margin: 0 0 25px;
4651
font-size: 18px;
4752
line-height: 1.5;
4853
}
4954

55+
5056
@media (min-width: 768px) {
5157
p {
5258
margin: 0 0 35px;

css/material.css

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,51 @@
1+
/*
2+
Damit die Bilder, auch automatisch generierte 'responsive' sind.
3+
*/
4+
img {
5+
max-width: 100%;
6+
height: auto;
7+
}
8+
9+
hr {
10+
margin: 100px 0;
11+
}
12+
13+
table.markdown {
14+
margin: 0 auto;
15+
border: solid 1px #ddd;
16+
table-layout: auto;
17+
margin-bottom: 5em;
18+
}
19+
20+
table.markdown thead tr th,
21+
table.markdown tfoot tr th,
22+
table.markdown tfoot tr td,
23+
table.markdown tbody tr th,
24+
table.markdown tbody tr td,
25+
table.markdown tr td {
26+
display: table-cell;
27+
line-height: 1.5rem;
28+
}
29+
30+
table.markdown tbody tr:nth-child(odd) {
31+
background-color: #e5e5e5;
32+
}
33+
34+
table.markdown tr th,
35+
table.markdown tr td {
36+
color: #222;
37+
text-align: left;
38+
padding: .5em 5px;
39+
line-height: 1.5;
40+
}
41+
142
#lang_chooser {
243
margin: 0 auto 100px;
344
}
445

5-
.lang_con{
46+
.lang_con {
647
cursor: pointer;
7-
font-size: 20pt;
48+
font-size: 18pt !important;
849
padding: 1px;
950
margin: 5px;
1051
height: 200px;
@@ -14,12 +55,12 @@
1455
box-shadow: 2px 2px 5px silver;
1556
}
1657

17-
.lang_con:hover{
58+
.lang_con:hover {
1859
background-color: #ffb400;
1960
border: 2px solid gray;
2061
}
2162

22-
.active_lang{
63+
.active_lang {
2364
border: 2px solid gray;
2465
background-color: rgba(255, 180, 0, 0.33);
2566
}
@@ -35,23 +76,23 @@
3576
height: 150px;
3677
}
3778

38-
.language_section{
79+
.language_section {
3980
padding-top: 75px;
4081
}
4182

4283
@media (max-width: 767px) {
4384

44-
.lang_con{
85+
.lang_con {
4586
width: 100px;
4687
height: 100px;
4788
}
4889

49-
.lang_con > div{
90+
.lang_con > div {
5091
height: 90px;
5192
margin: 1px auto;
5293
}
5394

54-
.lang_con > div img{
95+
.lang_con > div img {
5596
height: 90px;
5697
}
5798

js/coderdojoka.js

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,37 @@ function collapseNavbar() {
1616
$(window).scroll(collapseNavbar);
1717
$(document).ready(collapseNavbar);
1818

19+
var MarkdownLoader = {
20+
21+
converter: new showdown.Converter({tables: true}),
22+
23+
load_md: function (selector, url) {
24+
25+
var $container = $(selector);
26+
$container.empty().append("Lade Inhalt. Bitte warten...");
27+
28+
$.get(url).done(function (data) {
29+
var html = MarkdownLoader.converter.makeHtml(data);
30+
$container.empty().append(html);
31+
$container.find("table").addClass("markdown");
32+
33+
}).fail(function (a, b) {
34+
$container.empty().append("Der Inhalt konnte nicht geladen werden :(");
35+
console.log(a, b)
36+
});
37+
}
38+
};
39+
40+
1941
// jQuery for page scrolling feature - requires jQuery Easing plugin
2042
function scroll_to(target) {
2143
$('html, body').stop().animate({
2244
scrollTop: $(target).offset().top
2345
}, 1500, 'easeInOutExpo');
2446
}
2547

26-
$(function() {
27-
$('a.page-scroll').bind('click', function(event) {
48+
$(function () {
49+
$('a.page-scroll').bind('click', function (event) {
2850
var $anchor = $(this);
2951
var target = $anchor.attr('href');
3052
scroll_to(target);
@@ -33,18 +55,18 @@ $(function() {
3355
});
3456

3557
// Closes the Responsive Menu on Menu Item Click
36-
$('.navbar-collapse ul li a').click(function() {
58+
$('.navbar-collapse ul li a').click(function () {
3759
$('.navbar-toggle:visible').click();
3860
});
39-
40-
$('.navbar-nav > li.dropdown.hidden-xs').hover(function() {
41-
$('ul.dropdown-menu', this).stop(true, true).slideDown('fast');
42-
$(this).addClass('open');
43-
},
44-
function() {
45-
$('ul.dropdown-menu', this).stop(true, true).slideUp('fast');
46-
$(this).removeClass('open');
47-
});
61+
62+
$('.navbar-nav > li.dropdown.hidden-xs').hover(function () {
63+
$('ul.dropdown-menu', this).stop(true, true).slideDown('fast');
64+
$(this).addClass('open');
65+
},
66+
function () {
67+
$('ul.dropdown-menu', this).stop(true, true).slideUp('fast');
68+
$(this).removeClass('open');
69+
});
4870

4971

5072
// Google Maps Scripts

0 commit comments

Comments
 (0)