]> git.wh0rd.org Git - tt-rss.git/commitdiff
label editor: print active color indicator
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 19 Nov 2010 15:32:09 +0000 (18:32 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 19 Nov 2010 15:32:09 +0000 (18:32 +0300)
modules/pref-labels.php

index d7352e5e862e5d27caf20f9114c9136405ea3211..42b1b3cd75dfd9c55c1eb2df105e3e42bcec84f2 100644 (file)
 
                        print "<div class=\"dlgSecCont\">";
 
+                       $fg_color = $line['fg_color'];
+                       $bg_color = $line['bg_color'];
+
+                       print "<span class=\"labelColorIndicator\" id=\"label-editor-indicator\" style='color : $fg_color; background-color : $bg_color'>&alpha;</span>";
+
                        print "<input style=\"font-size : 18px\" name=\"caption\" 
                                onkeypress=\"return filterCR(event, editLabelSave)\"
                                value=\"".htmlspecialchars($line['caption'])."\">";
 
                        print "<tr><td style='padding-right : 10px'>";
 
-                       $fg_color = $line['fg_color'];
-                       $bg_color = $line['bg_color'];
-
                        print "<input type=\"hidden\" name=\"fg_color\" value=\"$fg_color\">";
                        print "<input type=\"hidden\" name=\"bg_color\" value=\"$bg_color\">";
 
                        print "<div dojoType=\"dijit.ColorPalette\">
                                <script type=\"dojo/method\" event=\"onChange\" args=\"fg_color\">
                                        document.forms['label_edit_form'].fg_color.value = fg_color;
+                                       $('label-editor-indicator').setStyle({color: fg_color});
                                </script>
                        </div>";
                        print "</div>";
@@ -60,6 +63,7 @@
                        print "<div dojoType=\"dijit.ColorPalette\">
                                <script type=\"dojo/method\" event=\"onChange\" args=\"bg_color\">
                                        document.forms['label_edit_form'].bg_color.value = bg_color;
+                                       $('label-editor-indicator').setStyle({backgroundColor: bg_color});
                                </script>
                        </div>";
                        print "</div>";