[Jifty-commit] r1894 - in jifty/trunk: lib/Jifty share/web/static/js
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Wed Aug 30 19:48:00 EDT 2006
Author: jesse
Date: Wed Aug 30 19:47:59 2006
New Revision: 1894
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Web.pm
jifty/trunk/share/web/static/js/jifty.js
Log:
r23112 at pinglin: jesse | 2006-08-30 19:28:04 -0400
* Moved "Dismiss" buttons on messages and errors into Behaviour, so they only show up in javascripty contexts where they'd be useful
Modified: jifty/trunk/lib/Jifty/Web.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web.pm (original)
+++ jifty/trunk/lib/Jifty/Web.pm Wed Aug 30 19:47:59 2006
@@ -836,15 +836,8 @@
return unless grep {$_->$type()} values %results;
my $plural = $type . "s";
- $self->out(qq{<div id="$plural">});
+ $self->out(qq{<div class="jifty results messages" id="$plural">});
- $self->out( qq[<a id="dismiss_$plural" href="#" title="]
- . _('Dismiss')
- .qq[" onmousedown="this.onfocus=this.blur;" onmouseup="this.onfocus=window.clientInformation?null:window.undefined" ]
- .qq[ onclick="Effect.Fade(this.parentNode); return false;">]
- . _('Dismiss')
- .qq[</a>]);
-
foreach my $moniker ( keys %results ) {
if ( $results{$moniker}->$type() ) {
$self->out( qq{<div class="$type $moniker">}
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 Wed Aug 30 19:47:59 2006
@@ -446,16 +446,19 @@
DOM.Events.addListener( e, "keypress", Form.Element.handleEnter );
Element.addClassName( e, "jifty_enter_handler_attached" );
}
+ },
+ "div.jifty, div.results, div.messages": function(e) {
+ if ( !Element.hasClassName( e, "jifty_enter_handler_attached" ) ) {
+ e.innerHTML=
+ '<a href="#" id="dismiss_'+e.id+'" title="Dismiss" onmousedown="this.onfocus=this.blur;" onmouseup="this.onfocus=window.clientInformation?null:window.undefined" onclick="Effect.Fade(this.parentNode); return false;">Dismiss</a>' + e.innerHTML;
+
+ Element.addClassName( e, "jifty_enter_handler_attached" );
+ }
}
});
-
-/* Regions */
-// Keep track of the fragments on the page
-var fragments = $H();
-
-var Region = Class.create();
+/* Regions */ // Keep track of the fragments on the page var fragments = $H(); var Region = Class.create();
Region.prototype = {
initialize: function(name, args, path, parent) {
this.name = name;
More information about the Jifty-commit
mailing list