Fossil SCM
Merge trunk, also change "Svg" to "SVG"
Commit
c319f52cf79accd718147ea227039219fd46fc587f04497752650fc03bc00366
Parent
59d27ab4ae84a8c…
2 files changed
+11
+11
+11
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -2185,10 +2185,11 @@ | ||
| 2185 | 2185 | ** name=NAME - filename or hash as a query parameter |
| 2186 | 2186 | ** filename=NAME - alternative spelling for "name=" |
| 2187 | 2187 | ** fn=NAME - alternative spelling for "name=" |
| 2188 | 2188 | ** ci=VERSION - The specific check-in to use with "name=" to |
| 2189 | 2189 | ** identify the file. |
| 2190 | +** txt - Force display of unformatted source text | |
| 2190 | 2191 | ** |
| 2191 | 2192 | ** The /artifact page show the complete content of a file |
| 2192 | 2193 | ** identified by HASH. The /whatis page shows only a description |
| 2193 | 2194 | ** of how the artifact is used. The /file page shows the most recent |
| 2194 | 2195 | ** version of the file or directory called NAME, or a list of the |
| @@ -2209,10 +2210,11 @@ | ||
| 2209 | 2210 | Blob content; |
| 2210 | 2211 | const char *zMime; |
| 2211 | 2212 | Blob downloadName; |
| 2212 | 2213 | int renderAsWiki = 0; |
| 2213 | 2214 | int renderAsHtml = 0; |
| 2215 | + int renderAsSvg = 0; | |
| 2214 | 2216 | int objType; |
| 2215 | 2217 | int asText; |
| 2216 | 2218 | const char *zUuid = 0; |
| 2217 | 2219 | u32 objdescFlags = OBJDESC_BASE; |
| 2218 | 2220 | int descOnly = fossil_strcmp(g.zPath,"whatis")==0; |
| @@ -2419,10 +2421,17 @@ | ||
| 2419 | 2421 | style_submenu_element("Wiki", "%s", url_render(&url, "txt", 0, 0, 0)); |
| 2420 | 2422 | }else{ |
| 2421 | 2423 | renderAsWiki = 1; |
| 2422 | 2424 | style_submenu_element("Text", "%s", url_render(&url, "txt", "1", 0, 0)); |
| 2423 | 2425 | } |
| 2426 | + }else if( fossil_strcmp(zMime, "image/svg+xml")==0 ){ | |
| 2427 | + if( asText ){ | |
| 2428 | + style_submenu_element("SVG", "%s", url_render(&url, "txt", 0, 0, 0)); | |
| 2429 | + }else{ | |
| 2430 | + renderAsSvg = 1; | |
| 2431 | + style_submenu_element("Text", "%s", url_render(&url, "txt", "1", 0, 0)); | |
| 2432 | + } | |
| 2424 | 2433 | } |
| 2425 | 2434 | if( fileedit_is_editable(zName) ){ |
| 2426 | 2435 | style_submenu_element("Edit", |
| 2427 | 2436 | "%R/fileedit?filename=%T&checkin=%!S", |
| 2428 | 2437 | zName, zCI); |
| @@ -2450,10 +2459,12 @@ | ||
| 2450 | 2459 | @ function(){ |
| 2451 | 2460 | @ this.height=this.contentDocument.documentElement.scrollHeight + 75; |
| 2452 | 2461 | @ } |
| 2453 | 2462 | @ ); |
| 2454 | 2463 | @ </script> |
| 2464 | + }else if( renderAsSvg ){ | |
| 2465 | + @ <object type="image/svg+xml" data="%R/raw/%s(zUuid)"></object> | |
| 2455 | 2466 | }else{ |
| 2456 | 2467 | style_submenu_element("Hex", "%s/hexdump?name=%s", g.zTop, zUuid); |
| 2457 | 2468 | if( zLn==0 || atoi(zLn)==0 ){ |
| 2458 | 2469 | style_submenu_checkbox("ln", "Line Numbers", 0, 0); |
| 2459 | 2470 | } |
| 2460 | 2471 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2185,10 +2185,11 @@ | |
| 2185 | ** name=NAME - filename or hash as a query parameter |
| 2186 | ** filename=NAME - alternative spelling for "name=" |
| 2187 | ** fn=NAME - alternative spelling for "name=" |
| 2188 | ** ci=VERSION - The specific check-in to use with "name=" to |
| 2189 | ** identify the file. |
| 2190 | ** |
| 2191 | ** The /artifact page show the complete content of a file |
| 2192 | ** identified by HASH. The /whatis page shows only a description |
| 2193 | ** of how the artifact is used. The /file page shows the most recent |
| 2194 | ** version of the file or directory called NAME, or a list of the |
| @@ -2209,10 +2210,11 @@ | |
| 2209 | Blob content; |
| 2210 | const char *zMime; |
| 2211 | Blob downloadName; |
| 2212 | int renderAsWiki = 0; |
| 2213 | int renderAsHtml = 0; |
| 2214 | int objType; |
| 2215 | int asText; |
| 2216 | const char *zUuid = 0; |
| 2217 | u32 objdescFlags = OBJDESC_BASE; |
| 2218 | int descOnly = fossil_strcmp(g.zPath,"whatis")==0; |
| @@ -2419,10 +2421,17 @@ | |
| 2419 | style_submenu_element("Wiki", "%s", url_render(&url, "txt", 0, 0, 0)); |
| 2420 | }else{ |
| 2421 | renderAsWiki = 1; |
| 2422 | style_submenu_element("Text", "%s", url_render(&url, "txt", "1", 0, 0)); |
| 2423 | } |
| 2424 | } |
| 2425 | if( fileedit_is_editable(zName) ){ |
| 2426 | style_submenu_element("Edit", |
| 2427 | "%R/fileedit?filename=%T&checkin=%!S", |
| 2428 | zName, zCI); |
| @@ -2450,10 +2459,12 @@ | |
| 2450 | @ function(){ |
| 2451 | @ this.height=this.contentDocument.documentElement.scrollHeight + 75; |
| 2452 | @ } |
| 2453 | @ ); |
| 2454 | @ </script> |
| 2455 | }else{ |
| 2456 | style_submenu_element("Hex", "%s/hexdump?name=%s", g.zTop, zUuid); |
| 2457 | if( zLn==0 || atoi(zLn)==0 ){ |
| 2458 | style_submenu_checkbox("ln", "Line Numbers", 0, 0); |
| 2459 | } |
| 2460 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2185,10 +2185,11 @@ | |
| 2185 | ** name=NAME - filename or hash as a query parameter |
| 2186 | ** filename=NAME - alternative spelling for "name=" |
| 2187 | ** fn=NAME - alternative spelling for "name=" |
| 2188 | ** ci=VERSION - The specific check-in to use with "name=" to |
| 2189 | ** identify the file. |
| 2190 | ** txt - Force display of unformatted source text |
| 2191 | ** |
| 2192 | ** The /artifact page show the complete content of a file |
| 2193 | ** identified by HASH. The /whatis page shows only a description |
| 2194 | ** of how the artifact is used. The /file page shows the most recent |
| 2195 | ** version of the file or directory called NAME, or a list of the |
| @@ -2209,10 +2210,11 @@ | |
| 2210 | Blob content; |
| 2211 | const char *zMime; |
| 2212 | Blob downloadName; |
| 2213 | int renderAsWiki = 0; |
| 2214 | int renderAsHtml = 0; |
| 2215 | int renderAsSvg = 0; |
| 2216 | int objType; |
| 2217 | int asText; |
| 2218 | const char *zUuid = 0; |
| 2219 | u32 objdescFlags = OBJDESC_BASE; |
| 2220 | int descOnly = fossil_strcmp(g.zPath,"whatis")==0; |
| @@ -2419,10 +2421,17 @@ | |
| 2421 | style_submenu_element("Wiki", "%s", url_render(&url, "txt", 0, 0, 0)); |
| 2422 | }else{ |
| 2423 | renderAsWiki = 1; |
| 2424 | style_submenu_element("Text", "%s", url_render(&url, "txt", "1", 0, 0)); |
| 2425 | } |
| 2426 | }else if( fossil_strcmp(zMime, "image/svg+xml")==0 ){ |
| 2427 | if( asText ){ |
| 2428 | style_submenu_element("SVG", "%s", url_render(&url, "txt", 0, 0, 0)); |
| 2429 | }else{ |
| 2430 | renderAsSvg = 1; |
| 2431 | style_submenu_element("Text", "%s", url_render(&url, "txt", "1", 0, 0)); |
| 2432 | } |
| 2433 | } |
| 2434 | if( fileedit_is_editable(zName) ){ |
| 2435 | style_submenu_element("Edit", |
| 2436 | "%R/fileedit?filename=%T&checkin=%!S", |
| 2437 | zName, zCI); |
| @@ -2450,10 +2459,12 @@ | |
| 2459 | @ function(){ |
| 2460 | @ this.height=this.contentDocument.documentElement.scrollHeight + 75; |
| 2461 | @ } |
| 2462 | @ ); |
| 2463 | @ </script> |
| 2464 | }else if( renderAsSvg ){ |
| 2465 | @ <object type="image/svg+xml" data="%R/raw/%s(zUuid)"></object> |
| 2466 | }else{ |
| 2467 | style_submenu_element("Hex", "%s/hexdump?name=%s", g.zTop, zUuid); |
| 2468 | if( zLn==0 || atoi(zLn)==0 ){ |
| 2469 | style_submenu_checkbox("ln", "Line Numbers", 0, 0); |
| 2470 | } |
| 2471 |
+11
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -2185,10 +2185,11 @@ | ||
| 2185 | 2185 | ** name=NAME - filename or hash as a query parameter |
| 2186 | 2186 | ** filename=NAME - alternative spelling for "name=" |
| 2187 | 2187 | ** fn=NAME - alternative spelling for "name=" |
| 2188 | 2188 | ** ci=VERSION - The specific check-in to use with "name=" to |
| 2189 | 2189 | ** identify the file. |
| 2190 | +** txt - Force display of unformatted source text | |
| 2190 | 2191 | ** |
| 2191 | 2192 | ** The /artifact page show the complete content of a file |
| 2192 | 2193 | ** identified by HASH. The /whatis page shows only a description |
| 2193 | 2194 | ** of how the artifact is used. The /file page shows the most recent |
| 2194 | 2195 | ** version of the file or directory called NAME, or a list of the |
| @@ -2209,10 +2210,11 @@ | ||
| 2209 | 2210 | Blob content; |
| 2210 | 2211 | const char *zMime; |
| 2211 | 2212 | Blob downloadName; |
| 2212 | 2213 | int renderAsWiki = 0; |
| 2213 | 2214 | int renderAsHtml = 0; |
| 2215 | + int renderAsSvg = 0; | |
| 2214 | 2216 | int objType; |
| 2215 | 2217 | int asText; |
| 2216 | 2218 | const char *zUuid = 0; |
| 2217 | 2219 | u32 objdescFlags = OBJDESC_BASE; |
| 2218 | 2220 | int descOnly = fossil_strcmp(g.zPath,"whatis")==0; |
| @@ -2419,10 +2421,17 @@ | ||
| 2419 | 2421 | style_submenu_element("Wiki", "%s", url_render(&url, "txt", 0, 0, 0)); |
| 2420 | 2422 | }else{ |
| 2421 | 2423 | renderAsWiki = 1; |
| 2422 | 2424 | style_submenu_element("Text", "%s", url_render(&url, "txt", "1", 0, 0)); |
| 2423 | 2425 | } |
| 2426 | + }else if( fossil_strcmp(zMime, "image/svg+xml")==0 ){ | |
| 2427 | + if( asText ){ | |
| 2428 | + style_submenu_element("SVG", "%s", url_render(&url, "txt", 0, 0, 0)); | |
| 2429 | + }else{ | |
| 2430 | + renderAsSvg = 1; | |
| 2431 | + style_submenu_element("Text", "%s", url_render(&url, "txt", "1", 0, 0)); | |
| 2432 | + } | |
| 2424 | 2433 | } |
| 2425 | 2434 | if( fileedit_is_editable(zName) ){ |
| 2426 | 2435 | style_submenu_element("Edit", |
| 2427 | 2436 | "%R/fileedit?filename=%T&checkin=%!S", |
| 2428 | 2437 | zName, zCI); |
| @@ -2450,10 +2459,12 @@ | ||
| 2450 | 2459 | @ function(){ |
| 2451 | 2460 | @ this.height=this.contentDocument.documentElement.scrollHeight + 75; |
| 2452 | 2461 | @ } |
| 2453 | 2462 | @ ); |
| 2454 | 2463 | @ </script> |
| 2464 | + }else if( renderAsSvg ){ | |
| 2465 | + @ <object type="image/svg+xml" data="%R/raw/%s(zUuid)"></object> | |
| 2455 | 2466 | }else{ |
| 2456 | 2467 | style_submenu_element("Hex", "%s/hexdump?name=%s", g.zTop, zUuid); |
| 2457 | 2468 | if( zLn==0 || atoi(zLn)==0 ){ |
| 2458 | 2469 | style_submenu_checkbox("ln", "Line Numbers", 0, 0); |
| 2459 | 2470 | } |
| 2460 | 2471 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2185,10 +2185,11 @@ | |
| 2185 | ** name=NAME - filename or hash as a query parameter |
| 2186 | ** filename=NAME - alternative spelling for "name=" |
| 2187 | ** fn=NAME - alternative spelling for "name=" |
| 2188 | ** ci=VERSION - The specific check-in to use with "name=" to |
| 2189 | ** identify the file. |
| 2190 | ** |
| 2191 | ** The /artifact page show the complete content of a file |
| 2192 | ** identified by HASH. The /whatis page shows only a description |
| 2193 | ** of how the artifact is used. The /file page shows the most recent |
| 2194 | ** version of the file or directory called NAME, or a list of the |
| @@ -2209,10 +2210,11 @@ | |
| 2209 | Blob content; |
| 2210 | const char *zMime; |
| 2211 | Blob downloadName; |
| 2212 | int renderAsWiki = 0; |
| 2213 | int renderAsHtml = 0; |
| 2214 | int objType; |
| 2215 | int asText; |
| 2216 | const char *zUuid = 0; |
| 2217 | u32 objdescFlags = OBJDESC_BASE; |
| 2218 | int descOnly = fossil_strcmp(g.zPath,"whatis")==0; |
| @@ -2419,10 +2421,17 @@ | |
| 2419 | style_submenu_element("Wiki", "%s", url_render(&url, "txt", 0, 0, 0)); |
| 2420 | }else{ |
| 2421 | renderAsWiki = 1; |
| 2422 | style_submenu_element("Text", "%s", url_render(&url, "txt", "1", 0, 0)); |
| 2423 | } |
| 2424 | } |
| 2425 | if( fileedit_is_editable(zName) ){ |
| 2426 | style_submenu_element("Edit", |
| 2427 | "%R/fileedit?filename=%T&checkin=%!S", |
| 2428 | zName, zCI); |
| @@ -2450,10 +2459,12 @@ | |
| 2450 | @ function(){ |
| 2451 | @ this.height=this.contentDocument.documentElement.scrollHeight + 75; |
| 2452 | @ } |
| 2453 | @ ); |
| 2454 | @ </script> |
| 2455 | }else{ |
| 2456 | style_submenu_element("Hex", "%s/hexdump?name=%s", g.zTop, zUuid); |
| 2457 | if( zLn==0 || atoi(zLn)==0 ){ |
| 2458 | style_submenu_checkbox("ln", "Line Numbers", 0, 0); |
| 2459 | } |
| 2460 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2185,10 +2185,11 @@ | |
| 2185 | ** name=NAME - filename or hash as a query parameter |
| 2186 | ** filename=NAME - alternative spelling for "name=" |
| 2187 | ** fn=NAME - alternative spelling for "name=" |
| 2188 | ** ci=VERSION - The specific check-in to use with "name=" to |
| 2189 | ** identify the file. |
| 2190 | ** txt - Force display of unformatted source text |
| 2191 | ** |
| 2192 | ** The /artifact page show the complete content of a file |
| 2193 | ** identified by HASH. The /whatis page shows only a description |
| 2194 | ** of how the artifact is used. The /file page shows the most recent |
| 2195 | ** version of the file or directory called NAME, or a list of the |
| @@ -2209,10 +2210,11 @@ | |
| 2210 | Blob content; |
| 2211 | const char *zMime; |
| 2212 | Blob downloadName; |
| 2213 | int renderAsWiki = 0; |
| 2214 | int renderAsHtml = 0; |
| 2215 | int renderAsSvg = 0; |
| 2216 | int objType; |
| 2217 | int asText; |
| 2218 | const char *zUuid = 0; |
| 2219 | u32 objdescFlags = OBJDESC_BASE; |
| 2220 | int descOnly = fossil_strcmp(g.zPath,"whatis")==0; |
| @@ -2419,10 +2421,17 @@ | |
| 2421 | style_submenu_element("Wiki", "%s", url_render(&url, "txt", 0, 0, 0)); |
| 2422 | }else{ |
| 2423 | renderAsWiki = 1; |
| 2424 | style_submenu_element("Text", "%s", url_render(&url, "txt", "1", 0, 0)); |
| 2425 | } |
| 2426 | }else if( fossil_strcmp(zMime, "image/svg+xml")==0 ){ |
| 2427 | if( asText ){ |
| 2428 | style_submenu_element("SVG", "%s", url_render(&url, "txt", 0, 0, 0)); |
| 2429 | }else{ |
| 2430 | renderAsSvg = 1; |
| 2431 | style_submenu_element("Text", "%s", url_render(&url, "txt", "1", 0, 0)); |
| 2432 | } |
| 2433 | } |
| 2434 | if( fileedit_is_editable(zName) ){ |
| 2435 | style_submenu_element("Edit", |
| 2436 | "%R/fileedit?filename=%T&checkin=%!S", |
| 2437 | zName, zCI); |
| @@ -2450,10 +2459,12 @@ | |
| 2459 | @ function(){ |
| 2460 | @ this.height=this.contentDocument.documentElement.scrollHeight + 75; |
| 2461 | @ } |
| 2462 | @ ); |
| 2463 | @ </script> |
| 2464 | }else if( renderAsSvg ){ |
| 2465 | @ <object type="image/svg+xml" data="%R/raw/%s(zUuid)"></object> |
| 2466 | }else{ |
| 2467 | style_submenu_element("Hex", "%s/hexdump?name=%s", g.zTop, zUuid); |
| 2468 | if( zLn==0 || atoi(zLn)==0 ){ |
| 2469 | style_submenu_checkbox("ln", "Line Numbers", 0, 0); |
| 2470 | } |
| 2471 |