Fossil SCM
Add the "lappend" TH1 command. All built-in skins now respond to the "desktoponly" and "wideonly" classes on the main menu.
Commit
d4c91b40a4eb05a94a6711ad3aa0641cb5542b291241bb116eae1e9b878a5a97
Parent
eb5356185e0ef46…
19 files changed
-3
+2
-3
+1
-1
-3
+2
-3
-3
+2
-3
-13
-9
+1
-1
+1
-1
+1
-1
+1
-1
+1
-1
+1
-1
+1
-1
+13
+34
-13
+39
~
skins/ardoise/css.txt
~
skins/ardoise/header.txt
~
skins/black_and_white/header.txt
~
skins/blitz/css.txt
~
skins/blitz/header.txt
~
skins/blitz_no_logo/css.txt
~
skins/blitz_no_logo/header.txt
~
skins/darkmode/css.txt
~
skins/default/css.txt
~
skins/eagle/header.txt
~
skins/enhanced1/header.txt
~
skins/khaki/header.txt
~
skins/original/header.txt
~
skins/plain_gray/header.txt
~
skins/rounded1/header.txt
~
skins/xekri/header.txt
~
src/default.css
~
src/style.c
~
src/th_lang.c
| --- skins/ardoise/css.txt | ||
| +++ skins/ardoise/css.txt | ||
| @@ -699,17 +699,15 @@ | ||
| 699 | 699 | clear: both |
| 700 | 700 | z-index: 21; |
| 701 | 701 | } |
| 702 | 702 | .mainmenu ul { |
| 703 | 703 | list-style: none; |
| 704 | - display: block; | |
| 705 | 704 | border-top: 1px solid transparent; |
| 706 | 705 | padding: 0 |
| 707 | 706 | } |
| 708 | 707 | .mainmenu li { |
| 709 | 708 | outline: 0; |
| 710 | - display: block; | |
| 711 | 709 | float: left; |
| 712 | 710 | margin: 0 |
| 713 | 711 | } |
| 714 | 712 | .mainmenu li.active { |
| 715 | 713 | background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNyIgaGVpZ2h0PSI5IiB2aWV3Qm94PSIwIDAgNC40OTggMi4zODEiPjxwYXRoIGQ9Ik00LjIzMyAyLjM4MUguMjY1bC45OTgtMS4wNTguOTg2LTEuMDU4Ljk5OCAxLjA2MnoiIGZpbGw9IiNmZjgwMDAiLz48L3N2Zz4=); |
| @@ -716,11 +714,10 @@ | ||
| 716 | 714 | background-repeat: no-repeat; |
| 717 | 715 | background-position: center bottom |
| 718 | 716 | } |
| 719 | 717 | .mainmenu li a { |
| 720 | 718 | color: #66a8c7; |
| 721 | - display: block; | |
| 722 | 719 | padding: 10px 15px |
| 723 | 720 | } |
| 724 | 721 | .mainmenu li.active a { |
| 725 | 722 | text-shadow: 0 0 1px #b1d2e2 |
| 726 | 723 | } |
| 727 | 724 |
| --- skins/ardoise/css.txt | |
| +++ skins/ardoise/css.txt | |
| @@ -699,17 +699,15 @@ | |
| 699 | clear: both |
| 700 | z-index: 21; |
| 701 | } |
| 702 | .mainmenu ul { |
| 703 | list-style: none; |
| 704 | display: block; |
| 705 | border-top: 1px solid transparent; |
| 706 | padding: 0 |
| 707 | } |
| 708 | .mainmenu li { |
| 709 | outline: 0; |
| 710 | display: block; |
| 711 | float: left; |
| 712 | margin: 0 |
| 713 | } |
| 714 | .mainmenu li.active { |
| 715 | background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNyIgaGVpZ2h0PSI5IiB2aWV3Qm94PSIwIDAgNC40OTggMi4zODEiPjxwYXRoIGQ9Ik00LjIzMyAyLjM4MUguMjY1bC45OTgtMS4wNTguOTg2LTEuMDU4Ljk5OCAxLjA2MnoiIGZpbGw9IiNmZjgwMDAiLz48L3N2Zz4=); |
| @@ -716,11 +714,10 @@ | |
| 716 | background-repeat: no-repeat; |
| 717 | background-position: center bottom |
| 718 | } |
| 719 | .mainmenu li a { |
| 720 | color: #66a8c7; |
| 721 | display: block; |
| 722 | padding: 10px 15px |
| 723 | } |
| 724 | .mainmenu li.active a { |
| 725 | text-shadow: 0 0 1px #b1d2e2 |
| 726 | } |
| 727 |
| --- skins/ardoise/css.txt | |
| +++ skins/ardoise/css.txt | |
| @@ -699,17 +699,15 @@ | |
| 699 | clear: both |
| 700 | z-index: 21; |
| 701 | } |
| 702 | .mainmenu ul { |
| 703 | list-style: none; |
| 704 | border-top: 1px solid transparent; |
| 705 | padding: 0 |
| 706 | } |
| 707 | .mainmenu li { |
| 708 | outline: 0; |
| 709 | float: left; |
| 710 | margin: 0 |
| 711 | } |
| 712 | .mainmenu li.active { |
| 713 | background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNyIgaGVpZ2h0PSI5IiB2aWV3Qm94PSIwIDAgNC40OTggMi4zODEiPjxwYXRoIGQ9Ik00LjIzMyAyLjM4MUguMjY1bC45OTgtMS4wNTguOTg2LTEuMDU4Ljk5OCAxLjA2MnoiIGZpbGw9IiNmZjgwMDAiLz48L3N2Zz4=); |
| @@ -716,11 +714,10 @@ | |
| 714 | background-repeat: no-repeat; |
| 715 | background-position: center bottom |
| 716 | } |
| 717 | .mainmenu li a { |
| 718 | color: #66a8c7; |
| 719 | padding: 10px 15px |
| 720 | } |
| 721 | .mainmenu li.active a { |
| 722 | text-shadow: 0 0 1px #b1d2e2 |
| 723 | } |
| 724 |
+2
-3
| --- skins/ardoise/header.txt | ||
| +++ skins/ardoise/header.txt | ||
| @@ -27,15 +27,14 @@ | ||
| 27 | 27 | builtin_request_js hbmenu.js |
| 28 | 28 | set once 1 |
| 29 | 29 | foreach {name url expr class} $mainmenu { |
| 30 | 30 | if {![capexpr $expr]} continue |
| 31 | 31 | if {$once && [string match /$current_page* $url]} { |
| 32 | - html "<li class='active'>" | |
| 32 | + lappend class active | |
| 33 | 33 | set once 0 |
| 34 | - } else { | |
| 35 | - html "<li>" | |
| 36 | 34 | } |
| 35 | + html "<li class='$class'>" | |
| 37 | 36 | if {[string match /* $url]} {set url $home$url} |
| 38 | 37 | html "<a href='$url'>$name</a></li>\n" |
| 39 | 38 | } |
| 40 | 39 | </th1></ul> |
| 41 | 40 | </div> <!-- end div mainmenu --> |
| 42 | 41 |
| --- skins/ardoise/header.txt | |
| +++ skins/ardoise/header.txt | |
| @@ -27,15 +27,14 @@ | |
| 27 | builtin_request_js hbmenu.js |
| 28 | set once 1 |
| 29 | foreach {name url expr class} $mainmenu { |
| 30 | if {![capexpr $expr]} continue |
| 31 | if {$once && [string match /$current_page* $url]} { |
| 32 | html "<li class='active'>" |
| 33 | set once 0 |
| 34 | } else { |
| 35 | html "<li>" |
| 36 | } |
| 37 | if {[string match /* $url]} {set url $home$url} |
| 38 | html "<a href='$url'>$name</a></li>\n" |
| 39 | } |
| 40 | </th1></ul> |
| 41 | </div> <!-- end div mainmenu --> |
| 42 |
| --- skins/ardoise/header.txt | |
| +++ skins/ardoise/header.txt | |
| @@ -27,15 +27,14 @@ | |
| 27 | builtin_request_js hbmenu.js |
| 28 | set once 1 |
| 29 | foreach {name url expr class} $mainmenu { |
| 30 | if {![capexpr $expr]} continue |
| 31 | if {$once && [string match /$current_page* $url]} { |
| 32 | lappend class active |
| 33 | set once 0 |
| 34 | } |
| 35 | html "<li class='$class'>" |
| 36 | if {[string match /* $url]} {set url $home$url} |
| 37 | html "<a href='$url'>$name</a></li>\n" |
| 38 | } |
| 39 | </th1></ul> |
| 40 | </div> <!-- end div mainmenu --> |
| 41 |
+1
-1
| --- skins/black_and_white/header.txt | ||
| +++ skins/black_and_white/header.txt | ||
| @@ -15,8 +15,8 @@ | ||
| 15 | 15 | <div class="mainmenu"> |
| 16 | 16 | <th1> |
| 17 | 17 | foreach {name url expr class} $mainmenu { |
| 18 | 18 | if {![capexpr $expr]} continue |
| 19 | 19 | if {[string match /* $url]} {set url $home$url} |
| 20 | - html "<a href='$url'>$name</a><br/>\n" | |
| 20 | + html "<a href='$url' class='$class'>$name</a><br/>\n" | |
| 21 | 21 | } |
| 22 | 22 | </th1></div> |
| 23 | 23 |
| --- skins/black_and_white/header.txt | |
| +++ skins/black_and_white/header.txt | |
| @@ -15,8 +15,8 @@ | |
| 15 | <div class="mainmenu"> |
| 16 | <th1> |
| 17 | foreach {name url expr class} $mainmenu { |
| 18 | if {![capexpr $expr]} continue |
| 19 | if {[string match /* $url]} {set url $home$url} |
| 20 | html "<a href='$url'>$name</a><br/>\n" |
| 21 | } |
| 22 | </th1></div> |
| 23 |
| --- skins/black_and_white/header.txt | |
| +++ skins/black_and_white/header.txt | |
| @@ -15,8 +15,8 @@ | |
| 15 | <div class="mainmenu"> |
| 16 | <th1> |
| 17 | foreach {name url expr class} $mainmenu { |
| 18 | if {![capexpr $expr]} continue |
| 19 | if {[string match /* $url]} {set url $home$url} |
| 20 | html "<a href='$url' class='$class'>$name</a><br/>\n" |
| 21 | } |
| 22 | </th1></div> |
| 23 |
-3
| --- skins/blitz/css.txt | ||
| +++ skins/blitz/css.txt | ||
| @@ -848,19 +848,17 @@ | ||
| 848 | 848 | clear:both; |
| 849 | 849 | } |
| 850 | 850 | |
| 851 | 851 | .mainmenu ul { |
| 852 | 852 | list-style: none outside; |
| 853 | - display: block; | |
| 854 | 853 | position: relative; |
| 855 | 854 | border-top: 1px solid #ccc; |
| 856 | 855 | padding: 0; |
| 857 | 856 | } |
| 858 | 857 | |
| 859 | 858 | .mainmenu li { |
| 860 | 859 | outline: 0; |
| 861 | - display: block; | |
| 862 | 860 | float: left; |
| 863 | 861 | margin: 0; |
| 864 | 862 | } |
| 865 | 863 | |
| 866 | 864 | .mainmenu li.active { |
| @@ -869,11 +867,10 @@ | ||
| 869 | 867 | background-position: center bottom; |
| 870 | 868 | } |
| 871 | 869 | |
| 872 | 870 | .mainmenu li a { |
| 873 | 871 | color: #3b5c6b; |
| 874 | - display: block; | |
| 875 | 872 | padding: 10px 15px; |
| 876 | 873 | } |
| 877 | 874 | |
| 878 | 875 | .mainmenu li.active a { |
| 879 | 876 | font-weight: bold; |
| 880 | 877 |
| --- skins/blitz/css.txt | |
| +++ skins/blitz/css.txt | |
| @@ -848,19 +848,17 @@ | |
| 848 | clear:both; |
| 849 | } |
| 850 | |
| 851 | .mainmenu ul { |
| 852 | list-style: none outside; |
| 853 | display: block; |
| 854 | position: relative; |
| 855 | border-top: 1px solid #ccc; |
| 856 | padding: 0; |
| 857 | } |
| 858 | |
| 859 | .mainmenu li { |
| 860 | outline: 0; |
| 861 | display: block; |
| 862 | float: left; |
| 863 | margin: 0; |
| 864 | } |
| 865 | |
| 866 | .mainmenu li.active { |
| @@ -869,11 +867,10 @@ | |
| 869 | background-position: center bottom; |
| 870 | } |
| 871 | |
| 872 | .mainmenu li a { |
| 873 | color: #3b5c6b; |
| 874 | display: block; |
| 875 | padding: 10px 15px; |
| 876 | } |
| 877 | |
| 878 | .mainmenu li.active a { |
| 879 | font-weight: bold; |
| 880 |
| --- skins/blitz/css.txt | |
| +++ skins/blitz/css.txt | |
| @@ -848,19 +848,17 @@ | |
| 848 | clear:both; |
| 849 | } |
| 850 | |
| 851 | .mainmenu ul { |
| 852 | list-style: none outside; |
| 853 | position: relative; |
| 854 | border-top: 1px solid #ccc; |
| 855 | padding: 0; |
| 856 | } |
| 857 | |
| 858 | .mainmenu li { |
| 859 | outline: 0; |
| 860 | float: left; |
| 861 | margin: 0; |
| 862 | } |
| 863 | |
| 864 | .mainmenu li.active { |
| @@ -869,11 +867,10 @@ | |
| 867 | background-position: center bottom; |
| 868 | } |
| 869 | |
| 870 | .mainmenu li a { |
| 871 | color: #3b5c6b; |
| 872 | padding: 10px 15px; |
| 873 | } |
| 874 | |
| 875 | .mainmenu li.active a { |
| 876 | font-weight: bold; |
| 877 |
+2
-3
| --- skins/blitz/header.txt | ||
| +++ skins/blitz/header.txt | ||
| @@ -28,15 +28,14 @@ | ||
| 28 | 28 | <ul><th1> |
| 29 | 29 | set once 1 |
| 30 | 30 | foreach {name url expr class} $mainmenu { |
| 31 | 31 | if {![capexpr $expr]} continue |
| 32 | 32 | if {$once && [string match /$current_page* $url]} { |
| 33 | - html "<li class='active'>" | |
| 33 | + lappend class active | |
| 34 | 34 | set once 0 |
| 35 | - } else { | |
| 36 | - html "<li>" | |
| 37 | 35 | } |
| 36 | + html "<li class='$class'>" | |
| 38 | 37 | if {[string match /* $url]} {set url $home$url} |
| 39 | 38 | html "<a href='$url'>$name</a></li>\n" |
| 40 | 39 | } |
| 41 | 40 | </th1></ul> |
| 42 | 41 | </div> <!-- end div mainmenu --> |
| 43 | 42 |
| --- skins/blitz/header.txt | |
| +++ skins/blitz/header.txt | |
| @@ -28,15 +28,14 @@ | |
| 28 | <ul><th1> |
| 29 | set once 1 |
| 30 | foreach {name url expr class} $mainmenu { |
| 31 | if {![capexpr $expr]} continue |
| 32 | if {$once && [string match /$current_page* $url]} { |
| 33 | html "<li class='active'>" |
| 34 | set once 0 |
| 35 | } else { |
| 36 | html "<li>" |
| 37 | } |
| 38 | if {[string match /* $url]} {set url $home$url} |
| 39 | html "<a href='$url'>$name</a></li>\n" |
| 40 | } |
| 41 | </th1></ul> |
| 42 | </div> <!-- end div mainmenu --> |
| 43 |
| --- skins/blitz/header.txt | |
| +++ skins/blitz/header.txt | |
| @@ -28,15 +28,14 @@ | |
| 28 | <ul><th1> |
| 29 | set once 1 |
| 30 | foreach {name url expr class} $mainmenu { |
| 31 | if {![capexpr $expr]} continue |
| 32 | if {$once && [string match /$current_page* $url]} { |
| 33 | lappend class active |
| 34 | set once 0 |
| 35 | } |
| 36 | html "<li class='$class'>" |
| 37 | if {[string match /* $url]} {set url $home$url} |
| 38 | html "<a href='$url'>$name</a></li>\n" |
| 39 | } |
| 40 | </th1></ul> |
| 41 | </div> <!-- end div mainmenu --> |
| 42 |
| --- skins/blitz_no_logo/css.txt | ||
| +++ skins/blitz_no_logo/css.txt | ||
| @@ -848,19 +848,17 @@ | ||
| 848 | 848 | clear:both; |
| 849 | 849 | } |
| 850 | 850 | |
| 851 | 851 | .mainmenu ul { |
| 852 | 852 | list-style: none outside; |
| 853 | - display: block; | |
| 854 | 853 | position: relative; |
| 855 | 854 | border-top: 1px solid #ccc; |
| 856 | 855 | padding: 0; |
| 857 | 856 | } |
| 858 | 857 | |
| 859 | 858 | .mainmenu li { |
| 860 | 859 | outline: 0; |
| 861 | - display: block; | |
| 862 | 860 | float: left; |
| 863 | 861 | margin: 0; |
| 864 | 862 | } |
| 865 | 863 | |
| 866 | 864 | .mainmenu li.active { |
| @@ -869,11 +867,10 @@ | ||
| 869 | 867 | background-position: center bottom; |
| 870 | 868 | } |
| 871 | 869 | |
| 872 | 870 | .mainmenu li a { |
| 873 | 871 | color: #3b5c6b; |
| 874 | - display: block; | |
| 875 | 872 | padding: 10px 15px; |
| 876 | 873 | } |
| 877 | 874 | |
| 878 | 875 | .mainmenu li.active a { |
| 879 | 876 | font-weight: bold; |
| 880 | 877 |
| --- skins/blitz_no_logo/css.txt | |
| +++ skins/blitz_no_logo/css.txt | |
| @@ -848,19 +848,17 @@ | |
| 848 | clear:both; |
| 849 | } |
| 850 | |
| 851 | .mainmenu ul { |
| 852 | list-style: none outside; |
| 853 | display: block; |
| 854 | position: relative; |
| 855 | border-top: 1px solid #ccc; |
| 856 | padding: 0; |
| 857 | } |
| 858 | |
| 859 | .mainmenu li { |
| 860 | outline: 0; |
| 861 | display: block; |
| 862 | float: left; |
| 863 | margin: 0; |
| 864 | } |
| 865 | |
| 866 | .mainmenu li.active { |
| @@ -869,11 +867,10 @@ | |
| 869 | background-position: center bottom; |
| 870 | } |
| 871 | |
| 872 | .mainmenu li a { |
| 873 | color: #3b5c6b; |
| 874 | display: block; |
| 875 | padding: 10px 15px; |
| 876 | } |
| 877 | |
| 878 | .mainmenu li.active a { |
| 879 | font-weight: bold; |
| 880 |
| --- skins/blitz_no_logo/css.txt | |
| +++ skins/blitz_no_logo/css.txt | |
| @@ -848,19 +848,17 @@ | |
| 848 | clear:both; |
| 849 | } |
| 850 | |
| 851 | .mainmenu ul { |
| 852 | list-style: none outside; |
| 853 | position: relative; |
| 854 | border-top: 1px solid #ccc; |
| 855 | padding: 0; |
| 856 | } |
| 857 | |
| 858 | .mainmenu li { |
| 859 | outline: 0; |
| 860 | float: left; |
| 861 | margin: 0; |
| 862 | } |
| 863 | |
| 864 | .mainmenu li.active { |
| @@ -869,11 +867,10 @@ | |
| 867 | background-position: center bottom; |
| 868 | } |
| 869 | |
| 870 | .mainmenu li a { |
| 871 | color: #3b5c6b; |
| 872 | padding: 10px 15px; |
| 873 | } |
| 874 | |
| 875 | .mainmenu li.active a { |
| 876 | font-weight: bold; |
| 877 |
+2
-3
| --- skins/blitz_no_logo/header.txt | ||
| +++ skins/blitz_no_logo/header.txt | ||
| @@ -25,15 +25,14 @@ | ||
| 25 | 25 | <ul><th1> |
| 26 | 26 | set once 1 |
| 27 | 27 | foreach {name url expr class} $mainmenu { |
| 28 | 28 | if {![capexpr $expr]} continue |
| 29 | 29 | if {$once && [string match /$current_page* $url]} { |
| 30 | - html "<li class='active'>" | |
| 30 | + lappend class active | |
| 31 | 31 | set once 0 |
| 32 | - } else { | |
| 33 | - html "<li>" | |
| 34 | 32 | } |
| 33 | + html "<li class='$class'>" | |
| 35 | 34 | if {[string match /* $url]} {set url $home$url} |
| 36 | 35 | html "<a href='$url'>$name</a></li>\n" |
| 37 | 36 | } |
| 38 | 37 | </th1></ul> |
| 39 | 38 | </div> <!-- end div mainmenu --> |
| 40 | 39 |
| --- skins/blitz_no_logo/header.txt | |
| +++ skins/blitz_no_logo/header.txt | |
| @@ -25,15 +25,14 @@ | |
| 25 | <ul><th1> |
| 26 | set once 1 |
| 27 | foreach {name url expr class} $mainmenu { |
| 28 | if {![capexpr $expr]} continue |
| 29 | if {$once && [string match /$current_page* $url]} { |
| 30 | html "<li class='active'>" |
| 31 | set once 0 |
| 32 | } else { |
| 33 | html "<li>" |
| 34 | } |
| 35 | if {[string match /* $url]} {set url $home$url} |
| 36 | html "<a href='$url'>$name</a></li>\n" |
| 37 | } |
| 38 | </th1></ul> |
| 39 | </div> <!-- end div mainmenu --> |
| 40 |
| --- skins/blitz_no_logo/header.txt | |
| +++ skins/blitz_no_logo/header.txt | |
| @@ -25,15 +25,14 @@ | |
| 25 | <ul><th1> |
| 26 | set once 1 |
| 27 | foreach {name url expr class} $mainmenu { |
| 28 | if {![capexpr $expr]} continue |
| 29 | if {$once && [string match /$current_page* $url]} { |
| 30 | lappend class active |
| 31 | set once 0 |
| 32 | } |
| 33 | html "<li class='$class'>" |
| 34 | if {[string match /* $url]} {set url $home$url} |
| 35 | html "<a href='$url'>$name</a></li>\n" |
| 36 | } |
| 37 | </th1></ul> |
| 38 | </div> <!-- end div mainmenu --> |
| 39 |
-13
| --- skins/darkmode/css.txt | ||
| +++ skins/darkmode/css.txt | ||
| @@ -550,18 +550,5 @@ | ||
| 550 | 550 | |
| 551 | 551 | body.forum .forumPostBody > div blockquote { |
| 552 | 552 | border: 1px inset; |
| 553 | 553 | padding: 0 0.5em; |
| 554 | 554 | } |
| 555 | - | |
| 556 | -@media screen and (max-width: 600px) { | |
| 557 | - /* Spacing for mobile */ | |
| 558 | - .desktoponly { | |
| 559 | - display: none; | |
| 560 | - } | |
| 561 | -} | |
| 562 | -@media screen and (max-width: 1200px) { | |
| 563 | - /* Special declarations for narrow desktop or wide mobile */ | |
| 564 | - .wideonly { | |
| 565 | - display: none; | |
| 566 | - } | |
| 567 | -} | |
| 568 | 555 |
| --- skins/darkmode/css.txt | |
| +++ skins/darkmode/css.txt | |
| @@ -550,18 +550,5 @@ | |
| 550 | |
| 551 | body.forum .forumPostBody > div blockquote { |
| 552 | border: 1px inset; |
| 553 | padding: 0 0.5em; |
| 554 | } |
| 555 | |
| 556 | @media screen and (max-width: 600px) { |
| 557 | /* Spacing for mobile */ |
| 558 | .desktoponly { |
| 559 | display: none; |
| 560 | } |
| 561 | } |
| 562 | @media screen and (max-width: 1200px) { |
| 563 | /* Special declarations for narrow desktop or wide mobile */ |
| 564 | .wideonly { |
| 565 | display: none; |
| 566 | } |
| 567 | } |
| 568 |
| --- skins/darkmode/css.txt | |
| +++ skins/darkmode/css.txt | |
| @@ -550,18 +550,5 @@ | |
| 550 | |
| 551 | body.forum .forumPostBody > div blockquote { |
| 552 | border: 1px inset; |
| 553 | padding: 0 0.5em; |
| 554 | } |
| 555 |
| --- skins/default/css.txt | ||
| +++ skins/default/css.txt | ||
| @@ -272,13 +272,10 @@ | ||
| 272 | 272 | padding: 10px 10px; |
| 273 | 273 | } |
| 274 | 274 | .mainmenu { |
| 275 | 275 | padding: 10px; |
| 276 | 276 | } |
| 277 | - .desktoponly { | |
| 278 | - display: none; | |
| 279 | - } | |
| 280 | 277 | } |
| 281 | 278 | @media screen and (min-width: 600px) { |
| 282 | 279 | /* Spacing for desktop */ |
| 283 | 280 | body { |
| 284 | 281 | padding-left: 20px; |
| @@ -294,11 +291,5 @@ | ||
| 294 | 291 | } |
| 295 | 292 | .mainmenu { |
| 296 | 293 | padding: 10px; |
| 297 | 294 | } |
| 298 | 295 | } |
| 299 | -@media screen and (max-width: 1200px) { | |
| 300 | - /* Special declarations for narrow desktop or wide mobile */ | |
| 301 | - .wideonly { | |
| 302 | - display: none; | |
| 303 | - } | |
| 304 | -} | |
| 305 | 296 |
| --- skins/default/css.txt | |
| +++ skins/default/css.txt | |
| @@ -272,13 +272,10 @@ | |
| 272 | padding: 10px 10px; |
| 273 | } |
| 274 | .mainmenu { |
| 275 | padding: 10px; |
| 276 | } |
| 277 | .desktoponly { |
| 278 | display: none; |
| 279 | } |
| 280 | } |
| 281 | @media screen and (min-width: 600px) { |
| 282 | /* Spacing for desktop */ |
| 283 | body { |
| 284 | padding-left: 20px; |
| @@ -294,11 +291,5 @@ | |
| 294 | } |
| 295 | .mainmenu { |
| 296 | padding: 10px; |
| 297 | } |
| 298 | } |
| 299 | @media screen and (max-width: 1200px) { |
| 300 | /* Special declarations for narrow desktop or wide mobile */ |
| 301 | .wideonly { |
| 302 | display: none; |
| 303 | } |
| 304 | } |
| 305 |
| --- skins/default/css.txt | |
| +++ skins/default/css.txt | |
| @@ -272,13 +272,10 @@ | |
| 272 | padding: 10px 10px; |
| 273 | } |
| 274 | .mainmenu { |
| 275 | padding: 10px; |
| 276 | } |
| 277 | } |
| 278 | @media screen and (min-width: 600px) { |
| 279 | /* Spacing for desktop */ |
| 280 | body { |
| 281 | padding-left: 20px; |
| @@ -294,11 +291,5 @@ | |
| 291 | } |
| 292 | .mainmenu { |
| 293 | padding: 10px; |
| 294 | } |
| 295 | } |
| 296 |
+1
-1
| --- skins/eagle/header.txt | ||
| +++ skins/eagle/header.txt | ||
| @@ -93,11 +93,11 @@ | ||
| 93 | 93 | </script> |
| 94 | 94 | <div class="mainmenu"><th1> |
| 95 | 95 | foreach {name url expr class} $mainmenu { |
| 96 | 96 | if {![capexpr $expr]} continue |
| 97 | 97 | if {[string match /* $url]} {set url $home$url} |
| 98 | - html "<a href='$url'>$name</a>\n" | |
| 98 | + html "<a href='$url' class='$class'>$name</a>\n" | |
| 99 | 99 | } |
| 100 | 100 | if {[info exists login]} { |
| 101 | 101 | html "<a href='$home/logout'>Logout</a>\n" |
| 102 | 102 | } else { |
| 103 | 103 | html "<a href='$home/login'>Login</a>\n" |
| 104 | 104 |
| --- skins/eagle/header.txt | |
| +++ skins/eagle/header.txt | |
| @@ -93,11 +93,11 @@ | |
| 93 | </script> |
| 94 | <div class="mainmenu"><th1> |
| 95 | foreach {name url expr class} $mainmenu { |
| 96 | if {![capexpr $expr]} continue |
| 97 | if {[string match /* $url]} {set url $home$url} |
| 98 | html "<a href='$url'>$name</a>\n" |
| 99 | } |
| 100 | if {[info exists login]} { |
| 101 | html "<a href='$home/logout'>Logout</a>\n" |
| 102 | } else { |
| 103 | html "<a href='$home/login'>Login</a>\n" |
| 104 |
| --- skins/eagle/header.txt | |
| +++ skins/eagle/header.txt | |
| @@ -93,11 +93,11 @@ | |
| 93 | </script> |
| 94 | <div class="mainmenu"><th1> |
| 95 | foreach {name url expr class} $mainmenu { |
| 96 | if {![capexpr $expr]} continue |
| 97 | if {[string match /* $url]} {set url $home$url} |
| 98 | html "<a href='$url' class='$class'>$name</a>\n" |
| 99 | } |
| 100 | if {[info exists login]} { |
| 101 | html "<a href='$home/logout'>Logout</a>\n" |
| 102 | } else { |
| 103 | html "<a href='$home/login'>Login</a>\n" |
| 104 |
+1
-1
| --- skins/enhanced1/header.txt | ||
| +++ skins/enhanced1/header.txt | ||
| @@ -93,8 +93,8 @@ | ||
| 93 | 93 | </script> |
| 94 | 94 | <div class="mainmenu"><th1> |
| 95 | 95 | foreach {name url expr class} $mainmenu { |
| 96 | 96 | if {![capexpr $expr]} continue |
| 97 | 97 | if {[string match /* $url]} {set url $home$url} |
| 98 | - html "<a href='$url'>$name</a>\n" | |
| 98 | + html "<a href='$url' class='$class'>$name</a>\n" | |
| 99 | 99 | } |
| 100 | 100 | </th1></div> |
| 101 | 101 |
| --- skins/enhanced1/header.txt | |
| +++ skins/enhanced1/header.txt | |
| @@ -93,8 +93,8 @@ | |
| 93 | </script> |
| 94 | <div class="mainmenu"><th1> |
| 95 | foreach {name url expr class} $mainmenu { |
| 96 | if {![capexpr $expr]} continue |
| 97 | if {[string match /* $url]} {set url $home$url} |
| 98 | html "<a href='$url'>$name</a>\n" |
| 99 | } |
| 100 | </th1></div> |
| 101 |
| --- skins/enhanced1/header.txt | |
| +++ skins/enhanced1/header.txt | |
| @@ -93,8 +93,8 @@ | |
| 93 | </script> |
| 94 | <div class="mainmenu"><th1> |
| 95 | foreach {name url expr class} $mainmenu { |
| 96 | if {![capexpr $expr]} continue |
| 97 | if {[string match /* $url]} {set url $home$url} |
| 98 | html "<a href='$url' class='$class'>$name</a>\n" |
| 99 | } |
| 100 | </th1></div> |
| 101 |
+1
-1
| --- skins/khaki/header.txt | ||
| +++ skins/khaki/header.txt | ||
| @@ -14,9 +14,9 @@ | ||
| 14 | 14 | html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>☰</a>" |
| 15 | 15 | builtin_request_js hbmenu.js |
| 16 | 16 | foreach {name url expr class} $mainmenu { |
| 17 | 17 | if {![capexpr $expr]} continue |
| 18 | 18 | if {[string match /* $url]} {set url $home$url} |
| 19 | - html "<a href='$url'>$name</a>\n" | |
| 19 | + html "<a href='$url' class='$class'>$name</a>\n" | |
| 20 | 20 | } |
| 21 | 21 | </th1></div> |
| 22 | 22 | <div id='hbdrop'></div> |
| 23 | 23 |
| --- skins/khaki/header.txt | |
| +++ skins/khaki/header.txt | |
| @@ -14,9 +14,9 @@ | |
| 14 | html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>☰</a>" |
| 15 | builtin_request_js hbmenu.js |
| 16 | foreach {name url expr class} $mainmenu { |
| 17 | if {![capexpr $expr]} continue |
| 18 | if {[string match /* $url]} {set url $home$url} |
| 19 | html "<a href='$url'>$name</a>\n" |
| 20 | } |
| 21 | </th1></div> |
| 22 | <div id='hbdrop'></div> |
| 23 |
| --- skins/khaki/header.txt | |
| +++ skins/khaki/header.txt | |
| @@ -14,9 +14,9 @@ | |
| 14 | html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>☰</a>" |
| 15 | builtin_request_js hbmenu.js |
| 16 | foreach {name url expr class} $mainmenu { |
| 17 | if {![capexpr $expr]} continue |
| 18 | if {[string match /* $url]} {set url $home$url} |
| 19 | html "<a href='$url' class='$class'>$name</a>\n" |
| 20 | } |
| 21 | </th1></div> |
| 22 | <div id='hbdrop'></div> |
| 23 |
+1
-1
| --- skins/original/header.txt | ||
| +++ skins/original/header.txt | ||
| @@ -13,8 +13,8 @@ | ||
| 13 | 13 | </div> |
| 14 | 14 | <div class="mainmenu"><th1> |
| 15 | 15 | foreach {name url expr class} $mainmenu { |
| 16 | 16 | if {![capexpr $expr]} continue |
| 17 | 17 | if {[string match /* $url]} {set url $home$url} |
| 18 | - html "<a href='$url'>$name</a>\n" | |
| 18 | + html "<a href='$url' class='$class'>$name</a>\n" | |
| 19 | 19 | } |
| 20 | 20 | </th1></div> |
| 21 | 21 |
| --- skins/original/header.txt | |
| +++ skins/original/header.txt | |
| @@ -13,8 +13,8 @@ | |
| 13 | </div> |
| 14 | <div class="mainmenu"><th1> |
| 15 | foreach {name url expr class} $mainmenu { |
| 16 | if {![capexpr $expr]} continue |
| 17 | if {[string match /* $url]} {set url $home$url} |
| 18 | html "<a href='$url'>$name</a>\n" |
| 19 | } |
| 20 | </th1></div> |
| 21 |
| --- skins/original/header.txt | |
| +++ skins/original/header.txt | |
| @@ -13,8 +13,8 @@ | |
| 13 | </div> |
| 14 | <div class="mainmenu"><th1> |
| 15 | foreach {name url expr class} $mainmenu { |
| 16 | if {![capexpr $expr]} continue |
| 17 | if {[string match /* $url]} {set url $home$url} |
| 18 | html "<a href='$url' class='$class'>$name</a>\n" |
| 19 | } |
| 20 | </th1></div> |
| 21 |
+1
-1
| --- skins/plain_gray/header.txt | ||
| +++ skins/plain_gray/header.txt | ||
| @@ -6,9 +6,9 @@ | ||
| 6 | 6 | html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>☰</a>" |
| 7 | 7 | builtin_request_js hbmenu.js |
| 8 | 8 | foreach {name url expr class} $mainmenu { |
| 9 | 9 | if {![capexpr $expr]} continue |
| 10 | 10 | if {[string match /* $url]} {set url $home$url} |
| 11 | - html "<a href='$url'>$name</a>\n" | |
| 11 | + html "<a href='$url' class='$class'>$name</a>\n" | |
| 12 | 12 | } |
| 13 | 13 | </th1></div> |
| 14 | 14 | <div id='hbdrop' class='hbdrop'></div> |
| 15 | 15 |
| --- skins/plain_gray/header.txt | |
| +++ skins/plain_gray/header.txt | |
| @@ -6,9 +6,9 @@ | |
| 6 | html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>☰</a>" |
| 7 | builtin_request_js hbmenu.js |
| 8 | foreach {name url expr class} $mainmenu { |
| 9 | if {![capexpr $expr]} continue |
| 10 | if {[string match /* $url]} {set url $home$url} |
| 11 | html "<a href='$url'>$name</a>\n" |
| 12 | } |
| 13 | </th1></div> |
| 14 | <div id='hbdrop' class='hbdrop'></div> |
| 15 |
| --- skins/plain_gray/header.txt | |
| +++ skins/plain_gray/header.txt | |
| @@ -6,9 +6,9 @@ | |
| 6 | html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>☰</a>" |
| 7 | builtin_request_js hbmenu.js |
| 8 | foreach {name url expr class} $mainmenu { |
| 9 | if {![capexpr $expr]} continue |
| 10 | if {[string match /* $url]} {set url $home$url} |
| 11 | html "<a href='$url' class='$class'>$name</a>\n" |
| 12 | } |
| 13 | </th1></div> |
| 14 | <div id='hbdrop' class='hbdrop'></div> |
| 15 |
+1
-1
| --- skins/rounded1/header.txt | ||
| +++ skins/rounded1/header.txt | ||
| @@ -14,8 +14,8 @@ | ||
| 14 | 14 | </div> |
| 15 | 15 | <div class="mainmenu"><th1> |
| 16 | 16 | foreach {name url expr class} $mainmenu { |
| 17 | 17 | if {![capexpr $expr]} continue |
| 18 | 18 | if {[string match /* $url]} {set url $home$url} |
| 19 | - html "<a href='$url'>$name</a>\n" | |
| 19 | + html "<a href='$url' class='$class'>$name</a>\n" | |
| 20 | 20 | } |
| 21 | 21 | </th1></div> |
| 22 | 22 |
| --- skins/rounded1/header.txt | |
| +++ skins/rounded1/header.txt | |
| @@ -14,8 +14,8 @@ | |
| 14 | </div> |
| 15 | <div class="mainmenu"><th1> |
| 16 | foreach {name url expr class} $mainmenu { |
| 17 | if {![capexpr $expr]} continue |
| 18 | if {[string match /* $url]} {set url $home$url} |
| 19 | html "<a href='$url'>$name</a>\n" |
| 20 | } |
| 21 | </th1></div> |
| 22 |
| --- skins/rounded1/header.txt | |
| +++ skins/rounded1/header.txt | |
| @@ -14,8 +14,8 @@ | |
| 14 | </div> |
| 15 | <div class="mainmenu"><th1> |
| 16 | foreach {name url expr class} $mainmenu { |
| 17 | if {![capexpr $expr]} continue |
| 18 | if {[string match /* $url]} {set url $home$url} |
| 19 | html "<a href='$url' class='$class'>$name</a>\n" |
| 20 | } |
| 21 | </th1></div> |
| 22 |
+1
-1
| --- skins/xekri/header.txt | ||
| +++ skins/xekri/header.txt | ||
| @@ -94,11 +94,11 @@ | ||
| 94 | 94 | <div class="mainmenu"><th1> |
| 95 | 95 | foreach {name url expr class} $mainmenu { |
| 96 | 96 | if {![capexpr $expr]} continue |
| 97 | 97 | if {[string match /* $url]} { |
| 98 | 98 | if {[string match /$current_page* $url]} { |
| 99 | - set class "active $class" | |
| 99 | + lappend class active | |
| 100 | 100 | } |
| 101 | 101 | set url $home$url |
| 102 | 102 | } |
| 103 | 103 | html "<a href='$url' class='$class'>$name</a>\n" |
| 104 | 104 | } |
| 105 | 105 |
| --- skins/xekri/header.txt | |
| +++ skins/xekri/header.txt | |
| @@ -94,11 +94,11 @@ | |
| 94 | <div class="mainmenu"><th1> |
| 95 | foreach {name url expr class} $mainmenu { |
| 96 | if {![capexpr $expr]} continue |
| 97 | if {[string match /* $url]} { |
| 98 | if {[string match /$current_page* $url]} { |
| 99 | set class "active $class" |
| 100 | } |
| 101 | set url $home$url |
| 102 | } |
| 103 | html "<a href='$url' class='$class'>$name</a>\n" |
| 104 | } |
| 105 |
| --- skins/xekri/header.txt | |
| +++ skins/xekri/header.txt | |
| @@ -94,11 +94,11 @@ | |
| 94 | <div class="mainmenu"><th1> |
| 95 | foreach {name url expr class} $mainmenu { |
| 96 | if {![capexpr $expr]} continue |
| 97 | if {[string match /* $url]} { |
| 98 | if {[string match /$current_page* $url]} { |
| 99 | lappend class active |
| 100 | } |
| 101 | set url $home$url |
| 102 | } |
| 103 | html "<a href='$url' class='$class'>$name</a>\n" |
| 104 | } |
| 105 |
+13
| --- src/default.css | ||
| +++ src/default.css | ||
| @@ -1762,5 +1762,18 @@ | ||
| 1762 | 1762 | |
| 1763 | 1763 | body.chat #chat-drop-details img { |
| 1764 | 1764 | max-width: 45%; |
| 1765 | 1765 | max-height: 45%; |
| 1766 | 1766 | } |
| 1767 | + | |
| 1768 | +/* Objects in the "desktoponly" class are invisible on mobile */ | |
| 1769 | +@media screen and (max-width: 600px) { | |
| 1770 | + .desktoponly { | |
| 1771 | + display: none; | |
| 1772 | + } | |
| 1773 | +} | |
| 1774 | +/* Objects in the "wideonly" class are invisible only on wide-screen desktops */ | |
| 1775 | +@media screen and (max-width: 1200px) { | |
| 1776 | + .wideonly { | |
| 1777 | + display: none; | |
| 1778 | + } | |
| 1779 | +} | |
| 1767 | 1780 |
| --- src/default.css | |
| +++ src/default.css | |
| @@ -1762,5 +1762,18 @@ | |
| 1762 | |
| 1763 | body.chat #chat-drop-details img { |
| 1764 | max-width: 45%; |
| 1765 | max-height: 45%; |
| 1766 | } |
| 1767 |
| --- src/default.css | |
| +++ src/default.css | |
| @@ -1762,5 +1762,18 @@ | |
| 1762 | |
| 1763 | body.chat #chat-drop-details img { |
| 1764 | max-width: 45%; |
| 1765 | max-height: 45%; |
| 1766 | } |
| 1767 | |
| 1768 | /* Objects in the "desktoponly" class are invisible on mobile */ |
| 1769 | @media screen and (max-width: 600px) { |
| 1770 | .desktoponly { |
| 1771 | display: none; |
| 1772 | } |
| 1773 | } |
| 1774 | /* Objects in the "wideonly" class are invisible only on wide-screen desktops */ |
| 1775 | @media screen and (max-width: 1200px) { |
| 1776 | .wideonly { |
| 1777 | display: none; |
| 1778 | } |
| 1779 | } |
| 1780 |
+34
-13
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -1097,13 +1097,14 @@ | ||
| 1097 | 1097 | style_init_th1_vars(0); |
| 1098 | 1098 | Th_Render(zScript?zScript:""); |
| 1099 | 1099 | } |
| 1100 | 1100 | |
| 1101 | 1101 | /* |
| 1102 | -** If one of the "name" or "page" URL parameters (in that order) | |
| 1103 | -** is set then this function looks for page/page group-specific | |
| 1104 | -** CSS and (if found) appends it to pOut, else it is a no-op. | |
| 1102 | +** Check for "name" or "page" query parameters on an /style.css | |
| 1103 | +** page request. If present, then page-specific CSS is requested, | |
| 1104 | +** so add that CSS to pOut. If the "name" and "page" query parameters | |
| 1105 | +** are omitted, then pOut is unchnaged. | |
| 1105 | 1106 | */ |
| 1106 | 1107 | static void page_style_css_append_page_style(Blob *pOut){ |
| 1107 | 1108 | const char *zPage = PD("name",P("page")); |
| 1108 | 1109 | char * zFile; |
| 1109 | 1110 | int nFile = 0; |
| @@ -1115,19 +1116,14 @@ | ||
| 1115 | 1116 | zFile = mprintf("style.%s.css", zPage); |
| 1116 | 1117 | zBuiltin = (const char *)builtin_file(zFile, &nFile); |
| 1117 | 1118 | if(nFile>0){ |
| 1118 | 1119 | blob_appendf(pOut, |
| 1119 | 1120 | "\n/***********************************************************\n" |
| 1120 | - "** Start of page-specific CSS for page %s...\n" | |
| 1121 | + "** Page-specific CSS for \"%s\"\n" | |
| 1121 | 1122 | "***********************************************************/\n", |
| 1122 | 1123 | zPage); |
| 1123 | 1124 | blob_append(pOut, zBuiltin, nFile); |
| 1124 | - blob_appendf(pOut, | |
| 1125 | - "\n/***********************************************************\n" | |
| 1126 | - "** End of page-specific CSS for page %s.\n" | |
| 1127 | - "***********************************************************/\n", | |
| 1128 | - zPage); | |
| 1129 | 1125 | fossil_free(zFile); |
| 1130 | 1126 | return; |
| 1131 | 1127 | } |
| 1132 | 1128 | /* Potential TODO: check for aliases/page groups. e.g. group all |
| 1133 | 1129 | ** /forumXYZ CSS into one file, all /setupXYZ into another, etc. As |
| @@ -1137,29 +1133,54 @@ | ||
| 1137 | 1133 | } |
| 1138 | 1134 | |
| 1139 | 1135 | /* |
| 1140 | 1136 | ** WEBPAGE: style.css |
| 1141 | 1137 | ** |
| 1142 | -** Return the style sheet. | |
| 1138 | +** Return the style sheet. The style sheet is assemblied from | |
| 1139 | +** multiple sources, in order: | |
| 1140 | +** | |
| 1141 | +** (1) The built-in "default.css" style sheet containing basic defaults. | |
| 1142 | +** | |
| 1143 | +** (2) The page-specific style sheet taken from the built-in | |
| 1144 | +** called "PAGENAME.css" where PAGENAME is the value of the name= | |
| 1145 | +** or page= query parameters. If neither name= nor page= exist, | |
| 1146 | +** then this section is a no-op. | |
| 1147 | +** | |
| 1148 | +** (3) The skin-specific "css.txt" file, if there one. | |
| 1149 | +** | |
| 1150 | +** All of (1), (2), and (3) above (or as many as exist) are concatenated. | |
| 1151 | +** The result is then run through TH1 with the following variables set: | |
| 1152 | +** | |
| 1153 | +** * $basename | |
| 1154 | +** * $secureurl | |
| 1155 | +** * $home | |
| 1156 | +** * $logo | |
| 1157 | +** * $background | |
| 1158 | +** | |
| 1159 | +** The output from TH1 becomes the style sheet. Fossil always reports | |
| 1160 | +** that the style sheet is cacheable. | |
| 1143 | 1161 | */ |
| 1144 | 1162 | void page_style_css(void){ |
| 1145 | 1163 | Blob css = empty_blob; |
| 1146 | 1164 | int i; |
| 1147 | 1165 | const char * zDefaults; |
| 1166 | + const char *zSkin; | |
| 1148 | 1167 | |
| 1149 | 1168 | cgi_set_content_type("text/css"); |
| 1150 | 1169 | etag_check(0, 0); |
| 1151 | 1170 | /* Emit all default rules... */ |
| 1152 | 1171 | zDefaults = (const char*)builtin_file("default.css", &i); |
| 1153 | 1172 | blob_append(&css, zDefaults, i); |
| 1154 | 1173 | /* Page-specific CSS, if any... */ |
| 1155 | 1174 | page_style_css_append_page_style(&css); |
| 1156 | - blob_append(&css, | |
| 1175 | + zSkin = skin_in_use(); | |
| 1176 | + if( zSkin==0 ) zSkin = "this repository"; | |
| 1177 | + blob_appendf(&css, | |
| 1157 | 1178 | "\n/***********************************************************\n" |
| 1158 | - "** All CSS which follows is supplied by the repository \"skin\".\n" | |
| 1179 | + "** Skin-specific CSS for %s\n" | |
| 1159 | 1180 | "***********************************************************/\n", |
| 1160 | - -1); | |
| 1181 | + zSkin); | |
| 1161 | 1182 | blob_append(&css,skin_get("css"),-1); |
| 1162 | 1183 | /* Process through TH1 in order to give an opportunity to substitute |
| 1163 | 1184 | ** variables such as $baseurl. |
| 1164 | 1185 | */ |
| 1165 | 1186 | Th_Store("baseurl", g.zBaseURL); |
| 1166 | 1187 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -1097,13 +1097,14 @@ | |
| 1097 | style_init_th1_vars(0); |
| 1098 | Th_Render(zScript?zScript:""); |
| 1099 | } |
| 1100 | |
| 1101 | /* |
| 1102 | ** If one of the "name" or "page" URL parameters (in that order) |
| 1103 | ** is set then this function looks for page/page group-specific |
| 1104 | ** CSS and (if found) appends it to pOut, else it is a no-op. |
| 1105 | */ |
| 1106 | static void page_style_css_append_page_style(Blob *pOut){ |
| 1107 | const char *zPage = PD("name",P("page")); |
| 1108 | char * zFile; |
| 1109 | int nFile = 0; |
| @@ -1115,19 +1116,14 @@ | |
| 1115 | zFile = mprintf("style.%s.css", zPage); |
| 1116 | zBuiltin = (const char *)builtin_file(zFile, &nFile); |
| 1117 | if(nFile>0){ |
| 1118 | blob_appendf(pOut, |
| 1119 | "\n/***********************************************************\n" |
| 1120 | "** Start of page-specific CSS for page %s...\n" |
| 1121 | "***********************************************************/\n", |
| 1122 | zPage); |
| 1123 | blob_append(pOut, zBuiltin, nFile); |
| 1124 | blob_appendf(pOut, |
| 1125 | "\n/***********************************************************\n" |
| 1126 | "** End of page-specific CSS for page %s.\n" |
| 1127 | "***********************************************************/\n", |
| 1128 | zPage); |
| 1129 | fossil_free(zFile); |
| 1130 | return; |
| 1131 | } |
| 1132 | /* Potential TODO: check for aliases/page groups. e.g. group all |
| 1133 | ** /forumXYZ CSS into one file, all /setupXYZ into another, etc. As |
| @@ -1137,29 +1133,54 @@ | |
| 1137 | } |
| 1138 | |
| 1139 | /* |
| 1140 | ** WEBPAGE: style.css |
| 1141 | ** |
| 1142 | ** Return the style sheet. |
| 1143 | */ |
| 1144 | void page_style_css(void){ |
| 1145 | Blob css = empty_blob; |
| 1146 | int i; |
| 1147 | const char * zDefaults; |
| 1148 | |
| 1149 | cgi_set_content_type("text/css"); |
| 1150 | etag_check(0, 0); |
| 1151 | /* Emit all default rules... */ |
| 1152 | zDefaults = (const char*)builtin_file("default.css", &i); |
| 1153 | blob_append(&css, zDefaults, i); |
| 1154 | /* Page-specific CSS, if any... */ |
| 1155 | page_style_css_append_page_style(&css); |
| 1156 | blob_append(&css, |
| 1157 | "\n/***********************************************************\n" |
| 1158 | "** All CSS which follows is supplied by the repository \"skin\".\n" |
| 1159 | "***********************************************************/\n", |
| 1160 | -1); |
| 1161 | blob_append(&css,skin_get("css"),-1); |
| 1162 | /* Process through TH1 in order to give an opportunity to substitute |
| 1163 | ** variables such as $baseurl. |
| 1164 | */ |
| 1165 | Th_Store("baseurl", g.zBaseURL); |
| 1166 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -1097,13 +1097,14 @@ | |
| 1097 | style_init_th1_vars(0); |
| 1098 | Th_Render(zScript?zScript:""); |
| 1099 | } |
| 1100 | |
| 1101 | /* |
| 1102 | ** Check for "name" or "page" query parameters on an /style.css |
| 1103 | ** page request. If present, then page-specific CSS is requested, |
| 1104 | ** so add that CSS to pOut. If the "name" and "page" query parameters |
| 1105 | ** are omitted, then pOut is unchnaged. |
| 1106 | */ |
| 1107 | static void page_style_css_append_page_style(Blob *pOut){ |
| 1108 | const char *zPage = PD("name",P("page")); |
| 1109 | char * zFile; |
| 1110 | int nFile = 0; |
| @@ -1115,19 +1116,14 @@ | |
| 1116 | zFile = mprintf("style.%s.css", zPage); |
| 1117 | zBuiltin = (const char *)builtin_file(zFile, &nFile); |
| 1118 | if(nFile>0){ |
| 1119 | blob_appendf(pOut, |
| 1120 | "\n/***********************************************************\n" |
| 1121 | "** Page-specific CSS for \"%s\"\n" |
| 1122 | "***********************************************************/\n", |
| 1123 | zPage); |
| 1124 | blob_append(pOut, zBuiltin, nFile); |
| 1125 | fossil_free(zFile); |
| 1126 | return; |
| 1127 | } |
| 1128 | /* Potential TODO: check for aliases/page groups. e.g. group all |
| 1129 | ** /forumXYZ CSS into one file, all /setupXYZ into another, etc. As |
| @@ -1137,29 +1133,54 @@ | |
| 1133 | } |
| 1134 | |
| 1135 | /* |
| 1136 | ** WEBPAGE: style.css |
| 1137 | ** |
| 1138 | ** Return the style sheet. The style sheet is assemblied from |
| 1139 | ** multiple sources, in order: |
| 1140 | ** |
| 1141 | ** (1) The built-in "default.css" style sheet containing basic defaults. |
| 1142 | ** |
| 1143 | ** (2) The page-specific style sheet taken from the built-in |
| 1144 | ** called "PAGENAME.css" where PAGENAME is the value of the name= |
| 1145 | ** or page= query parameters. If neither name= nor page= exist, |
| 1146 | ** then this section is a no-op. |
| 1147 | ** |
| 1148 | ** (3) The skin-specific "css.txt" file, if there one. |
| 1149 | ** |
| 1150 | ** All of (1), (2), and (3) above (or as many as exist) are concatenated. |
| 1151 | ** The result is then run through TH1 with the following variables set: |
| 1152 | ** |
| 1153 | ** * $basename |
| 1154 | ** * $secureurl |
| 1155 | ** * $home |
| 1156 | ** * $logo |
| 1157 | ** * $background |
| 1158 | ** |
| 1159 | ** The output from TH1 becomes the style sheet. Fossil always reports |
| 1160 | ** that the style sheet is cacheable. |
| 1161 | */ |
| 1162 | void page_style_css(void){ |
| 1163 | Blob css = empty_blob; |
| 1164 | int i; |
| 1165 | const char * zDefaults; |
| 1166 | const char *zSkin; |
| 1167 | |
| 1168 | cgi_set_content_type("text/css"); |
| 1169 | etag_check(0, 0); |
| 1170 | /* Emit all default rules... */ |
| 1171 | zDefaults = (const char*)builtin_file("default.css", &i); |
| 1172 | blob_append(&css, zDefaults, i); |
| 1173 | /* Page-specific CSS, if any... */ |
| 1174 | page_style_css_append_page_style(&css); |
| 1175 | zSkin = skin_in_use(); |
| 1176 | if( zSkin==0 ) zSkin = "this repository"; |
| 1177 | blob_appendf(&css, |
| 1178 | "\n/***********************************************************\n" |
| 1179 | "** Skin-specific CSS for %s\n" |
| 1180 | "***********************************************************/\n", |
| 1181 | zSkin); |
| 1182 | blob_append(&css,skin_get("css"),-1); |
| 1183 | /* Process through TH1 in order to give an opportunity to substitute |
| 1184 | ** variables such as $baseurl. |
| 1185 | */ |
| 1186 | Th_Store("baseurl", g.zBaseURL); |
| 1187 |
+39
| --- src/th_lang.c | ||
| +++ src/th_lang.c | ||
| @@ -228,10 +228,48 @@ | ||
| 228 | 228 | return TH_OK; |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | /* |
| 232 | 232 | ** TH Syntax: |
| 233 | +** | |
| 234 | +** lappend var ?arg1? ?arg2? ...? | |
| 235 | +** | |
| 236 | +** Interpret the content of variable var as a list. Create var if it | |
| 237 | +** does not already exist. Append each argument as a new list element. | |
| 238 | +*/ | |
| 239 | +static int lappend_command( | |
| 240 | + Th_Interp *interp, | |
| 241 | + void *ctx, | |
| 242 | + int argc, | |
| 243 | + const char **argv, | |
| 244 | + int *argl | |
| 245 | +){ | |
| 246 | + char *zList = 0; | |
| 247 | + int nList = 0; | |
| 248 | + int i, rc; | |
| 249 | + | |
| 250 | + if( argc<2 ){ | |
| 251 | + return Th_WrongNumArgs(interp, "lappend var ..."); | |
| 252 | + } | |
| 253 | + rc = Th_GetVar(interp, argv[1], argl[1]); | |
| 254 | + if( rc==TH_OK ){ | |
| 255 | + zList = Th_TakeResult(interp, &nList); | |
| 256 | + } | |
| 257 | + | |
| 258 | + for(i=2; i<argc; i++){ | |
| 259 | + Th_ListAppend(interp, &zList, &nList, argv[i], argl[i]); | |
| 260 | + } | |
| 261 | + | |
| 262 | + Th_SetResult(interp, zList, nList); | |
| 263 | + Th_Free(interp, zList); | |
| 264 | + | |
| 265 | + return TH_OK; | |
| 266 | +} | |
| 267 | + | |
| 268 | + | |
| 269 | +/* | |
| 270 | +** TH Syntax: | |
| 233 | 271 | ** |
| 234 | 272 | ** lindex list index |
| 235 | 273 | */ |
| 236 | 274 | static int lindex_command( |
| 237 | 275 | Th_Interp *interp, |
| @@ -1354,10 +1392,11 @@ | ||
| 1354 | 1392 | {"expr", expr_command, 0}, |
| 1355 | 1393 | {"for", for_command, 0}, |
| 1356 | 1394 | {"foreach", foreach_command, 0}, |
| 1357 | 1395 | {"if", if_command, 0}, |
| 1358 | 1396 | {"info", info_command, 0}, |
| 1397 | + {"lappend", lappend_command, 0}, | |
| 1359 | 1398 | {"lindex", lindex_command, 0}, |
| 1360 | 1399 | {"list", list_command, 0}, |
| 1361 | 1400 | {"llength", llength_command, 0}, |
| 1362 | 1401 | {"lsearch", lsearch_command, 0}, |
| 1363 | 1402 | {"proc", proc_command, 0}, |
| 1364 | 1403 |
| --- src/th_lang.c | |
| +++ src/th_lang.c | |
| @@ -228,10 +228,48 @@ | |
| 228 | return TH_OK; |
| 229 | } |
| 230 | |
| 231 | /* |
| 232 | ** TH Syntax: |
| 233 | ** |
| 234 | ** lindex list index |
| 235 | */ |
| 236 | static int lindex_command( |
| 237 | Th_Interp *interp, |
| @@ -1354,10 +1392,11 @@ | |
| 1354 | {"expr", expr_command, 0}, |
| 1355 | {"for", for_command, 0}, |
| 1356 | {"foreach", foreach_command, 0}, |
| 1357 | {"if", if_command, 0}, |
| 1358 | {"info", info_command, 0}, |
| 1359 | {"lindex", lindex_command, 0}, |
| 1360 | {"list", list_command, 0}, |
| 1361 | {"llength", llength_command, 0}, |
| 1362 | {"lsearch", lsearch_command, 0}, |
| 1363 | {"proc", proc_command, 0}, |
| 1364 |
| --- src/th_lang.c | |
| +++ src/th_lang.c | |
| @@ -228,10 +228,48 @@ | |
| 228 | return TH_OK; |
| 229 | } |
| 230 | |
| 231 | /* |
| 232 | ** TH Syntax: |
| 233 | ** |
| 234 | ** lappend var ?arg1? ?arg2? ...? |
| 235 | ** |
| 236 | ** Interpret the content of variable var as a list. Create var if it |
| 237 | ** does not already exist. Append each argument as a new list element. |
| 238 | */ |
| 239 | static int lappend_command( |
| 240 | Th_Interp *interp, |
| 241 | void *ctx, |
| 242 | int argc, |
| 243 | const char **argv, |
| 244 | int *argl |
| 245 | ){ |
| 246 | char *zList = 0; |
| 247 | int nList = 0; |
| 248 | int i, rc; |
| 249 | |
| 250 | if( argc<2 ){ |
| 251 | return Th_WrongNumArgs(interp, "lappend var ..."); |
| 252 | } |
| 253 | rc = Th_GetVar(interp, argv[1], argl[1]); |
| 254 | if( rc==TH_OK ){ |
| 255 | zList = Th_TakeResult(interp, &nList); |
| 256 | } |
| 257 | |
| 258 | for(i=2; i<argc; i++){ |
| 259 | Th_ListAppend(interp, &zList, &nList, argv[i], argl[i]); |
| 260 | } |
| 261 | |
| 262 | Th_SetResult(interp, zList, nList); |
| 263 | Th_Free(interp, zList); |
| 264 | |
| 265 | return TH_OK; |
| 266 | } |
| 267 | |
| 268 | |
| 269 | /* |
| 270 | ** TH Syntax: |
| 271 | ** |
| 272 | ** lindex list index |
| 273 | */ |
| 274 | static int lindex_command( |
| 275 | Th_Interp *interp, |
| @@ -1354,10 +1392,11 @@ | |
| 1392 | {"expr", expr_command, 0}, |
| 1393 | {"for", for_command, 0}, |
| 1394 | {"foreach", foreach_command, 0}, |
| 1395 | {"if", if_command, 0}, |
| 1396 | {"info", info_command, 0}, |
| 1397 | {"lappend", lappend_command, 0}, |
| 1398 | {"lindex", lindex_command, 0}, |
| 1399 | {"list", list_command, 0}, |
| 1400 | {"llength", llength_command, 0}, |
| 1401 | {"lsearch", lsearch_command, 0}, |
| 1402 | {"proc", proc_command, 0}, |
| 1403 |