Fossil SCM

Load HTML files in iframes instead of inlining them directly into /artifact pages.

joel 2013-05-04 01:02 trunk
Commit 63443f920b06653a6f0ae9ad97d419d52187a5d3
1 file changed +5 -4
+5 -4
--- src/info.c
+++ src/info.c
@@ -1629,14 +1629,15 @@
16291629
@ <hr />
16301630
content_get(rid, &content);
16311631
if( renderAsWiki ){
16321632
wiki_convert(&content, 0, 0);
16331633
}else if( renderAsHtml ){
1634
- @ <div>
1635
- blob_to_utf8_no_bom(&content, 0);
1636
- cgi_append_content(blob_buffer(&content), blob_size(&content));
1637
- @ </div>
1634
+ @ <iframe src="%R/raw/%T(blob_str(&downloadName))?name=%s(zUuid)"
1635
+ @ width="100%%" frameborder="0" marginwidth="0" marginheight="0"
1636
+ @ sandbox="allow-same-origin"
1637
+ @ onload="this.height = this.contentDocument.documentElement.scrollHeight;">
1638
+ @ </iframe>
16381639
}else{
16391640
style_submenu_element("Hex","Hex", "%s/hexdump?name=%s", g.zTop, zUuid);
16401641
zMime = mimetype_from_content(&content);
16411642
@ <blockquote>
16421643
if( zMime==0 ){
16431644
--- src/info.c
+++ src/info.c
@@ -1629,14 +1629,15 @@
1629 @ <hr />
1630 content_get(rid, &content);
1631 if( renderAsWiki ){
1632 wiki_convert(&content, 0, 0);
1633 }else if( renderAsHtml ){
1634 @ <div>
1635 blob_to_utf8_no_bom(&content, 0);
1636 cgi_append_content(blob_buffer(&content), blob_size(&content));
1637 @ </div>
 
1638 }else{
1639 style_submenu_element("Hex","Hex", "%s/hexdump?name=%s", g.zTop, zUuid);
1640 zMime = mimetype_from_content(&content);
1641 @ <blockquote>
1642 if( zMime==0 ){
1643
--- src/info.c
+++ src/info.c
@@ -1629,14 +1629,15 @@
1629 @ <hr />
1630 content_get(rid, &content);
1631 if( renderAsWiki ){
1632 wiki_convert(&content, 0, 0);
1633 }else if( renderAsHtml ){
1634 @ <iframe src="%R/raw/%T(blob_str(&downloadName))?name=%s(zUuid)"
1635 @ width="100%%" frameborder="0" marginwidth="0" marginheight="0"
1636 @ sandbox="allow-same-origin"
1637 @ onload="this.height = this.contentDocument.documentElement.scrollHeight;">
1638 @ </iframe>
1639 }else{
1640 style_submenu_element("Hex","Hex", "%s/hexdump?name=%s", g.zTop, zUuid);
1641 zMime = mimetype_from_content(&content);
1642 @ <blockquote>
1643 if( zMime==0 ){
1644

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button