aboutsummaryrefslogtreecommitdiffstats
path: root/docs/docs.js
diff options
context:
space:
mode:
authorMisko Hevery2010-11-15 12:15:27 -0800
committerMisko Hevery2010-11-15 12:28:08 -0800
commitb467a50bc75b7f4c0d9bcee521387eda460337bf (patch)
tree3360037c664cda94bc683663a9a7afe9df46eeb8 /docs/docs.js
parenta1652057a5e1fce1911b118a5d43629abe772ab6 (diff)
downloadangular.js-b467a50bc75b7f4c0d9bcee521387eda460337bf.tar.bz2
generate keyword for searches; improved layout of doc
Diffstat (limited to 'docs/docs.js')
-rw-r--r--docs/docs.js37
1 files changed, 32 insertions, 5 deletions
diff --git a/docs/docs.js b/docs/docs.js
index 6f5c5034..96fba9cc 100644
--- a/docs/docs.js
+++ b/docs/docs.js
@@ -1,7 +1,34 @@
-function DocController($resource, $location){
- this.docs = $resource('documentation.json').get();
- this.getPartialDoc = function(){
- return encodeURIComponent($location.hashPath) + '.html';
+SyntaxHighlighter['defaults'].toolbar = false;
+
+DocsController.$inject = ['$location', '$browser'];
+function DocsController($location, $browser) {
+ this.pages = NG_PAGES;
+ window.$root = this.$root;
+
+ this.getUrl = function(page){
+ return '#!' + encodeURIComponent(page.name);
};
+
+ this.getCurrentPartial = function(){
+ return './' + this.getTitle() + '.html';
+ };
+
+ this.getTitle = function(){
+ var hashPath = $location.hashPath || '!angular';
+ if (hashPath.match(/^!angular/)) {
+ this.partialTitle = hashPath.substring(1);
+ }
+ return this.partialTitle;
+ };
+
+ this.getClass = function(page) {
+ var depth = page.name.split(/\./).length - 1;
+ return 'level-' + depth +
+ (page.name == this.getTitle() ? ' selected' : '');
+ };
+
}
-DocController.$inject=['$resource', '$location']; \ No newline at end of file
+
+angular.filter('short', function(name){
+ return (name||'').split(/\./).pop();
+}); \ No newline at end of file