Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Allow unlimited sub-directory replacements
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiemonge committed Nov 21, 2011
1 parent f6c4738 commit e2f16bd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/_assets/js/jqm-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,13 @@ if ( location.protocol.substr(0,4) === 'file' ||
location.protocol.substr(0,11) === '*-extension' ||
location.protocol.substr(0,6) === 'widget' ) {
$( function() {
// Check to see if ajax can be used. This does a quick ajax request and blocks the page until its done
// Start with links with only the trailing slash, and then move on to the ones that start with ..
$( "a" )
.filter( "[href='../']" ).attr( "href", "../index.html" ).end()
.filter( "[href='../../']" ).attr( "href", "../../index.html" ).end()
.filter( "[href='../../../']" ).attr( "href", "../../../index.html" );
.filter( "[href='/']" ).attr( "href", "/index.html" ).end()
.filter( "[href^='..']" ).filter( "[href$='/']" ).each(function() {
this.href = $(this).attr("href")+"index.html";
});
});

// Check to see if ajax can be used. This does a quick ajax request and blocks the page until its done
Expand Down

0 comments on commit e2f16bd

Please sign in to comment.