diff options
Diffstat (limited to 'docs/src/templates')
| -rw-r--r-- | docs/src/templates/docs.css | 27 | ||||
| -rw-r--r-- | docs/src/templates/docs.js | 20 | ||||
| -rw-r--r-- | docs/src/templates/index.html | 44 |
3 files changed, 65 insertions, 26 deletions
diff --git a/docs/src/templates/docs.css b/docs/src/templates/docs.css index f5b9275b..4f47367d 100644 --- a/docs/src/templates/docs.css +++ b/docs/src/templates/docs.css @@ -18,6 +18,24 @@ a { height: 3.5em; } +#header .navigation { + position: absolute; + text-align: center; + top: 0; + right: 0; + left: 0; + margin: 0; + padding: 0; +} +#header .navigation > li { + display: inline; + padding: 0 .5em; +} + +#header .navigation > li.selected { + font-weight: bold; +} + #sidebar, #main { position: absolute; @@ -191,12 +209,8 @@ a { margin-top: 0; } -#sidebar ul li.level-1.level-angular { +#sidebar ul li.monospace{ font-family: monospace; - font-weight: normal; - font-size: 1em; - margin-top: 0; - margin-bottom: 0; } #sidebar ul li.level-1 { @@ -208,17 +222,14 @@ a { #sidebar ul li.level-2 { margin-left: 2em; - font-family: monospace; } #sidebar ul li.level-3 { margin-left: 3em; - font-family: monospace; } #sidebar ul li.level-4 { margin-left: 4em; - font-family: monospace; } diff --git a/docs/src/templates/docs.js b/docs/src/templates/docs.js index 9483496e..47bb87a6 100644 --- a/docs/src/templates/docs.js +++ b/docs/src/templates/docs.js @@ -1,8 +1,8 @@ var HAS_HASH = /#/; DocsController.$inject = ['$location', '$browser', '$window']; function DocsController($location, $browser, $window) { - this.pages = NG_PAGES; window.$root = this.$root; + var self = this; this.$location = $location; if (!HAS_HASH.test($location.href)) { @@ -11,28 +11,36 @@ function DocsController($location, $browser, $window) { this.$watch('$location.hashPath', function(hashPath) { if (hashPath.match(/^!/)) { - this.partialId = hashPath.substring(1); - this.partialTitle = (angular.Array.filter(NG_PAGES, {id:this.partialId})[0]||{}).name; + var parts = hashPath.substring(1).split('/'); + self.sectionId = parts[0]; + self.partialId = parts[1] || '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.id; + return '#!' + page.section + '/' + page.id; }; this.getCurrentPartial = function(){ - return './' + this.partialId + '.html'; + return './' + this.sectionId + '/' + this.partialId + '.html'; }; this.getClass = function(page) { var depth = page.depth, cssClass = 'level-' + depth + (page.name == this.partialId ? ' selected' : ''); - if (depth == 1 && page.type !== 'overview') cssClass += ' level-angular'; + if (page.section == 'api') + cssClass += ' monospace'; return cssClass; }; + this.selectedSection = function(section) { + return section == self.sectionId ? 'selected' : null; + }; + this.afterPartialLoaded = function() { SyntaxHighlighter.highlight(); }; diff --git a/docs/src/templates/index.html b/docs/src/templates/index.html index 63e8d871..1c3dd3a6 100644 --- a/docs/src/templates/index.html +++ b/docs/src/templates/index.html @@ -4,23 +4,36 @@ ng:controller="DocsController"> <head> <title ng:bind-template="<angular/>: {{partialTitle}}"><angular/></title> - <meta name="fragment" content="!"> - <link rel="stylesheet" href="doc_widgets.css" type="text/css" /> <link rel="stylesheet" href="docs.css" type="text/css"/> <link rel="stylesheet" href="syntaxhighlighter/shCore.css" type="text/css"/> <link rel="stylesheet" href="syntaxhighlighter/shThemeDefault.css" type="text/css"/> - - <script src="jquery.min.js"></script> - <script src="syntaxhighlighter/shCore.js"></script> - <script src="syntaxhighlighter/shBrushJScript.js"></script> - <script src="syntaxhighlighter/shBrushXml.js"></script> - - <script src="../angular.min.js" ng:autobind></script> - <script src="docs.js"></script> - <script src="doc_widgets.js"></script> - <script src="docs-keywords.js"></script> + <script> + /*! + * $script.js v1.3 + * https://github.com/ded/script.js + * Copyright: @ded & @fat - Dustin Diaz, Jacob Thornton 2011 + * Follow our software http://twitter.com/dedfat + * License: MIT + */ + !function(a,b,c){function w(a,c){var e=b.createElement("script"),f=0;e.onload=e[r]=function(){e[p]&&!!h.test(e[p])||f||(e.onload=e[r]=null,f=1,c())},e.async=1,e.src=a,d.parentNode.insertBefore(e,d)}function t(a,b){s(a,function(a){return!b(a)})}var d=b.getElementsByTagName("script")[0],e={},f={},g={},h=/^i|c/,i={},k="string",l=!1,m,n="push",o="DOMContentLoaded",p="readyState",q="addEventListener",r="onreadystatechange",s=function(a,b){for(m=0,j=a.length;m<j;++m)if(!b(a[m]))return 0;return 1};!b[p]&&b[q]&&(b[q](o,function u(){b.removeEventListener(o,u,l),b[p]="complete"},l),b[p]="loading");var v=function(a,b,d){function o(){if(!--l){e[k]=1,j&&j();for(var a in g)s(a.split("|"),m)&&!t(g[a],m)&&(g[a]=[])}}function m(a){return a.call?a():e[a]}a=a[n]?a:[a];var h=b&&b.call,j=h?b:d,k=h?a.join(""):b,l=a.length;c(function(){t(a,function(a){i[a]?(k&&(f[k]=1),o()):(i[a]=1,k&&(f[k]=1),w(v.path?v.path+a+".js":a,o))})},0);return v};v.get=w,v.ready=function(a,b,c){a=a[n]?a:[a];var d=[];!t(a,function(a){e[a]||d[n](a)})&&s(a,function(a){return e[a]})?b():!function(a){g[a]=g[a]||[],g[a][n](b),c&&c(d)}(a.join("|"));return v};var x=a.$script;v.noConflict=function(){a.$script=x;return this},typeof module!="undefined"&&module.exports?module.exports=v:a.$script=v}(this,document,setTimeout) + $script([ + 'jquery.min.js', + 'syntaxhighlighter/shCore.js'], function(){ + $script([ + 'syntaxhighlighter/shBrushJScript.js', + 'syntaxhighlighter/shBrushXml.js', + '../angular.min.js'], function(){ + $script([ + 'docs.js', + 'doc_widgets.js', + 'docs-keywords.js'], function(){ + angular.compile(document)(); + }); + }); + }); + </script> </head> <body style="display:none;" ng:show="true"> <div id="header"> @@ -28,6 +41,13 @@ <span class="main-title">{{partialTitle}}</span> <a href="#" tabindex="0"><span class="angular"><angular/></span> Docs</a> </h1> + <ul class="navigation"> + <li ng:class="selectedSection('intro')"><a href="#!intro">Introduction</a></li> + <li ng:class="selectedSection('tutorial')"><a href="#!tutoria">Tutorial</a></li> + <li ng:class="selectedSection('guide')"><a href="#!guide">Developer Guide</a></li> + <li ng:class="selectedSection('api')"><a href="#!api">API Reference</a></li> + <li ng:class="selectedSection('cookbook')"><a href="#!cookbook">Cookbook</a></li> + </ul> </div> <div id="sidebar"> <input type="text" name="search" id="search-box" placeholder="search the docs" |
