Skip to content

Commit

Permalink
added a navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
danieltanfh95 committed Sep 30, 2015
1 parent e77edee commit 4a91331
Show file tree
Hide file tree
Showing 14 changed files with 72 additions and 17 deletions.
1 change: 1 addition & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
start nodemon ./bin/www
start jade -w ./views -o ./public
6 changes: 4 additions & 2 deletions public/category.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html><html><head><title>Baka Tsuki API</title><link rel="stylesheet" href="/stylesheets/bootstrap.min.css"><link rel="stylesheet" href="/stylesheets/style.css"><link rel="stylesheet" href="/stylesheets/jquery.jsonview.css"></head><body><div class="toc"><p>Table of Contents</p><ul><li> <a href="#TLS">Type and Language Search</a></li><li><a href="#Example_Type">JSON example for type parameter only</a></li><li><a href="#Example_Language">JSON example for language parameter only</a></li><li><a href="#Example_Both">JSON example for type and langauge parameter</a></li></ul></div><div id="TLS"><h3>Type and Language Search</h3><h5>route: "/api/category"</h5><h5>return: JSON</h5><h5>format: /api/category?[type={type_of_title}][language={type_of_language}]</h5><br><h4> <u>Filter Parameters</u></h4><h5>By type (Optional)</h5><a href="/api/category?type=LIGHT_NOVEL">/api/category?type=LIGHT_NOVEL</a><p>
<!DOCTYPE html><html><head><title>Baka Tsuki API</title><link rel="stylesheet" href="/stylesheets/bootstrap.min.css"><link rel="stylesheet" href="/stylesheets/style.css"><link rel="stylesheet" href="/stylesheets/jquery.jsonview.css"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"></head><body><nav style="height:50px;" class="navbar navbar-default navbar-fixed-top"><div class="container-fluid"><div class="navbar-header"><button type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" class="navbar-toggle collapsed"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="#" class="navbar-brand">Home</a></div><div class="collapse navbar-collapse"><ul class="nav navbar-nav"><li><a href="https://github.com/Shadowys/btapi" data-toggle="tooltip" data-placement="right" title="" data-original-title="Source code here!"><i class="fa fa-github fa-2x"> </i></a></li><li><a href="https://www.baka-tsuki.org/forums/viewtopic.php?f=84&amp;t=10959" data-toggle="tooltip" data-placement="right" title="" data-original-title="Share your thoughts"><i class="fa fa-commenting fa-2x"> </i></a></li></ul><ul class="nav navbar-nav navbar-right"><li><a href="#">Top</a></li></ul></div></div></nav><div id="toc"><p>Table of Contents</p><ul><li> <a href="#TLS">Type and Language Search</a></li><li><a href="#Example_Type">JSON example for type parameter only</a></li><li><a href="#Example_Language">JSON example for language parameter only</a></li><li><a href="#Example_Both">JSON example for type and langauge parameter</a></li></ul></div><div id="TLS"><h3>Type and Language Search</h3><h5>route: "/api/category"</h5><h5>return: JSON</h5><h5>format: /api/category?[type={type_of_title}][language={type_of_language}]</h5><br><h4> <u>Filter Parameters</u></h4><h5>By type (Optional)</h5><a href="/api/category?type=LIGHT_NOVEL">/api/category?type=LIGHT_NOVEL</a><p>
Either parameter may be present. Current available types includes: <b>LIGHT_NOVEL, TEASER, ORIGINAL_NOVEL. </b>It is <b>case insensitive.</b></p><h5>By language (Optional)</h5><a href="/api/category?type=ENGLISH">/api/category?language=ENGLISH</a><p>
Either parameter may be present. Language must be given in it's english name.<b>english name. </b>It is <b>case insensitive.</b></p><br><h4> <u>JSON properties</u></h4><p>There are different responses for different parameter combinations.</p><div id="Example_Type" class="row"><div class="col-md-7"> <h5>Type</h5><p>(JSON) Shows the language available for that particular type.</p><ul> <li> <h5>type</h5><p>
(STRING) type of title, e.g. <b>Light_novel, teaser, Original_novel.</b></p></li><li> <h5>language</h5><p>
Expand All @@ -10,7 +10,9 @@
(STRING) type of the titles</p></li><li> <h5>language</h5><p>
(LIST) language of the titles</p></li><li> <h5>titles</h5><p>
(LIST) JSON data of the titles<ul><li> <h5>title</h5><p>(STRING) title name of the book</p></li><li> <h5>page</h5><p>(STRING) interwiki main page title of the book.</p></li><li> <h5>lastreviseddate</h5><p>(STRING) The data and time of the last revision, in UTC+0.</p></li><li> <h5>lastrevisedid</h5><p>(NUMBER) the unique id of the last revison.</p></li><li> <h5>pageid</h5><p>(NUMBER) the unique id of the main page of the book</p></li></ul></p></li></ul></div><div class="col-md-5"><h4>
Example response using </h4><a href="/api/category?type=LIGHT_NOVEL&amp;language=ARABIC"><code>/api/category?type=LIGHT_NOVEL&language=ARABIC</code></a><div id="json_display_3"></div></div></div></div><script src="javascripts/jquery-2.1.1.js"></script><script src="javascripts/jquery.jsonview.js"></script><script>$(document).ready(function() {
Example response using </h4><a href="/api/category?type=LIGHT_NOVEL&amp;language=ARABIC"><code>/api/category?type=LIGHT_NOVEL&language=ARABIC</code></a><div id="json_display_3"></div></div></div></div><script src="javascripts/jquery-2.1.1.js"></script><script src="javascripts/bootstrap.min.js"></script><script src="javascripts/jquery.jsonview.js"></script><script>$(document).ready(function () {
$("[data-toggle='tooltip']").tooltip();
});</script><script>$(document).ready(function() {
$('#json_display_1').JSONView(data_1).JSONView('toggle',1);
$('#json_display_2').JSONView(data_2)
$('#json_display_3').JSONView(data_3);
Expand Down
6 changes: 4 additions & 2 deletions public/genre.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<!DOCTYPE html><html><head><title>Baka Tsuki API</title><link rel="stylesheet" href="/stylesheets/bootstrap.min.css"><link rel="stylesheet" href="/stylesheets/style.css"><link rel="stylesheet" href="/stylesheets/jquery.jsonview.css"></head><body><div class="toc"><p>Table of Contents</p><ul><li> <a href="#GS">Genre Search</a></li><li> <a href="#Example">JSON example</a></li></ul></div><h3 id="GS">Genre Search</h3><h5>route: "/api/genre"</h5><h5>return: JSON</h5><h5>format: /api/genre?list={list_of_genres}</h5><br><h4> <u>Filter Parameters</u></h4><h5>By list</h5><a href="/api?list=action|romance">/api?title=Zero_no_Tsukaima </a><p>
<!DOCTYPE html><html><head><title>Baka Tsuki API</title><link rel="stylesheet" href="/stylesheets/bootstrap.min.css"><link rel="stylesheet" href="/stylesheets/style.css"><link rel="stylesheet" href="/stylesheets/jquery.jsonview.css"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"></head><body><nav style="height:50px;" class="navbar navbar-default navbar-fixed-top"><div class="container-fluid"><div class="navbar-header"><button type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" class="navbar-toggle collapsed"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="#" class="navbar-brand">Home</a></div><div class="collapse navbar-collapse"><ul class="nav navbar-nav"><li><a href="https://github.com/Shadowys/btapi" data-toggle="tooltip" data-placement="right" title="" data-original-title="Source code here!"><i class="fa fa-github fa-2x"> </i></a></li><li><a href="https://www.baka-tsuki.org/forums/viewtopic.php?f=84&amp;t=10959" data-toggle="tooltip" data-placement="right" title="" data-original-title="Share your thoughts"><i class="fa fa-commenting fa-2x"> </i></a></li></ul><ul class="nav navbar-nav navbar-right"><li><a href="#">Top</a></li></ul></div></div></nav><div id="toc"><p>Table of Contents</p><ul><li> <a href="#GS">Genre Search</a></li><li> <a href="#Example">JSON example</a></li></ul></div><h3 id="GS">Genre Search</h3><h5>route: "/api/genre"</h5><h5>return: JSON</h5><h5>format: /api/genre?list={list_of_genres}</h5><br><h4> <u>Filter Parameters</u></h4><h5>By list</h5><a href="/api?list=action|romance">/api?title=Zero_no_Tsukaima </a><p>
This parameter <b>must be present </b>to continue. The values are separated by a <b>pipe ("|")</b>character. It is <b>case-insensitive.</b></p><br><h4> <u>JSON properties</u></h4><div id="Example" class="row"><div class="col-md-7"><h5>genres</h5><p>(STRING) The list of genres that have been queried.</p><h5>titles</h5><p>(LIST) JSON data of the titles.</p><ul><li> <h5>title</h5><p>(STRING) title name of the book</p></li><li> <h5>page</h5><p>(STRING) interwiki main page title of the book.</p></li><li> <h5>lastreviseddate</h5><p>(STRING) The data and time of the last revision, in UTC+0.</p></li><li> <h5>lastrevisedid</h5><p>(NUMBER) the unique id of the last revison.</p></li><li> <h5>pageid</h5><p>(NUMBER) the unique id of the main page of the book</p></li></ul></div><div class="col-md-5"><h4>
Example response using </h4><a href="/api/genre?list=shoujo|comedy"></a><code>/api/genre?list=shoujo|comedy</code><div id="json_display"></div></div></div><script src="javascripts/jquery-2.1.1.js"></script><script src="javascripts/jquery.jsonview.js"></script><script>$(document).ready(function() {
Example response using </h4><a href="/api/genre?list=shoujo|comedy"></a><code>/api/genre?list=shoujo|comedy</code><div id="json_display"></div></div></div><script src="javascripts/jquery-2.1.1.js"></script><script src="javascripts/bootstrap.min.js"></script><script src="javascripts/jquery.jsonview.js"></script><script>$(document).ready(function () {
$("[data-toggle='tooltip']").tooltip();
});</script><script>$(document).ready(function() {
$('#json_display').JSONView(data);
});
data={"genres":["shoujo","comedy"],"titles":{"2974":{"page":"Ghost_Hunt","title":"Ghost Hunt","lastreviseddate":"2015-09-18T00:36:56Z","pageid":2974}}};</script></body></html>
6 changes: 4 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!DOCTYPE html><html><head><title>Baka Tsuki API</title><link rel="stylesheet" href="/stylesheets/bootstrap.min.css"><link rel="stylesheet" href="/stylesheets/style.css"><link rel="stylesheet" href="/stylesheets/jquery.jsonview.css"></head><body><a href="https://github.com/Shadowys/btapi"><h2>Baka Tsuki API</h2></a><h5>
<!DOCTYPE html><html><head><title>Baka Tsuki API</title><link rel="stylesheet" href="/stylesheets/bootstrap.min.css"><link rel="stylesheet" href="/stylesheets/style.css"><link rel="stylesheet" href="/stylesheets/jquery.jsonview.css"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"></head><body><nav style="height:50px;" class="navbar navbar-default navbar-fixed-top"><div class="container-fluid"><div class="navbar-header"><button type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" class="navbar-toggle collapsed"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="#" class="navbar-brand">Home</a></div><div class="collapse navbar-collapse"><ul class="nav navbar-nav"><li><a href="https://github.com/Shadowys/btapi" data-toggle="tooltip" data-placement="right" title="" data-original-title="Source code here!"><i class="fa fa-github fa-2x"> </i></a></li><li><a href="https://www.baka-tsuki.org/forums/viewtopic.php?f=84&amp;t=10959" data-toggle="tooltip" data-placement="right" title="" data-original-title="Share your thoughts"><i class="fa fa-commenting fa-2x"> </i></a></li></ul><ul class="nav navbar-nav navbar-right"><li><a href="#">Top</a></li></ul></div></div></nav><a href="https://github.com/Shadowys/btapi"><h2>Baka Tsuki API</h2></a><h5>
Welcome to the new <b>REST API </b>centre. I'm planning to cleanup the current API provided by mediawiki
so that there would be a unified API for accessing Baka Tsuki data.</h5><p>The API always returns JSON and is based on filtering.</p><br><p>Click the links below to get started</p><a href="/series.html"><h4>Light Novel Search </h4></a><a href="/category.html"><h4>Type and Language Search </h4></a><a href="/time.html"><h4>Time and Revision Search </h4></a><a href="/genre.html"><h4>Genre Search</h4></a><br><p>Help needed : documentation cleanup </p><script src="javascripts/jquery-2.1.1.js"></script><script src="javascripts/jquery.jsonview.js"></script></body></html>
so that there would be a unified API for accessing Baka Tsuki data.</h5><p>The API always returns JSON and is based on filtering.</p><br><p>Click the links below to get started</p><a href="/series.html"><h4>Light Novel Search </h4></a><a href="/category.html"><h4>Type and Language Search </h4></a><a href="/time.html"><h4>Time and Revision Search </h4></a><a href="/genre.html"><h4>Genre Search</h4></a><br><p>Help needed : documentation cleanup </p><script src="javascripts/jquery-2.1.1.js"></script><script src="javascripts/bootstrap.min.js"></script><script src="javascripts/jquery.jsonview.js"></script><script>$(document).ready(function () {
$("[data-toggle='tooltip']").tooltip();
});</script></body></html>
6 changes: 6 additions & 0 deletions public/javascripts/bootstrap.min.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion public/layout.html
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
<!DOCTYPE html><html><head><title>Baka Tsuki API</title><link rel="stylesheet" href="/stylesheets/bootstrap.min.css"><link rel="stylesheet" href="/stylesheets/style.css"><link rel="stylesheet" href="/stylesheets/jquery.jsonview.css"></head><body><script src="javascripts/jquery-2.1.1.js"></script><script src="javascripts/jquery.jsonview.js"></script></body></html>
<!DOCTYPE html><html><head><title>Baka Tsuki API</title><link rel="stylesheet" href="/stylesheets/bootstrap.min.css"><link rel="stylesheet" href="/stylesheets/style.css"><link rel="stylesheet" href="/stylesheets/jquery.jsonview.css"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"></head><body><nav style="height:50px;" class="navbar navbar-default navbar-fixed-top"><div class="container-fluid"><div class="navbar-header"><button type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" class="navbar-toggle collapsed"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="#" class="navbar-brand">Home</a></div><div class="collapse navbar-collapse"><ul class="nav navbar-nav"><li><a href="https://github.com/Shadowys/btapi" data-toggle="tooltip" data-placement="right" title="" data-original-title="Source code here!"><i class="fa fa-github fa-2x"> </i></a></li><li><a href="https://www.baka-tsuki.org/forums/viewtopic.php?f=84&amp;t=10959" data-toggle="tooltip" data-placement="right" title="" data-original-title="Share your thoughts"><i class="fa fa-commenting fa-2x"> </i></a></li></ul><ul class="nav navbar-nav navbar-right"><li><a href="#">Top</a></li></ul></div></div></nav><script src="javascripts/jquery-2.1.1.js"></script><script src="javascripts/bootstrap.min.js"></script><script src="javascripts/jquery.jsonview.js"></script><script>$(document).ready(function () {
$("[data-toggle='tooltip']").tooltip();
});</script></body></html>
6 changes: 4 additions & 2 deletions public/series.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html><html><head><title>Baka Tsuki API</title><link rel="stylesheet" href="/stylesheets/bootstrap.min.css"><link rel="stylesheet" href="/stylesheets/style.css"><link rel="stylesheet" href="/stylesheets/jquery.jsonview.css"></head><body><div class="toc"><p>Table of Contents</p><ul><li> <a href="#LNS">Light Novel Search</a></li><li> <a href="#Example">JSON example</a></li></ul></div><div class="wrapper"><h3 id="LNS">Light Novel Search</h3><route>"/api"</route><return><JSON></JSON></return><format>/api?title={light_novel_title}[&series={regex_of_series_name}][&volume={regex_of_volume_name}][&volumeno={volume_number}]</format><br><h4> <u>Filter Parameters</u></h4><h5>By title</h5><a href="/api?title=Zero_no_Tsukaima">/api?title=Zero_no_Tsukaima </a><p>
<!DOCTYPE html><html><head><title>Baka Tsuki API</title><link rel="stylesheet" href="/stylesheets/bootstrap.min.css"><link rel="stylesheet" href="/stylesheets/style.css"><link rel="stylesheet" href="/stylesheets/jquery.jsonview.css"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"></head><body><nav style="height:50px;" class="navbar navbar-default navbar-fixed-top"><div class="container-fluid"><div class="navbar-header"><button type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" class="navbar-toggle collapsed"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="#" class="navbar-brand">Home</a></div><div class="collapse navbar-collapse"><ul class="nav navbar-nav"><li><a href="https://github.com/Shadowys/btapi" data-toggle="tooltip" data-placement="right" title="" data-original-title="Source code here!"><i class="fa fa-github fa-2x"> </i></a></li><li><a href="https://www.baka-tsuki.org/forums/viewtopic.php?f=84&amp;t=10959" data-toggle="tooltip" data-placement="right" title="" data-original-title="Share your thoughts"><i class="fa fa-commenting fa-2x"> </i></a></li></ul><ul class="nav navbar-nav navbar-right"><li><a href="#">Top</a></li></ul></div></div></nav><div id="toc"><p>Table of Contents</p><ul><li> <a href="#LNS">Light Novel Search</a></li><li> <a href="#Example">JSON example</a></li></ul></div><div class="wrapper"><h3 id="LNS">Light Novel Search</h3><route>"/api"</route><return><JSON></JSON></return><format>/api?title={light_novel_title}[&series={regex_of_series_name}][&volume={regex_of_volume_name}][&volumeno={volume_number}]</format><br><h4> <u>Filter Parameters</u></h4><h5>By title</h5><a href="/api?title=Zero_no_Tsukaima">/api?title=Zero_no_Tsukaima </a><p>
This parameter <b>must be present </b>to continue.</p><h5>By series (Optional)</h5><a href="/api?title=Chrome_Shelled_Regios&amp;series=chrome|regios">/api?title=Chrome_Shelled_Regios&series=chrome|regios </a><p>
This parameter can be a <b>regex </b>of the series name. The example above uses the pipe character.</p><h5>By volume (Optional)</h5><a href="/api?title=Chrome_Shelled_Regios&amp;series=chrome&amp;volume=15|log">/api?title=Chrome_Shelled_Regios&series=chrome&volume=15|log </a><p>
This parameter can be a <b>regex </b>of the volume name, which includes the volume number. The example above uses the pipe character.</p><h5>By volume number (Optional)</h5><a href="/api?title=Chrome_Shelled_Regios&amp;series=chrome&amp;volumeno=1">/api?title=Chrome_Shelled_Regios&series=chrome&volumeno=1 </a><p>
Expand All @@ -7,7 +7,9 @@
(LIST) The light novel series available. The data is provided as <b>nested lists </b>which contain json to preserve the order. Each series contains a
list of volumes and each volume contains a list of chapters. </p><p>
Each chapter contains the <b>wiki link </b>to the page.</p><ul> <li> <h5>title </h5><p>(STRING) title of the series</p></li><li> <h5>books</h5><p>(LIST) volumes available for the series</p><ul><li><h5>title</h5><p>(STRING) title of the volume </p><h5>cover</h5><p>(LINK) absolute link to the cover image of the volume</p><h5>chapters</h5><p>(LIST) chapters available for the volume, including external links</p><ul> <li><h5>title</h5><p>(STRING) title of the chapter</p><h5>page</h5><p>(STRING) title of the page of the chapter in the wiki or link of external page.</p><h5>linktype</h5><p>(STRING) type of link of the chapter page. Two options are available: internal and external</p><h5>link</h5><p>(LINK) absolute link to the chapter</p></li></ul></li></ul></li></ul><h5>cover</h5><p>(LINK) absolute link to the cover image of the novel</p></div><div class="col-md-5"><h4>
Example response using </h4><a href="/api?title=Hyouka&amp;volumeno=1"><code>/api?title=Hyouka&volumeno=1</code></a><div id="json_display"></div></div></div></div><script src="javascripts/jquery-2.1.1.js"></script><script src="javascripts/jquery.jsonview.js"></script><script>$(document).ready(function() {
Example response using </h4><a href="/api?title=Hyouka&amp;volumeno=1"><code>/api?title=Hyouka&volumeno=1</code></a><div id="json_display"></div></div></div></div><script src="javascripts/jquery-2.1.1.js"></script><script src="javascripts/bootstrap.min.js"></script><script src="javascripts/jquery.jsonview.js"></script><script>$(document).ready(function () {
$("[data-toggle='tooltip']").tooltip();
});</script><script>$(document).ready(function() {
$('#json_display').JSONView(data);
$('#json_display').JSONView('toggle',3);
});
Expand Down
Loading

0 comments on commit 4a91331

Please sign in to comment.