Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfc8df5b

Browse files
Merge pull request#115 from CoderDojoPotsdam/refactoring
refactor tutorial
2 parents6aed2d8 +058c263 commitfc8df5b

File tree

3 files changed

+67
-78
lines changed

3 files changed

+67
-78
lines changed

‎404.html‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
---
2-
layout: default
3-
title: 404page
4-
permalink: /404.html
5-
---
6-
<h1>Whoops! Could not find that page.</h1>
7-
<p>Sorry this page has been renamed, please find it in the tutorial =(</p>
8-
<ahref="https://coderdojopotsdam.github.io/regex-tutorial">tutorial link</a>
1+
---
2+
layout: default
3+
title: 404page
4+
permalink: /404.html
5+
---
6+
<h1>Whoops! Could not find that page.</h1>
7+
<p>Sorry this page has been renamed, please find it in the tutorial =(</p>
8+
<ahref="https://coderdojopotsdam.github.io/regex-tutorial">tutorial link</a>

‎_layouts/tutorial.html‎

Lines changed: 53 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<scripttype="text/javascript"async=""src="../js/requirements.js"></script>
99
<scripttype="text/javascript"async=""src="../js/compatibility.js"></script>
1010
<scripttype="text/javascript"async=""src="../js/languages.js"></script>
11+
<scripttype="text/javascript"async=""src="../js/switch-language.js"></script>
1112
<linktype="text/css"rel="stylesheet"href="../css/tutorial.css"media="screen"/>
1213
<linktype="text/css"rel="stylesheet"href="../css/playfield.css"media="screen"/>
1314
<linktype="text/css"rel="stylesheet"href="../css/quiz.css"media="screen"/>
@@ -67,88 +68,70 @@
6768
<body>
6869
<header>
6970
<divclass="progress">
70-
{% assign same_topic_started = false %}
71-
{% assign should_assign_next = false %}
72-
{% assign has_next_page = false %}
73-
{% assign step_index = 0 %}
74-
{% assign next_page = nil %}
75-
{% for p in site.pages %}
76-
{% assign file_name = page.path | split: "/" %}
77-
{% assign file_name = file_name[1] %}
78-
79-
{% assign p_file_name = p.path | split: "/" %}
80-
{% assign p_file_name = p_file_name[1] %}
81-
82-
{% assign topic = file_name | split: "-" | first %}
83-
{% assign p_topic = p_file_name | split: "-" | first %}
84-
85-
{% if p.lang == page.lang %}
86-
{% assign step_index = step_index | plus: 1 %}
87-
{% if p_topic == topic and same_topic_started == false %}
71+
{%- assign same_topic_started = false %}
72+
{%- assign should_assign_next = false %}
73+
{%- assign has_next_page = false %}
74+
{%- assign step_index = 0 %}
75+
{%- assign next_page = nil %}
76+
{%- for p in site.pages %}
77+
{%- assign file_name = page.path | split: "/" %}
78+
{%- assign file_name = file_name[1] %}
79+
80+
{%- assign p_file_name = p.path | split: "/" %}
81+
{%- assign p_file_name = p_file_name[1] %}
82+
83+
{%- assign topic = file_name | split: "-" | first %}
84+
{%- assign p_topic = p_file_name | split: "-" | first %}
85+
86+
{%- if p.lang == page.lang %}
87+
{%- assign step_index = step_index | plus: 1 %}
88+
{%- if p_topic == topic and same_topic_started == false %}
8889
<divclass="same-topic">
89-
{% assign same_topic_started = true %}
90-
{% endif %}
91-
{% if p_topic != topic and same_topic_started == true %}
90+
{%- assign same_topic_started = true %}
91+
{%- endif %}
92+
{%- if p_topic != topic and same_topic_started == true %}
9293
</div>
93-
{% assign same_topic_started = false %}
94-
{% endif %}
95-
<aid="page-{{ p.path }}"class="step {% if page == p %}current{% endif %}"href="..{{ p.url }}">{% if page == p %}{{ step_index }}{% endif %}</a>
96-
{% if should_assign_next %}
97-
{% assign should_assign_next = false %}
98-
{% assign has_next_page = true %}
99-
{% assign next_page = p %}
100-
{% endif %}
101-
{% if page == p %}
102-
{% assign should_assign_next = true %}
103-
{% endif %}
104-
{% endif %}
105-
{% endfor %}
106-
{% if same_topic_started %}
94+
{%- assign same_topic_started = false %}
95+
{%- endif %}
96+
<aid="page-{{ p.path }}"class="step {% if page == p %}current{% endif %}"href="..{{ p.url }}">{%- if page == p %}{{ step_index }}{% endif %}</a>
97+
{%- if should_assign_next %}
98+
{%- assign should_assign_next = false %}
99+
{%- assign has_next_page = true %}
100+
{%- assign next_page = p %}
101+
{%- endif %}
102+
{%- if page == p %}
103+
{%- assign should_assign_next = true %}
104+
{%- endif %}
105+
{%- endif %}
106+
{%- endfor %}
107+
{%- if same_topic_started %}
107108
</div>
108-
{% endif %}
109+
{%- endif %}
109110
</div>
110111
<h2>{{ page.title | escape }}</h2>
111112
</header>
112113
<divclass="main">
113114
{{ content }}
114-
{% if has_next_page %}
115+
{%- if has_next_page %}
115116
<ahref="..{{ next_page.url }}"class="next-page">{{ site.data.localization.footer.nextStep[page.lang] }}</a>
116-
{% endif %}
117+
{%- endif %}
117118
</div>
118119
<footer>
119-
<divclass ="languageFooterMenu">
120+
<divclass="languageFooterMenu">
120121
<selectid="languageMenu"onchange="changeLanguage()">
121-
122-
{% assign languagesArray = 'English,Deutsch,Svenska' | split: ',' %}
123-
124-
{% for language in languagesArray %}
125-
{% assign lang = language | slice: 0, 2 | downcase %}
126-
{{ lang }}
127-
{{ page.lang }}
128-
{% if lang == page.lang %}
129-
<optionid =page.langselectedhref="..{{page.url}}"value="{{ page.url | remove:".html"}}">{{language}}</option>
130-
{% endif %}
131-
{% if lang != page.lang %}
132-
<optionid = "{{lang}}"href="..{{page.url | replace: page.lang, lang}}"value="{{ page.url | remove:".html" | replace: page.lang, lang}}">{{language}}</option>
133-
{% endif %}
134-
{% endfor %}
122+
{%- assign languagesArray = 'English,Deutsch,Svenska' | split: ',' %}
123+
{%- for language in languagesArray %}
124+
{%- assign lang = language | slice: 0, 2 | downcase %}
125+
{%- if lang == page.lang %}
126+
<optionid="{{lang}}"selectedhref="..{{page.url}}">{{language}}</option>
127+
{%- endif %}
128+
{%- if lang != page.lang %}
129+
<optionid="{{lang}}"href="..{{page.url | replace: page.lang, lang}}">{{language}}</option>
130+
{%- endif %}
131+
{%- endfor %}
135132
</select>
136-
137133
<script>
138-
functionchangeLanguage(){
139-
vargetLanguageMenu=document.getElementById('languageMenu');
140-
vargetLanguageHref=getLanguageMenu.options[getLanguageMenu.selectedIndex].getAttribute('href');
141-
window.location.assign(getLanguageHref);
142134

143-
}
144-
</script>
145-
<scriptsrc="http://code.jquery.com/jquery-3.2.1.min.js"></script>
146-
<script>
147-
$(document).ready(function(){
148-
$("select").each(function(){
149-
$(this).val($(this).find('option[selected]').val());
150-
});
151-
});
152135
</script>
153136
</div>
154137
<divclass="links">
@@ -162,10 +145,10 @@ <h2>{{ page.title | escape }}</h2>
162145
<imgalt="Creative Commons Lizenzvertrag"style="border-width:0"src="../img/cc-by-sa.png"/>
163146
</a>
164147
{{ site.data.localization.license[page.lang] }}
165-
{% assign lowercase_content = content | downcase %}
166-
{% if lowercase_content contains "<img" %}
148+
{%- assign lowercase_content = content | downcase %}
149+
{%- if lowercase_content contains "<img" %}
167150
{{ site.data.localization.licenseImage[page.lang] }}
168-
{% endif %}
151+
{%- endif %}
169152
</div>
170153
</footer>
171154
</body>

‎js/switch-language.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
functionchangeLanguage(){
2+
vargetLanguageMenu=document.getElementById('languageMenu');
3+
vargetLanguageHref=getLanguageMenu.options[getLanguageMenu.selectedIndex].getAttribute('href');
4+
window.location.assign(getLanguageHref);
5+
}
6+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp