convert Extras

parent a4e35a00
--- ---
layout: page
title: About title: About
--- ---
{% include carpentries.html %}
TODO
{% include links.md %} {% include links.md %}
--- ---
layout: page
title: Figures title: Figures
--- ---
...@@ -6,17 +7,17 @@ title: Figures ...@@ -6,17 +7,17 @@ title: Figures
<script> <script>
window.onload = function() { window.onload = function() {
var lesson_episodes = [ var lesson_modules = [
{% for episode in site.episodes %} {% for module in site.modules %}
"{{ episode.url }}"{% unless forloop.last %},{% endunless %} "{{ module.url }}"{% unless forloop.last %},{% endunless %}
{% endfor %} {% endfor %}
]; ];
var xmlHttp = []; /* Required since we are going to query every episode. */ var xmlHttp = []; /* Required since we are going to query every episode. */
for (i=0; i < lesson_episodes.length; i++) { for (i=0; i < lesson_modules.length; i++) {
xmlHttp[i] = new XMLHttpRequest(); xmlHttp[i] = new XMLHttpRequest();
xmlHttp[i].episode = lesson_episodes[i]; /* To enable use this later. */ xmlHttp[i].module = lesson_modules[i]; /* To enable use this later. */
xmlHttp[i].onreadystatechange = function() { xmlHttp[i].onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) { if (this.readyState == 4 && this.status == 200) {
...@@ -24,7 +25,7 @@ title: Figures ...@@ -24,7 +25,7 @@ title: Figures
var htmlDoc = parser.parseFromString(this.responseText,"text/html"); var htmlDoc = parser.parseFromString(this.responseText,"text/html");
var htmlDocArticle = htmlDoc.getElementsByTagName("article")[0]; var htmlDocArticle = htmlDoc.getElementsByTagName("article")[0];
var article_here = document.getElementById(this.episode); var article_here = document.getElementById(this.module);
var images = htmlDocArticle.getElementsByTagName("img"); var images = htmlDocArticle.getElementsByTagName("img");
if (images.length > 0) { if (images.length > 0) {
...@@ -52,17 +53,17 @@ title: Figures ...@@ -52,17 +53,17 @@ title: Figures
} }
} }
} }
episode_url = "{{ relative_root_path }}" + lesson_episodes[i]; module_url = "{{ relative_root_path }}" + lesson_modules[i];
xmlHttp[i].open("GET", episode_url); xmlHttp[i].open("GET", module_url);
xmlHttp[i].send(null); xmlHttp[i].send(null);
} }
} }
</script> </script>
{% comment %} {% comment %}
Create anchor for each one of the episodes. Create anchor for each one of the modules.
{% endcomment %} {% endcomment %}
{% for episode in site.episodes %} {% for module in site.modules %}
<article id="{{ episode.url }}" class="figures"></article> <article id="{{ module.url }}" class="figures"></article>
{% endfor %} {% endfor %}
{% include links.md %} {% include links.md %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment