aboutsummaryrefslogtreecommitdiffstats
path: root/docs/src/templates/doc_widgets.js
diff options
context:
space:
mode:
authorIgor Minar2011-06-06 08:52:02 -0700
committerIgor Minar2011-06-06 22:52:02 -0700
commitf8417b48beaa3080e4e80784c11e8fa68afdec96 (patch)
tree075310d1102ac406885b547cd1ea10e7460e716c /docs/src/templates/doc_widgets.js
parent7f1e2e48467f80cc083d24b44f088620e4e7bcb6 (diff)
downloadangular.js-f8417b48beaa3080e4e80784c11e8fa68afdec96.tar.bz2
docs app css/js/html rewrite
Diffstat (limited to 'docs/src/templates/doc_widgets.js')
-rw-r--r--docs/src/templates/doc_widgets.js44
1 files changed, 41 insertions, 3 deletions
diff --git a/docs/src/templates/doc_widgets.js b/docs/src/templates/doc_widgets.js
index a3527c52..b38b9fde 100644
--- a/docs/src/templates/doc_widgets.js
+++ b/docs/src/templates/doc_widgets.js
@@ -86,7 +86,7 @@
};
var HTML_TPL =
- '<a ng:init="showInstructions = {show}" ng:show="!showInstructions" ng:click="showInstructions = true" href>Show Instructions</a>' +
+ '<p><a ng:init="showInstructions = {show}" ng:show="!showInstructions" ng:click="showInstructions = true" href>Workspace Reset Instructions</a></p>' +
'<div ng:controller="TutorialInstructionsCtrl" ng:show="showInstructions">' +
'<div class="tabs-nav">' +
'<ul>' +
@@ -111,7 +111,7 @@
'<ol>' +
'<li><p>Reset the workspace to step {step}.</p>' +
'<pre><code> git checkout -f step-{step}</code></pre></li>' +
- '<li><p>Refresh your browser or check the app out on <a href="http://angular.github.com/angular-phonecat/step-{step}/app">anglar\'s server</a>.</p></li>' +
+ '<li><p>Refresh your browser or check the app out on <a href="http://angular.github.com/angular-phonecat/step-{step}/app">angular\'s server</a>.</p></li>' +
'</ol>' +
'</div>' +
@@ -135,7 +135,7 @@
'<ol>' +
'<li><p>Reset the workspace to step {step}.</p>' +
'<pre><code> ./goto_step.bat {step}</code></pre></li>' +
- '<li><p>Refresh your browser or check the app out on <a href="http://angular.github.com/angular-phonecat/step-{step}/app">anglar\'s server</a>.</p></li>' +
+ '<li><p>Refresh your browser or check the app out on <a href="http://angular.github.com/angular-phonecat/step-{step}/app">angular\'s server</a>.</p></li>' +
'</ol>' +
'</div>';
@@ -167,4 +167,42 @@
element.append(tabs);
element.show();
});
+
+
+ angular.directive('doc:tutorial-nav', function(step) {
+ return function(element) {
+ var prevStep, codeDiff, nextStep,
+ content;
+
+ step = parseInt(step, 10);
+
+ if (step === 0) {
+ prevStep = '';
+ nextStep = 'step_01';
+ codeDiff = 'step-0~7...step-0';
+ } else if (step === 11){
+ prevStep = 'step_10';
+ nextStep = 'the_end';
+ codeDiff = 'step-10...step-11';
+ } else {
+ prevStep = 'step_' + pad(step - 1)
+ nextStep = 'step_' + pad(step + 1);
+ codeDiff = 'step-' + step + '...step-' + step;
+ }
+
+ content = angular.element(
+ '<li><a href="#!tutorial/' + prevStep + '">Previous</a></li>' +
+ '<li><a href="http://angular.github.com/angular-phonecat/step-' + step + '/app">Live Demo</a></li>' +
+ '<li><a href="https://github.com/angular/angular-phonecat/compare/' + codeDiff + '">Code Diff</a></li>' +
+ '<li><a href="#!tutorial/' + nextStep + '">Next</a></li>'
+ );
+
+ element.attr('id', 'tutorial-nav');
+ element.append(content);
+ }
+
+ function pad(step) {
+ return (step < 10) ? ('0' + step) : step;
+ }
+ });
})();