summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--application/views/file/html_header.php29
-rw-r--r--data/paste.css9
2 files changed, 38 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>
diff --git a/data/paste.css b/data/paste.css
index 2a5ce55f7..f511c54fe 100644
--- a/data/paste.css
+++ b/data/paste.css
@@ -14,6 +14,15 @@ body {
.numbers a:target {
background: yellow;
}
+div#highlight_line {
+ background: yellow;
+ display: inline;
+ position: absolute;
+ z-index: -1;
+ left: 0;
+ width: 100%;
+
+}
.content {
padding-left:3px;