Commit f2cdb03e authored by Thomas Dennis's avatar Thomas Dennis

Add kana JS code + fix stupid mistakes with document.body.onload in various...

Add kana JS code + fix stupid mistakes with document.body.onload in various files. Also add doxyfile and gitignore.
parent 1d48879f
doc/
\ No newline at end of file
......@@ -2,12 +2,11 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="default.css">
<script src="js/util.js"></script>
<title>naniJSore</title>
</head>
<body>
<div id="navbar" class="custom-navbar custom-header">
<a href="index.html" class="custom-brand">
あ naniJSore
......@@ -19,11 +18,9 @@
<!--<a href="particles.html">Particles</a>-->
<span class="custom-expand"></span>
</div>
<div class="body-content">
<!--yield-->
</div>
<div class="custom-navbar custom-footer">
<a href="index.html">Index</a>
<span class="custom-expand">
......
......@@ -2,12 +2,11 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="default.css">
<script src="js/util.js"></script>
<title>naniJSore</title>
</head>
<body>
<div id="navbar" class="custom-navbar custom-header">
<a href="index.html" class="custom-brand">
あ naniJSore
......@@ -19,7 +18,6 @@
<!--<a href="particles.html">Particles</a>-->
<span class="custom-expand"></span>
</div>
<div class="body-content">
<!--content-->
<h1>Verbs &amp; Adjectives</h1>
......@@ -49,7 +47,6 @@
<a class="jslink" href="#top" onclick="reset()">Restart</a>
<span id="score"></span>
</div>
<script src="js/util.js"></script>
<script src="js/verb_u.js"></script>
<script src="js/verb_eru.js"></script>
<script src="js/adjective_i.js"></script>
......@@ -57,7 +54,6 @@
<script src="js/conjugate.js"></script>
<!--content-->
</div>
<div class="custom-navbar custom-footer">
<a href="index.html">Index</a>
<span class="custom-expand">
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,12 +2,11 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="default.css">
<script src="js/util.js"></script>
<title>naniJSore</title>
</head>
<body>
<div id="navbar" class="custom-navbar custom-header">
<a href="index.html" class="custom-brand">
あ naniJSore
......@@ -19,7 +18,6 @@
<!--<a href="particles.html">Particles</a>-->
<span class="custom-expand"></span>
</div>
<div class="body-content">
<!--content-->
<div class="logo-text">nani<span>JS</span>ore</div>
......@@ -33,7 +31,6 @@
</div>
<!--content-->
</div>
<div class="custom-navbar custom-footer">
<a href="index.html">Index</a>
<span class="custom-expand">
......
/**
@file
@brief Code specific to the conjugate.html page.
*/
"use strict";
// This stores the various question types (stored in other files).
......@@ -190,5 +195,4 @@ function check()
}
// Set "ready" function.
document.onready = setup();
document.body.onload = setup;
/**
@file
@brief Code specific to the kana.html page.
*/
"use strict";
/**
@brief Replace the contents of all kana table cells with hiragana/katakana.
@param katakana_mode True = Switch to katakana, false = Switch to hiragana.
*/
function kana_change(katakana_mode)
{
var kana = document.querySelectorAll(".kana-grid td");
for (var k = 0; k < kana.length; ++k)
{
if (katakana_mode) { kana[k].innerHTML = kana[k].innerHTML.toKatakana(); }
else { kana[k].innerHTML = kana[k].innerHTML.toHiragana(); }
}
}
/**
@brief Initialise everything.
*/
function setup()
{
var hiragana_buttons = document.querySelectorAll(".js-hiragana-button");
for (var i = 0; i < hiragana_buttons.length; ++i)
{ hiragana_buttons[i].onclick = function() { kana_change(false); }; }
var katakana_buttons = document.querySelectorAll(".js-katakana-button");
for (var i = 0; i < katakana_buttons.length; ++i)
{ katakana_buttons[i].onclick = function() { kana_change(true); }; }
}
document.body.onload = setup;
/**
@file
@brief Code specific to the kanji.html page.
*/
"use strict";
/**
......@@ -94,7 +99,7 @@ var KANJI_DICTIONARY = {
}
};
function main()
function setup()
{
var body = document.getElementById("kanji-content");
for (var k in KANJI_DICTIONARY)
......@@ -137,4 +142,4 @@ function main()
}
}
document.body.onload = main;
document.body.onload = setup;
/**
@file
@brief Code specific to the nouns.html page.
*/
"use strict";
// This defines the question set:
......@@ -129,5 +134,4 @@ function check(lang)
}
// Set "ready" function.
document.onready = setup();
document.body.onload = setup;
......@@ -2,12 +2,11 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="default.css">
<script src="js/util.js"></script>
<title>naniJSore</title>
</head>
<body>
<div id="navbar" class="custom-navbar custom-header">
<a href="index.html" class="custom-brand">
あ naniJSore
......@@ -19,7 +18,6 @@
<!--<a href="particles.html">Particles</a>-->
<span class="custom-expand"></span>
</div>
<div class="body-content">
<!--content-->
<h1>Kana - Hiragana and Katakana</h1>
......@@ -54,6 +52,11 @@
TODO: Explain alternative transliteration systems (Hepburn system + Kunrei-shiki) here...
</p>
<div>
<span class="jslink js-hiragana-button">あ Hiragana</span>
<span class="jslink js-katakana-button">ア Katakana</span>
</div>
<h2>Basic Kana (Unvoiced)</h2>
<table class="kana-grid">
......@@ -197,9 +200,9 @@ couple of exceptions to the usual rule:
<p>
How can you tell when they're being used as particles? Context.
</p>
<script src="js/kana.js"></script>
<!--content-->
</div>
<div class="custom-navbar custom-footer">
<a href="index.html">Index</a>
<span class="custom-expand">
......
......@@ -2,12 +2,11 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="default.css">
<script src="js/util.js"></script>
<title>naniJSore</title>
</head>
<body>
<div id="navbar" class="custom-navbar custom-header">
<a href="index.html" class="custom-brand">
あ naniJSore
......@@ -19,7 +18,6 @@
<!--<a href="particles.html">Particles</a>-->
<span class="custom-expand"></span>
</div>
<div class="body-content">
<!--content-->
<h1>Kanji</h1>
......@@ -29,11 +27,9 @@
<div id="kanji-content">
<noscript>Javascript is disabled.</noscript>
</div>
<script src="js/util.js"></script>
<script src="js/kanji.js"></script>
<!--content-->
</div>
<div class="custom-navbar custom-footer">
<a href="index.html">Index</a>
<span class="custom-expand">
......
......@@ -2,12 +2,11 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="default.css">
<script src="js/util.js"></script>
<title>naniJSore</title>
</head>
<body>
<div id="navbar" class="custom-navbar custom-header">
<a href="index.html" class="custom-brand">
あ naniJSore
......@@ -19,7 +18,6 @@
<!--<a href="particles.html">Particles</a>-->
<span class="custom-expand"></span>
</div>
<div class="body-content">
<!--content-->
<div id="noun-content">
......@@ -31,7 +29,6 @@
<script src="js/nouns.js"></script>
<!--content-->
</div>
<div class="custom-navbar custom-footer">
<a href="index.html">Index</a>
<span class="custom-expand">
......
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