App-Dochazka-WWW
view release on metacpan or search on metacpan
lib/App/Dochazka/WWW/Dispatch.pm view on Meta::CPAN
authorized and the body is well-formed, the request is forwarded to the REST
server via the L<App::MFILE> package's C<rest_req> routine and the REST
server's response is sent back to the user's browser, where it is processed by
the JavaScript code.
In derived-distro mode, this structure is expected to be translated into a
"real" HTTP request, to be forwarded via the LWP::UserAgent object stored in
the session data. The status object received in the response is then passed
back to the JavaScript side.
There is one special case: the POST request from the login dialog looks like this:
{ method: "LOGIN", path: "login", body: { nam: "foo", pwd: "bar" } }
Login requests receive special handling.
=cut
sub process_post {
my $self = shift;
$log->debug( "Entering " . __PACKAGE__ . "::process_post()" );
share/js/dochazka-www/viewer.js view on Meta::CPAN
// =========================
//
// Given a multi-day interval object, trigger AJAX call "GET holiday/:tsrange"
// where tsrange is [ "beginDate 00:00", "endDate 23:59" ) - which will include
// all dates in the interval range and allow us to determine which ones are
// weekends/holidays and which are not.
//
// In the success function of that AJAX call, populate the haw ("holidays and
// weekends") object from the AJAX payload. A function "holidayOrWeekend()"
// takes each date string, canonicalizes it, and
// looks it up in the "haw" lookup object, and return true or false as
// appropriate.
//
// Next, the intervals-to-be-viewed array will be processed. First, to each
// date in haw, add an "intervals" array that will be empty at first. Second,
// iterate over all the intervals-to-be-viewed and push them into the respective
// "intervals" array in haw. At the same time, convert the time range string
// (e.g. "08:00-08:10") into a startTime-duration object (e.g. { "startTime":
// "08:00", "duration": "10" } where "duration" is always in minutes.
//
// Now, haw contains all information needed to construct the SVG blocks.
( run in 0.304 second using v1.01-cache-2.11-cpan-64827b87656 )