DistributedProofreaders / dproofreaders

Distributed Proofreaders is a web application intended to ease the process of converting public domain books into e-texts.
https://www.pgdp.net
GNU General Public License v2.0
46 stars 28 forks source link

Process new page request inline without redirect #1227

Closed cpeel closed 3 weeks ago

cpeel commented 3 weeks ago

When a user requests a new page, handle it all inline to the initial proof_frame.php load instead of doing a 302 redirect.

Currently when a user clicks "Start Proofreading" we load proof_frame.php for it to figure out which page to give the user and then it redirects back to itself. But there's no need to do the redirect -- we already have all of the data we need to just serve the page up. We could have removed one more level of indirection and just construct the PPage object directly instead of calling get_requested_PPage() but this keeps the PPage construction all in one place.

Except for removing the redirect, this should work exactly like it did before. This page is loaded within a frame in proof.php so the change in the URL is transparent to the user.

Sandbox: https://www.pgdp.org/~cpeel/c.branch/reduce-redirects/