summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2011-09-30 17:02:19 +0200
committerFlorian Pritz <bluewind@xinu.at>2011-09-30 17:02:19 +0200
commitda4df73ad770c30b2e6c5d2606e11ed7dc291cd0 (patch)
tree573fc9f5a8dbbbd8939592e6ba55fe009a0056e3 /application
parentf8d5e386ca303c14881d32b43807dafdc685909f (diff)
highlight complete line; not only line number
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application')
-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>