afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
afuna ([personal profile] afuna) wrote in [site community profile] changelog2009-11-23 04:28 pm

[dw-free] selecting/deselecting colors when adding to circle

[commit: http://hg.dwscoalition.org/dw-free/rev/12fbf1b192f0]

http://bugs.dwscoalition.org/show_bug.cgi?id=491

Respect the "select friend colors" checkbox, so that if you select custom
friends colors, then change your mind and uncheck the checkbox, we *don't*
add the colors

Patch by [personal profile] afuna.

Files modified:
  • htdocs/manage/circle/add.bml
--------------------------------------------------------------------------------
diff -r a6fda2a24dea -r 12fbf1b192f0 htdocs/manage/circle/add.bml
--- a/htdocs/manage/circle/add.bml	Sat Nov 21 16:40:05 2009 -0600
+++ b/htdocs/manage/circle/add.bml	Mon Nov 23 16:26:55 2009 +0000
@@ -76,8 +76,8 @@
         }
 
         if ( $POST{add_watch} ) {
-            my $fg = LJ::color_todb( $POST{editfriend_add_1_fg} );
-            my $bg = LJ::color_todb( $POST{editfriend_add_1_bg} );
+            my $fg = $POST{color_switch} ? LJ::color_todb( $POST{editfriend_add_1_fg} ) : "";
+            my $bg = $POST{color_switch} ? LJ::color_todb( $POST{editfriend_add_1_bg} ) : "";
             $remote->add_edge( $u, watch => {
                 fgcolor => $fg,
                 bgcolor => $bg,
@@ -270,7 +270,7 @@
 
     ## let them pick the colors
     my $color_text = "<?p <table><tr><td valign=\"top\"><i>$ML{'.optional'}:</i> ".
-             "<input type=\"checkbox\" id=\"color_switch\" value=\"\" onClick=\"color_display(this);\"> </td><td><label for=\"color_switch\">" .
+             "<input type=\"checkbox\" id=\"color_switch\" name=\"color_switch\" onClick=\"color_display(this);\"> </td><td><label for=\"color_switch\">" .
              BML::ml( '.colors.text', { user => $username } ) .
              "</label><br /><span style=\"font-size: 7pt;\">($ML{'.colors.disclaimer'})</span></td></tr></table> p?>";
     $body .= "<script>\n";
--------------------------------------------------------------------------------