Added link redirect to docs

This commit is contained in:
Sashko Stubailo
2014-08-28 10:12:09 -07:00
parent ab0e177561
commit 2b680d087c
2 changed files with 18 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ code-prettify@1.0.0
coffeescript@1.0.2
ctl-helper@1.0.2
ctl@1.0.0
deps@1.0.1
ejson@1.0.0
follower-livedata@1.0.0
geojson-utils@1.0.0
@@ -41,7 +42,6 @@ spacebars@1.0.0
spiderable@1.0.2
standard-app-packages@1.0.0
templating@1.0.4
tracker@1.0.1
ui@1.0.0
underscore@1.0.0
webapp@1.0.2

View File

@@ -0,0 +1,17 @@
// make links backwards compatible - for example, #deps -> #tracker
var getRedirect = function (hash) {
if (hash.indexOf("deps") !== -1) {
return hash.replace("deps", "tracker");
}
// don't redirect
return false;
};
var curLink = window.location.hash.slice(1);
var redirect = getRedirect(curLink);
if (redirect) {
window.location = "#" + redirect;
}