1. Alex Willmer
  2. trac-ticketlinks

Commits

cmlenz  committed e7b7924

Ported [682] to stable

  • Participants
  • Parent commits 6eba7f7
  • Branches 0.7-stable

Comments (0)

Files changed (3)

File htdocs/trac.js

View file
         var newNode = node.splitText(pos);
         newNode.nodeValue = newNode.nodeValue.substr(word.length);
         node.parentNode.insertBefore(span, newNode);
+        return true;
       }
     } else if (!node.nodeName.match(/button|select|textarea/i)) {
       // Recurse into child nodes
       for (var i = 0; i < node.childNodes.length; i++) {
-        highlightWord(node.childNodes[i], word, searchwordindex);
+        if (highlightWord(node.childNodes[i], word, searchwordindex)) i++;
       }
     }
+    return false;
   }
 
   var words = getSearchWords(document.URL);
     }
   }
 }
-
-// Allow search highlighting of all pages
-addEvent(window, 'load', searchHighlight);

File templates/footer.cs

View file
+<script type="text/javascript">searchHighlight()</script>
 <div id="footer">
  <hr />
  <a id="tracpowered" href="http://trac.edgewall.com/"><img src="<?cs

File templates/header.cs

View file
    <?cs /if ?>
    <?cs include "site_css.cs" ?>
   </style>
-  <script src="<?cs var:$htdocs_location ?>trac.js" type="text/javascript"></script>
+  <script src="<?cs var:$htdocs_location ?>trac.js" type="text/javascript"
+      defer="defer"></script>
  </head>
 <body>
 <?cs include "site_header.cs" ?>