Commit ced23995 authored by Ian Dennis Miller's avatar Ian Dennis Miller

toggle appearances, full citation in article chooser, toggle focus

parent ed4aa3fb
......@@ -28,14 +28,14 @@
<ul id="ui-config">
<li><a href="#" onclick="toggle_help(); return false;">[h]elp</a></li>
<li><a href="#" onclick="hide_all(); return false;">[f]ocus mode</a></li>
<li><a href="#" onclick="show_all(); return false;">show [a]ll</a></li>
<li><a href="#" onclick="toggle_focus(); return false;">toggle [f]ocus</a></li>
<li><a href="#" onclick="toggle_appearances(); return false;">toggle [a]ppearances</a></li>
<li><a href="#" onclick="toggle_dark_mode(); return false;">[d]ark mode</a></li>
</ul>
</div>
<div id="ui-help">
<ul>
<li><b>A</b>: show all cards</li>
<li><b>A</b>: toggle appearance (title)</li>
<li><b>F</b>: focus on card</li>
<li><b>left/right</b>: previous/next (in focus mode)</li>
<li><b>D</b>: toggle dark mode</li>
......
......@@ -3,6 +3,17 @@ var counter = 0;
var filtered = false;
var focused = true;
var filter_id = "";
var appearances = "visible";
var toggle_focus = function() {
if (focused) {
show_all();
}
else {
hide_all();
}
}
var hide_all = function() {
for (var i = 0; i < divs.length; i++){
......@@ -128,6 +139,31 @@ var toggle_appearance = function(id) {
}
}
var hide_appearances = function() {
var els = document.querySelectorAll('.appearance');
for (var i = 0; i < els.length; i++){
els[i].style.display = "none";
}
appearances = "hidden";
}
var show_appearances = function() {
var els = document.querySelectorAll('.appearance');
for (var i = 0; i < els.length; i++){
els[i].style.display = "block";
}
appearances = "visible";
}
var toggle_appearances = function() {
if (appearances == "hidden") {
show_appearances();
}
else {
hide_appearances();
}
}
var close_ui = function() {
var content = document.getElementById("ui-content");
var ui_control = document.getElementById("ui-control");
......@@ -183,11 +219,11 @@ var handler = function(e) {
if (charCode == '65') {
// a: all
show_all();
toggle_appearances();
}
else if (charCode == '70') {
// f: focus
hide_all();
toggle_focus();
}
else if (charCode == '37') {
// left arrow
......
......@@ -56,15 +56,15 @@ class VisFact:
if m:
fact_id = "claim-{0:0>2}-{1:0>4}".format(m.group(1), m.group(2))
if appearance_id not in articles.keys():
articles[appearance_id] = appearance
cite = "{authors}. ({year}). {title}.".format(
authors=authors,
year=year,
title=title
)
if appearance_id not in articles.keys():
articles[appearance_id] = cite
source = {
'authors': authors,
'year': year,
......
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