2021-01-25 18:09:30 +00:00
|
|
|
document.body.style.overflowY = "scroll";
|
2021-02-04 00:13:55 +00:00
|
|
|
CineraProps.Orientation = GetRealOrientation(orientations.LANDSCAPE_LEFT, CineraProps.IsMobile);
|
2021-01-25 18:09:30 +00:00
|
|
|
|
|
|
|
// Element Selection
|
|
|
|
//
|
|
|
|
Nav.Nexus = document.getElementById("cineraIndex");
|
|
|
|
Nav.Controls.Header = document.getElementById("cineraIndexControl");
|
|
|
|
Nav.Controls.Sort = Nav.Controls.Header.querySelector(".cineraMenuItem.sort");
|
|
|
|
Nav.Controls.View = Nav.Controls.Header.querySelector(".cineraMenuItem.view");
|
|
|
|
Nav.Controls.Anim = Nav.Controls.Header.querySelector(".cineraMenuItem.anim");
|
|
|
|
Nav.Controls.Save = Nav.Controls.Header.querySelector(".cineraMenuItem.save");
|
|
|
|
Nav.Controls.Help = Nav.Nexus.querySelector(".cineraHelp");
|
|
|
|
Nav.Controls.HelpDocumentation = Nav.Controls.Help.querySelector(".help_container");
|
|
|
|
Nav.GridContainer = Nav.Nexus.querySelector(".cineraIndexGridContainer");
|
2021-02-05 20:15:40 +00:00
|
|
|
Nav.Controls.GridTraversal.Container = Nav.GridContainer.querySelector(".cineraTraversalContainer");
|
2021-01-25 18:09:30 +00:00
|
|
|
Nav.Controls.GridTraversal.Header = Nav.GridContainer.querySelector(".cineraTraversal");
|
|
|
|
Nav.Controls.GridTraversal.Ascend = Nav.Controls.GridTraversal.Header.querySelector(".cineraButton.ascension");
|
|
|
|
Nav.Controls.GridTraversal.Prev = Nav.Controls.GridTraversal.Header.querySelector(".cineraButton.prev");
|
|
|
|
Nav.Controls.GridTraversal.Next = Nav.Controls.GridTraversal.Header.querySelector(".cineraButton.next");
|
|
|
|
|
|
|
|
Search.QueryElement = document.getElementById("query");
|
|
|
|
Search.ResultsSummary = document.getElementById("cineraResultsSummary");
|
|
|
|
Search.ResultsContainer = document.getElementById("cineraResults");
|
|
|
|
Search.IndexContainer = document.getElementById("cineraIndexList");
|
|
|
|
Search.ProjectsContainer = Search.IndexContainer.querySelectorAll(".cineraIndexProject");
|
|
|
|
//
|
|
|
|
///
|
|
|
|
|
|
|
|
// NOTE(matt): Initialisation
|
|
|
|
//
|
|
|
|
if(CineraProps.IsMobile)
|
|
|
|
{
|
|
|
|
Nav.Nexus.classList.add("mobile");
|
|
|
|
}
|
|
|
|
InitTraversalStack();
|
|
|
|
InitNexus();
|
|
|
|
InitHelpKeys(Nav.Controls.HelpDocumentation);
|
|
|
|
Nav.GridSize = ComputeOptimalGridSize();
|
|
|
|
SetHelpKeyAvailability(Nav.GridSize);
|
|
|
|
InitButtons(); // NOTE(matt): Also does "keydown" listeners, needed before UpdateButtons()
|
|
|
|
UpdateButtons();
|
|
|
|
|
|
|
|
InitQuery(Search.QueryElement);
|
|
|
|
InitPrototypes(Search.ResultsContainer);
|
|
|
|
prepareProjects();
|
|
|
|
|
|
|
|
SyncNavState();
|
|
|
|
//
|
|
|
|
////
|
|
|
|
|
|
|
|
// NOTE(matt): Listeners
|
|
|
|
//
|
2021-02-04 00:13:55 +00:00
|
|
|
BindControlKeys();
|
|
|
|
BindGridKeys(Nav.GridSize);
|
2021-01-25 18:09:30 +00:00
|
|
|
BindControls();
|
|
|
|
InitResizeEventListener();
|
|
|
|
InitOrientationChangeListener();
|
2021-02-10 23:50:43 +00:00
|
|
|
InitScrollEventListener(Nav.GridContainer, CineraProps.IsMobile, Nav.Controls.Header);
|
2021-01-25 18:09:30 +00:00
|
|
|
//
|
|
|
|
////
|
|
|
|
|
|
|
|
// NOTE(matt): On-load Execution
|
|
|
|
//
|
|
|
|
runSearch();
|
|
|
|
//
|
|
|
|
////
|