[Jifty-commit] r5312 - in jifty/branches/jquery: . lib/Jifty/Manual lib/Jifty/Plugin/Authentication lib/Jifty/Plugin/Authentication/Ldap/Action lib/Jifty/View/Declare share/plugins/Jifty/Plugin/AutoReference/web/static/js t/Continuations/t t/TestApp-JiftyJS/t
Jifty commits
jifty-commit at lists.jifty.org
Tue Apr 15 21:34:28 EDT 2008
Author: gugod
Date: Tue Apr 15 21:34:27 2008
New Revision: 5312
Modified:
jifty/branches/jquery/ (props changed)
jifty/branches/jquery/lib/Jifty/Manual/JavaScript.pod
jifty/branches/jquery/lib/Jifty/Manual/jQueryMigrationGuide.pod
jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Ldap.pm
jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Ldap/Action/LDAPLogin.pm
jifty/branches/jquery/lib/Jifty/View/Declare/CRUD.pm
jifty/branches/jquery/share/plugins/Jifty/Plugin/AutoReference/web/static/js/autoreference.js
jifty/branches/jquery/share/web/static/js/context_menu.js
jifty/branches/jquery/share/web/static/js/jifty_interface.js
jifty/branches/jquery/share/web/static/js/jifty_utils.js
jifty/branches/jquery/t/Continuations/t/03-gc.t
jifty/branches/jquery/t/TestApp-JiftyJS/t/6-offer-actions.t
Log:
- Merge /prj/mirror/jifty/trunk to /prj/mirror/jifty/branches/jquery
Modified: jifty/branches/jquery/lib/Jifty/Manual/JavaScript.pod
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Manual/JavaScript.pod (original)
+++ jifty/branches/jquery/lib/Jifty/Manual/JavaScript.pod Tue Apr 15 21:34:27 2008
@@ -32,7 +32,7 @@
object that acts likes a Enumerable object (but still, not one). If you
really want a Array, you can do:
- my array_of_message = jQuery("span.message").get()
+ var array_of_message = jQuery("span.message").get()
For most cases, C<jQuery("#" + id).get(0)> can be a replacement pattern
to C<$(id)>. Selecting elements with C<jQuery()> function always
Modified: jifty/branches/jquery/lib/Jifty/Manual/jQueryMigrationGuide.pod
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Manual/jQueryMigrationGuide.pod (original)
+++ jifty/branches/jquery/lib/Jifty/Manual/jQueryMigrationGuide.pod Tue Apr 15 21:34:27 2008
@@ -36,10 +36,10 @@
$ = jQuery;
However, instead of making a global alias, it's always recommended to
-always make this alias with a closure to really localize it.
+localize this alias within a closure:
(function($) {
- // $ is an alias to jQuery to the end of this closure
+ // $ is an alias to jQuery only inside this closure
$(".message").show();
})(jQuery);
@@ -55,8 +55,8 @@
Prototype library can destroy those Jifty functions.
The new jQuery-fashioned way is to always extend internal functions
-under Jifty object. C<Form becomes C<Jifty.Form>, C<Form.Element> becomes
-C<Jifty.Form.Element>, and so on. The detail list of these defined
+under Jifty object. C<Form> becomes C<Jifty.Form>, C<Form.Element> becomes
+C<Jifty.Form.Element> and so on. The detail list of these defined
functions are given in L<Jifty::Manual::Javascript>. Most of
those functions are internal functions that you probably should not
use them directly.
Modified: jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Ldap.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Ldap.pm (original)
+++ jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Ldap.pm Tue Apr 15 21:34:27 2008
@@ -56,11 +56,12 @@
my %args = @_;
$params{'Hostname'} = $args{LDAPhost};
- $params{'base'} = $args{LDAPbase};
+ $params{'base'} = $args{LDAPbase} or die "Need LDAPbase in plugin config";
$params{'uid'} = $args{LDAPuid} || "uid";
$params{'email'} = $args{LDAPMail} || "";
$params{'name'} = $args{LDAPName} || "cn";
- $LDAP = Net::LDAP->new($params{Hostname},async=>1,onerror => 'undef', debug => 0);
+ $LDAP = Net::LDAP->new($params{Hostname},async=>1,onerror => 'undef', debug => 0)
+ or die "Can't connect to LDAP server ",$params{Hostname};
}
sub LDAP {
@@ -94,6 +95,7 @@
attrs => [$self->name(),$self->email()],
sizelimit => 1
);
+ $result->code && Jifty->log->error( 'LDAP uid=' . $user . ' ' . $result->error );
my ($ret) = $result->entries;
my $name = $ret->get_value($self->name());
my $email = $ret->get_value($self->email());
Modified: jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Ldap/Action/LDAPLogin.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Ldap/Action/LDAPLogin.pm (original)
+++ jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Ldap/Action/LDAPLogin.pm Tue Apr 15 21:34:27 2008
@@ -66,15 +66,17 @@
my $dn = $plugin->uid().'='.$username.','.
$plugin->base();
+ Jifty->log->debug( "dn = $dn" );
# Bind on ldap
my $msg = $plugin->LDAP()->bind($dn ,'password' =>$self->argument_value('password'));
- unless (not $msg->code) {
+ if ($msg->code) {
$self->result->error(
_('You may have mistyped your login or password. Give it another shot?')
);
+ Jifty->log->error( "LDAP bind $dn " . $msg->error . "" );
return;
}
Modified: jifty/branches/jquery/lib/Jifty/View/Declare/CRUD.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/View/Declare/CRUD.pm (original)
+++ jifty/branches/jquery/lib/Jifty/View/Declare/CRUD.pm Tue Apr 15 21:34:27 2008
@@ -489,7 +489,7 @@
# unlimited collection if there is no current search.
sub _current_collection {
my $self = shift;
- my ( $page ) = get('page');
+ my ( $page ) = get('page') || 1;
my $collection_class = $self->record_class->collection_class;
my $search = ( Jifty->web->response->result('search') ? Jifty->web->response->result('search')->content('search') : undef );
my $collection;
Modified: jifty/branches/jquery/share/plugins/Jifty/Plugin/AutoReference/web/static/js/autoreference.js
==============================================================================
--- jifty/branches/jquery/share/plugins/Jifty/Plugin/AutoReference/web/static/js/autoreference.js (original)
+++ jifty/branches/jquery/share/plugins/Jifty/Plugin/AutoReference/web/static/js/autoreference.js Tue Apr 15 21:34:27 2008
@@ -7,7 +7,7 @@
// Copied from Jifty.Autocompleter.initialize
this.field = $(field);
- this.action = Form.Element.getAction(this.hiddenField);
+ this.action = Jifty.Form.Element.getAction(this.hiddenField);
this.url = '/__jifty/autocomplete.xml';
Event.observe(this.field, "focus", this.onFocus.bindAsEventListener(this));
@@ -33,7 +33,7 @@
afterUpdate: function(field, selection) {
- Form.Element.validate(this.hiddenField);
+ Jifty.Form.Element.validate(this.hiddenField);
},
getUpdatedChoices: function() {
@@ -44,7 +44,7 @@
a['class'] = 'Jifty::Action::Autocomplete';
a['fields'] = $H();
a['fields']['moniker'] = this.action.moniker;
- a['fields']['argument'] = Form.Element.getField(this.field);
+ a['fields']['argument'] = Jifty.Form.Element.getField(this.field);
request['actions']['autocomplete'] = a;
request['actions'][this.action.moniker] = this.action.data_structure();
request['actions'][this.action.moniker]['active'] = 0;
Modified: jifty/branches/jquery/share/web/static/js/context_menu.js
==============================================================================
--- jifty/branches/jquery/share/web/static/js/context_menu.js (original)
+++ jifty/branches/jquery/share/web/static/js/context_menu.js Tue Apr 15 21:34:27 2008
@@ -38,8 +38,7 @@
if ( ul ) {
var li = Jifty.ContextMenu.getParentListItem(ul);
- Element.removeClassName(li, "open");
- Element.addClassName(li, "closed");
+ jQuery(li).removeClass("open").addClass("closed");
ul.style.display = "none";
}
@@ -58,7 +57,7 @@
var li = Jifty.ContextMenu.getParentListItem(ul);
- Element.addClassName( ul, "dropdown_menu" );
+ jQuery(ul).addClass("dropdown_menu");
ul.style.position = "absolute";
ul.style.width = "12em";
@@ -79,8 +78,7 @@
li.style.position = "relative";
}
- Element.removeClassName(li, "closed");
- Element.addClassName(li, "open");
+ jQuery(li).removeClass("closed").addClass("open");
ul.style.display = "block";
Jifty.ContextMenu.currently_open = ul.id;
Modified: jifty/branches/jquery/share/web/static/js/jifty_interface.js
==============================================================================
--- jifty/branches/jquery/share/web/static/js/jifty_interface.js (original)
+++ jifty/branches/jquery/share/web/static/js/jifty_interface.js Tue Apr 15 21:34:27 2008
@@ -58,3 +58,18 @@
);
}
};
+
+jQuery.fn.shake = function() {
+ this.each(function(init) {
+ var e = jQuery(this);
+ e.css('position', 'relative');
+ for (var i = 1; i < 5; i++) {
+ e.animate({ left: -20/i }, 50)
+ .animate({ left: 0 }, 50)
+ .animate({ left: 20/i }, 50)
+ .animate({ left: 0 }, 50);
+ }
+ });
+ return this;
+};
+
Modified: jifty/branches/jquery/share/web/static/js/jifty_utils.js
==============================================================================
--- jifty/branches/jquery/share/web/static/js/jifty_utils.js (original)
+++ jifty/branches/jquery/share/web/static/js/jifty_utils.js Tue Apr 15 21:34:27 2008
@@ -129,7 +129,7 @@
},
scrollToShow: function(id) {
- var ul = $(id);
+ var ul = Jifty.$(id);
var y = Jifty.Utils.findPosY( ul ) + ul.offsetHeight + 10;
var scrollTop = Jifty.Utils.getScrollTop();
var screen = Jifty.Utils.findScreenHeight() + scrollTop;
Modified: jifty/branches/jquery/t/Continuations/t/03-gc.t
==============================================================================
--- jifty/branches/jquery/t/Continuations/t/03-gc.t (original)
+++ jifty/branches/jquery/t/Continuations/t/03-gc.t Tue Apr 15 21:34:27 2008
@@ -7,7 +7,9 @@
use lib 't/lib';
use Jifty::SubTest;
-use Jifty::Test skip_all => "test file not done yet";
+use Jifty::Test;
+
+plan skip_all => "test file not done yet";
#### garbage collection
# for now, an "on request, sweep all continuations older than the last 50"?
Modified: jifty/branches/jquery/t/TestApp-JiftyJS/t/6-offer-actions.t
==============================================================================
More information about the Jifty-commit
mailing list