[jifty-devel] Renaming 'message' and 'error'.
Jesse Vincent
jesse at bestpractical.com
Wed Mar 7 14:16:20 EST 2007
On Thu, Mar 01, 2007 at 07:00:27PM -0500, jpollack at gmail.com wrote:
> As discussed on IRC, here is a patch renaming 'message' and 'error' to
> 'jifty_message' and 'jifty_error'. This is to avoid conflicting with
> other things that might have class="message" in the users' apps. It
> passes tests and seems to behave correctly.
The problem we ran into after deploying this is that it breaks every
single user application and needs template-level hacking to fix things.
We've temporarily backed it out while we research a solution.
Jesse
>
> Joshua
> Index: share/web/static/css/notices.css
> ===================================================================
> --- share/web/static/css/notices.css (revision 2878)
> +++ share/web/static/css/notices.css (working copy)
> @@ -1,20 +1,20 @@
> /* IE can't handle this nicely w/ AJAX validation */
>
> -html>body .message {
> +html>body .jifty_message {
> background: url(/static/images/silk/information.png) no-repeat center left;
> padding-left: 20px;
> }
>
> -html>body .error {
> +html>body .jifty_error {
> background: url(/static/images/silk/error.png) no-repeat center left;
> padding-left: 20px;
> }
>
> -.error {
> +.jifty_error {
> color: #a00000;
> }
>
> -div#messages, div#errors {
> +div#jifty_messages, div#jifty_errors {
> background-color: rgb(240,234,183);
> border: 1px solid rgb(230,224,173);
> margin-top: 10px;
> @@ -24,8 +24,8 @@
> position: relative;
> }
>
> -#dismiss_messages,
> -#dismiss_errors
> +#dismiss_jifty_messages,
> +#dismiss_jifty_errors
> {
> padding-left: 16px;
> background: url(/static/images/silk/cancel_grey.png) no-repeat;
> @@ -36,4 +36,3 @@
> display: block;
> text-indent: -9999em;
> }
> -
> Index: share/web/static/css/base.css
> ===================================================================
> --- share/web/static/css/base.css (revision 2878)
> +++ share/web/static/css/base.css (working copy)
> @@ -4,7 +4,7 @@
> body.calpopup {
> }
>
> -.error {
> +.jifty_error {
> color: #a00000;
> }
>
> @@ -20,11 +20,11 @@
> clear: both;
> }
>
> -.messages .message {
> +.jifty_messages .jifty_message {
> display: block;
> }
>
> -div#messages, div#errors {
> +div#jifty_messages, div#jifty_errors {
> background-color: rgb(240,234,183);
> border: 1px solid rgb(230,224,173);
> margin-top: 10px;
> Index: share/web/static/js/jifty.js
> ===================================================================
> --- share/web/static/js/jifty.js (revision 2878)
> +++ share/web/static/js/jifty.js (working copy)
> @@ -475,7 +475,7 @@
> Element.addClassName( e, "jifty_enter_handler_attached" );
> }
> },
> - ".messages": function(e) {
> + ".jifty_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;
> Index: lib/Jifty/Web.pm
> ===================================================================
> --- lib/Jifty/Web.pm (revision 2878)
> +++ lib/Jifty/Web.pm (working copy)
> @@ -871,12 +871,12 @@
>
> return unless grep {$_->$type()} values %results;
>
> - my $plural = $type . "s";
> - $self->out(qq{<div class="jifty results messages" id="$plural">});
> + my $plural = "jifty_" . $type . "s";
> + $self->out(qq{<div class="jifty results jifty_messages" id="$plural">});
>
> foreach my $moniker ( sort keys %results ) {
> if ( $results{$moniker}->$type() ) {
> - $self->out( qq{<div class="$type $moniker">}
> + $self->out( qq{<div class="jifty_$type $moniker">}
> . $results{$moniker}->$type()
> . qq{</div>} );
> }
> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
--
More information about the jifty-devel
mailing list