Fossil SCM
Minor restructuring of the /file line number DOM elements to address text-mode browsers. [forum:c8fd094267a0f0d9| Forum post c8fd094267a0f0d9].
Commit
53ff9d0de0ca79d0e58d8e75f26bb1bda42806a0d201df0a06f260085c596d67
Parent
c3362100e297585…
2 files changed
+7
-6
+4
-3
+7
-6
| --- src/default.css | ||
| +++ src/default.css | ||
| @@ -1306,16 +1306,17 @@ | ||
| 1306 | 1306 | padding: 0.25em 0 0 0 /*prevents slight overlap at top */; |
| 1307 | 1307 | } |
| 1308 | 1308 | table.numbered-lines td.line-numbers { |
| 1309 | 1309 | width: 4.5em; |
| 1310 | 1310 | } |
| 1311 | -table.numbered-lines td.line-numbers > span:first-of-type { | |
| 1312 | - margin-top: 0.25em/*must match top PADDING of | |
| 1313 | - td.file-content > pre > code*/; | |
| 1311 | +table.numbered-lines td.line-numbers > pre { | |
| 1312 | + margin: 0.25em/*must match top PADDING of td.file-content | |
| 1313 | + > pre > code*/ 0 0 0; | |
| 1314 | + padding: 0; | |
| 1314 | 1315 | } |
| 1315 | -table.numbered-lines td.line-numbers > span { | |
| 1316 | - display: block; | |
| 1316 | +table.numbered-lines td.line-numbers span { | |
| 1317 | + display: inline-block; | |
| 1317 | 1318 | margin: 0; |
| 1318 | 1319 | padding: 0; |
| 1319 | 1320 | line-height: inherit; |
| 1320 | 1321 | font-size: inherit; |
| 1321 | 1322 | font-family: inherit; |
| @@ -1322,11 +1323,11 @@ | ||
| 1322 | 1323 | cursor: pointer; |
| 1323 | 1324 | white-space: pre; |
| 1324 | 1325 | margin-right: 2px/*keep selection from nudging the right column */; |
| 1325 | 1326 | text-align: right; |
| 1326 | 1327 | } |
| 1327 | -table.numbered-lines td.line-numbers > span:hover { | |
| 1328 | +table.numbered-lines td.line-numbers span:hover { | |
| 1328 | 1329 | background-color: rgba(112, 112, 112, 0.25); |
| 1329 | 1330 | } |
| 1330 | 1331 | table.numbered-lines td.file-content { |
| 1331 | 1332 | padding-left: 0.25em; |
| 1332 | 1333 | } |
| 1333 | 1334 |
| --- src/default.css | |
| +++ src/default.css | |
| @@ -1306,16 +1306,17 @@ | |
| 1306 | padding: 0.25em 0 0 0 /*prevents slight overlap at top */; |
| 1307 | } |
| 1308 | table.numbered-lines td.line-numbers { |
| 1309 | width: 4.5em; |
| 1310 | } |
| 1311 | table.numbered-lines td.line-numbers > span:first-of-type { |
| 1312 | margin-top: 0.25em/*must match top PADDING of |
| 1313 | td.file-content > pre > code*/; |
| 1314 | } |
| 1315 | table.numbered-lines td.line-numbers > span { |
| 1316 | display: block; |
| 1317 | margin: 0; |
| 1318 | padding: 0; |
| 1319 | line-height: inherit; |
| 1320 | font-size: inherit; |
| 1321 | font-family: inherit; |
| @@ -1322,11 +1323,11 @@ | |
| 1322 | cursor: pointer; |
| 1323 | white-space: pre; |
| 1324 | margin-right: 2px/*keep selection from nudging the right column */; |
| 1325 | text-align: right; |
| 1326 | } |
| 1327 | table.numbered-lines td.line-numbers > span:hover { |
| 1328 | background-color: rgba(112, 112, 112, 0.25); |
| 1329 | } |
| 1330 | table.numbered-lines td.file-content { |
| 1331 | padding-left: 0.25em; |
| 1332 | } |
| 1333 |
| --- src/default.css | |
| +++ src/default.css | |
| @@ -1306,16 +1306,17 @@ | |
| 1306 | padding: 0.25em 0 0 0 /*prevents slight overlap at top */; |
| 1307 | } |
| 1308 | table.numbered-lines td.line-numbers { |
| 1309 | width: 4.5em; |
| 1310 | } |
| 1311 | table.numbered-lines td.line-numbers > pre { |
| 1312 | margin: 0.25em/*must match top PADDING of td.file-content |
| 1313 | > pre > code*/ 0 0 0; |
| 1314 | padding: 0; |
| 1315 | } |
| 1316 | table.numbered-lines td.line-numbers span { |
| 1317 | display: inline-block; |
| 1318 | margin: 0; |
| 1319 | padding: 0; |
| 1320 | line-height: inherit; |
| 1321 | font-size: inherit; |
| 1322 | font-family: inherit; |
| @@ -1322,11 +1323,11 @@ | |
| 1323 | cursor: pointer; |
| 1324 | white-space: pre; |
| 1325 | margin-right: 2px/*keep selection from nudging the right column */; |
| 1326 | text-align: right; |
| 1327 | } |
| 1328 | table.numbered-lines td.line-numbers span:hover { |
| 1329 | background-color: rgba(112, 112, 112, 0.25); |
| 1330 | } |
| 1331 | table.numbered-lines td.file-content { |
| 1332 | padding-left: 0.25em; |
| 1333 | } |
| 1334 |
+4
-3
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -2248,11 +2248,11 @@ | ||
| 2248 | 2248 | iStart = iEnd = atoi(&zLn[i++]); |
| 2249 | 2249 | }while( zLn[i] && iStart && iEnd ); |
| 2250 | 2250 | } |
| 2251 | 2251 | /*cgi_printf("<!-- ln span count=%d -->", nSpans);*/ |
| 2252 | 2252 | cgi_append_content("<table class='numbered-lines'><tbody>" |
| 2253 | - "<tr><td class='line-numbers'>", -1); | |
| 2253 | + "<tr><td class='line-numbers'><pre>", -1); | |
| 2254 | 2254 | iStart = iEnd = 0; |
| 2255 | 2255 | count_lines(z, nZ, &nLine); |
| 2256 | 2256 | for( n=1 ; n<=nLine; ++n ){ |
| 2257 | 2257 | const char * zAttr = ""; |
| 2258 | 2258 | const char * zId = ""; |
| @@ -2290,13 +2290,14 @@ | ||
| 2290 | 2290 | zAttr = " class='selected-line end'"; |
| 2291 | 2291 | iEnd = 0; |
| 2292 | 2292 | }else if( n>iStart && n<iEnd ){ |
| 2293 | 2293 | zAttr = " class='selected-line'"; |
| 2294 | 2294 | } |
| 2295 | - cgi_printf("<span%s%s>%6d</span>", zId, zAttr, n); | |
| 2295 | + cgi_printf("<span%s%s>%6d</span>\n", zId, zAttr, n) | |
| 2296 | + /* ^^^ explicit \n is necessary for text-mode browsers. */; | |
| 2296 | 2297 | } |
| 2297 | - cgi_append_content("</td><td class='file-content'><pre>",-1); | |
| 2298 | + cgi_append_content("</pre></td><td class='file-content'><pre>",-1); | |
| 2298 | 2299 | if(zExt && *zExt){ |
| 2299 | 2300 | cgi_printf("<code class='language-%h'>",zExt); |
| 2300 | 2301 | }else{ |
| 2301 | 2302 | cgi_append_content("<code>", -1); |
| 2302 | 2303 | } |
| 2303 | 2304 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2248,11 +2248,11 @@ | |
| 2248 | iStart = iEnd = atoi(&zLn[i++]); |
| 2249 | }while( zLn[i] && iStart && iEnd ); |
| 2250 | } |
| 2251 | /*cgi_printf("<!-- ln span count=%d -->", nSpans);*/ |
| 2252 | cgi_append_content("<table class='numbered-lines'><tbody>" |
| 2253 | "<tr><td class='line-numbers'>", -1); |
| 2254 | iStart = iEnd = 0; |
| 2255 | count_lines(z, nZ, &nLine); |
| 2256 | for( n=1 ; n<=nLine; ++n ){ |
| 2257 | const char * zAttr = ""; |
| 2258 | const char * zId = ""; |
| @@ -2290,13 +2290,14 @@ | |
| 2290 | zAttr = " class='selected-line end'"; |
| 2291 | iEnd = 0; |
| 2292 | }else if( n>iStart && n<iEnd ){ |
| 2293 | zAttr = " class='selected-line'"; |
| 2294 | } |
| 2295 | cgi_printf("<span%s%s>%6d</span>", zId, zAttr, n); |
| 2296 | } |
| 2297 | cgi_append_content("</td><td class='file-content'><pre>",-1); |
| 2298 | if(zExt && *zExt){ |
| 2299 | cgi_printf("<code class='language-%h'>",zExt); |
| 2300 | }else{ |
| 2301 | cgi_append_content("<code>", -1); |
| 2302 | } |
| 2303 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2248,11 +2248,11 @@ | |
| 2248 | iStart = iEnd = atoi(&zLn[i++]); |
| 2249 | }while( zLn[i] && iStart && iEnd ); |
| 2250 | } |
| 2251 | /*cgi_printf("<!-- ln span count=%d -->", nSpans);*/ |
| 2252 | cgi_append_content("<table class='numbered-lines'><tbody>" |
| 2253 | "<tr><td class='line-numbers'><pre>", -1); |
| 2254 | iStart = iEnd = 0; |
| 2255 | count_lines(z, nZ, &nLine); |
| 2256 | for( n=1 ; n<=nLine; ++n ){ |
| 2257 | const char * zAttr = ""; |
| 2258 | const char * zId = ""; |
| @@ -2290,13 +2290,14 @@ | |
| 2290 | zAttr = " class='selected-line end'"; |
| 2291 | iEnd = 0; |
| 2292 | }else if( n>iStart && n<iEnd ){ |
| 2293 | zAttr = " class='selected-line'"; |
| 2294 | } |
| 2295 | cgi_printf("<span%s%s>%6d</span>\n", zId, zAttr, n) |
| 2296 | /* ^^^ explicit \n is necessary for text-mode browsers. */; |
| 2297 | } |
| 2298 | cgi_append_content("</pre></td><td class='file-content'><pre>",-1); |
| 2299 | if(zExt && *zExt){ |
| 2300 | cgi_printf("<code class='language-%h'>",zExt); |
| 2301 | }else{ |
| 2302 | cgi_append_content("<code>", -1); |
| 2303 | } |
| 2304 |