2010-11-15 20:15:27 +00:00
|
|
|
SyntaxHighlighter['defaults'].toolbar = false;
|
|
|
|
|
|
2010-11-16 21:39:50 +00:00
|
|
|
DocsController.$inject = ['$location', '$browser', '$window'];
|
|
|
|
|
function DocsController($location, $browser, $window) {
|
2010-11-15 20:15:27 +00:00
|
|
|
this.pages = NG_PAGES;
|
|
|
|
|
window.$root = this.$root;
|
|
|
|
|
|
|
|
|
|
this.getUrl = function(page){
|
2010-11-18 19:56:10 +00:00
|
|
|
return '#!' + page.name;
|
2010-10-27 22:31:10 +00:00
|
|
|
};
|
2010-11-15 20:15:27 +00:00
|
|
|
|
|
|
|
|
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) {
|
2010-11-17 19:33:30 +00:00
|
|
|
var depth = page.name.split(/\./).length - 1,
|
|
|
|
|
cssClass = 'level-' + depth + (page.name == this.getTitle() ? ' selected' : '');
|
|
|
|
|
|
|
|
|
|
if (depth == 1 && page.type !== 'overview') cssClass += ' level-angular';
|
|
|
|
|
|
|
|
|
|
return cssClass;
|
2010-11-15 20:15:27 +00:00
|
|
|
};
|
2010-11-16 21:39:50 +00:00
|
|
|
|
|
|
|
|
this.afterPartialLoaded = function() {
|
|
|
|
|
$window.scroll(0,0);
|
|
|
|
|
SyntaxHighlighter.highlight();
|
|
|
|
|
};
|
2010-11-19 00:53:11 +00:00
|
|
|
|
|
|
|
|
this.getFeedbackUrl = function() {
|
|
|
|
|
return "mailto:angular@googlegroups.com?" +
|
|
|
|
|
"subject=" + escape("Feedback on " + $location.href) + "&" +
|
|
|
|
|
"body=" + escape("Hi there,\n\nI read " + $location.href + " and wanted to ask ....");
|
|
|
|
|
}
|
2010-11-15 20:15:27 +00:00
|
|
|
|
2010-10-27 22:31:10 +00:00
|
|
|
}
|
2010-11-15 20:15:27 +00:00
|
|
|
|
|
|
|
|
angular.filter('short', function(name){
|
|
|
|
|
return (name||'').split(/\./).pop();
|
|
|
|
|
});
|