[Jifty-commit] r3921 - in jifty/trunk: lib/Jifty lib/Jifty/Plugin
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Mon Aug 20 16:55:14 EDT 2007
Author: sterling
Date: Mon Aug 20 16:55:14 2007
New Revision: 3921
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Continuation.pm
jifty/trunk/lib/Jifty/Plugin/JQuery.pm
Log:
r8820 at riddle: andrew | 2007-08-20 15:54:10 -0500
Fixing pod coverage problems with the jQuery plugin.
Modified: jifty/trunk/lib/Jifty/Continuation.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Continuation.pm (original)
+++ jifty/trunk/lib/Jifty/Continuation.pm Mon Aug 20 16:55:14 2007
@@ -14,6 +14,10 @@
re-visit that context later by providing the continuation again.
Continuations are stored on the user's session.
+A common use of a continuation is to perform a tangent/return in Jifty. For example, if you visit a page that you must be logged in to see, a Jifty application could present a link labeled "Click here to login." That link would be a "L<Jifty::Manual::Glossary/tangent>," which creates a continuation as part of the process of taking you to the login page. After you login, the application may perform a "L<Jifty::Manual::Glossary/return>," which calls the continuation stored by the tangent and returns you to the original page, but this time you are logged in.
+
+Almost any time you need to save the state for later recall, continuations can come in handy.
+
Continuations store a L<Jifty::Request> object and the
L<Jifty::Response> object for the request. They can also store
arbitrary code to be run when the continuation is called.
@@ -87,6 +91,7 @@
my $class = shift;
my $self = bless { }, $class;
+ # Setup some nice defaults
my %args = (
parent => Jifty->web->request->continuation,
request => Jifty::Request->new(),
@@ -143,13 +148,12 @@
=head2 call
-Call the continuation; this is generally done during request
-processing, after actions have been run.
-L<Jifty::Request::Mapper>-controlled values are filled into the stored
-request based on the current request and response. During the
-process, another continuation is created, with the filled-in results
-of the current actions included, and the browser is redirected to the
-proper path, with that continuation.
+Call the continuation; this is generally done during request processing, after
+actions have been run. L<Jifty::Request::Mapper>-controlled values are filled
+into the stored request based on the current request and response. During the
+process, another continuation is created, with the filled-in results of the
+current actions included, and the browser is redirected to the proper path,
+with that continuation.
=cut
@@ -157,11 +161,13 @@
my $self = shift;
Jifty->log->debug("Redirect to @{[$self->request->path]} via continuation");
+
+ # web services should do an internal redirect rather than an HTTP redirect
if (Jifty->web->request->argument('_webservice_redirect')) {
- # for continuation - perform internal redirect under webservices.
Jifty->web->webservices_redirect($self->request->path);
- return;
+ return;
}
+
# If we needed to fix up the path (it contains invalid
# characters) then warn, because this may cause infinite
# redirects
Modified: jifty/trunk/lib/Jifty/Plugin/JQuery.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/JQuery.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/JQuery.pm Mon Aug 20 16:55:14 2007
@@ -31,6 +31,12 @@
$("div").hide();
}(jQuery);
+=head1 METHODS
+
+=head2 init
+
+This initializes the plugin, which simply includes the JavaScript necessary to load jQuery and then disable the jQuery implementation of C<$()>.
+
=cut
sub init {
More information about the Jifty-commit
mailing list