Fossil SCM
Improvements to the accordion panes in the UI. The associated wiki on the /info page defaults to collapsed.
Commit
45889598287f2dbac3a272e30bef13df171a53fc7186d1ba77e87e77f9f0a9c0
Parent
593fb3f7e1aa24d…
17 files changed
+1
-1
+1
-1
+1
-1
+1
-1
+1
-1
+1
-1
+2
-1
-99
+7
-6
+34
-1
+4
-1
+10
-8
-1
+8
-4
+11
-9
-1
+1
-3
~
skins/black_and_white/css.txt
~
skins/darkmode/css.txt
~
skins/eagle/css.txt
~
skins/khaki/css.txt
~
skins/original/css.txt
~
skins/plain_gray/css.txt
~
skins/xekri/css.txt
-
src/accordion.js
~
src/backlink.c
~
src/checkin.c
~
src/default.css
~
src/info.c
~
src/main.mk
~
src/tar.c
~
src/wiki.c
~
win/Makefile.mingw
~
win/Makefile.msc
+1
-1
| --- skins/black_and_white/css.txt | ||
| +++ skins/black_and_white/css.txt | ||
| @@ -121,11 +121,11 @@ | ||
| 121 | 121 | div.content { |
| 122 | 122 | padding: 2ex 1ex 0ex 2ex; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | /* Some pages have section dividers */ |
| 126 | -div.section { | |
| 126 | +div.section, summary.section { | |
| 127 | 127 | margin-bottom: 0px; |
| 128 | 128 | margin-top: 1em; |
| 129 | 129 | padding: 1px 1px 1px 1px; |
| 130 | 130 | font-size: 1.2em; |
| 131 | 131 | font-weight: bold; |
| 132 | 132 |
| --- skins/black_and_white/css.txt | |
| +++ skins/black_and_white/css.txt | |
| @@ -121,11 +121,11 @@ | |
| 121 | div.content { |
| 122 | padding: 2ex 1ex 0ex 2ex; |
| 123 | } |
| 124 | |
| 125 | /* Some pages have section dividers */ |
| 126 | div.section { |
| 127 | margin-bottom: 0px; |
| 128 | margin-top: 1em; |
| 129 | padding: 1px 1px 1px 1px; |
| 130 | font-size: 1.2em; |
| 131 | font-weight: bold; |
| 132 |
| --- skins/black_and_white/css.txt | |
| +++ skins/black_and_white/css.txt | |
| @@ -121,11 +121,11 @@ | |
| 121 | div.content { |
| 122 | padding: 2ex 1ex 0ex 2ex; |
| 123 | } |
| 124 | |
| 125 | /* Some pages have section dividers */ |
| 126 | div.section, summary.section { |
| 127 | margin-bottom: 0px; |
| 128 | margin-top: 1em; |
| 129 | padding: 1px 1px 1px 1px; |
| 130 | font-size: 1.2em; |
| 131 | font-weight: bold; |
| 132 |
+1
-1
| --- skins/darkmode/css.txt | ||
| +++ skins/darkmode/css.txt | ||
| @@ -155,11 +155,11 @@ | ||
| 155 | 155 | div.content { |
| 156 | 156 | padding: 0ex 1ex 1ex 1ex; |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | /* Some pages have section dividers */ |
| 160 | -div.section { | |
| 160 | +div.section, summary.section { | |
| 161 | 161 | margin-bottom: 0; |
| 162 | 162 | margin-top: 1em; |
| 163 | 163 | padding: 0.1em; |
| 164 | 164 | font-size: 1.2em; |
| 165 | 165 | font-weight: bold; |
| 166 | 166 |
| --- skins/darkmode/css.txt | |
| +++ skins/darkmode/css.txt | |
| @@ -155,11 +155,11 @@ | |
| 155 | div.content { |
| 156 | padding: 0ex 1ex 1ex 1ex; |
| 157 | } |
| 158 | |
| 159 | /* Some pages have section dividers */ |
| 160 | div.section { |
| 161 | margin-bottom: 0; |
| 162 | margin-top: 1em; |
| 163 | padding: 0.1em; |
| 164 | font-size: 1.2em; |
| 165 | font-weight: bold; |
| 166 |
| --- skins/darkmode/css.txt | |
| +++ skins/darkmode/css.txt | |
| @@ -155,11 +155,11 @@ | |
| 155 | div.content { |
| 156 | padding: 0ex 1ex 1ex 1ex; |
| 157 | } |
| 158 | |
| 159 | /* Some pages have section dividers */ |
| 160 | div.section, summary.section { |
| 161 | margin-bottom: 0; |
| 162 | margin-top: 1em; |
| 163 | padding: 0.1em; |
| 164 | font-size: 1.2em; |
| 165 | font-weight: bold; |
| 166 |
+1
-1
| --- skins/eagle/css.txt | ||
| +++ skins/eagle/css.txt | ||
| @@ -106,11 +106,11 @@ | ||
| 106 | 106 | div.content { |
| 107 | 107 | padding: 0ex 1ex 0ex 2ex; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /* Some pages have section dividers */ |
| 111 | -div.section { | |
| 111 | +div.section, summary.section { | |
| 112 | 112 | margin-bottom: 0px; |
| 113 | 113 | margin-top: 1em; |
| 114 | 114 | padding: 1px 1px 1px 1px; |
| 115 | 115 | font-size: 1.2em; |
| 116 | 116 | font-weight: bold; |
| 117 | 117 |
| --- skins/eagle/css.txt | |
| +++ skins/eagle/css.txt | |
| @@ -106,11 +106,11 @@ | |
| 106 | div.content { |
| 107 | padding: 0ex 1ex 0ex 2ex; |
| 108 | } |
| 109 | |
| 110 | /* Some pages have section dividers */ |
| 111 | div.section { |
| 112 | margin-bottom: 0px; |
| 113 | margin-top: 1em; |
| 114 | padding: 1px 1px 1px 1px; |
| 115 | font-size: 1.2em; |
| 116 | font-weight: bold; |
| 117 |
| --- skins/eagle/css.txt | |
| +++ skins/eagle/css.txt | |
| @@ -106,11 +106,11 @@ | |
| 106 | div.content { |
| 107 | padding: 0ex 1ex 0ex 2ex; |
| 108 | } |
| 109 | |
| 110 | /* Some pages have section dividers */ |
| 111 | div.section, summary.section { |
| 112 | margin-bottom: 0px; |
| 113 | margin-top: 1em; |
| 114 | padding: 1px 1px 1px 1px; |
| 115 | font-size: 1.2em; |
| 116 | font-weight: bold; |
| 117 |
+1
-1
| --- skins/khaki/css.txt | ||
| +++ skins/khaki/css.txt | ||
| @@ -109,11 +109,11 @@ | ||
| 109 | 109 | text-decoration: none; |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | |
| 113 | 113 | /* Some pages have section dividers */ |
| 114 | -div.section { | |
| 114 | +div.section, summary.section { | |
| 115 | 115 | margin-bottom: 0px; |
| 116 | 116 | margin-top: 1em; |
| 117 | 117 | padding: 3px 3px 0 3px; |
| 118 | 118 | font-size: 1.2em; |
| 119 | 119 | font-weight: bold; |
| 120 | 120 |
| --- skins/khaki/css.txt | |
| +++ skins/khaki/css.txt | |
| @@ -109,11 +109,11 @@ | |
| 109 | text-decoration: none; |
| 110 | } |
| 111 | |
| 112 | |
| 113 | /* Some pages have section dividers */ |
| 114 | div.section { |
| 115 | margin-bottom: 0px; |
| 116 | margin-top: 1em; |
| 117 | padding: 3px 3px 0 3px; |
| 118 | font-size: 1.2em; |
| 119 | font-weight: bold; |
| 120 |
| --- skins/khaki/css.txt | |
| +++ skins/khaki/css.txt | |
| @@ -109,11 +109,11 @@ | |
| 109 | text-decoration: none; |
| 110 | } |
| 111 | |
| 112 | |
| 113 | /* Some pages have section dividers */ |
| 114 | div.section, summary.section { |
| 115 | margin-bottom: 0px; |
| 116 | margin-top: 1em; |
| 117 | padding: 3px 3px 0 3px; |
| 118 | font-size: 1.2em; |
| 119 | font-weight: bold; |
| 120 |
+1
-1
| --- skins/original/css.txt | ||
| +++ skins/original/css.txt | ||
| @@ -91,11 +91,11 @@ | ||
| 91 | 91 | border: solid #aaa; |
| 92 | 92 | border-width: 1px; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /* Some pages have section dividers */ |
| 96 | -div.section { | |
| 96 | +div.section, summary.section { | |
| 97 | 97 | margin-bottom: 0px; |
| 98 | 98 | margin-top: 1em; |
| 99 | 99 | padding: 1px 1px 1px 1px; |
| 100 | 100 | font-size: 1.2em; |
| 101 | 101 | font-weight: bold; |
| 102 | 102 |
| --- skins/original/css.txt | |
| +++ skins/original/css.txt | |
| @@ -91,11 +91,11 @@ | |
| 91 | border: solid #aaa; |
| 92 | border-width: 1px; |
| 93 | } |
| 94 | |
| 95 | /* Some pages have section dividers */ |
| 96 | div.section { |
| 97 | margin-bottom: 0px; |
| 98 | margin-top: 1em; |
| 99 | padding: 1px 1px 1px 1px; |
| 100 | font-size: 1.2em; |
| 101 | font-weight: bold; |
| 102 |
| --- skins/original/css.txt | |
| +++ skins/original/css.txt | |
| @@ -91,11 +91,11 @@ | |
| 91 | border: solid #aaa; |
| 92 | border-width: 1px; |
| 93 | } |
| 94 | |
| 95 | /* Some pages have section dividers */ |
| 96 | div.section, summary.section { |
| 97 | margin-bottom: 0px; |
| 98 | margin-top: 1em; |
| 99 | padding: 1px 1px 1px 1px; |
| 100 | font-size: 1.2em; |
| 101 | font-weight: bold; |
| 102 |
+1
-1
| --- skins/plain_gray/css.txt | ||
| +++ skins/plain_gray/css.txt | ||
| @@ -107,11 +107,11 @@ | ||
| 107 | 107 | padding: 0.5em; |
| 108 | 108 | white-space: pre-wrap; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /* Some pages have section dividers */ |
| 112 | -div.section { | |
| 112 | +div.section, summary.section { | |
| 113 | 113 | margin-bottom: 0px; |
| 114 | 114 | margin-top: 1em; |
| 115 | 115 | padding: 1px 1px 1px 1px; |
| 116 | 116 | font-size: 1.2em; |
| 117 | 117 | font-weight: bold; |
| 118 | 118 |
| --- skins/plain_gray/css.txt | |
| +++ skins/plain_gray/css.txt | |
| @@ -107,11 +107,11 @@ | |
| 107 | padding: 0.5em; |
| 108 | white-space: pre-wrap; |
| 109 | } |
| 110 | |
| 111 | /* Some pages have section dividers */ |
| 112 | div.section { |
| 113 | margin-bottom: 0px; |
| 114 | margin-top: 1em; |
| 115 | padding: 1px 1px 1px 1px; |
| 116 | font-size: 1.2em; |
| 117 | font-weight: bold; |
| 118 |
| --- skins/plain_gray/css.txt | |
| +++ skins/plain_gray/css.txt | |
| @@ -107,11 +107,11 @@ | |
| 107 | padding: 0.5em; |
| 108 | white-space: pre-wrap; |
| 109 | } |
| 110 | |
| 111 | /* Some pages have section dividers */ |
| 112 | div.section, summary.section { |
| 113 | margin-bottom: 0px; |
| 114 | margin-top: 1em; |
| 115 | padding: 1px 1px 1px 1px; |
| 116 | font-size: 1.2em; |
| 117 | font-weight: bold; |
| 118 |
+2
-1
| --- skins/xekri/css.txt | ||
| +++ skins/xekri/css.txt | ||
| @@ -549,11 +549,12 @@ | ||
| 549 | 549 | |
| 550 | 550 | /************************************** |
| 551 | 551 | * Sections |
| 552 | 552 | */ |
| 553 | 553 | |
| 554 | -div.section, div.sectionmenu { | |
| 554 | +div.section, div.sectionmenu, | |
| 555 | +summary.section{ | |
| 555 | 556 | color: #2ee; |
| 556 | 557 | background-color: #22c; |
| 557 | 558 | border-radius: 0 3rem; |
| 558 | 559 | box-shadow: 2px 2px #000; |
| 559 | 560 | display: flex; |
| 560 | 561 | |
| 561 | 562 | DELETED src/accordion.js |
| --- skins/xekri/css.txt | |
| +++ skins/xekri/css.txt | |
| @@ -549,11 +549,12 @@ | |
| 549 | |
| 550 | /************************************** |
| 551 | * Sections |
| 552 | */ |
| 553 | |
| 554 | div.section, div.sectionmenu { |
| 555 | color: #2ee; |
| 556 | background-color: #22c; |
| 557 | border-radius: 0 3rem; |
| 558 | box-shadow: 2px 2px #000; |
| 559 | display: flex; |
| 560 | |
| 561 | ELETED src/accordion.js |
| --- skins/xekri/css.txt | |
| +++ skins/xekri/css.txt | |
| @@ -549,11 +549,12 @@ | |
| 549 | |
| 550 | /************************************** |
| 551 | * Sections |
| 552 | */ |
| 553 | |
| 554 | div.section, div.sectionmenu, |
| 555 | summary.section{ |
| 556 | color: #2ee; |
| 557 | background-color: #22c; |
| 558 | border-radius: 0 3rem; |
| 559 | box-shadow: 2px 2px #000; |
| 560 | display: flex; |
| 561 | |
| 562 | ELETED src/accordion.js |
D
src/accordion.js
-99
| --- a/src/accordion.js | ||
| +++ b/src/accordion.js | ||
| @@ -1,99 +0,0 @@ | ||
| 1 | -/* | |
| 2 | -** Attach appropriate javascript to each ".accordion" button so that it expands | |
| 3 | -** and contracts when clicked. | |
| 4 | -** | |
| 5 | -** The uncompressed source code for the SVG icons can be found on the wiki page | |
| 6 | -** "branch/accordion-experiments" in the Fossil repository. | |
| 7 | -** | |
| 8 | -** Implementation notes: | |
| 9 | -** | |
| 10 | -** The `maxHeight' CSS property is quite restrictive for vertical resizing of | |
| 11 | -** elements, especially for dynamic-content areas like the diff panels. That's | |
| 12 | -** why `maxHeight' is set only during animation, to prevent truncated elements. | |
| 13 | -** (The diff panels may get truncated right after page loading, and other | |
| 14 | -** elements may get truncated when resizing the browser window to a smaller | |
| 15 | -** width, causing vertical growth.) | |
| 16 | -** | |
| 17 | -** Another problem is that `scrollHeight' used to calculate the expanded height | |
| 18 | -** while still in the contracted state may return values with small errors on | |
| 19 | -** some browsers, especially for large elements, presumably due to omitting the | |
| 20 | -** space required by the vertical scrollbar that may become necessary, causing | |
| 21 | -** additional horizontal shrinking and consequently more vertical growth than | |
| 22 | -** calculated. That's why setting `maxHeight' to `scrollHeight' is considered | |
| 23 | -** "good enough" only during animation, but cleared afterwards. | |
| 24 | -** | |
| 25 | -** https://fossil-scm.org/forum/forumpost/66d7075f40 | |
| 26 | -** https://fossil-scm.org/home/timeline?r=accordion-fix | |
| 27 | -** | |
| 28 | -** To work around the missing support for `overflow-y: clip', this script uses a | |
| 29 | -** fallback and sets `overflow-y: hidden' during the accordion panel animations. | |
| 30 | -** That's because if `overflow-y: hidden' is set statically from the stylesheet, | |
| 31 | -** the shadow of the selected or current timeline entries in the context section | |
| 32 | -** of `/info' pages is still truncated on the right (which is strange, as that's | |
| 33 | -** not the "y" direction) in all major browsers. Otherwise, the stylesheet might | |
| 34 | -** define the fallback using the `@supports(…)' at-rule: | |
| 35 | -** | |
| 36 | -** .accordion_panel { | |
| 37 | -** overflow-y: hidden; | |
| 38 | -** } | |
| 39 | -** @supports(overflow-y: clip) { | |
| 40 | -** .accordion_panel { | |
| 41 | -** overflow-y: clip; | |
| 42 | -** } | |
| 43 | -** } | |
| 44 | -*/ | |
| 45 | -(function(){ | |
| 46 | - const acc_svgdata = ["data:image/svg+xml,"+ | |
| 47 | - "%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E"+ | |
| 48 | - "%3Cpath style='fill:black;opacity:0' d='M16,16H0V0h16v16z'/%3E"+ | |
| 49 | - "%3Cpath style='fill:rgb(240,240,240)' d='M14,14H2V2h12v12z'/%3E"+ | |
| 50 | - "%3Cpath style='fill:rgb(64,64,64)' d='M13,13H3V3h10v10z'/%3E"+ | |
| 51 | - "%3Cpath style='fill:rgb(248,248,248)' d='M12,12H4V4h8v8z'/%3E"+ | |
| 52 | - "%3Cpath style='fill:rgb(80,128,208)' d='", "'/%3E%3C/svg%3E", | |
| 53 | - "M5,7h2v-2h2v2h2v2h-2v2h-2v-2h-2z", "M11,9H5V7h6v6z"]; | |
| 54 | - const a = document.getElementsByClassName("accordion"); | |
| 55 | - const xClickyHTML = /^(?:A|AREA|BUTTON|INPUT|LABEL|SELECT|TEXTAREA|DETAILS)$/; | |
| 56 | - const onclick = function(evt){ | |
| 57 | - /* Ignore clicks to hyperlinks and other "click-responsive" HTML elements in | |
| 58 | - ** ".accordion" headers (for which Fossil uses <DIV> elements that represent | |
| 59 | - ** section headers). */ | |
| 60 | - if( xClickyHTML.test(evt.target.tagName) ) return; | |
| 61 | - const x = this.nextElementSibling; | |
| 62 | - if( this.classList.contains("accordion_closed") ){ | |
| 63 | - x.style.maxHeight = x.scrollHeight + "px"; | |
| 64 | - setTimeout(function(){ | |
| 65 | - x.style.maxHeight = ""; | |
| 66 | - if( !window.CSS || !window.CSS.supports("overflow: clip") ){ | |
| 67 | - x.style.overflowY = ""; | |
| 68 | - } | |
| 69 | - },250); // default.css: .accordion_panel { transition-duration } | |
| 70 | - }else{ | |
| 71 | - x.style.maxHeight = x.scrollHeight + "px"; | |
| 72 | - if( !window.CSS || !window.CSS.supports("overflow: clip") ){ | |
| 73 | - x.style.overflowY = "hidden"; | |
| 74 | - } | |
| 75 | - setTimeout(function(){ | |
| 76 | - x.style.maxHeight = "0"; | |
| 77 | - },1); | |
| 78 | - } | |
| 79 | - this.classList.toggle("accordion_closed"); | |
| 80 | - }; | |
| 81 | - for(const e of a){ | |
| 82 | - let img = document.createElement("img"); | |
| 83 | - img.src = acc_svgdata[0]+acc_svgdata[2]+acc_svgdata[1]; | |
| 84 | - img.className = "accordion_btn accordion_btn_plus"; | |
| 85 | - e.insertBefore(img,e.firstChild); | |
| 86 | - img = document.createElement("img"); | |
| 87 | - img.src = acc_svgdata[0]+acc_svgdata[3]+acc_svgdata[1]; | |
| 88 | - img.className = "accordion_btn accordion_btn_minus"; | |
| 89 | - e.insertBefore(img,e.firstChild); | |
| 90 | - e.addEventListener("click", onclick); | |
| 91 | - if( e.classList.contains('collapsed') ){ | |
| 92 | - /* C code sets the 'collapsed' class for accordions which should | |
| 93 | - start that way. */ | |
| 94 | - e.classList.remove('collapsed'); | |
| 95 | - console.warn("WTH?", e); | |
| 96 | - e.click(); | |
| 97 | - } | |
| 98 | - } | |
| 99 | -})(); |
| --- a/src/accordion.js | |
| +++ b/src/accordion.js | |
| @@ -1,99 +0,0 @@ | |
| 1 | /* |
| 2 | ** Attach appropriate javascript to each ".accordion" button so that it expands |
| 3 | ** and contracts when clicked. |
| 4 | ** |
| 5 | ** The uncompressed source code for the SVG icons can be found on the wiki page |
| 6 | ** "branch/accordion-experiments" in the Fossil repository. |
| 7 | ** |
| 8 | ** Implementation notes: |
| 9 | ** |
| 10 | ** The `maxHeight' CSS property is quite restrictive for vertical resizing of |
| 11 | ** elements, especially for dynamic-content areas like the diff panels. That's |
| 12 | ** why `maxHeight' is set only during animation, to prevent truncated elements. |
| 13 | ** (The diff panels may get truncated right after page loading, and other |
| 14 | ** elements may get truncated when resizing the browser window to a smaller |
| 15 | ** width, causing vertical growth.) |
| 16 | ** |
| 17 | ** Another problem is that `scrollHeight' used to calculate the expanded height |
| 18 | ** while still in the contracted state may return values with small errors on |
| 19 | ** some browsers, especially for large elements, presumably due to omitting the |
| 20 | ** space required by the vertical scrollbar that may become necessary, causing |
| 21 | ** additional horizontal shrinking and consequently more vertical growth than |
| 22 | ** calculated. That's why setting `maxHeight' to `scrollHeight' is considered |
| 23 | ** "good enough" only during animation, but cleared afterwards. |
| 24 | ** |
| 25 | ** https://fossil-scm.org/forum/forumpost/66d7075f40 |
| 26 | ** https://fossil-scm.org/home/timeline?r=accordion-fix |
| 27 | ** |
| 28 | ** To work around the missing support for `overflow-y: clip', this script uses a |
| 29 | ** fallback and sets `overflow-y: hidden' during the accordion panel animations. |
| 30 | ** That's because if `overflow-y: hidden' is set statically from the stylesheet, |
| 31 | ** the shadow of the selected or current timeline entries in the context section |
| 32 | ** of `/info' pages is still truncated on the right (which is strange, as that's |
| 33 | ** not the "y" direction) in all major browsers. Otherwise, the stylesheet might |
| 34 | ** define the fallback using the `@supports(…)' at-rule: |
| 35 | ** |
| 36 | ** .accordion_panel { |
| 37 | ** overflow-y: hidden; |
| 38 | ** } |
| 39 | ** @supports(overflow-y: clip) { |
| 40 | ** .accordion_panel { |
| 41 | ** overflow-y: clip; |
| 42 | ** } |
| 43 | ** } |
| 44 | */ |
| 45 | (function(){ |
| 46 | const acc_svgdata = ["data:image/svg+xml,"+ |
| 47 | "%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E"+ |
| 48 | "%3Cpath style='fill:black;opacity:0' d='M16,16H0V0h16v16z'/%3E"+ |
| 49 | "%3Cpath style='fill:rgb(240,240,240)' d='M14,14H2V2h12v12z'/%3E"+ |
| 50 | "%3Cpath style='fill:rgb(64,64,64)' d='M13,13H3V3h10v10z'/%3E"+ |
| 51 | "%3Cpath style='fill:rgb(248,248,248)' d='M12,12H4V4h8v8z'/%3E"+ |
| 52 | "%3Cpath style='fill:rgb(80,128,208)' d='", "'/%3E%3C/svg%3E", |
| 53 | "M5,7h2v-2h2v2h2v2h-2v2h-2v-2h-2z", "M11,9H5V7h6v6z"]; |
| 54 | const a = document.getElementsByClassName("accordion"); |
| 55 | const xClickyHTML = /^(?:A|AREA|BUTTON|INPUT|LABEL|SELECT|TEXTAREA|DETAILS)$/; |
| 56 | const onclick = function(evt){ |
| 57 | /* Ignore clicks to hyperlinks and other "click-responsive" HTML elements in |
| 58 | ** ".accordion" headers (for which Fossil uses <DIV> elements that represent |
| 59 | ** section headers). */ |
| 60 | if( xClickyHTML.test(evt.target.tagName) ) return; |
| 61 | const x = this.nextElementSibling; |
| 62 | if( this.classList.contains("accordion_closed") ){ |
| 63 | x.style.maxHeight = x.scrollHeight + "px"; |
| 64 | setTimeout(function(){ |
| 65 | x.style.maxHeight = ""; |
| 66 | if( !window.CSS || !window.CSS.supports("overflow: clip") ){ |
| 67 | x.style.overflowY = ""; |
| 68 | } |
| 69 | },250); // default.css: .accordion_panel { transition-duration } |
| 70 | }else{ |
| 71 | x.style.maxHeight = x.scrollHeight + "px"; |
| 72 | if( !window.CSS || !window.CSS.supports("overflow: clip") ){ |
| 73 | x.style.overflowY = "hidden"; |
| 74 | } |
| 75 | setTimeout(function(){ |
| 76 | x.style.maxHeight = "0"; |
| 77 | },1); |
| 78 | } |
| 79 | this.classList.toggle("accordion_closed"); |
| 80 | }; |
| 81 | for(const e of a){ |
| 82 | let img = document.createElement("img"); |
| 83 | img.src = acc_svgdata[0]+acc_svgdata[2]+acc_svgdata[1]; |
| 84 | img.className = "accordion_btn accordion_btn_plus"; |
| 85 | e.insertBefore(img,e.firstChild); |
| 86 | img = document.createElement("img"); |
| 87 | img.src = acc_svgdata[0]+acc_svgdata[3]+acc_svgdata[1]; |
| 88 | img.className = "accordion_btn accordion_btn_minus"; |
| 89 | e.insertBefore(img,e.firstChild); |
| 90 | e.addEventListener("click", onclick); |
| 91 | if( e.classList.contains('collapsed') ){ |
| 92 | /* C code sets the 'collapsed' class for accordions which should |
| 93 | start that way. */ |
| 94 | e.classList.remove('collapsed'); |
| 95 | console.warn("WTH?", e); |
| 96 | e.click(); |
| 97 | } |
| 98 | } |
| 99 | })(); |
| --- a/src/accordion.js | |
| +++ b/src/accordion.js | |
| @@ -1,99 +0,0 @@ | |
+7
-6
| --- src/backlink.c | ||
| +++ src/backlink.c | ||
| @@ -26,10 +26,11 @@ | ||
| 26 | 26 | #include <assert.h> |
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | /* |
| 30 | 30 | ** Show a graph of all wiki, tickets, and check-ins that refer to object zUuid. |
| 31 | +** If there are none, emit no output. | |
| 31 | 32 | ** |
| 32 | 33 | ** If zLabel is not NULL and the graph is not empty, then output zLabel as |
| 33 | 34 | ** a prefix to the graph. |
| 34 | 35 | */ |
| 35 | 36 | void render_backlink_graph(const char *zUuid, const char *zLabel){ |
| @@ -49,27 +50,27 @@ | ||
| 49 | 50 | " FROM backlink\n" |
| 50 | 51 | " WHERE target GLOB %Q" |
| 51 | 52 | " AND %Q GLOB (target || '*');", |
| 52 | 53 | zGlob, zUuid |
| 53 | 54 | ); |
| 55 | + fossil_free(zGlob); | |
| 54 | 56 | if( !db_exists("SELECT 1 FROM ok") ) return; |
| 55 | 57 | if( zLabel ){ |
| 56 | - cgi_printf("%s", zLabel); | |
| 57 | - if( strstr(zLabel, "accordion")!=0 ){ | |
| 58 | - cgi_printf("<div class=\"accordion_panel\">\n"); | |
| 59 | - needEndPanel = 1; | |
| 60 | - } | |
| 58 | + cgi_printf("<details open>" | |
| 59 | + "<summary class='section'>%h</summary>" | |
| 60 | + "<div class=\"accordion_panel\">", zLabel); | |
| 61 | + needEndPanel = 1; | |
| 61 | 62 | } |
| 62 | 63 | blob_zero(&sql); |
| 63 | 64 | blob_append(&sql, timeline_query_for_www(), -1); |
| 64 | 65 | blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC"); |
| 65 | 66 | db_prepare(&q, "%s", blob_sql_text(&sql)); |
| 66 | 67 | www_print_timeline(&q, |
| 67 | 68 | TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL|TIMELINE_REFS, 0); |
| 68 | 69 | db_finalize(&q); |
| 69 | 70 | if( needEndPanel ){ |
| 70 | - cgi_printf("</div>\n"); | |
| 71 | + cgi_printf("</div></details>\n"); | |
| 71 | 72 | } |
| 72 | 73 | } |
| 73 | 74 | |
| 74 | 75 | /* |
| 75 | 76 | ** WEBPAGE: test-backlink-timeline |
| 76 | 77 |
| --- src/backlink.c | |
| +++ src/backlink.c | |
| @@ -26,10 +26,11 @@ | |
| 26 | #include <assert.h> |
| 27 | |
| 28 | |
| 29 | /* |
| 30 | ** Show a graph of all wiki, tickets, and check-ins that refer to object zUuid. |
| 31 | ** |
| 32 | ** If zLabel is not NULL and the graph is not empty, then output zLabel as |
| 33 | ** a prefix to the graph. |
| 34 | */ |
| 35 | void render_backlink_graph(const char *zUuid, const char *zLabel){ |
| @@ -49,27 +50,27 @@ | |
| 49 | " FROM backlink\n" |
| 50 | " WHERE target GLOB %Q" |
| 51 | " AND %Q GLOB (target || '*');", |
| 52 | zGlob, zUuid |
| 53 | ); |
| 54 | if( !db_exists("SELECT 1 FROM ok") ) return; |
| 55 | if( zLabel ){ |
| 56 | cgi_printf("%s", zLabel); |
| 57 | if( strstr(zLabel, "accordion")!=0 ){ |
| 58 | cgi_printf("<div class=\"accordion_panel\">\n"); |
| 59 | needEndPanel = 1; |
| 60 | } |
| 61 | } |
| 62 | blob_zero(&sql); |
| 63 | blob_append(&sql, timeline_query_for_www(), -1); |
| 64 | blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC"); |
| 65 | db_prepare(&q, "%s", blob_sql_text(&sql)); |
| 66 | www_print_timeline(&q, |
| 67 | TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL|TIMELINE_REFS, 0); |
| 68 | db_finalize(&q); |
| 69 | if( needEndPanel ){ |
| 70 | cgi_printf("</div>\n"); |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | /* |
| 75 | ** WEBPAGE: test-backlink-timeline |
| 76 |
| --- src/backlink.c | |
| +++ src/backlink.c | |
| @@ -26,10 +26,11 @@ | |
| 26 | #include <assert.h> |
| 27 | |
| 28 | |
| 29 | /* |
| 30 | ** Show a graph of all wiki, tickets, and check-ins that refer to object zUuid. |
| 31 | ** If there are none, emit no output. |
| 32 | ** |
| 33 | ** If zLabel is not NULL and the graph is not empty, then output zLabel as |
| 34 | ** a prefix to the graph. |
| 35 | */ |
| 36 | void render_backlink_graph(const char *zUuid, const char *zLabel){ |
| @@ -49,27 +50,27 @@ | |
| 50 | " FROM backlink\n" |
| 51 | " WHERE target GLOB %Q" |
| 52 | " AND %Q GLOB (target || '*');", |
| 53 | zGlob, zUuid |
| 54 | ); |
| 55 | fossil_free(zGlob); |
| 56 | if( !db_exists("SELECT 1 FROM ok") ) return; |
| 57 | if( zLabel ){ |
| 58 | cgi_printf("<details open>" |
| 59 | "<summary class='section'>%h</summary>" |
| 60 | "<div class=\"accordion_panel\">", zLabel); |
| 61 | needEndPanel = 1; |
| 62 | } |
| 63 | blob_zero(&sql); |
| 64 | blob_append(&sql, timeline_query_for_www(), -1); |
| 65 | blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC"); |
| 66 | db_prepare(&q, "%s", blob_sql_text(&sql)); |
| 67 | www_print_timeline(&q, |
| 68 | TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL|TIMELINE_REFS, 0); |
| 69 | db_finalize(&q); |
| 70 | if( needEndPanel ){ |
| 71 | cgi_printf("</div></details>\n"); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | /* |
| 76 | ** WEBPAGE: test-backlink-timeline |
| 77 |
+34
-1
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -2442,11 +2442,11 @@ | ||
| 2442 | 2442 | blob_reset(&txt); |
| 2443 | 2443 | } |
| 2444 | 2444 | blob_reset(&html); |
| 2445 | 2445 | blob_reset(&in); |
| 2446 | 2446 | return rc; |
| 2447 | -} | |
| 2447 | +} | |
| 2448 | 2448 | |
| 2449 | 2449 | /* |
| 2450 | 2450 | ** COMMAND: ci# |
| 2451 | 2451 | ** COMMAND: commit |
| 2452 | 2452 | ** |
| @@ -2534,10 +2534,16 @@ | ||
| 2534 | 2534 | ** --proxy PROXY Use PROXY as http proxy during sync operation |
| 2535 | 2535 | ** --tag TAG-NAME Add TAG-NAME to the check-in. May be repeated. |
| 2536 | 2536 | ** --trace Debug tracing |
| 2537 | 2537 | ** --user-override USER Record USER as the login that created the |
| 2538 | 2538 | ** new check-in, rather that the current user. |
| 2539 | +** -w|--wiki FILE Adds FILE's content as a wiki page associated | |
| 2540 | +** with this check-in. | |
| 2541 | +** --wm|--wiki-mimetype TYPE Mimetype for --wiki-file. Default is from the | |
| 2542 | +** file extension: .md=markdown, .wiki=fossil, | |
| 2543 | +** otherwise plain text. Accepts "markdown", | |
| 2544 | +** "wiki", and "plain" as aliases. | |
| 2539 | 2545 | ** |
| 2540 | 2546 | ** See also: [[branch]], [[changes]], [[update]], [[extras]], [[sync]] |
| 2541 | 2547 | */ |
| 2542 | 2548 | void commit_cmd(void){ |
| 2543 | 2549 | int hasChanges; /* True if unsaved changes exist */ |
| @@ -2587,10 +2593,12 @@ | ||
| 2587 | 2593 | int bIgnoreSkew = 0; /* --ignore-clock-skew flag */ |
| 2588 | 2594 | int mxSize; |
| 2589 | 2595 | char *zCurBranch = 0; /* The current branch name of checkout */ |
| 2590 | 2596 | char *zNewBranch = 0; /* The branch name after update */ |
| 2591 | 2597 | int ckComFlgs; /* Flags passed to verify_comment() */ |
| 2598 | + const char * zWikiFile; /* --wiki X */ | |
| 2599 | + const char * zWikiMime; /* --wiki-mimetype X */ | |
| 2592 | 2600 | |
| 2593 | 2601 | memset(&sCiInfo, 0, sizeof(sCiInfo)); |
| 2594 | 2602 | url_proxy_options(); |
| 2595 | 2603 | /* Undocumented. Supported only for backwards |
| 2596 | 2604 | ** compatibility -------vvvvvvv */ |
| @@ -2655,10 +2663,12 @@ | ||
| 2655 | 2663 | if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; } |
| 2656 | 2664 | useCksum = db_get_boolean("repo-cksum", 1); |
| 2657 | 2665 | bIgnoreSkew = find_option("ignore-clock-skew",0,0)!=0; |
| 2658 | 2666 | mxSize = db_large_file_size(); |
| 2659 | 2667 | if( find_option("ignore-oversize",0,0)!=0 ) mxSize = 0; |
| 2668 | + zWikiFile = find_option("wiki","w",1); | |
| 2669 | + zWikiMime = find_option("wiki-mimetype","wm",1); | |
| 2660 | 2670 | (void)fossil_text_editor(); |
| 2661 | 2671 | verify_all_options(); |
| 2662 | 2672 | |
| 2663 | 2673 | /* The --no-warnings flag and the --force flag each imply |
| 2664 | 2674 | ** the --no-verify-comment flag */ |
| @@ -3305,10 +3315,33 @@ | ||
| 3305 | 3315 | vfile_aggregate_checksum_disk(nvid, &cksum2); |
| 3306 | 3316 | if( blob_compare(&cksum1, &cksum2) ){ |
| 3307 | 3317 | fossil_fatal("working check-out before and after commit does not match"); |
| 3308 | 3318 | } |
| 3309 | 3319 | } |
| 3320 | + | |
| 3321 | + if( zWikiFile ){ | |
| 3322 | + /* Handle --wiki and --wiki-mimetype */ | |
| 3323 | + Blob bWiki = BLOB_INITIALIZER; | |
| 3324 | + char * zPageName; | |
| 3325 | + int parentRid = 0; | |
| 3326 | + blob_read_from_file(&bWiki, zWikiFile, ExtFILE); | |
| 3327 | + if( !zWikiMime ){ | |
| 3328 | + if( 0==sqlite3_strglob("*.md", zWikiFile) ){ | |
| 3329 | + zWikiMime = "text/x-markdown"; | |
| 3330 | + }else if( 0==sqlite3_strglob("*.wiki", zWikiFile) ){ | |
| 3331 | + zWikiMime = "text/x-fossil-wiki"; | |
| 3332 | + }else{ | |
| 3333 | + zWikiMime = "text/plain"; | |
| 3334 | + } | |
| 3335 | + } | |
| 3336 | + zPageName = mprintf("checkin/%s", zUuid); | |
| 3337 | + zWikiMime = wiki_filter_mimetypes(zWikiMime); | |
| 3338 | + wiki_cmd_commit(zPageName, parentRid, &bWiki, zWikiMime, 1); | |
| 3339 | + fossil_print("Added %s (%s)\n", zPageName, zWikiMime); | |
| 3340 | + blob_reset(&bWiki); | |
| 3341 | + fossil_free(zPageName); | |
| 3342 | + } | |
| 3310 | 3343 | |
| 3311 | 3344 | /* Clear the undo/redo stack */ |
| 3312 | 3345 | undo_reset(); |
| 3313 | 3346 | |
| 3314 | 3347 | /* Commit */ |
| 3315 | 3348 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -2442,11 +2442,11 @@ | |
| 2442 | blob_reset(&txt); |
| 2443 | } |
| 2444 | blob_reset(&html); |
| 2445 | blob_reset(&in); |
| 2446 | return rc; |
| 2447 | } |
| 2448 | |
| 2449 | /* |
| 2450 | ** COMMAND: ci# |
| 2451 | ** COMMAND: commit |
| 2452 | ** |
| @@ -2534,10 +2534,16 @@ | |
| 2534 | ** --proxy PROXY Use PROXY as http proxy during sync operation |
| 2535 | ** --tag TAG-NAME Add TAG-NAME to the check-in. May be repeated. |
| 2536 | ** --trace Debug tracing |
| 2537 | ** --user-override USER Record USER as the login that created the |
| 2538 | ** new check-in, rather that the current user. |
| 2539 | ** |
| 2540 | ** See also: [[branch]], [[changes]], [[update]], [[extras]], [[sync]] |
| 2541 | */ |
| 2542 | void commit_cmd(void){ |
| 2543 | int hasChanges; /* True if unsaved changes exist */ |
| @@ -2587,10 +2593,12 @@ | |
| 2587 | int bIgnoreSkew = 0; /* --ignore-clock-skew flag */ |
| 2588 | int mxSize; |
| 2589 | char *zCurBranch = 0; /* The current branch name of checkout */ |
| 2590 | char *zNewBranch = 0; /* The branch name after update */ |
| 2591 | int ckComFlgs; /* Flags passed to verify_comment() */ |
| 2592 | |
| 2593 | memset(&sCiInfo, 0, sizeof(sCiInfo)); |
| 2594 | url_proxy_options(); |
| 2595 | /* Undocumented. Supported only for backwards |
| 2596 | ** compatibility -------vvvvvvv */ |
| @@ -2655,10 +2663,12 @@ | |
| 2655 | if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; } |
| 2656 | useCksum = db_get_boolean("repo-cksum", 1); |
| 2657 | bIgnoreSkew = find_option("ignore-clock-skew",0,0)!=0; |
| 2658 | mxSize = db_large_file_size(); |
| 2659 | if( find_option("ignore-oversize",0,0)!=0 ) mxSize = 0; |
| 2660 | (void)fossil_text_editor(); |
| 2661 | verify_all_options(); |
| 2662 | |
| 2663 | /* The --no-warnings flag and the --force flag each imply |
| 2664 | ** the --no-verify-comment flag */ |
| @@ -3305,10 +3315,33 @@ | |
| 3305 | vfile_aggregate_checksum_disk(nvid, &cksum2); |
| 3306 | if( blob_compare(&cksum1, &cksum2) ){ |
| 3307 | fossil_fatal("working check-out before and after commit does not match"); |
| 3308 | } |
| 3309 | } |
| 3310 | |
| 3311 | /* Clear the undo/redo stack */ |
| 3312 | undo_reset(); |
| 3313 | |
| 3314 | /* Commit */ |
| 3315 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -2442,11 +2442,11 @@ | |
| 2442 | blob_reset(&txt); |
| 2443 | } |
| 2444 | blob_reset(&html); |
| 2445 | blob_reset(&in); |
| 2446 | return rc; |
| 2447 | } |
| 2448 | |
| 2449 | /* |
| 2450 | ** COMMAND: ci# |
| 2451 | ** COMMAND: commit |
| 2452 | ** |
| @@ -2534,10 +2534,16 @@ | |
| 2534 | ** --proxy PROXY Use PROXY as http proxy during sync operation |
| 2535 | ** --tag TAG-NAME Add TAG-NAME to the check-in. May be repeated. |
| 2536 | ** --trace Debug tracing |
| 2537 | ** --user-override USER Record USER as the login that created the |
| 2538 | ** new check-in, rather that the current user. |
| 2539 | ** -w|--wiki FILE Adds FILE's content as a wiki page associated |
| 2540 | ** with this check-in. |
| 2541 | ** --wm|--wiki-mimetype TYPE Mimetype for --wiki-file. Default is from the |
| 2542 | ** file extension: .md=markdown, .wiki=fossil, |
| 2543 | ** otherwise plain text. Accepts "markdown", |
| 2544 | ** "wiki", and "plain" as aliases. |
| 2545 | ** |
| 2546 | ** See also: [[branch]], [[changes]], [[update]], [[extras]], [[sync]] |
| 2547 | */ |
| 2548 | void commit_cmd(void){ |
| 2549 | int hasChanges; /* True if unsaved changes exist */ |
| @@ -2587,10 +2593,12 @@ | |
| 2593 | int bIgnoreSkew = 0; /* --ignore-clock-skew flag */ |
| 2594 | int mxSize; |
| 2595 | char *zCurBranch = 0; /* The current branch name of checkout */ |
| 2596 | char *zNewBranch = 0; /* The branch name after update */ |
| 2597 | int ckComFlgs; /* Flags passed to verify_comment() */ |
| 2598 | const char * zWikiFile; /* --wiki X */ |
| 2599 | const char * zWikiMime; /* --wiki-mimetype X */ |
| 2600 | |
| 2601 | memset(&sCiInfo, 0, sizeof(sCiInfo)); |
| 2602 | url_proxy_options(); |
| 2603 | /* Undocumented. Supported only for backwards |
| 2604 | ** compatibility -------vvvvvvv */ |
| @@ -2655,10 +2663,12 @@ | |
| 2663 | if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; } |
| 2664 | useCksum = db_get_boolean("repo-cksum", 1); |
| 2665 | bIgnoreSkew = find_option("ignore-clock-skew",0,0)!=0; |
| 2666 | mxSize = db_large_file_size(); |
| 2667 | if( find_option("ignore-oversize",0,0)!=0 ) mxSize = 0; |
| 2668 | zWikiFile = find_option("wiki","w",1); |
| 2669 | zWikiMime = find_option("wiki-mimetype","wm",1); |
| 2670 | (void)fossil_text_editor(); |
| 2671 | verify_all_options(); |
| 2672 | |
| 2673 | /* The --no-warnings flag and the --force flag each imply |
| 2674 | ** the --no-verify-comment flag */ |
| @@ -3305,10 +3315,33 @@ | |
| 3315 | vfile_aggregate_checksum_disk(nvid, &cksum2); |
| 3316 | if( blob_compare(&cksum1, &cksum2) ){ |
| 3317 | fossil_fatal("working check-out before and after commit does not match"); |
| 3318 | } |
| 3319 | } |
| 3320 | |
| 3321 | if( zWikiFile ){ |
| 3322 | /* Handle --wiki and --wiki-mimetype */ |
| 3323 | Blob bWiki = BLOB_INITIALIZER; |
| 3324 | char * zPageName; |
| 3325 | int parentRid = 0; |
| 3326 | blob_read_from_file(&bWiki, zWikiFile, ExtFILE); |
| 3327 | if( !zWikiMime ){ |
| 3328 | if( 0==sqlite3_strglob("*.md", zWikiFile) ){ |
| 3329 | zWikiMime = "text/x-markdown"; |
| 3330 | }else if( 0==sqlite3_strglob("*.wiki", zWikiFile) ){ |
| 3331 | zWikiMime = "text/x-fossil-wiki"; |
| 3332 | }else{ |
| 3333 | zWikiMime = "text/plain"; |
| 3334 | } |
| 3335 | } |
| 3336 | zPageName = mprintf("checkin/%s", zUuid); |
| 3337 | zWikiMime = wiki_filter_mimetypes(zWikiMime); |
| 3338 | wiki_cmd_commit(zPageName, parentRid, &bWiki, zWikiMime, 1); |
| 3339 | fossil_print("Added %s (%s)\n", zPageName, zWikiMime); |
| 3340 | blob_reset(&bWiki); |
| 3341 | fossil_free(zPageName); |
| 3342 | } |
| 3343 | |
| 3344 | /* Clear the undo/redo stack */ |
| 3345 | undo_reset(); |
| 3346 | |
| 3347 | /* Commit */ |
| 3348 |
+4
-1
| --- src/default.css | ||
| +++ src/default.css | ||
| @@ -1244,13 +1244,16 @@ | ||
| 1244 | 1244 | display: none; |
| 1245 | 1245 | } |
| 1246 | 1246 | .accordion_closed > .accordion_btn_plus { |
| 1247 | 1247 | display: inline-block; |
| 1248 | 1248 | } |
| 1249 | -.accordion_panel { | |
| 1249 | +.accordion_panel, details > div { | |
| 1250 | 1250 | overflow-y: clip; |
| 1251 | 1251 | transition: max-height 0.25s ease-out; |
| 1252 | +} | |
| 1253 | +details > summary.section { | |
| 1254 | + cursor: pointer; | |
| 1252 | 1255 | } |
| 1253 | 1256 | .error { |
| 1254 | 1257 | color: darkred; |
| 1255 | 1258 | background: yellow; |
| 1256 | 1259 | } |
| 1257 | 1260 |
| --- src/default.css | |
| +++ src/default.css | |
| @@ -1244,13 +1244,16 @@ | |
| 1244 | display: none; |
| 1245 | } |
| 1246 | .accordion_closed > .accordion_btn_plus { |
| 1247 | display: inline-block; |
| 1248 | } |
| 1249 | .accordion_panel { |
| 1250 | overflow-y: clip; |
| 1251 | transition: max-height 0.25s ease-out; |
| 1252 | } |
| 1253 | .error { |
| 1254 | color: darkred; |
| 1255 | background: yellow; |
| 1256 | } |
| 1257 |
| --- src/default.css | |
| +++ src/default.css | |
| @@ -1244,13 +1244,16 @@ | |
| 1244 | display: none; |
| 1245 | } |
| 1246 | .accordion_closed > .accordion_btn_plus { |
| 1247 | display: inline-block; |
| 1248 | } |
| 1249 | .accordion_panel, details > div { |
| 1250 | overflow-y: clip; |
| 1251 | transition: max-height 0.25s ease-out; |
| 1252 | } |
| 1253 | details > summary.section { |
| 1254 | cursor: pointer; |
| 1255 | } |
| 1256 | .error { |
| 1257 | color: darkred; |
| 1258 | background: yellow; |
| 1259 | } |
| 1260 |
+10
-8
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -1080,11 +1080,12 @@ | ||
| 1080 | 1080 | zComment = db_column_text(&q1, 3); |
| 1081 | 1081 | zDate = db_column_text(&q1,1); |
| 1082 | 1082 | zOrigDate = db_column_text(&q1, 4); |
| 1083 | 1083 | if( zOrigDate==0 ) zOrigDate = zDate; |
| 1084 | 1084 | zZulu = db_column_text(&q1, 6); |
| 1085 | - @ <div class="section accordion">Overview</div> | |
| 1085 | + @ <details open> | |
| 1086 | + @ <summary class="section">Overview</summary> | |
| 1086 | 1087 | @ <div class="accordion_panel"> |
| 1087 | 1088 | @ <table class="label-value"> |
| 1088 | 1089 | @ <tr><th>Comment:</th><td class="infoComment">\ |
| 1089 | 1090 | @ %!W(zEComment?zEComment:zComment)</td></tr> |
| 1090 | 1091 | |
| @@ -1269,20 +1270,21 @@ | ||
| 1269 | 1270 | }else{ |
| 1270 | 1271 | style_header("Check-in Information"); |
| 1271 | 1272 | login_anonymous_available(); |
| 1272 | 1273 | } |
| 1273 | 1274 | db_finalize(&q1); |
| 1274 | - @ </div> | |
| 1275 | - builtin_request_js("accordion.js"); | |
| 1275 | + @ </details> | |
| 1276 | 1276 | if( !PB("nowiki") ){ |
| 1277 | 1277 | wiki_render_associated("checkin", zUuid, 0); |
| 1278 | 1278 | } |
| 1279 | - render_backlink_graph(zUuid, | |
| 1280 | - "<div class=\"section accordion\">References</div>\n"); | |
| 1281 | - @ <div class="section accordion">Context</div><div class="accordion_panel"> | |
| 1279 | + render_backlink_graph(zUuid, "References"); | |
| 1280 | + @ <details open><summary class="section">Context</summary> | |
| 1281 | + @ <div class="accordion_panel"> | |
| 1282 | 1282 | render_checkin_context(rid, 0, 2, 0); |
| 1283 | - @ </div><div class="section accordion" id="changes_section">Changes</div> | |
| 1283 | + @ </div></details> | |
| 1284 | + @ <details open> | |
| 1285 | + @ <summary class="section" id="changes_section">Changes</summary> | |
| 1284 | 1286 | @ <div class="accordion_panel"> |
| 1285 | 1287 | @ <div class="sectionmenu info-changes-menu"> |
| 1286 | 1288 | /* ^^^ .info-changes-menu is used by diff scroll sync */ |
| 1287 | 1289 | pCfg = construct_diff_flags(diffType, &DCfg); |
| 1288 | 1290 | DCfg.diffFlags |= DIFF_NUMSTAT; /* Show stats in the 'Changes' section */ |
| @@ -1338,11 +1340,11 @@ | ||
| 1338 | 1340 | const char *zOldName = db_column_text(&q3, 4); |
| 1339 | 1341 | append_file_change_line(zUuid, zName, zOld, zNew, zOldName, |
| 1340 | 1342 | pCfg,mperm,aChng); |
| 1341 | 1343 | } |
| 1342 | 1344 | db_finalize(&q3); |
| 1343 | - @ </div> | |
| 1345 | + @ </div></details> | |
| 1344 | 1346 | if( diffType!=0 ){ |
| 1345 | 1347 | adjust_changes_section_title(__LINE__, aChng); |
| 1346 | 1348 | } |
| 1347 | 1349 | append_diff_javascript(diffType); |
| 1348 | 1350 | style_finish_page(); |
| 1349 | 1351 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1080,11 +1080,12 @@ | |
| 1080 | zComment = db_column_text(&q1, 3); |
| 1081 | zDate = db_column_text(&q1,1); |
| 1082 | zOrigDate = db_column_text(&q1, 4); |
| 1083 | if( zOrigDate==0 ) zOrigDate = zDate; |
| 1084 | zZulu = db_column_text(&q1, 6); |
| 1085 | @ <div class="section accordion">Overview</div> |
| 1086 | @ <div class="accordion_panel"> |
| 1087 | @ <table class="label-value"> |
| 1088 | @ <tr><th>Comment:</th><td class="infoComment">\ |
| 1089 | @ %!W(zEComment?zEComment:zComment)</td></tr> |
| 1090 | |
| @@ -1269,20 +1270,21 @@ | |
| 1269 | }else{ |
| 1270 | style_header("Check-in Information"); |
| 1271 | login_anonymous_available(); |
| 1272 | } |
| 1273 | db_finalize(&q1); |
| 1274 | @ </div> |
| 1275 | builtin_request_js("accordion.js"); |
| 1276 | if( !PB("nowiki") ){ |
| 1277 | wiki_render_associated("checkin", zUuid, 0); |
| 1278 | } |
| 1279 | render_backlink_graph(zUuid, |
| 1280 | "<div class=\"section accordion\">References</div>\n"); |
| 1281 | @ <div class="section accordion">Context</div><div class="accordion_panel"> |
| 1282 | render_checkin_context(rid, 0, 2, 0); |
| 1283 | @ </div><div class="section accordion" id="changes_section">Changes</div> |
| 1284 | @ <div class="accordion_panel"> |
| 1285 | @ <div class="sectionmenu info-changes-menu"> |
| 1286 | /* ^^^ .info-changes-menu is used by diff scroll sync */ |
| 1287 | pCfg = construct_diff_flags(diffType, &DCfg); |
| 1288 | DCfg.diffFlags |= DIFF_NUMSTAT; /* Show stats in the 'Changes' section */ |
| @@ -1338,11 +1340,11 @@ | |
| 1338 | const char *zOldName = db_column_text(&q3, 4); |
| 1339 | append_file_change_line(zUuid, zName, zOld, zNew, zOldName, |
| 1340 | pCfg,mperm,aChng); |
| 1341 | } |
| 1342 | db_finalize(&q3); |
| 1343 | @ </div> |
| 1344 | if( diffType!=0 ){ |
| 1345 | adjust_changes_section_title(__LINE__, aChng); |
| 1346 | } |
| 1347 | append_diff_javascript(diffType); |
| 1348 | style_finish_page(); |
| 1349 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1080,11 +1080,12 @@ | |
| 1080 | zComment = db_column_text(&q1, 3); |
| 1081 | zDate = db_column_text(&q1,1); |
| 1082 | zOrigDate = db_column_text(&q1, 4); |
| 1083 | if( zOrigDate==0 ) zOrigDate = zDate; |
| 1084 | zZulu = db_column_text(&q1, 6); |
| 1085 | @ <details open> |
| 1086 | @ <summary class="section">Overview</summary> |
| 1087 | @ <div class="accordion_panel"> |
| 1088 | @ <table class="label-value"> |
| 1089 | @ <tr><th>Comment:</th><td class="infoComment">\ |
| 1090 | @ %!W(zEComment?zEComment:zComment)</td></tr> |
| 1091 | |
| @@ -1269,20 +1270,21 @@ | |
| 1270 | }else{ |
| 1271 | style_header("Check-in Information"); |
| 1272 | login_anonymous_available(); |
| 1273 | } |
| 1274 | db_finalize(&q1); |
| 1275 | @ </details> |
| 1276 | if( !PB("nowiki") ){ |
| 1277 | wiki_render_associated("checkin", zUuid, 0); |
| 1278 | } |
| 1279 | render_backlink_graph(zUuid, "References"); |
| 1280 | @ <details open><summary class="section">Context</summary> |
| 1281 | @ <div class="accordion_panel"> |
| 1282 | render_checkin_context(rid, 0, 2, 0); |
| 1283 | @ </div></details> |
| 1284 | @ <details open> |
| 1285 | @ <summary class="section" id="changes_section">Changes</summary> |
| 1286 | @ <div class="accordion_panel"> |
| 1287 | @ <div class="sectionmenu info-changes-menu"> |
| 1288 | /* ^^^ .info-changes-menu is used by diff scroll sync */ |
| 1289 | pCfg = construct_diff_flags(diffType, &DCfg); |
| 1290 | DCfg.diffFlags |= DIFF_NUMSTAT; /* Show stats in the 'Changes' section */ |
| @@ -1338,11 +1340,11 @@ | |
| 1340 | const char *zOldName = db_column_text(&q3, 4); |
| 1341 | append_file_change_line(zUuid, zName, zOld, zNew, zOldName, |
| 1342 | pCfg,mperm,aChng); |
| 1343 | } |
| 1344 | db_finalize(&q3); |
| 1345 | @ </div></details> |
| 1346 | if( diffType!=0 ){ |
| 1347 | adjust_changes_section_title(__LINE__, aChng); |
| 1348 | } |
| 1349 | append_diff_javascript(diffType); |
| 1350 | style_finish_page(); |
| 1351 |
-1
| --- src/main.mk | ||
| +++ src/main.mk | ||
| @@ -214,11 +214,10 @@ | ||
| 214 | 214 | $(SRCDIR)/../skins/plain_gray/header.txt \ |
| 215 | 215 | $(SRCDIR)/../skins/xekri/css.txt \ |
| 216 | 216 | $(SRCDIR)/../skins/xekri/details.txt \ |
| 217 | 217 | $(SRCDIR)/../skins/xekri/footer.txt \ |
| 218 | 218 | $(SRCDIR)/../skins/xekri/header.txt \ |
| 219 | - $(SRCDIR)/accordion.js \ | |
| 220 | 219 | $(SRCDIR)/alerts/bflat2.wav \ |
| 221 | 220 | $(SRCDIR)/alerts/bflat3.wav \ |
| 222 | 221 | $(SRCDIR)/alerts/bloop.wav \ |
| 223 | 222 | $(SRCDIR)/alerts/plunk.wav \ |
| 224 | 223 | $(SRCDIR)/ci_edit.js \ |
| 225 | 224 |
| --- src/main.mk | |
| +++ src/main.mk | |
| @@ -214,11 +214,10 @@ | |
| 214 | $(SRCDIR)/../skins/plain_gray/header.txt \ |
| 215 | $(SRCDIR)/../skins/xekri/css.txt \ |
| 216 | $(SRCDIR)/../skins/xekri/details.txt \ |
| 217 | $(SRCDIR)/../skins/xekri/footer.txt \ |
| 218 | $(SRCDIR)/../skins/xekri/header.txt \ |
| 219 | $(SRCDIR)/accordion.js \ |
| 220 | $(SRCDIR)/alerts/bflat2.wav \ |
| 221 | $(SRCDIR)/alerts/bflat3.wav \ |
| 222 | $(SRCDIR)/alerts/bloop.wav \ |
| 223 | $(SRCDIR)/alerts/plunk.wav \ |
| 224 | $(SRCDIR)/ci_edit.js \ |
| 225 |
| --- src/main.mk | |
| +++ src/main.mk | |
| @@ -214,11 +214,10 @@ | |
| 214 | $(SRCDIR)/../skins/plain_gray/header.txt \ |
| 215 | $(SRCDIR)/../skins/xekri/css.txt \ |
| 216 | $(SRCDIR)/../skins/xekri/details.txt \ |
| 217 | $(SRCDIR)/../skins/xekri/footer.txt \ |
| 218 | $(SRCDIR)/../skins/xekri/header.txt \ |
| 219 | $(SRCDIR)/alerts/bflat2.wav \ |
| 220 | $(SRCDIR)/alerts/bflat3.wav \ |
| 221 | $(SRCDIR)/alerts/bloop.wav \ |
| 222 | $(SRCDIR)/alerts/plunk.wav \ |
| 223 | $(SRCDIR)/ci_edit.js \ |
| 224 |
+8
-4
| --- src/tar.c | ||
| +++ src/tar.c | ||
| @@ -1351,12 +1351,13 @@ | ||
| 1351 | 1351 | ")", |
| 1352 | 1352 | rid |
| 1353 | 1353 | ); |
| 1354 | 1354 | style_header("Downloads For Check-in %!S", zUuid); |
| 1355 | 1355 | zBase = archive_base_name(rid); |
| 1356 | - @ <div class="section accordion">Downloads for check-in \ | |
| 1357 | - @ %z(href("%R/info/%!S",zUuid))%S(zUuid)</a>%h(zTags)</div> | |
| 1356 | + @ <details open> | |
| 1357 | + @ <summary class="section">Downloads for check-in \ | |
| 1358 | + @ %z(href("%R/info/%!S",zUuid))%S(zUuid)</a>%h(zTags)</summary> | |
| 1358 | 1359 | @ <div class="accordion_panel"> |
| 1359 | 1360 | @ <table class="label-value"> |
| 1360 | 1361 | @ <tr> |
| 1361 | 1362 | @ <th>Tarball:</th> |
| 1362 | 1363 | @ <td>%z(href("%R/tarball/%s.tar.gz",zBase))\ |
| @@ -1373,12 +1374,15 @@ | ||
| 1373 | 1374 | @ <th>SQLAR:</th> |
| 1374 | 1375 | @ <td>%z(href("%R/sqlar/%s.sqlar",zBase))\ |
| 1375 | 1376 | @ %s(g.zBaseURL)/sqlar/%s(zBase).sqlar</a></td> |
| 1376 | 1377 | @ </tr> |
| 1377 | 1378 | @ </table></div> |
| 1379 | + @ </details> | |
| 1378 | 1380 | fossil_free(zBase); |
| 1379 | - @ <div class="section accordion">Context</div><div class="accordion_panel"> | |
| 1381 | + @ <details open> | |
| 1382 | + @ <summary class="section">Context</summary> | |
| 1383 | + @ <div class="accordion_panel"> | |
| 1380 | 1384 | render_checkin_context(rid, 0, 0, 0); |
| 1381 | 1385 | @ </div> |
| 1382 | - builtin_request_js("accordion.js"); | |
| 1386 | + @ </details> | |
| 1383 | 1387 | style_finish_page(); |
| 1384 | 1388 | } |
| 1385 | 1389 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -1351,12 +1351,13 @@ | |
| 1351 | ")", |
| 1352 | rid |
| 1353 | ); |
| 1354 | style_header("Downloads For Check-in %!S", zUuid); |
| 1355 | zBase = archive_base_name(rid); |
| 1356 | @ <div class="section accordion">Downloads for check-in \ |
| 1357 | @ %z(href("%R/info/%!S",zUuid))%S(zUuid)</a>%h(zTags)</div> |
| 1358 | @ <div class="accordion_panel"> |
| 1359 | @ <table class="label-value"> |
| 1360 | @ <tr> |
| 1361 | @ <th>Tarball:</th> |
| 1362 | @ <td>%z(href("%R/tarball/%s.tar.gz",zBase))\ |
| @@ -1373,12 +1374,15 @@ | |
| 1373 | @ <th>SQLAR:</th> |
| 1374 | @ <td>%z(href("%R/sqlar/%s.sqlar",zBase))\ |
| 1375 | @ %s(g.zBaseURL)/sqlar/%s(zBase).sqlar</a></td> |
| 1376 | @ </tr> |
| 1377 | @ </table></div> |
| 1378 | fossil_free(zBase); |
| 1379 | @ <div class="section accordion">Context</div><div class="accordion_panel"> |
| 1380 | render_checkin_context(rid, 0, 0, 0); |
| 1381 | @ </div> |
| 1382 | builtin_request_js("accordion.js"); |
| 1383 | style_finish_page(); |
| 1384 | } |
| 1385 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -1351,12 +1351,13 @@ | |
| 1351 | ")", |
| 1352 | rid |
| 1353 | ); |
| 1354 | style_header("Downloads For Check-in %!S", zUuid); |
| 1355 | zBase = archive_base_name(rid); |
| 1356 | @ <details open> |
| 1357 | @ <summary class="section">Downloads for check-in \ |
| 1358 | @ %z(href("%R/info/%!S",zUuid))%S(zUuid)</a>%h(zTags)</summary> |
| 1359 | @ <div class="accordion_panel"> |
| 1360 | @ <table class="label-value"> |
| 1361 | @ <tr> |
| 1362 | @ <th>Tarball:</th> |
| 1363 | @ <td>%z(href("%R/tarball/%s.tar.gz",zBase))\ |
| @@ -1373,12 +1374,15 @@ | |
| 1374 | @ <th>SQLAR:</th> |
| 1375 | @ <td>%z(href("%R/sqlar/%s.sqlar",zBase))\ |
| 1376 | @ %s(g.zBaseURL)/sqlar/%s(zBase).sqlar</a></td> |
| 1377 | @ </tr> |
| 1378 | @ </table></div> |
| 1379 | @ </details> |
| 1380 | fossil_free(zBase); |
| 1381 | @ <details open> |
| 1382 | @ <summary class="section">Context</summary> |
| 1383 | @ <div class="accordion_panel"> |
| 1384 | render_checkin_context(rid, 0, 0, 0); |
| 1385 | @ </div> |
| 1386 | @ </details> |
| 1387 | style_finish_page(); |
| 1388 | } |
| 1389 |
+11
-9
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -725,13 +725,13 @@ | ||
| 725 | 725 | ** If pRid is not NULL then if a result is found *pRid is set to its |
| 726 | 726 | ** RID. If ppWiki is not NULL then if found *ppWiki is set to the |
| 727 | 727 | ** loaded wiki object, which the caller is responsible for passing to |
| 728 | 728 | ** manifest_destroy(). |
| 729 | 729 | */ |
| 730 | -static int wiki_fetch_by_name( const char *zPageName, | |
| 731 | - unsigned int versionsBack, | |
| 732 | - int * pRid, Manifest **ppWiki ){ | |
| 730 | +int wiki_fetch_by_name( const char *zPageName, | |
| 731 | + unsigned int versionsBack, | |
| 732 | + int * pRid, Manifest **ppWiki ){ | |
| 733 | 733 | Manifest *pWiki = 0; |
| 734 | 734 | char *zTag = mprintf("wiki-%s", zPageName); |
| 735 | 735 | Stmt q = empty_Stmt; |
| 736 | 736 | int rid = 0; |
| 737 | 737 | |
| @@ -2527,10 +2527,11 @@ | ||
| 2527 | 2527 | #if INTERFACE |
| 2528 | 2528 | #define WIKIASSOC_FULL_TITLE 0x00001 /* Full title */ |
| 2529 | 2529 | #define WIKIASSOC_MENU_READ 0x00002 /* Add submenu link to read wiki */ |
| 2530 | 2530 | #define WIKIASSOC_MENU_WRITE 0x00004 /* Add submenu link to add wiki */ |
| 2531 | 2531 | #define WIKIASSOC_ALL 0x00007 /* All of the above */ |
| 2532 | +#define WIKIASSOC_REVEAL 0x00008 /* Reveal content by default */ | |
| 2532 | 2533 | #endif |
| 2533 | 2534 | |
| 2534 | 2535 | /* |
| 2535 | 2536 | ** Show the default Section label for an associated wiki page. |
| 2536 | 2537 | */ |
| @@ -2538,15 +2539,15 @@ | ||
| 2538 | 2539 | const char *zPrefix, /* "branch", "tag", or "checkin" */ |
| 2539 | 2540 | const char *zName, /* Name of the object */ |
| 2540 | 2541 | unsigned int mFlags /* Zero or more WIKIASSOC_* flags */ |
| 2541 | 2542 | ){ |
| 2542 | 2543 | if( (mFlags & WIKIASSOC_FULL_TITLE)==0 ){ |
| 2543 | - @ <div class="section accordion">About</div> | |
| 2544 | + @ <summary class="section">About</summary> | |
| 2544 | 2545 | }else if( zPrefix[0]=='c' ){ /* checkin/... */ |
| 2545 | - @ <div class="section accordion">About check-in %.20h(zName)</div> | |
| 2546 | + @ <summary class="section accordion">About check-in %.20h(zName)</summary> | |
| 2546 | 2547 | }else{ |
| 2547 | - @ <div class="section accordion">About %s(zPrefix) %h(zName)</div> | |
| 2548 | + @ <summary class="section accordion">About %s(zPrefix) %h(zName)</summary> | |
| 2548 | 2549 | } |
| 2549 | 2550 | } |
| 2550 | 2551 | |
| 2551 | 2552 | /* |
| 2552 | 2553 | ** Add an "Wiki" button in a submenu that links to the read-wiki page. |
| @@ -2604,18 +2605,19 @@ | ||
| 2604 | 2605 | style_submenu_element("Add Wiki", "%R/wikiedit?name=%s/%t", |
| 2605 | 2606 | zPrefix, zName); |
| 2606 | 2607 | } |
| 2607 | 2608 | return 0; |
| 2608 | 2609 | } |
| 2610 | + @ <details %s((WIKIASSOC_REVEAL & mFlags) ? "open" : "")> | |
| 2609 | 2611 | if( fossil_strcmp(pWiki->zMimetype, "text/x-markdown")==0 ){ |
| 2610 | 2612 | Blob tail = BLOB_INITIALIZER; |
| 2611 | 2613 | Blob title = BLOB_INITIALIZER; |
| 2612 | 2614 | Blob markdown; |
| 2613 | 2615 | blob_init(&markdown, pWiki->zWiki, -1); |
| 2614 | 2616 | markdown_to_html(&markdown, &title, &tail); |
| 2615 | 2617 | if( blob_size(&title) ){ |
| 2616 | - @ <div class="section accordion">%h(blob_str(&title))</div> | |
| 2618 | + @ <summary class="section">%h(blob_str(&title))</summary> | |
| 2617 | 2619 | }else{ |
| 2618 | 2620 | wiki_section_label(zPrefix, zName, mFlags); |
| 2619 | 2621 | } |
| 2620 | 2622 | wiki_submenu_to_read_wiki(zPrefix, zName, mFlags); |
| 2621 | 2623 | wiki_submenu_to_edit_wiki(zPrefix, zName, mFlags); |
| @@ -2638,11 +2640,11 @@ | ||
| 2638 | 2640 | Blob title = BLOB_INITIALIZER; |
| 2639 | 2641 | Blob wiki; |
| 2640 | 2642 | Blob *pBody; |
| 2641 | 2643 | blob_init(&wiki, pWiki->zWiki, -1); |
| 2642 | 2644 | if( wiki_find_title(&wiki, &title, &tail) ){ |
| 2643 | - @ <div class="section accordion">%h(blob_str(&title))</div> | |
| 2645 | + @ <summary class="section">%h(blob_str(&title))</summary> | |
| 2644 | 2646 | pBody = &tail; |
| 2645 | 2647 | }else{ |
| 2646 | 2648 | wiki_section_label(zPrefix, zName, mFlags); |
| 2647 | 2649 | pBody = &wiki; |
| 2648 | 2650 | } |
| @@ -2652,9 +2654,9 @@ | ||
| 2652 | 2654 | @ </div></div> |
| 2653 | 2655 | blob_reset(&tail); |
| 2654 | 2656 | blob_reset(&title); |
| 2655 | 2657 | blob_reset(&wiki); |
| 2656 | 2658 | } |
| 2659 | + @ </details> | |
| 2657 | 2660 | manifest_destroy(pWiki); |
| 2658 | - builtin_request_js("accordion.js"); | |
| 2659 | 2661 | return 1; |
| 2660 | 2662 | } |
| 2661 | 2663 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -725,13 +725,13 @@ | |
| 725 | ** If pRid is not NULL then if a result is found *pRid is set to its |
| 726 | ** RID. If ppWiki is not NULL then if found *ppWiki is set to the |
| 727 | ** loaded wiki object, which the caller is responsible for passing to |
| 728 | ** manifest_destroy(). |
| 729 | */ |
| 730 | static int wiki_fetch_by_name( const char *zPageName, |
| 731 | unsigned int versionsBack, |
| 732 | int * pRid, Manifest **ppWiki ){ |
| 733 | Manifest *pWiki = 0; |
| 734 | char *zTag = mprintf("wiki-%s", zPageName); |
| 735 | Stmt q = empty_Stmt; |
| 736 | int rid = 0; |
| 737 | |
| @@ -2527,10 +2527,11 @@ | |
| 2527 | #if INTERFACE |
| 2528 | #define WIKIASSOC_FULL_TITLE 0x00001 /* Full title */ |
| 2529 | #define WIKIASSOC_MENU_READ 0x00002 /* Add submenu link to read wiki */ |
| 2530 | #define WIKIASSOC_MENU_WRITE 0x00004 /* Add submenu link to add wiki */ |
| 2531 | #define WIKIASSOC_ALL 0x00007 /* All of the above */ |
| 2532 | #endif |
| 2533 | |
| 2534 | /* |
| 2535 | ** Show the default Section label for an associated wiki page. |
| 2536 | */ |
| @@ -2538,15 +2539,15 @@ | |
| 2538 | const char *zPrefix, /* "branch", "tag", or "checkin" */ |
| 2539 | const char *zName, /* Name of the object */ |
| 2540 | unsigned int mFlags /* Zero or more WIKIASSOC_* flags */ |
| 2541 | ){ |
| 2542 | if( (mFlags & WIKIASSOC_FULL_TITLE)==0 ){ |
| 2543 | @ <div class="section accordion">About</div> |
| 2544 | }else if( zPrefix[0]=='c' ){ /* checkin/... */ |
| 2545 | @ <div class="section accordion">About check-in %.20h(zName)</div> |
| 2546 | }else{ |
| 2547 | @ <div class="section accordion">About %s(zPrefix) %h(zName)</div> |
| 2548 | } |
| 2549 | } |
| 2550 | |
| 2551 | /* |
| 2552 | ** Add an "Wiki" button in a submenu that links to the read-wiki page. |
| @@ -2604,18 +2605,19 @@ | |
| 2604 | style_submenu_element("Add Wiki", "%R/wikiedit?name=%s/%t", |
| 2605 | zPrefix, zName); |
| 2606 | } |
| 2607 | return 0; |
| 2608 | } |
| 2609 | if( fossil_strcmp(pWiki->zMimetype, "text/x-markdown")==0 ){ |
| 2610 | Blob tail = BLOB_INITIALIZER; |
| 2611 | Blob title = BLOB_INITIALIZER; |
| 2612 | Blob markdown; |
| 2613 | blob_init(&markdown, pWiki->zWiki, -1); |
| 2614 | markdown_to_html(&markdown, &title, &tail); |
| 2615 | if( blob_size(&title) ){ |
| 2616 | @ <div class="section accordion">%h(blob_str(&title))</div> |
| 2617 | }else{ |
| 2618 | wiki_section_label(zPrefix, zName, mFlags); |
| 2619 | } |
| 2620 | wiki_submenu_to_read_wiki(zPrefix, zName, mFlags); |
| 2621 | wiki_submenu_to_edit_wiki(zPrefix, zName, mFlags); |
| @@ -2638,11 +2640,11 @@ | |
| 2638 | Blob title = BLOB_INITIALIZER; |
| 2639 | Blob wiki; |
| 2640 | Blob *pBody; |
| 2641 | blob_init(&wiki, pWiki->zWiki, -1); |
| 2642 | if( wiki_find_title(&wiki, &title, &tail) ){ |
| 2643 | @ <div class="section accordion">%h(blob_str(&title))</div> |
| 2644 | pBody = &tail; |
| 2645 | }else{ |
| 2646 | wiki_section_label(zPrefix, zName, mFlags); |
| 2647 | pBody = &wiki; |
| 2648 | } |
| @@ -2652,9 +2654,9 @@ | |
| 2652 | @ </div></div> |
| 2653 | blob_reset(&tail); |
| 2654 | blob_reset(&title); |
| 2655 | blob_reset(&wiki); |
| 2656 | } |
| 2657 | manifest_destroy(pWiki); |
| 2658 | builtin_request_js("accordion.js"); |
| 2659 | return 1; |
| 2660 | } |
| 2661 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -725,13 +725,13 @@ | |
| 725 | ** If pRid is not NULL then if a result is found *pRid is set to its |
| 726 | ** RID. If ppWiki is not NULL then if found *ppWiki is set to the |
| 727 | ** loaded wiki object, which the caller is responsible for passing to |
| 728 | ** manifest_destroy(). |
| 729 | */ |
| 730 | int wiki_fetch_by_name( const char *zPageName, |
| 731 | unsigned int versionsBack, |
| 732 | int * pRid, Manifest **ppWiki ){ |
| 733 | Manifest *pWiki = 0; |
| 734 | char *zTag = mprintf("wiki-%s", zPageName); |
| 735 | Stmt q = empty_Stmt; |
| 736 | int rid = 0; |
| 737 | |
| @@ -2527,10 +2527,11 @@ | |
| 2527 | #if INTERFACE |
| 2528 | #define WIKIASSOC_FULL_TITLE 0x00001 /* Full title */ |
| 2529 | #define WIKIASSOC_MENU_READ 0x00002 /* Add submenu link to read wiki */ |
| 2530 | #define WIKIASSOC_MENU_WRITE 0x00004 /* Add submenu link to add wiki */ |
| 2531 | #define WIKIASSOC_ALL 0x00007 /* All of the above */ |
| 2532 | #define WIKIASSOC_REVEAL 0x00008 /* Reveal content by default */ |
| 2533 | #endif |
| 2534 | |
| 2535 | /* |
| 2536 | ** Show the default Section label for an associated wiki page. |
| 2537 | */ |
| @@ -2538,15 +2539,15 @@ | |
| 2539 | const char *zPrefix, /* "branch", "tag", or "checkin" */ |
| 2540 | const char *zName, /* Name of the object */ |
| 2541 | unsigned int mFlags /* Zero or more WIKIASSOC_* flags */ |
| 2542 | ){ |
| 2543 | if( (mFlags & WIKIASSOC_FULL_TITLE)==0 ){ |
| 2544 | @ <summary class="section">About</summary> |
| 2545 | }else if( zPrefix[0]=='c' ){ /* checkin/... */ |
| 2546 | @ <summary class="section accordion">About check-in %.20h(zName)</summary> |
| 2547 | }else{ |
| 2548 | @ <summary class="section accordion">About %s(zPrefix) %h(zName)</summary> |
| 2549 | } |
| 2550 | } |
| 2551 | |
| 2552 | /* |
| 2553 | ** Add an "Wiki" button in a submenu that links to the read-wiki page. |
| @@ -2604,18 +2605,19 @@ | |
| 2605 | style_submenu_element("Add Wiki", "%R/wikiedit?name=%s/%t", |
| 2606 | zPrefix, zName); |
| 2607 | } |
| 2608 | return 0; |
| 2609 | } |
| 2610 | @ <details %s((WIKIASSOC_REVEAL & mFlags) ? "open" : "")> |
| 2611 | if( fossil_strcmp(pWiki->zMimetype, "text/x-markdown")==0 ){ |
| 2612 | Blob tail = BLOB_INITIALIZER; |
| 2613 | Blob title = BLOB_INITIALIZER; |
| 2614 | Blob markdown; |
| 2615 | blob_init(&markdown, pWiki->zWiki, -1); |
| 2616 | markdown_to_html(&markdown, &title, &tail); |
| 2617 | if( blob_size(&title) ){ |
| 2618 | @ <summary class="section">%h(blob_str(&title))</summary> |
| 2619 | }else{ |
| 2620 | wiki_section_label(zPrefix, zName, mFlags); |
| 2621 | } |
| 2622 | wiki_submenu_to_read_wiki(zPrefix, zName, mFlags); |
| 2623 | wiki_submenu_to_edit_wiki(zPrefix, zName, mFlags); |
| @@ -2638,11 +2640,11 @@ | |
| 2640 | Blob title = BLOB_INITIALIZER; |
| 2641 | Blob wiki; |
| 2642 | Blob *pBody; |
| 2643 | blob_init(&wiki, pWiki->zWiki, -1); |
| 2644 | if( wiki_find_title(&wiki, &title, &tail) ){ |
| 2645 | @ <summary class="section">%h(blob_str(&title))</summary> |
| 2646 | pBody = &tail; |
| 2647 | }else{ |
| 2648 | wiki_section_label(zPrefix, zName, mFlags); |
| 2649 | pBody = &wiki; |
| 2650 | } |
| @@ -2652,9 +2654,9 @@ | |
| 2654 | @ </div></div> |
| 2655 | blob_reset(&tail); |
| 2656 | blob_reset(&title); |
| 2657 | blob_reset(&wiki); |
| 2658 | } |
| 2659 | @ </details> |
| 2660 | manifest_destroy(pWiki); |
| 2661 | return 1; |
| 2662 | } |
| 2663 |
-1
| --- win/Makefile.mingw | ||
| +++ win/Makefile.mingw | ||
| @@ -600,11 +600,10 @@ | ||
| 600 | 600 | $(SRCDIR)/../skins/plain_gray/header.txt \ |
| 601 | 601 | $(SRCDIR)/../skins/xekri/css.txt \ |
| 602 | 602 | $(SRCDIR)/../skins/xekri/details.txt \ |
| 603 | 603 | $(SRCDIR)/../skins/xekri/footer.txt \ |
| 604 | 604 | $(SRCDIR)/../skins/xekri/header.txt \ |
| 605 | - $(SRCDIR)/accordion.js \ | |
| 606 | 605 | $(SRCDIR)/alerts/bflat2.wav \ |
| 607 | 606 | $(SRCDIR)/alerts/bflat3.wav \ |
| 608 | 607 | $(SRCDIR)/alerts/bloop.wav \ |
| 609 | 608 | $(SRCDIR)/alerts/plunk.wav \ |
| 610 | 609 | $(SRCDIR)/ci_edit.js \ |
| 611 | 610 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -600,11 +600,10 @@ | |
| 600 | $(SRCDIR)/../skins/plain_gray/header.txt \ |
| 601 | $(SRCDIR)/../skins/xekri/css.txt \ |
| 602 | $(SRCDIR)/../skins/xekri/details.txt \ |
| 603 | $(SRCDIR)/../skins/xekri/footer.txt \ |
| 604 | $(SRCDIR)/../skins/xekri/header.txt \ |
| 605 | $(SRCDIR)/accordion.js \ |
| 606 | $(SRCDIR)/alerts/bflat2.wav \ |
| 607 | $(SRCDIR)/alerts/bflat3.wav \ |
| 608 | $(SRCDIR)/alerts/bloop.wav \ |
| 609 | $(SRCDIR)/alerts/plunk.wav \ |
| 610 | $(SRCDIR)/ci_edit.js \ |
| 611 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -600,11 +600,10 @@ | |
| 600 | $(SRCDIR)/../skins/plain_gray/header.txt \ |
| 601 | $(SRCDIR)/../skins/xekri/css.txt \ |
| 602 | $(SRCDIR)/../skins/xekri/details.txt \ |
| 603 | $(SRCDIR)/../skins/xekri/footer.txt \ |
| 604 | $(SRCDIR)/../skins/xekri/header.txt \ |
| 605 | $(SRCDIR)/alerts/bflat2.wav \ |
| 606 | $(SRCDIR)/alerts/bflat3.wav \ |
| 607 | $(SRCDIR)/alerts/bloop.wav \ |
| 608 | $(SRCDIR)/alerts/plunk.wav \ |
| 609 | $(SRCDIR)/ci_edit.js \ |
| 610 |
+1
-3
| --- win/Makefile.msc | ||
| +++ win/Makefile.msc | ||
| @@ -229,11 +229,11 @@ | ||
| 229 | 229 | !elseif $(OPTIMIZATIONS)>1 |
| 230 | 230 | RELOPTS = /O2 |
| 231 | 231 | !elseif $(OPTIMIZATIONS)>0 |
| 232 | 232 | RELOPTS = /O1 |
| 233 | 233 | !else |
| 234 | -RELOPTS = /Od | |
| 234 | +RELOPTS = | |
| 235 | 235 | !endif |
| 236 | 236 | |
| 237 | 237 | !if $(DEBUG)!=0 |
| 238 | 238 | CFLAGS = $(CFLAGS) /Zi $(CRTFLAGS) $(DBGOPTS) /DFOSSIL_DEBUG /DTH_MEMDEBUG |
| 239 | 239 | LDFLAGS = $(LDFLAGS) /DEBUG |
| @@ -565,11 +565,10 @@ | ||
| 565 | 565 | "$(SRCDIR)\..\skins\plain_gray\header.txt" \ |
| 566 | 566 | "$(SRCDIR)\..\skins\xekri\css.txt" \ |
| 567 | 567 | "$(SRCDIR)\..\skins\xekri\details.txt" \ |
| 568 | 568 | "$(SRCDIR)\..\skins\xekri\footer.txt" \ |
| 569 | 569 | "$(SRCDIR)\..\skins\xekri\header.txt" \ |
| 570 | - "$(SRCDIR)\accordion.js" \ | |
| 571 | 570 | "$(SRCDIR)\alerts\bflat2.wav" \ |
| 572 | 571 | "$(SRCDIR)\alerts\bflat3.wav" \ |
| 573 | 572 | "$(SRCDIR)\alerts\bloop.wav" \ |
| 574 | 573 | "$(SRCDIR)\alerts\plunk.wav" \ |
| 575 | 574 | "$(SRCDIR)\ci_edit.js" \ |
| @@ -1205,11 +1204,10 @@ | ||
| 1205 | 1204 | echo "$(SRCDIR)\../skins/plain_gray/header.txt" >> $@ |
| 1206 | 1205 | echo "$(SRCDIR)\../skins/xekri/css.txt" >> $@ |
| 1207 | 1206 | echo "$(SRCDIR)\../skins/xekri/details.txt" >> $@ |
| 1208 | 1207 | echo "$(SRCDIR)\../skins/xekri/footer.txt" >> $@ |
| 1209 | 1208 | echo "$(SRCDIR)\../skins/xekri/header.txt" >> $@ |
| 1210 | - echo "$(SRCDIR)\accordion.js" >> $@ | |
| 1211 | 1209 | echo "$(SRCDIR)\alerts/bflat2.wav" >> $@ |
| 1212 | 1210 | echo "$(SRCDIR)\alerts/bflat3.wav" >> $@ |
| 1213 | 1211 | echo "$(SRCDIR)\alerts/bloop.wav" >> $@ |
| 1214 | 1212 | echo "$(SRCDIR)\alerts/plunk.wav" >> $@ |
| 1215 | 1213 | echo "$(SRCDIR)\ci_edit.js" >> $@ |
| 1216 | 1214 |
| --- win/Makefile.msc | |
| +++ win/Makefile.msc | |
| @@ -229,11 +229,11 @@ | |
| 229 | !elseif $(OPTIMIZATIONS)>1 |
| 230 | RELOPTS = /O2 |
| 231 | !elseif $(OPTIMIZATIONS)>0 |
| 232 | RELOPTS = /O1 |
| 233 | !else |
| 234 | RELOPTS = /Od |
| 235 | !endif |
| 236 | |
| 237 | !if $(DEBUG)!=0 |
| 238 | CFLAGS = $(CFLAGS) /Zi $(CRTFLAGS) $(DBGOPTS) /DFOSSIL_DEBUG /DTH_MEMDEBUG |
| 239 | LDFLAGS = $(LDFLAGS) /DEBUG |
| @@ -565,11 +565,10 @@ | |
| 565 | "$(SRCDIR)\..\skins\plain_gray\header.txt" \ |
| 566 | "$(SRCDIR)\..\skins\xekri\css.txt" \ |
| 567 | "$(SRCDIR)\..\skins\xekri\details.txt" \ |
| 568 | "$(SRCDIR)\..\skins\xekri\footer.txt" \ |
| 569 | "$(SRCDIR)\..\skins\xekri\header.txt" \ |
| 570 | "$(SRCDIR)\accordion.js" \ |
| 571 | "$(SRCDIR)\alerts\bflat2.wav" \ |
| 572 | "$(SRCDIR)\alerts\bflat3.wav" \ |
| 573 | "$(SRCDIR)\alerts\bloop.wav" \ |
| 574 | "$(SRCDIR)\alerts\plunk.wav" \ |
| 575 | "$(SRCDIR)\ci_edit.js" \ |
| @@ -1205,11 +1204,10 @@ | |
| 1205 | echo "$(SRCDIR)\../skins/plain_gray/header.txt" >> $@ |
| 1206 | echo "$(SRCDIR)\../skins/xekri/css.txt" >> $@ |
| 1207 | echo "$(SRCDIR)\../skins/xekri/details.txt" >> $@ |
| 1208 | echo "$(SRCDIR)\../skins/xekri/footer.txt" >> $@ |
| 1209 | echo "$(SRCDIR)\../skins/xekri/header.txt" >> $@ |
| 1210 | echo "$(SRCDIR)\accordion.js" >> $@ |
| 1211 | echo "$(SRCDIR)\alerts/bflat2.wav" >> $@ |
| 1212 | echo "$(SRCDIR)\alerts/bflat3.wav" >> $@ |
| 1213 | echo "$(SRCDIR)\alerts/bloop.wav" >> $@ |
| 1214 | echo "$(SRCDIR)\alerts/plunk.wav" >> $@ |
| 1215 | echo "$(SRCDIR)\ci_edit.js" >> $@ |
| 1216 |
| --- win/Makefile.msc | |
| +++ win/Makefile.msc | |
| @@ -229,11 +229,11 @@ | |
| 229 | !elseif $(OPTIMIZATIONS)>1 |
| 230 | RELOPTS = /O2 |
| 231 | !elseif $(OPTIMIZATIONS)>0 |
| 232 | RELOPTS = /O1 |
| 233 | !else |
| 234 | RELOPTS = |
| 235 | !endif |
| 236 | |
| 237 | !if $(DEBUG)!=0 |
| 238 | CFLAGS = $(CFLAGS) /Zi $(CRTFLAGS) $(DBGOPTS) /DFOSSIL_DEBUG /DTH_MEMDEBUG |
| 239 | LDFLAGS = $(LDFLAGS) /DEBUG |
| @@ -565,11 +565,10 @@ | |
| 565 | "$(SRCDIR)\..\skins\plain_gray\header.txt" \ |
| 566 | "$(SRCDIR)\..\skins\xekri\css.txt" \ |
| 567 | "$(SRCDIR)\..\skins\xekri\details.txt" \ |
| 568 | "$(SRCDIR)\..\skins\xekri\footer.txt" \ |
| 569 | "$(SRCDIR)\..\skins\xekri\header.txt" \ |
| 570 | "$(SRCDIR)\alerts\bflat2.wav" \ |
| 571 | "$(SRCDIR)\alerts\bflat3.wav" \ |
| 572 | "$(SRCDIR)\alerts\bloop.wav" \ |
| 573 | "$(SRCDIR)\alerts\plunk.wav" \ |
| 574 | "$(SRCDIR)\ci_edit.js" \ |
| @@ -1205,11 +1204,10 @@ | |
| 1204 | echo "$(SRCDIR)\../skins/plain_gray/header.txt" >> $@ |
| 1205 | echo "$(SRCDIR)\../skins/xekri/css.txt" >> $@ |
| 1206 | echo "$(SRCDIR)\../skins/xekri/details.txt" >> $@ |
| 1207 | echo "$(SRCDIR)\../skins/xekri/footer.txt" >> $@ |
| 1208 | echo "$(SRCDIR)\../skins/xekri/header.txt" >> $@ |
| 1209 | echo "$(SRCDIR)\alerts/bflat2.wav" >> $@ |
| 1210 | echo "$(SRCDIR)\alerts/bflat3.wav" >> $@ |
| 1211 | echo "$(SRCDIR)\alerts/bloop.wav" >> $@ |
| 1212 | echo "$(SRCDIR)\alerts/plunk.wav" >> $@ |
| 1213 | echo "$(SRCDIR)\ci_edit.js" >> $@ |
| 1214 |