Permalink
Browse files

Removed XSLT from topnav

  • Loading branch information...
1 parent 806c455 commit f7f7a1e8b72ab42d6f6d652e2ee798510a3d15b0 @vecter vecter committed Jan 15, 2012
Showing with 5,169 additions and 5,159 deletions.
  1. +6 −9 scraper/python/scrape.js
  2. +5,149 −5,149 static/data/python.json
  3. +10 −0 static/index.html
  4. +1 −0 static/js/views/pagesearchresults.js
  5. +2 −0 static/offline.manifest
  6. +1 −1 static/templates/topnav.html
@@ -121,21 +121,18 @@ requirejs([
searchableItems[i].domId = newId;
}
- /*
- // Each <a> without an href attribute is used as an anchor on this page.
- // It has <a name="anchorname">. Modify it so it becomes
- // <a name="anchorname" id="anchorname">. This is because the clienside js
- // will select anchors by id, not by name.
+ // If a link href starts with a hashtag, leave it. If it is a relative url,
+ // then make it absolute.
+ var baseUrl = url.substr(0, url.lastIndexOf('/') + 1);
$('a').each(function(i, elt) {
var $elt = $(elt);
- if ($elt.attr('name') && !$elt.attr('id')) {
- $elt.attr('id', $elt.attr('name'));
+ var href = $elt.attr('href');
+ if (href.charAt(0) != '#' && href.indexOf('://') === -1) {
+ $elt.attr('href', baseUrl + href);
}
});
- */
// Change img srcs from relative to absolute
- var baseUrl = url.substr(0, url.lastIndexOf('/') + 1);
$('img').each(function(i, img) {
var src = img.attribs.src;
if (src.indexOf('http') === -1) {
View
Oops, something went wrong.
View
@@ -23,6 +23,16 @@
<!-- javascript -->
<script data-main="js/main" src="js/libs/require/require.js"></script>
+ <script type="text/javascript">
+ <-- c.f. http://appcachefacts.info/ -->
+ if (window.applicationCache) {
+ applicationCache.addEventListener('updateready', function() {
+ if (confirm('An update is available. Reload now?')) {
+ window.location.reload();
+ }
+ });
+ }
+ </script>
</head>
@@ -28,6 +28,7 @@ define([
this.$searchResults.scrollTop(searchResultsTopVal + topVal - 60);
} else {
// External link
+ // When we scraped, should turn all external relative links to absolute links.
window.location.href = href;
}
},
@@ -1,5 +1,7 @@
CACHE MANIFEST
+# Version 0.01
+
# just copy/pasted a dump of server logs...might be a better way to do this programmatically
CACHE:
js/libs/require/require.js
@@ -9,7 +9,7 @@
<li><a id="nav-jquery" data-lang="jquery" class="pointer">jQuery</a></li>
<li><a id="nav-php" data-lang="php" class="pointer">PHP</a></li>
<li><a id="nav-python" data-lang="python" class="pointer">Python</a></li>
- <li><a id="nav-xslt" data-lang="xslt" class="pointer">XPath/XSLT</a></li>
+ <!--<li><a id="nav-xslt" data-lang="xslt" class="pointer">XPath/XSLT</a></li>-->
</ul>
<ul id="secondary-nav" class="secondary-nav">
<li><a id="nav-about" href="#about">About</a></li>

0 comments on commit f7f7a1e

Please sign in to comment.