hmml_to_html.c: Fix lastFocused stuff [#24]

This commit is contained in:
Matt Mascarenhas 2017-06-03 04:47:07 +01:00
parent 4ad0a0e737
commit 97332baf52
2 changed files with 38 additions and 10 deletions

View File

@ -69,6 +69,7 @@ char *Credentials[ ][5] =
{ "nothings", "Sean Barrett", "https://nothings.org/", "", ""},
{ "cmuratori", "Casey Muratori", "https://handmadehero.org", "patreon_logo.png", "https://patreon.com/cmuratori"},
{ "fierydrake", "Mike Tunnicliffe", "", "", ""},
{ "abnercoimbre", "Abner Coimbre", "https://handmade.network/m/abnercoimbre", "patreon_logo.png", "https://patreon.com/handmade_dev"},
};
#define ArrayCount(A) sizeof(A)/sizeof(*(A))
@ -1231,6 +1232,10 @@ TimecodeToSeconds(Anno->time));
"<span class=\"author\" style=\"color: %s;\">%s</span> ",
StringToColourHash(&Colour, Anno->author),
Anno->author);
if(!HasMedium)
{
HasMedium = TRUE;
}
}
InPtr = Anno->text;
@ -1738,12 +1743,12 @@ CategoryMedium[j][2]
if(HasFilterMenu)
{
CopyStringToBuffer(&Title,
" <span class=\"help_key\">V</span> <span class=\"help_text\">Reset filter</span> <span class=\"help_key\">z</span> <span class=\"help_text\">Toggle filter mode between \"inclusive\" and \"exclusive\"</span>\n");
" <span class=\"help_key\">z</span> <span class=\"help_text\">Toggle filter mode</span> <span class=\"help_key\">V</span> <span class=\"help_text\">Revert filter to original state</span>\n");
}
else
{
CopyStringToBuffer(&Title,
" <span class=\"help_key unavailable\">V</span> <span class=\"help_text unavailable\">Reset filter</span> <span class=\"help_key unavailable\">z</span> <span class=\"help_text unavailable\">Toggle filter mode between \"inclusive\" and \"exclusive\"</span>\n");
" <span class=\"help_key unavailable\">z</span> <span class=\"help_text unavailable\">Toggle filter mode</span> <span class=\"help_key unavailable\">V</span> <span class=\"help_text unavailable\">Revert filter to original state</span>\n");
}
CopyStringToBuffer(&Title,
@ -1976,10 +1981,14 @@ HMML.metadata.project);
"\n"
"var menuState = [];\n");
CopyStringToBuffer(&Script,
"var quotesMenu = document.querySelector(\".quotes_container\");\n");
if(HasQuoteMenu)
{
CopyStringToBuffer(&Script,
"var quotesMenu = document.querySelector(\".quotes_container\");\n"
"if(quotesMenu)\n"
"{\n"
"menuState.push(quotesMenu);\n"
"var quoteItems = quotesMenu.querySelectorAll(\".ref\");\n"
"for(var i = 0; i < quoteItems.length; ++i)\n"
@ -1988,13 +1997,18 @@ HMML.metadata.project);
" mouseOverQuotes(this);\n"
" })\n"
"};\n"
"var lastFocusedQuote = null;\n");
"var lastFocusedQuote = null;\n"
"}\n");
}
CopyStringToBuffer(&Script,
"var referencesMenu = document.querySelector(\".references_container\");\n");
if(HasReferenceMenu)
{
CopyStringToBuffer(&Script,
"var referencesMenu = document.querySelector(\".references_container\");\n"
"if(referencesMenu)\n"
"{\n"
"menuState.push(referencesMenu);\n"
"var referenceItems = referencesMenu.querySelectorAll(\".ref\");\n"
"for(var i = 0; i < referenceItems.length; ++i)\n"
@ -2004,13 +2018,18 @@ HMML.metadata.project);
" })\n"
"};\n"
"var lastFocusedReference = null;\n"
"var lastFocusedIdentifier = null;\n");
"var lastFocusedIdentifier = null;\n"
"}\n");
}
CopyStringToBuffer(&Script,
"var filterMenu = document.querySelector(\".filter_container\");\n");
if(HasFilterMenu)
{
CopyStringToBuffer(&Script,
"var filterMenu = document.querySelector(\".filter_container\");\n"
"if(filterMenu)\n"
"{\n"
" menuState.push(filterMenu);\n"
" var lastFocusedCategory = null;\n"
" var lastFocusedTopic = null;\n"
@ -2036,13 +2055,16 @@ HMML.metadata.project);
" });\n"
"\n"
"%s\n"
"}\n"
"}\n", FilterState.Location);
}
CopyStringToBuffer(&Script,
"var creditsMenu = document.querySelector(\".credits_container\");\n");
if(HasCreditsMenu)
{
CopyStringToBuffer(&Script,
"var creditsMenu = document.querySelector(\".credits_container\");\n"
"if(creditsMenu)\n"
"{\n"
" menuState.push(creditsMenu);\n"

View File

@ -336,7 +336,8 @@
word-wrap: break-word;
}
.markers_container > .marker.authored .content .author {
.markers_container > .marker.authored .content .author,
.markers_container > .marker.off_authored .content .author {
font-style: normal;
font-variant: normal;
font-weight: bold;
@ -344,10 +345,15 @@
.title > .menu > .refs .ref .ref_title,
.title .filter_content.authored .text,
.markers_container > .marker.authored {
.markers_container > .marker.authored,
.markers_container > .marker.off_authored {
font-style: oblique;
}
.markers_container > .marker.off_authored {
opacity: 0.5;
}
.markers_container > .marker .content sup {
font-style: normal;
font-variant: normal;