summaryrefslogtreecommitdiffstats
path: root/application/views
diff options
context:
space:
mode:
Diffstat (limited to 'application/views')
-rw-r--r--application/views/file/html_header.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/application/views/file/html_header.php b/application/views/file/html_header.php
index 52ffab007..f57884643 100644
--- a/application/views/file/html_header.php
+++ b/application/views/file/html_header.php
@@ -17,5 +17,34 @@
<a class="raw_link no" href="<?php echo $rmd_link; ?>">Render Markdown</a>
</div>
</div>
+ <script type="text/javascript">
+ /* <![CDATA[ */
+function update_anchor_highlight() {
+ var anchor = window.location.hash.substr(1);
+ var element = document.getElementById("highlight_line");
+ if (element) {
+ element.parentNode.removeChild(element);
+ }
+
+ anchor = document.getElementById(anchor);
+ if (!anchor) {
+ return;
+ }
+ var newElement = document.createElement("div");
+ newElement.setAttribute("id", "highlight_line");
+ newElement.textContent=" ";
+ anchor.parentNode.insertBefore(newElement, anchor.nextSibling);
+}
+
+if ("onhashchange" in window) {
+ window.onload = function () {
+ update_anchor_highlight();
+ }
+ window.onhashchange = function () {
+ update_anchor_highlight();
+ }
+}
+ /* ]]> */
+ </script>
<table class="content">
<tr>