[Jifty-commit] r3516 - in jifty/trunk: . lib/Jifty/Plugin
lib/Jifty/Plugin/Feedback lib/Jifty/Plugin/OpenID
lib/Jifty/Plugin/OpenID/Mixin/Model
lib/Jifty/Plugin/SinglePage lib/Jifty/Plugin/SiteNews
lib/Jifty/Plugin/SiteNews/View lib/Jifty/View/Declare
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Sun Jun 17 16:54:01 EDT 2007
Author: trs
Date: Sun Jun 17 16:54:01 2007
New Revision: 3516
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Plugin/CompressedCSSandJS.pm
jifty/trunk/lib/Jifty/Plugin/Feedback/View.pm
jifty/trunk/lib/Jifty/Plugin/OpenID.pm
jifty/trunk/lib/Jifty/Plugin/OpenID/Action/CreateOpenIDUser.pm
jifty/trunk/lib/Jifty/Plugin/OpenID/Dispatcher.pm
jifty/trunk/lib/Jifty/Plugin/OpenID/Mixin/Model/User.pm
jifty/trunk/lib/Jifty/Plugin/OpenID/View.pm
jifty/trunk/lib/Jifty/Plugin/SinglePage.pm
jifty/trunk/lib/Jifty/Plugin/SinglePage/Dispatcher.pm
jifty/trunk/lib/Jifty/Plugin/SiteNews.pm
jifty/trunk/lib/Jifty/Plugin/SiteNews/Dispatcher.pm
jifty/trunk/lib/Jifty/Plugin/SiteNews/View/News.pm
jifty/trunk/lib/Jifty/View/Declare/Page.pm
Log:
r24683 at zot: tom | 2007-06-17 16:49:49 -0400
Now with more POD! (and passing POD tests)
Modified: jifty/trunk/lib/Jifty/Plugin/CompressedCSSandJS.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/CompressedCSSandJS.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/CompressedCSSandJS.pm Sun Jun 17 16:54:01 2007
@@ -161,6 +161,12 @@
}
}
+=head2 minify_js \$js
+
+Runs the given JS through jsmin
+
+=cut
+
sub minify_js {
my $self = shift;
my $input = shift;
Modified: jifty/trunk/lib/Jifty/Plugin/Feedback/View.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/Feedback/View.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/Feedback/View.pm Sun Jun 17 16:54:01 2007
@@ -4,6 +4,15 @@
use Jifty::View::Declare -base;
+=head1 NAME
+
+Jifty::Plugin::Feedback::View
+
+=head1 DESCRIPTION
+
+Provides the feedback regions for L<Jifty::Plugin::Feedback>
+
+=cut
template 'feedback/request_feedback' => sub {
div {
Modified: jifty/trunk/lib/Jifty/Plugin/OpenID.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/OpenID.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/OpenID.pm Sun Jun 17 16:54:01 2007
@@ -4,4 +4,14 @@
package Jifty::Plugin::OpenID;
use base qw/Jifty::Plugin/;
+=head1 NAME
+
+Jifty::Plugin::OpenID
+
+=head1 DESCRIPTION
+
+Provides OpenID authentication for your app
+
+=cut
+
1;
Modified: jifty/trunk/lib/Jifty/Plugin/OpenID/Action/CreateOpenIDUser.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/OpenID/Action/CreateOpenIDUser.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/OpenID/Action/CreateOpenIDUser.pm Sun Jun 17 16:54:01 2007
@@ -10,6 +10,12 @@
package Jifty::Plugin::OpenID::Action::CreateOpenIDUser;
use base qw/Jifty::Action::Record/;
+=head2 record_class
+
+Returns the record class for this action
+
+=cut
+
sub record_class {
Jifty->app_class("Model", "User")
}
Modified: jifty/trunk/lib/Jifty/Plugin/OpenID/Dispatcher.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/OpenID/Dispatcher.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/OpenID/Dispatcher.pm Sun Jun 17 16:54:01 2007
@@ -4,6 +4,16 @@
package Jifty::Plugin::OpenID::Dispatcher;
use Jifty::Dispatcher -base;
+=head1 NAME
+
+Jifty::Plugin::OpenID::Dispatcher
+
+=head1 DESCRIPTION
+
+Dispatcher for L<Jifty::Plugin::OpenID>. Handles a lot of the work.
+
+=cut
+
before qr'^/(?:openid/link)' => run {
tangent('/openid/login') unless (Jifty->web->current_user->id)
};
Modified: jifty/trunk/lib/Jifty/Plugin/OpenID/Mixin/Model/User.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/OpenID/Mixin/Model/User.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/OpenID/Mixin/Model/User.pm Sun Jun 17 16:54:01 2007
@@ -5,6 +5,16 @@
use base 'Jifty::DBI::Record::Plugin';
use URI;
+=head1 NAME
+
+Jifty::Plugin::OpenID::Mixin::Model::User
+
+=head1 DESCRIPTION
+
+L<Jifty::Plugin::OpenID> mixin for the User model. Provides an 'openid' column.
+
+=cut
+
use Jifty::Plugin::OpenID::Record schema {
our @EXPORT = qw(has_alternative_auth link_to_openid);
@@ -18,14 +28,26 @@
};
+=head2 has_alternative_auth
+
+=cut
+
sub has_alternative_auth { 1 }
+=head2 register_triggers
+
+=cut
+
sub register_triggers {
my $self = shift;
$self->add_trigger(name => 'validate_openid', callback => \&validate_openid, abortable => 1);
$self->add_trigger(name => 'canonicalize_openid', callback => \&canonicalize_openid);
}
+=head2 validate_openid
+
+=cut
+
sub validate_openid {
my $self = shift;
my $openid = shift;
@@ -45,6 +67,10 @@
return 1;
}
+=head2 canonicalize_openid
+
+=cut
+
sub canonicalize_openid {
my $self = shift;
my $openid = shift;
@@ -60,6 +86,12 @@
return $uri->canonical;
}
+=head2 link_to_openid
+
+Links User's account to the specified OpenID (bypassing ACLs)
+
+=cut
+
sub link_to_openid {
my $self = shift;
my $openid = shift;
Modified: jifty/trunk/lib/Jifty/Plugin/OpenID/View.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/OpenID/View.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/OpenID/View.pm Sun Jun 17 16:54:01 2007
@@ -3,6 +3,16 @@
use warnings;
use Jifty::View::Declare -base;
+=head1 NAME
+
+Jifty::Plugin::OpenID::View
+
+=head1 DESCRIPTION
+
+The view class for L<Jifty::Plugin::OpenID>. Provides login and create pages.
+
+=cut
+
template 'openid/login' => page {
{ title is _ "Login with your OpenID" }
my $action = get('action');
Modified: jifty/trunk/lib/Jifty/Plugin/SinglePage.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/SinglePage.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/SinglePage.pm Sun Jun 17 16:54:01 2007
@@ -6,6 +6,20 @@
__PACKAGE__->mk_accessors(qw(region_name));
+=head1 NAME
+
+Jifty::Plugin::SinglePage
+
+=head1 DESCRIPTION
+
+Makes your normal Jifty app into a single-page app through clever use of regions
+
+=head2 init
+
+Registers a before_new trigger to modify links and sets up the special region
+
+=cut
+
sub init {
my $self = shift;
Jifty::Web::Form::Clickable->add_trigger( before_new => _sp_link($self));
@@ -33,12 +47,12 @@
args => $args->{parameters}});
}
elsif (exists $args->{submit}) {
- $self->_push_onclick($args, { refresh_self => 1, submit => $args->{submit} });
- $args->{as_button} = 1;
- }
+ $self->_push_onclick($args, { refresh_self => 1, submit => $args->{submit} });
+ $args->{as_button} = 1;
+ }
if (my $form = delete $args->{_form}) {
- $args->{call} = $form->call;
- }
+ $args->{call} = $form->call;
+ }
my $onclick = $args->{onclick};
if ( $args->{onclick} ) {
$self->_push_onclick($args); # make sure it's array
Modified: jifty/trunk/lib/Jifty/Plugin/SinglePage/Dispatcher.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/SinglePage/Dispatcher.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/SinglePage/Dispatcher.pm Sun Jun 17 16:54:01 2007
@@ -3,6 +3,16 @@
use warnings;
use Jifty::Dispatcher -base;
+=head1 NAME
+
+Jifty::Plugin::SinglePage::Dispatcher
+
+=head1 DESCRIPTION
+
+Dispatcher for L<Jifty::Plugin::SinglePage>
+
+=cut
+
before '__jifty/webservices/*' => run {
my (@actions) = grep { $_->class eq 'Jifty::Action::Redirect' } values %{ Jifty->web->request->{'actions'} };
$_->active(0) for @actions;
Modified: jifty/trunk/lib/Jifty/Plugin/SiteNews.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/SiteNews.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/SiteNews.pm Sun Jun 17 16:54:01 2007
@@ -3,5 +3,14 @@
package Jifty::Plugin::SiteNews;
use base qw'Jifty::Plugin';
+=head1 NAME
+
+Jifty::Plugin::SiteNews
+
+=head1 DESCRIPTION
+
+Provides a way to include site news in your Jifty app
+
+=cut
1;
Modified: jifty/trunk/lib/Jifty/Plugin/SiteNews/Dispatcher.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/SiteNews/Dispatcher.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/SiteNews/Dispatcher.pm Sun Jun 17 16:54:01 2007
@@ -4,6 +4,15 @@
package Jifty::Plugin::SiteNews::Dispatcher;
use base 'Jifty::Dispatcher';
+=head1 NAME
+
+Jifty::Plugin::SiteNews::Dispatcher
+
+=head1 DESCRIPTION
+
+Dispatcher for L<Jifty::Plugin::SiteNews>
+
+=cut
Modified: jifty/trunk/lib/Jifty/Plugin/SiteNews/View/News.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/SiteNews/View/News.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/SiteNews/View/News.pm Sun Jun 17 16:54:01 2007
@@ -5,10 +5,32 @@
use Jifty::View::Declare -base;
use Jifty::View::Declare::CRUD;
+=head1 NAME
+
+Jifty::Plugin::SiteNews::View::News
+
+=head1 DESCRIPTION
+
+The /news pages for L<Jifty::Plugin::SiteNews>
+
+=cut
+
import_templates Jifty::View::Declare::CRUD under '/';
+=head2 object_type
+
+News
+
+=cut
+
sub object_type { 'News' }
+=head2 fragment_base_path
+
+/news
+
+=cut
+
sub fragment_base_path {'/news'}
Modified: jifty/trunk/lib/Jifty/View/Declare/Page.pm
==============================================================================
--- jifty/trunk/lib/Jifty/View/Declare/Page.pm (original)
+++ jifty/trunk/lib/Jifty/View/Declare/Page.pm Sun Jun 17 16:54:01 2007
@@ -21,6 +21,12 @@
__PACKAGE__->mk_accessors(qw(content_code done_header _title));
use constant allow_single_page => 1;
+=head2 new
+
+Sets up a new page class
+
+=cut
+
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
@@ -127,6 +133,12 @@
};
}
+=head2 render_title
+
+Renders the in-page title
+
+=cut
+
sub render_title {
my $self = shift;
my $oldt = get('title');
@@ -135,12 +147,23 @@
set( title => $oldt );
}
+=head2 render_footer
+
+Renders the page footer and prepends the header to the L<Template::Declare> buffer.
+
+=cut
+
sub render_footer {
my $self = shift;
outs_raw('</html>');
Template::Declare->buffer->data( $self->done_header . Template::Declare->buffer->data );
}
+=head2 render_pre_content_hook
+
+Renders the AdminMode alert (if AdminMode is on)
+
+=cut
sub render_pre_content_hook {
if ( Jifty->config->framework('AdminMode') ) {
@@ -156,6 +179,12 @@
}
}
+=head2 render_jifty_page_detritus
+
+Renders the keybinding and PubSub javascript as well as the wait message
+
+=cut
+
sub render_jifty_page_detritus {
show('keybindings');
More information about the Jifty-commit
mailing list