summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom <tw201207@gmail.com>2014-11-12 20:27:17 +0100
committerTom <tw201207@gmail.com>2014-11-12 20:27:17 +0100
commit4dee2c5ee06677d12d5719bc18199a0affd13cc0 (patch)
tree45305dc6b0bbbf3276d190f2743a2d30c1591798
parentbae957cd80e59f16fe011dda45ce2624e2ffd4d2 (diff)
downloadgitblit-4dee2c5ee06677d12d5719bc18199a0affd13cc0.tar.gz
gitblit-4dee2c5ee06677d12d5719bc18199a0affd13cc0.zip
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.
-rw-r--r--src/main/java/com/gitblit/wicket/pages/BlobPage.html5
-rw-r--r--src/main/java/com/gitblit/wicket/pages/BlobPage.java2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/com/gitblit/wicket/pages/BlobPage.html b/src/main/java/com/gitblit/wicket/pages/BlobPage.html
index 3f9a959a..289c1498 100644
--- a/src/main/java/com/gitblit/wicket/pages/BlobPage.html
+++ b/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> \ No newline at end of file
diff --git a/src/main/java/com/gitblit/wicket/pages/BlobPage.java b/src/main/java/com/gitblit/wicket/pages/BlobPage.java
index 3c244f9a..df30e4cc 100644
--- a/src/main/java/com/gitblit/wicket/pages/BlobPage.java
+++ b/src/main/java/com/gitblit/wicket/pages/BlobPage.java
@@ -137,6 +137,7 @@ public class BlobPage extends RepositoryPage {
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 @@ public class BlobPage extends RepositoryPage {
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));