aboutsummaryrefslogtreecommitdiffstats
path: root/docs/src
diff options
context:
space:
mode:
authorIgor Minar2011-06-06 10:15:17 -0700
committerIgor Minar2011-06-06 23:10:27 -0700
commitc6dbdde6dc875c96a0b89bcdef669eb9171259e0 (patch)
treeae40b5b561e5c4dc9fb27d14e91ba85cfcd28437 /docs/src
parentf8417b48beaa3080e4e80784c11e8fa68afdec96 (diff)
downloadangular.js-c6dbdde6dc875c96a0b89bcdef669eb9171259e0.tar.bz2
fix hashpath prefix for docs/sitemap/etc
Diffstat (limited to 'docs/src')
-rw-r--r--docs/src/SiteMap.js6
-rw-r--r--docs/src/ngdoc.js4
-rw-r--r--docs/src/templates/docs.js10
-rw-r--r--docs/src/templates/index.html10
4 files changed, 16 insertions, 14 deletions
diff --git a/docs/src/SiteMap.js b/docs/src/SiteMap.js
index c2b1ec92..7626cbfc 100644
--- a/docs/src/SiteMap.js
+++ b/docs/src/SiteMap.js
@@ -12,8 +12,10 @@ function SiteMap(docs){
map.push('<?xml version="1.0" encoding="UTF-8"?>');
map.push('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">');
docs.forEach(function(doc){
- map.push(' <url><loc>http://docs.angularjs.org/#!' +
- encode(doc.name) + '</loc><changefreq>weekly</changefreq></url>');
+ map.push(' <url><loc>http://docs.angularjs.org/#!/' +
+ encode(doc.section) + '/' +
+ encode(doc.name) +
+ '</loc><changefreq>weekly</changefreq></url>');
});
map.push('</urlset>');
map.push('');
diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js
index 61ac6f78..be4efb6b 100644
--- a/docs/src/ngdoc.js
+++ b/docs/src/ngdoc.js
@@ -534,9 +534,9 @@ Doc.prototype = {
function scenarios(docs){
var specs = [];
docs.forEach(function(doc){
- specs.push('describe("' + doc.id + '", function(){');
+ specs.push('describe("' + doc.section + '/' + doc.id + '", function(){');
specs.push(' beforeEach(function(){');
- specs.push(' browser().navigateTo("index.html#!' + doc.id + '");');
+ specs.push(' browser().navigateTo("index.html#!/' + doc.section + '/' + doc.id + '");');
specs.push(' });');
specs.push('');
doc.scenarios.forEach(function(scenario){
diff --git a/docs/src/templates/docs.js b/docs/src/templates/docs.js
index e631d668..b6da7b97 100644
--- a/docs/src/templates/docs.js
+++ b/docs/src/templates/docs.js
@@ -6,21 +6,21 @@ function DocsController($location, $browser, $window) {
this.$location = $location;
if (!HAS_HASH.test($location.href)) {
- $location.hashPath = '!api/';
+ $location.hashPath = '!/api';
}
this.$watch('$location.hashPath', function(hashPath) {
if (hashPath.match(/^!/)) {
var parts = hashPath.substring(1).split('/');
- self.sectionId = parts[0];
- self.partialId = parts[1] || 'index';
+ self.sectionId = parts[1];
+ self.partialId = parts[2] || 'index';
self.pages = angular.Array.filter(NG_PAGES, {section:self.sectionId});
self.partialTitle = (angular.Array.filter(self.pages, function(doc){return doc.id == self.partialId;})[0]||{}).name;
}
});
this.getUrl = function(page){
- return '#!' + page.section + '/' + page.id;
+ return '#!/' + page.section + '/' + page.id;
};
this.getCurrentPartial = function(){
@@ -48,7 +48,7 @@ function DocsController($location, $browser, $window) {
this.afterPartialLoaded = function() {
SyntaxHighlighter.highlight();
$window.scrollTo(0,0);
- $window._gaq.push(['_trackPageview', $location.hashPath.replace('!', '/')]);
+ $window._gaq.push(['_trackPageview', $location.hashPath.substr(1)]);
};
this.getFeedbackUrl = function() {
diff --git a/docs/src/templates/index.html b/docs/src/templates/index.html
index 6d21fab2..0f000bfa 100644
--- a/docs/src/templates/index.html
+++ b/docs/src/templates/index.html
@@ -51,11 +51,11 @@
<ul id="navbar">
<li><a href="http://angularjs.org/">&lt;angular/&gt;</a></li>
- <li><a href="#!guide" ng:class="selectedSection('guide')">Developer Guide</a></li>
- <li><a href="#!api" ng:class="selectedSection('api')">API Reference</a></li>
- <li><a href="#!cookbook" ng:class="selectedSection('cookbook')">Examples</a></li>
- <li><a href="#!misc/started" ng:class="selectedSection('intro')">Getting Started</a></li>
- <li><a href="#!tutorial" ng:class="selectedSection('tutorial')">Tutorial</a></li>
+ <li><a href="#!/guide" ng:class="selectedSection('guide')">Developer Guide</a></li>
+ <li><a href="#!/api" ng:class="selectedSection('api')">API Reference</a></li>
+ <li><a href="#!/cookbook" ng:class="selectedSection('cookbook')">Examples</a></li>
+ <li><a href="#!/misc/started" ng:class="selectedSection('misc')">Getting Started</a></li>
+ <li><a href="#!/tutorial" ng:class="selectedSection('tutorial')">Tutorial</a></li>
</ul>
<div id="sidebar">