| | @@ -688,10 +688,62 @@ |
| 688 | 688 | } |
| 689 | 689 | } |
| 690 | 690 | return zResult; |
| 691 | 691 | } |
| 692 | 692 | |
| 693 | +extern const struct strctCssDefaults { |
| 694 | +/* From the generated default_css.h, which we cannot #include here |
| 695 | +** without causing an ODR violation. |
| 696 | +*/ |
| 697 | + const char *elementClass; /* Name of element needed */ |
| 698 | + const char *value; /* CSS text */ |
| 699 | +} cssDefaultList[]; |
| 700 | + |
| 701 | +/* |
| 702 | +** Emits the list of built-in default CSS selectors. Intended |
| 703 | +** for use only from the /setup_skinedit page. |
| 704 | +*/ |
| 705 | +static void skin_emit_css_defaults(){ |
| 706 | + struct strctCssDefaults const * pCss; |
| 707 | + fossil_print("<h1>CSS Defaults</h1>"); |
| 708 | + fossil_print("If a skin defines any of the following CSS selectors, " |
| 709 | + "that definition replaces the default, as opposed to " |
| 710 | + "cascading from it. "); |
| 711 | + fossil_print("See <a href=\"https://fossil-scm.org/fossil/" |
| 712 | + "doc/trunk/www/css-tricks.md\">this " |
| 713 | + "document</a> for more details."); |
| 714 | + /* To discuss: do we want to list only the default selectors or |
| 715 | + ** also their default values? The latter increases the size of the |
| 716 | + ** page considerably, but is arguably more useful. We could, of |
| 717 | + ** course, offer a URL param to toggle the view, but that currently |
| 718 | + ** seems like overkill. |
| 719 | + ** |
| 720 | + ** Be sure to adjust the default_css.txt #setup_skinedit_css entry |
| 721 | + ** for whichever impl ends up being selected. |
| 722 | + */ |
| 723 | +#if 1 |
| 724 | + /* List impl which elides style values */ |
| 725 | + fossil_print("<div class=\"columns\" " |
| 726 | + "id=\"setup_skinedit_css_defaults\"><ul>"); |
| 727 | + for(pCss = &cssDefaultList[0]; pCss->value!=0; ++pCss){ |
| 728 | + fossil_print("<li>%s</li>", pCss->elementClass); |
| 729 | + } |
| 730 | + fossil_print("</ul>"); |
| 731 | +#else |
| 732 | + /* Table impl which also includes style values. */ |
| 733 | + fossil_print("<table id=\"setup_skinedit_css_defaults\"><tbody>"); |
| 734 | + for(pCss = &cssDefaultList[0]; pCss->value!=0; ++pCss){ |
| 735 | + fossil_print("<tr><td>%s</td>", pCss->elementClass); |
| 736 | + /* A TD element apparently cannot be told to scroll its contents, |
| 737 | + ** so we require a DIV inside the value TD to scroll the long |
| 738 | + ** url(data:...) entries. */ |
| 739 | + fossil_print("<td><div>%s</div></td>", pCss->value); |
| 740 | + fossil_print("</td></tr>"); |
| 741 | + } |
| 742 | + fossil_print("</tbody></table>"); |
| 743 | +#endif |
| 744 | +} |
| 693 | 745 | |
| 694 | 746 | /* |
| 695 | 747 | ** WEBPAGE: setup_skinedit |
| 696 | 748 | ** |
| 697 | 749 | ** Edit aspects of a skin determined by the w= query parameter. |
| | @@ -814,10 +866,13 @@ |
| 814 | 866 | blob_reset(&from); |
| 815 | 867 | blob_reset(&to); |
| 816 | 868 | blob_reset(&out); |
| 817 | 869 | } |
| 818 | 870 | @ </div></form> |
| 871 | + if(ii==0/*CSS*/){ |
| 872 | + skin_emit_css_defaults(); |
| 873 | + } |
| 819 | 874 | style_footer(); |
| 820 | 875 | db_end_transaction(0); |
| 821 | 876 | } |
| 822 | 877 | |
| 823 | 878 | /* |
| 824 | 879 | |