[Jifty-commit] r1129 - in jifty/trunk: . inc/Module lib/Jifty
share/web/static/js
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Tue May 30 14:52:57 EDT 2006
Author: alexmv
Date: Tue May 30 14:52:56 2006
New Revision: 1129
Modified:
jifty/trunk/ (props changed)
jifty/trunk/inc/Module/AutoInstall.pm
jifty/trunk/inc/Module/Install.pm
jifty/trunk/inc/Module/Install/Metadata.pm
jifty/trunk/lib/Jifty/Web.pm
jifty/trunk/share/web/static/js/jifty.js
Log:
r13366 at zoq-fot-pik: chmrr | 2006-05-30 14:52:50 -0400
* Fragment requests get result metadata
Modified: jifty/trunk/inc/Module/AutoInstall.pm
==============================================================================
--- jifty/trunk/inc/Module/AutoInstall.pm (original)
+++ jifty/trunk/inc/Module/AutoInstall.pm Tue May 30 14:52:56 2006
@@ -639,9 +639,7 @@
# check for version numbers that are not in decimal format
if ( ref($cur) or ref($min) or $cur =~ /v|\..*\./ or $min =~ /v|\..*\./ ) {
- if ( ( $version::VERSION or defined( _load('version') )) and
- version->can('new')
- ) {
+ if ( $version::VERSION or defined( _load('version') ) ) {
# use version.pm if it is installed.
return (
@@ -752,4 +750,4 @@
__END__
-#line 990
+#line 988
Modified: jifty/trunk/inc/Module/Install.pm
==============================================================================
--- jifty/trunk/inc/Module/Install.pm (original)
+++ jifty/trunk/inc/Module/Install.pm Tue May 30 14:52:56 2006
@@ -51,22 +51,6 @@
END_DIE
}
-# If the script that is loading Module::Install is from the future,
-# then make will detect this and cause it to re-run over and over
-# again. This is bad. Rather than taking action to touch it (which
-# is unreliable on some platforms and requires write permissions)
-# for now we should catch this and refuse to run.
-if ( -f $0 and (stat($0))[9] > time ) {
- die << "END_DIE";
-Your installer $0 has a modification time in the future.
-
-This is known to create infinite loops in make.
-
-Please correct this, then run $0 again.
-
-END_DIE
-}
-
use Cwd ();
use File::Find ();
use File::Path ();
Modified: jifty/trunk/inc/Module/Install/Metadata.pm
==============================================================================
--- jifty/trunk/inc/Module/Install/Metadata.pm (original)
+++ jifty/trunk/inc/Module/Install/Metadata.pm Tue May 30 14:52:56 2006
@@ -123,9 +123,9 @@
require Module::Build;
my $build = Module::Build->new(
- dist_name => $self->name,
- dist_version => $self->version,
- license => $self->license,
+ dist_name => $self->{name},
+ dist_version => $self->{version},
+ license => $self->{license},
);
$self->provides(%{ $build->find_dist_packages || {} });
}
Modified: jifty/trunk/lib/Jifty/Web.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web.pm (original)
+++ jifty/trunk/lib/Jifty/Web.pm Tue May 30 14:52:56 2006
@@ -1017,6 +1017,29 @@
Jifty->web->current_region->exit while Jifty->web->current_region;
}
+
+ my %results = Jifty->web->response->results;
+ for (keys %results) {
+ $writer->startTag("result", moniker => $_, class => $results{$_}->action_class);
+ $writer->dataElement("success", $results{$_}->success);
+
+ $writer->dataElement("message", $results{$_}->message) if $results{$_}->message;
+ $writer->dataElement("error", $results{$_}->error) if $results{$_}->error;
+
+ my %warnings = $results{$_}->field_warnings;
+ my %errors = $results{$_}->field_errors;
+ my %fields; $fields{$_}++ for keys(%warnings), keys(%errors);
+ for (sort keys %fields) {
+ next unless $warnings{$_} or $errors{$_};
+ $writer->startTag("field", name => $_);
+ $writer->dataElement("warning", $warnings{$_}) if $warnings{$_};
+ $writer->dataElement("error", $errors{$_}) if $errors{$_};
+ $writer->endTag();
+ }
+
+ $writer->endTag();
+ }
+
$writer->endTag();
# Spit out a correct content-type; we set this *here* instead of
Modified: jifty/trunk/share/web/static/js/jifty.js
==============================================================================
--- jifty/trunk/share/web/static/js/jifty.js (original)
+++ jifty/trunk/share/web/static/js/jifty.js Tue May 30 14:52:56 2006
@@ -499,21 +499,23 @@
for (var response_fragment = response.firstChild;
response_fragment != null;
response_fragment = response_fragment.nextSibling) {
- if (response_fragment.getAttribute("id") == f['region']) {
- var textContent;
- if (response_fragment.textContent) {
- textContent = response_fragment.textContent;
- } else {
- textContent = response_fragment.firstChild.nodeValue;
+ if (response_fragment.nodeName == 'fragment') {
+ if (response_fragment.getAttribute("id") == f['region']) {
+ var textContent;
+ if (response_fragment.textContent) {
+ textContent = response_fragment.textContent;
+ } else {
+ textContent = response_fragment.firstChild.nodeValue;
+ }
+ // Once we find it, do the insertion
+ if (insertion) {
+ new insertion(element, textContent.stripScripts());
+ } else {
+ Element.update(element, textContent.stripScripts());
+ }
+ // We need to give the browser some "settle" time before we eval scripts in the body
+ setTimeout((function() { this.evalScripts() }).bind(textContent), 10);
}
- // Once we find it, do the insertion
- if (insertion) {
- new insertion(element, textContent.stripScripts());
- } else {
- Element.update(element, textContent.stripScripts());
- }
- // We need to give the browser some "settle" time before we eval scripts in the body
- setTimeout((function() { this.evalScripts() }).bind(textContent), 10);
}
}
@@ -526,6 +528,21 @@
(effect)($('region-'+f['region']), effect_args);
}
}
+ for (var result = response.firstChild;
+ result != null;
+ result = result.nextSibling) {
+ if (result.nodeName == 'result') {
+ for (var key = result.firstChild;
+ key != null;
+ key = key.nextSibling) {
+ if (key.nodeName == 'message') {
+ // alert(key.textContent);
+ } else if (key.nodeName == 'error') {
+ // alert('ERROR: '+key.textContent);
+ }
+ }
+ }
+ }
} finally {
// Re-apply the Behavior stuff
Behaviour.apply();
More information about the Jifty-commit
mailing list