Formulaic Analysis - warwickfoster/qurantools GitHub Wiki
File: app/dictionary/lane.php
Purpose
The code appears to be part of a web application that displays a PDF dictionary. It handles user input through arrow keys and provides an option to open the PDF in a new window.
Page and Volume Parameters
- The code extracts the
PAGEandVOLUMEparameters from the URL query string. - It validates these parameters and sets default values of 1 for
PAGEand 1 forVOLUMEif they are not present.
Lightview Mode
- The
LIGHTVIEWflag is set based on aLIGHTVIEWparameter in the URL query string. - If
LIGHTVIEWis set to "YES", the code indicates that the page is running in Lightview mode.
PDF Display
- The
GotoPage()function is called when the page loads, passing thePAGEandVOLUMEparameters. - Based on the device type, the code either redirects the user to a PDF file or loads it dynamically using AJAX.
Key Handling
- The code attaches a keydown event listener to the document.
- When the escape key is pressed, the Lightview window is closed.
- When the left or right arrow keys are pressed, the
currentPageis updated, and theGotoPage()function is called again.
Additional Features
- A link is displayed to open the PDF in a new window.
- A footer is included when the page is not running in Lightview mode.