Tom
2014-11-12 4dee2c5ee06677d12d5719bc18199a0affd13cc0
HTML bug fix on the blob page

That blob page sent *two* body tags. Now that we have bottom scripts,
we can fix that easily: don't try to set body.onload, but run the
prettyprinting through a bottom script on jQuery's document.ready.

2 files modified
7 ■■■■■ changed files
src/main/java/com/gitblit/wicket/pages/BlobPage.html 5 ●●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/wicket/pages/BlobPage.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/wicket/pages/BlobPage.html
@@ -40,9 +40,8 @@
  </wicket:link>
</wicket:head>
<body>
<wicket:extend>
<!-- need to specify body.onload -->
<body onload="prettyPrint()">
        <!-- blob nav links -->    
        <div class="page_nav2">
@@ -61,6 +60,6 @@
        <!--  blob image -->
        <img wicket:id="blobImage" style="padding-top:5px;"></img>
    
</body>
</wicket:extend>
</body>
</html>
src/main/java/com/gitblit/wicket/pages/BlobPage.java
@@ -137,6 +137,7 @@
                        table = missingBlob(blobPath, commit);
                    } else {
                        table = generateSourceView(source, extension, type == 1);
                        addBottomScriptInline("jQuery(prettyPrint);");
                    }
                    add(new Label("blobText", table).setEscapeModelStrings(false));
                    add(new Image("blobImage").setVisible(false));
@@ -150,6 +151,7 @@
                    table = missingBlob(blobPath, commit);
                } else {
                    table = generateSourceView(source, null, false);
                    addBottomScriptInline("jQuery(prettyPrint);");
                }
                add(new Label("blobText", table).setEscapeModelStrings(false));
                add(new Image("blobImage").setVisible(false));