aboutsummaryrefslogtreecommitdiffstats
path: root/docs/src/templates
diff options
context:
space:
mode:
authorPeter Bacon Darwin2014-02-12 22:47:42 +0000
committerPeter Bacon Darwin2014-02-16 19:03:41 +0000
commit389d4879da4aa620ee95d789b19ff9be44eb730a (patch)
tree93352ddc8738a975904a1774d51b93d585ca1075 /docs/src/templates
parenta564160511bf1bbed5a4fe5d2981fae1bb664eca (diff)
downloadangular.js-389d4879da4aa620ee95d789b19ff9be44eb730a.tar.bz2
chore(doc-gen): new docs
chore(doc-gen): implement dgeni
Diffstat (limited to 'docs/src/templates')
-rw-r--r--docs/src/templates/.htaccess19
-rw-r--r--docs/src/templates/css/animations.css62
-rw-r--r--docs/src/templates/css/doc_widgets.css150
-rw-r--r--docs/src/templates/css/docs.css575
-rw-r--r--docs/src/templates/css/prettify.css51
-rw-r--r--docs/src/templates/docs-scenario.html44
-rw-r--r--docs/src/templates/favicon.icobin1150 -> 0 bytes
-rw-r--r--docs/src/templates/index.html388
-rw-r--r--docs/src/templates/js/docs.js933
-rw-r--r--docs/src/templates/offline.html4
10 files changed, 0 insertions, 2226 deletions
diff --git a/docs/src/templates/.htaccess b/docs/src/templates/.htaccess
deleted file mode 100644
index aa3ae543..00000000
--- a/docs/src/templates/.htaccess
+++ /dev/null
@@ -1,19 +0,0 @@
-## OFFLINE SUPPORT ##
-
-# These rules tell apache to check if there is a cookie called "offline", with value set to the
-# current angular version. If this rule matches the appcache-offline.manifest will be served for
-# requests to appcache.manifest
-#
-# This file must be processed by Grunt in order to replace %ANGULAR_VERSION% with the actual version.
-
-Options -Indexes
-RewriteEngine on
-RewriteCond %{HTTP_COOKIE} ng-offline="NG_VERSION_FULL"
-RewriteRule appcache.manifest appcache-offline.manifest
-
-## Redirect to the latest manifest
-RewriteCond %{HTTP_HOST} ^docs-next\.angularjs\.org$
-RewriteRule appcache.manifest http://code.angularjs.org/next/docs/appcache.manifest [R=301]
-
-## HTML5 URL Support ##
-RewriteRule ^(guide|api|misc|tutorial)(/.*)?$ index.html
diff --git a/docs/src/templates/css/animations.css b/docs/src/templates/css/animations.css
deleted file mode 100644
index 7bf1e2e8..00000000
--- a/docs/src/templates/css/animations.css
+++ /dev/null
@@ -1,62 +0,0 @@
-.reveal.ng-enter {
- -webkit-transition:1s linear all;
- -moz-transition:1s linear all;
- -o-transition:1s linear all;
- transition:1s linear all;
-
- opacity:0;
-}
-.reveal.ng-enter.ng-enter-active {
- opacity:1;
-}
-
-.nav-list {
- padding: 0;
-}
-
-.nav-list li {
- margin:0!important;
- padding:2px 15px;
- overflow:hidden;
- line-height:1.1em;
-}
-
-.slide-reveal.ng-enter {
- -webkit-transition:0.5s linear all;
- -moz-transition:0.5s linear all;
- -o-transition:0.5s linear all;
- transition:0.5s linear all;
-
- opacity:0.5;
- position:relative;
- opacity:0;
- top:10px;
-}
-.slide-reveal.ng-enter.ng-enter-active {
- top:0;
- opacity:1;
-}
-
-.foldout.ng-enter,
-.foldout.ng-move,
-.foldout.ng-hide-add,
-.foldout.ng-hide-remove {
- -webkit-transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
- -moz-transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
- -o-transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
- transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
-}
-
-.foldout.ng-hide-remove,
-.foldout.ng-hide-add.ng-hide-active,
-.foldout.ng-enter,
-.foldout.ng-move {
- opacity:0;
-}
-
-.foldout.ng-move.ng-move-active,
-.foldout.ng-hide-remove.ng-hide-remove-active,
-.foldout.ng-hide-add,
-.foldout.ng-enter.ng-enter-active {
- opacity:1;
-}
diff --git a/docs/src/templates/css/doc_widgets.css b/docs/src/templates/css/doc_widgets.css
deleted file mode 100644
index 587d5a7e..00000000
--- a/docs/src/templates/css/doc_widgets.css
+++ /dev/null
@@ -1,150 +0,0 @@
-ul.doc-example {
- list-style-type: none;
- position: relative;
- font-size: 14px;
-}
-
-ul.doc-example > li {
- border: 2px solid gray;
- border-radius: 5px;
- -moz-border-radius: 5px;
- -webkit-border-radius: 5px;
- background-color: white;
- margin-bottom: 20px;
-}
-
-ul.doc-example > li.doc-example-heading {
- border: none;
- border-radius: 0;
- margin-bottom: -10px;
-}
-
-span.nojsfiddle {
- float: right;
- font-size: 14px;
- margin-right:10px;
- margin-top: 10px;
-}
-
-form.jsfiddle {
- position: absolute;
- right: 0;
- z-index: 1;
- height: 14px;
-}
-
-form.jsfiddle button {
- cursor: pointer;
- padding: 4px 10px;
- margin: 10px;
- background-color: #FFF;
- font-weight: bold;
- color: #7989D6;
- border-color: #7989D6;
- -moz-border-radius: 8px;
- -webkit-border-radius:8px;
- border-radius: 8px;
-}
-
-form.jsfiddle textarea, form.jsfiddle input {
- display: none;
-}
-
-li.doc-example-live {
- padding: 10px;
- font-size: 1.2em;
-}
-
-div.syntaxhighlighter {
- padding-bottom: 1px !important; /* fix to remove unnecessary scrollbars http://is.gd/gSMgC */
-}
-
-/* TABS - tutorial environment navigation */
-
-div.tabs-nav {
- height: 25px;
- position: relative;
-}
-
-div.tabs-nav ul li {
- list-style: none;
- display: inline-block;
- padding: 5px 10px;
-}
-
-div.tabs-nav ul li.current a {
- color: white;
- text-decoration: none;
-}
-
-div.tabs-nav ul li.current {
- background: #7989D6;
- -moz-box-shadow: 4px 4px 6px #48577D;
- -moz-border-radius-topright: 8px;
- -moz-border-radius-topleft: 8px;
- box-shadow: 4px 4px 6px #48577D;
- border-radius-topright: 8px;
- border-radius-topleft: 8px;
- -webkit-box-shadow: 4px 4px 6px #48577D;
- -webkit-border-top-right-radius: 8px;
- -webkit-border-top-left-radius: 8px;
- border-top-right-radius: 8px;
- border-top-left-radius: 8px;
-}
-
-div.tabs-content {
- padding: 4px;
- position: relative;
- background: #7989D6;
- -moz-border-radius: 8px;
- border-radius: 8px;
- -webkit-border-radius: 8px;
-}
-
-div.tabs-content-inner {
- margin: 1px;
- padding: 10px;
- background: white;
- border-radius: 6px;
- -moz-border-radius: 6px;
- -webkit-border-radius: 6px;
-}
-
-
-/* Tutorial Nav Bar */
-
-#tutorial-nav {
- margin: 0.5em 0 1em 0;
- padding: 0;
- list-style-type: none;
- background: #7989D6;
-
- -moz-border-radius: 15px;
- -webkit-border-radius: 15px;
- border-radius: 15px;
-
- -moz-box-shadow: 4px 4px 6px #48577D;
- -webkit-box-shadow: 4px 4px 6px #48577D;
- box-shadow: 4px 4px 6px #48577D;
-}
-
-
-#tutorial-nav li {
- display: inline;
-}
-
-
-#tutorial-nav a:link, #tutorial-nav a:visited {
- font-size: 1.2em;
- color: #FFF;
- text-decoration: none;
- text-align: center;
- display: inline-block;
- width: 11em;
- padding: 0.2em 0;
-}
-
-
-#tutorial-nav a:hover {
- color: #000;
-}
diff --git a/docs/src/templates/css/docs.css b/docs/src/templates/css/docs.css
deleted file mode 100644
index 10b60b5b..00000000
--- a/docs/src/templates/css/docs.css
+++ /dev/null
@@ -1,575 +0,0 @@
-/* Logo */
-
-.header .brand {
- padding-top: 6px;
- padding-bottom: 0px;
-}
-
-.header .brand img {
- height: 25px;
- width: 92px;
-}
-
-/* end: Logo */
-
-
-/* this is here to avoid the display=block shuffling of ngShow */
-.breadcrumb li > * {
- float:left;
- margin:0 2px 0 0;
-}
-
-.breadcrumb {
- padding-bottom:2px;
-}
-
-.clear-navbar {
- margin-top: 60px;
-}
-
-.footer {
- padding-top: 2em;
- background-color: #333;
- color: white;
- padding-bottom: 2em;
-}
-
-.spacer {
- height: 1em;
-}
-
-
-.icon-cog {
- line-height: 13px;
-}
-
-/* =============================== */
-
-.side-navigation .dropdown-menu {
- margin-left: 10px;
-}
-
-.side-navigation .code {
- font-family: monospace;
- font-weight: bold;
- font-size: 13px;
- color: black;
-}
-
-.side-navigation > ul.nav > li.module {
- background-color: #d3d3d3;
-}
-
-.side-navigation > ul.nav > li.section {
- background-color: #ebebeb;
- min-height: 14px;
-}
-
-.side-navigation > ul.nav > li.last {
- padding-bottom: 1em;
-}
-
-.side-navigation > ul.nav > li.last + li.api-list-item {
- margin-top:-1em;
- padding-bottom: 1em;
-}
-
-.side-navigation .well {
- border-color: #d3d3d3;
- padding-top: 0;
- padding-bottom: 0;
- margin-bottom: 15px;
-}
-
-.side-navigation .well .nav-header {
- text-transform: none;
- margin-top: 0;
- margin-left: -15px;
- margin-right: -15px;
-}
-
-.side-navigation .well .nav-header a {
- text-transform: none;
- color: black;
-}
-.side-navigation .well .nav-header a:hover {
- background-color: inherit;
-}
-
-.side-navigation .well li {
- line-height: 14px;
-}
-
-.side-navigation .well .guide {
- float: right;
- padding-top: 0;
- color: gray;
-}
-
-/* =============================== */
-/* Content */
-/* =============================== */
-
-.improve-docs, .view-source {
- float: right;
- margin: 0 5px;
- position: relative;
-}
-
-.improve-docs {
- z-index:100;
-}
-
-.hint {
- font-size: .7em;
- color: #c0c0c0;
-}
-
-.content code {
- background-color: inherit;
- color: inherit;
- border: none;
- padding: 0;
- font-size: inherit;
- font-family: monospace;
- white-space: nowrap;
-}
-
-.content pre code {
- white-space: inherit;
-}
-
-.content h2,
-.content h3,
-.content h4,
-.content h5 {
- margin-top: 1em;
- letter-spacing: -0.06em;
-}
-
-.content h2 {
- font-size: 36px;
- margin-bottom: .5em;
-}
-
-.content h3 {
- font-size: 24px;
- border-top: 1px solid #eee;
- padding-top: .5em;
-}
-
-.content h4 {
- font-size: 16px;
- margin-top: 1.5em;
-}
-
-.content ul {
- margin-top: .5em;
-}
-
-.content h6 {
- text-transform:none;
- color:black;
-}
-
-ul.parameters > li > p,
-.returns > p {
- display: inline;
-}
-
-ul.methods > li,
-ul.properties > li,
-ul.events > li {
- list-style: none;
- min-height: 20px;
- padding: 19px;
- margin-bottom: 20px;
- background-color: #f5f5f5;
- border: 1px solid #eee;
- border: 1px solid rgba(0, 0, 0, 0.05);
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
-}
-
-.member.method > h2,
-.member.property > h2,
-.member.event > h2 {
- margin-bottom: .5em;
-}
-
-ul.methods > li > h3,
-ul.properties > li > h3,
-ul.events > li > h3 {
- margin: -19px -19px 1em -19px;
- padding: .25em 19px;
- background-color: #d3d3d3;
- font-family: monospace;
-}
-
-.center {
- display: block;
- margin: 2em auto;
-}
-
-.diagram {
- display: block;
- margin: 2em auto;
- padding: 1em;
- border: 1px solid black;
-
- -moz-box-shadow: 4px 4px 6px #48577D;
- -webkit-box-shadow: 4px 4px 6px #48577D;
- box-shadow: 4px 4px 6px #48577D;
-
- -moz-border-radius: 15px;
- -webkit-border-radius: 15px;
- border-radius: 15px;
-}
-
-.tutorial-nav {
- margin-left: 175px;
- color: black;
- margin-top: 2em;
- margin-bottom: 2em;
-}
-
-.tutorial-nav a {
- color: white;
-}
-
-.tutorial-nav a:hover {
- color: white;
- text-decoration: none;
-}
-
-.tutorial-nav li {
- margin-right: 5px;
-}
-
-.clear {
- clear: both;
-}
-
-.variables-matrix td {
- vertical-align:top;
- padding:5px;
-}
-
-.type-hint {
- display:inline-block;
-}
-
-.variables-matrix .type-hint {
- text-align:center;
- display:block;
- min-width:60px;
-}
-
-.type-hint + .type-hint {
- margin-top:5px;
-}
-
-.type-hint-string {
- background:#3a87ad;
-}
-
-.type-hint-object {
- background:#999;
-}
-
-.type-hint-array {
- background:#F90;;
-}
-
-.type-hint-boolean {
- background:rgb(18, 131, 39);
-}
-
-.type-hint-number {
- background:rgb(189, 63, 66);
-}
-
-.syntax-links {
- background:#eee;
- border:1px solid #ddd;
- text-align:right;
- padding:1em;
- border-bottom:0;
- border-top-left-radius:4px;
- border-top-right-radius:4px;
-}
-
-.syntax-links a {
- margin-left:10px;
-}
-
-.syntax-links + pre {
- border-top-left-radius:0;
- border-top-right-radius:0;
-}
-
-.search-results {
- clear:both;
- display:table;
- width:100%;
-}
-
-.search-results.ng-hide {
- display:none;
-}
-
-.search-results > .search-group {
- vertical-align:top;
- padding:10px 0;
- display:table-cell;
-}
-
-.search-group.cols-1 { width:100%; }
-.search-group.cols-2 { width:50%; }
-.search-group.cols-3 { width:33%; }
-.search-group.cols-4 { width:25%; }
-
-.search-close {
- z-index:1029;
- position:absolute;
- bottom:-25px;
- left:80%;
- text-align:center;
- line-height:50px;
- width:50px;
- font-size:2em;
- background:#222222;
- border-radius:15px;
-}
-
-.search-close span {
- text-decoration:none;
- position:relative;
- z-index:1031;
-}
-
-.tutorial-index-page,
-.tutorial-the-end-page {
- padding-top:50px;
-}
-
-.tutorial-page {
- position:relative;
-}
-
-.tutorial-page .improve-docs {
- position:absolute;
- top:0;
- right:0;
-}
-
-.nocode-content {
- cursor:pointer;
- display:inline-block;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
-
- -webkit-transition:0.5s linear all;
- -moz-transition:0.5s linear all;
- -o-transition:0.5s linear all;
- transition:0.5s linear all;
- color: #223f7a;
- background:#ddd;
- border: 1px solid #ccc;
-}
-
-.nocode-content:hover {
- background-color: #99c2ff;
- border: 1px solid #e1e1e8;
-}
-
-.popover-incode .popover-inner {
- width:auto;
- min-width:200px;
- max-width:500px;
-}
-
-.popover-incode {
- -webkit-transition:0.2s linear opacity;
- -moz-transition:0.2s linear opacity;
- -o-transition:0.2s linear opacity;
- transition:0.2s linear opacity;
- opacity:0;
-}
-
-.popover-incode.visible {
- opacity:1;
-}
-
-.popover-incode code,
-.popover-incode pre {
- white-space:nowrap;
-}
-
-.popover-incode .arrow {
- left:50px!important;
-}
-
-.foldover-content {
- display:none;
-}
-
-.foldout:after {
- content:"";
- position:absolute;
- left:50%;
- top:-1px;
- margin-left:-10px;
- border-width:10px;
- border-style:solid;
- border-color:#f7f7f9 transparent transparent;
-}
-
-.foldout:before {
- content:"";
- position:absolute;
- left:50%;
- top:0;
- margin-left:-10px;
- border-width:10px;
- border-style:solid;
- border-color:#bbb transparent transparent;
-}
-
-.foldout {
- padding:8px 15px 5px;
- position:relative;
- background:#eee;
- white-space:normal;
- box-shadow:inset 0 0 20px #ccc;
- border-top:1px solid #bbb;
-}
-
-.prettyprint {
- padding-right:0!important;
- padding-bottom:0!important;
-}
-
-pre ol li {
- padding-bottom:2px;
- padding-right:5px;
-}
-
-#docs-fold {
- position:absolute;
- top:0;
- right:0;
- width:500px;
- min-height:100%;
- padding-top:50px;
- padding:50px 20px 20px 20px;
- background:white;
- border-left:1px solid #999;
- box-shadow:0 0 10px #555;
- z-index:1002;
-}
-
-#docs-fold.fold-show {
- -webkit-transition:0.4s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
- -moz-transition:0.4s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
- -o-transition:0.4s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
- transition:0.4s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
-}
-
-#docs-fold.fold-show {
- right:-200px;
- opacity:0;
-}
-
-#docs-fold.fold-show.fold-show-active {
- right:0;
- opacity:1;
-}
-
-#docs-fold-overlay {
- background:rgba(255,255,255,0.5);
- position:fixed;
- left:0;
- bottom:0;
- right:0;
- top:0;
- z-index:1001;
- cursor:pointer;
-}
-
-.fixed_body {
- position:fixed;
- top:0;
- z-index:1000;
- left:0;
- right:0;
-}
-
-#docs-fold-close {
- z-index: 1029;
- position: absolute;
- left: -30px;
- top: 60px;
- cursor:pointer;
- text-align: center;
- width:50px;
- line-height:50px;
- font-size: 2em;
- background: #fff;
- box-shadow:-6px 0 5px #555;
- display:block;
- border-radius:10px;
-}
-
-.docs-version-jump {
- width:180px;
- margin-bottom:20px;
-}
-
-.minerr-errmsg {
- clear: both;
- position: relative;
- top: 10px;
- font-size: 16px;
- word-break: normal;
-}
-
-.text-info {
- color:#3a87ad;
-}
-
-.definition-table tr > td:first-child {
- font-weight:bold;
- width:30%;
-}
-
-.definition-table.spaced {
- margin-bottom:30px;
-}
-
-.definition-table td {
- vertical-align: top;
-}
-
-.component-heading {
- text-transform:capitalize;
-}
-
-.component-breakdown {
- margin-bottom:30px;
- padding-bottom:30px;
- border-bottom:1px solid #aaa;
-}
-
-td.success {
- background-color: #dff0d8;
-}
-
-td.error {
- background-color: #f2dede;
-}
diff --git a/docs/src/templates/css/prettify.css b/docs/src/templates/css/prettify.css
deleted file mode 100644
index 16e0cafb..00000000
--- a/docs/src/templates/css/prettify.css
+++ /dev/null
@@ -1,51 +0,0 @@
-.pln { color: #000 } /* plain text */
-
-@media screen {
- .str { color: #080 } /* string content */
- .kwd { color: #008 } /* a keyword */
- .com { color: #800 } /* a comment */
- .typ { color: #606 } /* a type name */
- .lit { color: #066 } /* a literal value */
- /* punctuation, lisp open bracket, lisp close bracket */
- .pun, .opn, .clo { color: #660 }
- .tag { color: #008 } /* a markup tag name */
- .atn { color: #606 } /* a markup attribute name */
- .atv { color: #080 } /* a markup attribute value */
- .dec, .var { color: #606 } /* a declaration; a variable name */
- .fun { color: red } /* a function name */
-}
-
-/* Use higher contrast and text-weight for printable form. */
-@media print, projection {
- .str { color: #060 }
- .kwd { color: #006; font-weight: bold }
- .com { color: #600; font-style: italic }
- .typ { color: #404; font-weight: bold }
- .lit { color: #044 }
- .pun, .opn, .clo { color: #440 }
- .tag { color: #006; font-weight: bold }
- .atn { color: #404 }
- .atv { color: #060 }
-}
-
-pre.prettyprint {
- padding: 8px;
- background-color: #f7f7f9;
- border: 1px solid #e1e1e8;
-}
-pre.prettyprint.linenums {
- -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
- -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
- box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
-}
-ol.linenums {
- margin: 0 0 0 33px; /* IE indents via margin-left */
-}
-ol.linenums li {
- padding-left: 12px;
- font-size:12px;
- color: #bebec5;
- line-height: 18px;
- text-shadow: 0 1px 0 #fff;
- list-style-type:decimal!important;
-}
diff --git a/docs/src/templates/docs-scenario.html b/docs/src/templates/docs-scenario.html
deleted file mode 100644
index 2eca5f87..00000000
--- a/docs/src/templates/docs-scenario.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!DOCTYPE HTML>
-<html xmlns:ng="http://angularjs.org">
-<head>
- <title>AngularJS Docs E2E Test Runner</title>
- <script>
- var production = location.hostname === 'docs.angularjs.org',
- headEl = document.head,
- angularVersion = {
- current: '"NG_VERSION_FULL"', // rewrite during build
- cdn: '"NG_VERSION_CDN"'
- };
-
- addTag('script', {src: path('angular-scenario.js')}, function() {
- addTag('script', {src: 'docs-scenario.js'}, function() {
- angular.scenario.setUpAndRun();
- });
- });
-
- function addTag(name, attributes, callback) {
- var el = document.createElement(name),
- attrName;
-
- for (attrName in attributes) {
- el.setAttribute(attrName, attributes[attrName]);
- }
-
- if (callback) {
- el.onload = callback;
- }
-
- headEl.appendChild(el);
- }
-
-
- function path(name) {
- return production
- ? 'http://code.angularjs.org/' + angularVersion.cdn + '/' + name
- : '../' + name;
- }
- </script>
-</head>
-<body>
-</body>
-</html>
diff --git a/docs/src/templates/favicon.ico b/docs/src/templates/favicon.ico
deleted file mode 100644
index fe24a63a..00000000
--- a/docs/src/templates/favicon.ico
+++ /dev/null
Binary files differ
diff --git a/docs/src/templates/index.html b/docs/src/templates/index.html
deleted file mode 100644
index bc695119..00000000
--- a/docs/src/templates/index.html
+++ /dev/null
@@ -1,388 +0,0 @@
-<!doctype html>
-<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7 ng-app: docsApp;" lang="en" ng-controller="DocsController"> <![endif]-->
-<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8 ng-app: docsApp;" lang="en" ng-controller="DocsController"> <![endif]-->
-<!--[if IE 8]> <html class="no-js lt-ie9 ng-app: docsApp;" lang="en" ng-controller="DocsController"> <![endif]-->
-<!--[if gt IE 8]><!--> <html class="no-js ng-app: docsApp;" lang="en" ng-controller="DocsController"> <!--<![endif]-->
-<head>
- <style>
- .ng-hide { display:none!important; }
- </style>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="Description"
- content="AngularJS is what HTML would have been, had it been designed for building web-apps.
- Declarative templates with data-binding, MVC, dependency injection and great
- testability story all implemented with pure client-side JavaScript!">
- <meta name="fragment" content="!">
- <title ng-bind-template="AngularJS: {{partialTitle}}">AngularJS</title>
- <script type="text/javascript">
- // dynamically add base tag as well as css and javascript files.
- // we can't add css/js the usual way, because some browsers (FF) eagerly prefetch resources
- // before the base attribute is added, causing 404 and terribly slow loading of the docs app.
- (function() {
- if (window.name.indexOf('NG_DEFER_BOOTSTRAP!') == 0) {
- //TODO(i): super ugly hack to temporarily speed up our e2e tests until we move to protractor + extracted examples
- window.RUNNING_IN_NG_TEST_RUNNER = true;
- }
-
- var indexFile = (location.pathname.match(/\/(index[^\.]*\.html)/) || ['', ''])[1],
- rUrl = /(#!\/|api|guide|misc|tutorial|error|index[^\.]*\.html).*$/,
- baseUrl = location.href.replace(rUrl, indexFile),
- jQuery = /index-jq[^\.]*\.html$/.test(baseUrl),
- debug = /index[^\.]*-debug\.html$/.test(baseUrl),
- production = location.hostname === 'docs.angularjs.org',
- headEl = document.getElementsByTagName('head')[0],
- sync = true,
- angularVersion = {
- current: '"NG_VERSION_FULL"', // rewrite during build
- cdn: '"NG_VERSION_CDN"'
- };
-
- addTag('base', {href: baseUrl});
- addTag('link', {rel: 'stylesheet', href: 'components/bootstrap/css/' + (debug ? 'bootstrap.css' : 'bootstrap.min.css'), type: 'text/css'});
- addTag('link', {rel: 'stylesheet', href: 'components/font-awesome/css/' + (debug ? 'font-awesome.css' : 'font-awesome.min.css'), type: 'text/css'});
- addTag('link', {rel: 'stylesheet', href: 'css/prettify.css', type: 'text/css'});
- addTag('link', {rel: 'stylesheet', href: 'css/docs.css', type: 'text/css'});
- addTag('link', {rel: 'stylesheet', href: 'css/animations.css', type: 'text/css'});
- if (jQuery) addTag('script', {src: (debug ? 'components/jquery.js' : 'components/jquery.min.js')});
- addTag('script', {src: path('angular.js')}, sync);
- addTag('script', {src: path('angular-resource.js') }, sync);
- addTag('script', {src: path('angular-route.js') }, sync);
- addTag('script', {src: path('angular-cookies.js') }, sync);
- addTag('script', {src: path('angular-sanitize.js') }, sync);
- addTag('script', {src: path('angular-touch.js') }, sync);
- addTag('script', {src: path('angular-animate.js') }, sync);
- addTag('script', {src: 'components/angular-bootstrap.js' }, sync);
- addTag('script', {src: 'components/angular-bootstrap-prettify.js' }, sync);
- if (!window.RUNNING_IN_NG_TEST_RUNNER) {
- addTag('script', {src: 'components/google-code-prettify.js' }, sync);
- addTag('script', {src: 'components/' + (debug ? 'lunr.js' : 'lunr.min.js') }, sync);
- }
- addTag('script', {src: 'components/marked.js' }, sync);
- addTag('script', {src: 'docs-data.js'}, sync);
- addTag('script', {src: 'js/docs.js'}, sync);
-
- function path(name) {
- if (production) {
- if (name.match(/^angular(-\w+)?\.js/) && !name.match(/bootstrap/)) {
- name = '//ajax.googleapis.com/ajax/libs/angularjs/' +
- angularVersion.cdn +
- '/' +
- name.replace(/\.js$/, '.min.js');
- } else {
- name = 'http://code.angularjs.org/' +
- angularVersion.cdn +
- '/' +
- name.replace(/\.js$/, '.min.js');
- }
- return name;
- }
- return '../' + name.replace(/\.js$/, debug ? '.js' : '.min.js');
- }
-
- function addTag(name, attributes, sync) {
- var el = document.createElement(name),
- attrName;
-
- for (attrName in attributes) {
- el.setAttribute(attrName, attributes[attrName]);
- }
-
- sync ? document.write(outerHTML(el)) : headEl.appendChild(el);
- }
-
- function outerHTML(node){
- // if IE, Chrome take the internal method otherwise build one
- return node.outerHTML || (
- function(n){
- var div = document.createElement('div'), h;
- div.appendChild(n);
- h = div.innerHTML;
- div = null;
- return h;
- })(node);
- }
- })();
-
-
- // force page reload when new update is available
- window.applicationCache && window.applicationCache.addEventListener('updateready', function(e) {
- if (window.applicationCache.status == window.applicationCache.UPDATEREADY) {
- window.applicationCache.swapCache();
- window.location.reload();
- }
- }, false);
-
-
- // GA asynchronous tracker
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-8594346-3']);
- _gaq.push(['_setDomainName', '.angularjs.org']);
-
- if (!window.RUNNING_IN_NG_TEST_RUNNER) {
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
- }
- </script>
-</head>
-
-<body>
- <header class="header" ng-controller="DocsNavigationCtrl">
- <div class="navbar navbar-inverse navbar-fixed-top">
- <div class="navbar-inner">
- <div class="container">
- <a class="brand" href="http://angularjs.org">
- <img class="logo" src="img/angularjs-for-header-only.svg">
- </a>
- <ul class="nav">
- <li class="divider-vertical"></li>
- <li><a href="http://angularjs.org"><i class="icon-home icon-white"></i> Home</a></li>
- <li class="divider-vertical"></li>
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">
- <i class="icon-eye-open icon-white"></i> Learn <b class="caret"></b>
- </a>
- <ul class="dropdown-menu">
- <li class="disabled"><a href="http://angularjs.org/">Why AngularJS?</a></li>
- <li><a href="http://www.youtube.com/user/angularjs">Watch</a></li>
- <li><a href="tutorial">Tutorial</a></li>
- <li><a href="http://builtwith.angularjs.org/">Case Studies</a></li>
- <li><a href="https://github.com/angular/angular-seed">Seed App project template</a></li>
- <li><a href="misc/faq">FAQ</a></li>
- </ul>
- </li>
- <li class="divider-vertical"></li>
- <li class="dropdown active">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">
- <i class="icon-book icon-white"></i> Develop <b class="caret"></b>
- </a>
- <ul class="dropdown-menu">
- <li><a href="./tutorial/">Tutorial</a></li>
- <li><a href="./guide/">Developer Guide</a></li>
- <li><a href="./api/">API Reference</a></li>
- <li><a href="./error/">Error Reference</a></li>
- <li><a href="http://docs.angularjs.org/misc/contribute">Contribute</a></li>
- <li><a href="http://code.angularjs.org/">Download</a></li>
- </ul>
- </li>
- <li class="divider-vertical"></li>
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">
- <i class="icon-comment icon-white"></i> Discuss <b class="caret"></b>
- </a>
- <ul class="dropdown-menu">
- <li><a href="http://blog.angularjs.org">Blog</a></li>
- <li><a href="http://groups.google.com/group/angular">Mailing List</a></li>
- <li><a href="http://webchat.freenode.net/?channels=angularjs&uio=d4">Chat Room</a></li>
- <li class="divider"></li>
- <li><a href="https://twitter.com/#!/angularjs">Twitter</a></li>
- <li><a href="https://plus.google.com/110323587230527980117">Google+</a></li>
- <li class="divider"></li>
- <li><a href="https://github.com/angular/angular.js">GitHub</a></li>
- <li><a href="https://github.com/angular/angular.js/issues">Issue Tracker</a></li>
- </ul>
- </li>
- <li class="divider-vertical"></li>
- </ul>
- <form class="navbar-search pull-right" ng-submit="submit()">
- <input type="text"
- name="as_q"
- class="search-query"
- placeholder="Click to focus or press '/' to search"
- ng-change="search(q)"
- ng-model="q"
- docs-search-input
- autocomplete="off" />
- </form>
- <div ng-show="hasResults" class="search-results">
- <div ng-repeat="(key, value) in results" class="search-group" ng-class="colClassName">
- <h4>{{ key }}</h4>
- <div ng-repeat="item in value" class="search-result">
- <a ng-click="hideResults()" href="{{ item.url }}">{{ item.shortName }}</a>
- </div>
- </div>
- <a href="" ng-click="hideResults()" class="search-close">
- <span class="icon-remove-sign"></span>
- </a>
- </div>
- </div>
- </div>
- </div>
- </header>
-
- <div class="ng-hide" id="docs-fold-overlay" ng-show="docs_fold" ng-click="fold(null)"></div>
- <div class="foldout ng-hide" id="docs-fold" ng-show="docs_fold">
- <div id="docs-fold-close" ng-click="fold(null)">
- <span class="icon-remove-sign"></span>
- </div>
- <div ng-include="docs_fold"></div>
- </div>
-
-<div ng-class="{fixed_body:docs_fold}">
- <div role="main" class="container">
- <div class="row clear-navbar"></div>
-
- <div class="row">
- <div class="span12">
- <!--[if lt IE 7]>
- <p class="alert alert-error">Your browser is <em>ancient!</em>
- <a href="http://browsehappy.com/">Upgrade to a different browser</a> or
- <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to
- experience this site.
- </p>
- <![endif]-->
-
- <!--[if lt IE 9]>
- <div class="alert">
- You are using an old version of Internet Explorer.
- For better and safer browsing experience please <a href="http://www.microsoft.com/IE9">upgrade IE</a>
- or install <a href="http://google.com/chrome">Google Chrome browser</a>.
- </div>
- <![endif]-->
- </div>
-
- </div>
-
- <div class="row">
- <div class="span3">
- <div class="well">
- <div ng-controller="DocsVersionsCtrl">
- <select ng-options="v as v.title group by v.group for v in docs_versions"
- ng-model="docs_version"
- ng-change="jumpToDocsVersion(docs_version)"
- class="docs-version-jump">
- </select>
- </div>
- <div class="side-navigation">
- <ul class="nav nav-list" ng-hide="page">
- <li ng-repeat="page in pages track by page.url" ng-class="navClass(page)" class="api-list-item">
- <a href="{{page.url}}" tabindex="2">{{page.shortName}}</a>
- </li>
- </ul>
-
- <ul class="nav nav-list well api-list-item" ng-repeat="namespace in namespaces track by namespace.url">
- <li class="nav-header module">
- <a class="code" href="{{namespace.url}}">{{namespace.name}}</a>
- </li>
-
- <li ng-repeat="page in namespace.errors track by page.url" ng-class="navClass(page)" class="api-list-item">
- <a href="{{page.url}}" tabindex="2">{{page.shortName}}</a>
- </li>
- </ul>
-
- <ul class="nav nav-list well api-list-item" ng-repeat="module in modules track by module.url">
- <li class="nav-header module">
- <a class="guide" href="{{URL.module}}">module</a>
- <a class="code" href="{{module.url}}">{{module.name}}</a>
- </li>
-
- <li class="nav-header section" ng-show="module.directives">
- <a href="{{URL.directive}}" class="guide">directive</a>
- </li>
- <li ng-repeat="page in module.directives track by page.url" ng-class="navClass(page)" class="api-list-item">
- <a href="{{page.url}}" tabindex="2">{{page.shortName}}</a>
- </li>
-
- <li class="nav-header section" ng-show="module.filters">
- <a href="{{URL.filter}}" class="guide">filter</a>
- </li>
- <li ng-repeat="page in module.filters track by page.url" ng-class="navClass(page)" class="api-list-item">
- <a href="{{page.url}}" tabindex="2">{{page.shortName}}</a>
- </li>
-
- <li class="nav-header section" ng-show="module.services">
- <a href="{{URL.service}}" class="guide">service</a>
- </li>
- <li ng-repeat="service in module.services track by service.instance.url" ng-class="navClass(service.instance, service.provider)" class="api-list-item">
- <a ng-show="service.provider" class="pull-right" href="{{service.provider.url}}" tabindex="2"><i class="icon-cog"></i></a>
- <a href="{{service.instance.url}}" tabindex="2">{{service.name}}</a>
- </li>
-
- <li class="nav-header section" ng-show="module.types">
- <a href="{{URL.type}}" class="guide">Types</a>
- </li>
- <li ng-repeat="page in module.types track by page.url" ng-class="navClass(page)" class="api-list-item">
- <a href="{{page.url}}" tabindex="2">{{page.shortName}}</a>
- </li>
-
- <li class="nav-header section" ng-show="module.globals">
- <a href="{{URL.api}}" class="global guide">global APIs</a>
- &nbsp;
- </li>
- <li ng-repeat="page in module.globals track by page.url" ng-class="navClass(page)" class="api-list-item">
- <a href="{{page.url}}" tabindex="2">{{page.id}}</a>
- </li>
-
- </ul>
-
- </div>
- </div>
- </div>
- <div class="span9">
-
- <ul class="breadcrumb">
- <li ng-repeat="crumb in breadcrumb">
- <span ng-hide="crumb.url">{{crumb.name}}</span>
- <a ng-show="crumb.url" href="{{crumb.url}}">{{crumb.name}}</a>
- <span ng-show="crumb.url" class="divider">/</span>
- </li>
- </ul>
-
- <div id="loading" ng-show="loading">Loading...</div>
-
- <div ng-hide="loading" ng-include src="currentPage.partialUrl" onload="afterPartialLoaded()" autoscroll class="content slide-reveal"></div>
- </div>
- </div>
- </div>
-
-
-
- <div id="fader" ng-show="subpage" style="display: none"></div>
- <div id="subpage" ng-show="subpage" style="display: none">
- <div>
- <h2>Would you like full offline support for this AngularJS Docs App?</h2>
- <a ng-click="subpage=false">&#10005;</a>
- <p>
- If you want to be able to access the entire AngularJS documentation offline, click the
- button below. This will reload the current page and trigger background downloads of all the
- necessary files (approximately 3.5MB). The next time you load the docs, the browser will
- use these cached files.
- <br><br>
- This feature is supported on all modern browsers, except for IE9 which lacks application
- cache support.
- </p>
- <button id="cacheButton" ng-click="enableOffline()">Let me have them all!</button>
- </div>
- </div>
-
- <footer class="footer">
- <div class="container">
- <p class="pull-right"><a back-to-top href="#">Back to top</a></p>
-
- <p>
- Super-powered by Google ©2010-2012
- ( <a id="version"
- ng-href="https://github.com/angular/angular.js/blob/master/CHANGELOG.md#{{versionNumber}}"
- ng-bind-template="v{{version}}">
- </a>
- <!-- TODO(i): enable
- <a ng-hide="offlineEnabled" ng-click ="subpage = true">(enable offline support)</a>
- <span ng-show="offlineEnabled">(offline support enabled)</span>
- -->
- )
- </p>
- <p>
- Code licensed under the
- <a href="https://github.com/angular/angular.js/blob/master/LICENSE" target="_blank">The
- MIT License</a>. Documentation licensed under <a
- href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.
- </p>
- </div>
- </footer>
-</div>
-
-</body>
-</html>
diff --git a/docs/src/templates/js/docs.js b/docs/src/templates/js/docs.js
deleted file mode 100644
index dad57aa5..00000000
--- a/docs/src/templates/js/docs.js
+++ /dev/null
@@ -1,933 +0,0 @@
-var docsApp = {
- controller: {},
- directive: {},
- serviceFactory: {},
- filter: {}
-};
-
-docsApp.controller.DocsVersionsCtrl = ['$scope', '$rootScope', '$window', 'NG_VERSIONS', 'NG_VERSION', function($scope, $rootScope, $window, NG_VERSIONS, NG_VERSION) {
- $scope.docs_versions = NG_VERSIONS;
- $scope.docs_version = NG_VERSIONS[0];
-
- $scope.jumpToDocsVersion = function(version) {
- var currentPagePath = '';
-
- // preserve URL path when switching between doc versions
- if (angular.isObject($rootScope.currentPage) && $rootScope.currentPage.section && $rootScope.currentPage.id) {
- currentPagePath = '/' + $rootScope.currentPage.section + '/' + $rootScope.currentPage.id;
- }
-
- $window.location = version.url + currentPagePath;
- };
-}];
-
-docsApp.controller.DocsNavigationCtrl = ['$scope', '$location', 'docsSearch', function($scope, $location, docsSearch) {
- function clearResults() {
- $scope.results = [];
- $scope.colClassName = null;
- $scope.hasResults = false;
- }
-
- $scope.search = function(q) {
- var MIN_SEARCH_LENGTH = 3;
- if(q.length >= MIN_SEARCH_LENGTH) {
- var results = docsSearch(q);
- var totalSections = 0;
- for(var i in results) {
- ++totalSections;
- }
- if(totalSections > 0) {
- $scope.colClassName = 'cols-' + totalSections;
- }
- $scope.hasResults = totalSections > 0;
- $scope.results = results;
- }
- else {
- clearResults();
- }
- if(!$scope.$$phase) $scope.$apply();
- };
- $scope.submit = function() {
- var result;
- for(var i in $scope.results) {
- result = $scope.results[i][0];
- if(result) {
- break;
- }
- }
- if(result) {
- $location.path(result.url);
- $scope.hideResults();
- }
- };
- $scope.hideResults = function() {
- clearResults();
- $scope.q = '';
- };
-}];
-
-docsApp.serviceFactory.lunrSearch = function() {
- return function(properties) {
- if (window.RUNNING_IN_NG_TEST_RUNNER) return null;
-
- var engine = lunr(properties);
- return {
- store : function(values) {
- engine.add(values);
- },
- search : function(q) {
- return engine.search(q);
- }
- };
- };
-};
-
-docsApp.serviceFactory.docsSearch = ['$rootScope','lunrSearch', 'NG_PAGES',
- function($rootScope, lunrSearch, NG_PAGES) {
- if (window.RUNNING_IN_NG_TEST_RUNNER) {
- return null;
- }
-
- var index = lunrSearch(function() {
- this.ref('id');
- this.field('title', {boost: 50});
- this.field('description', { boost : 20 });
- });
-
- angular.forEach(NG_PAGES, function(page, i) {
- var title = page.shortName;
- if(title.charAt(0) == 'n' && title.charAt(1) == 'g') {
- title = title + ' ' + title.charAt(2).toLowerCase() + title.substr(3);
- }
- index.store({
- id: i,
- title: title,
- description: page.keywords
- });
- });
-
- return function(q) {
- var results = {};
- angular.forEach(index.search(q), function(result) {
- var item = NG_PAGES[result.ref];
- var section = item.section;
- results[section] = results[section] || [];
- if(results[section].length < 15) {
- results[section].push(item);
- }
- });
- return results;
- };
-}];
-
-docsApp.directive.focused = function($timeout) {
- return function(scope, element, attrs) {
- element[0].focus();
- element.on('focus', function() {
- scope.$apply(attrs.focused + '=true');
- });
- element.on('blur', function() {
- // have to use $timeout, so that we close the drop-down after the user clicks,
- // otherwise when the user clicks we process the closing before we process the click.
- $timeout(function() {
- scope.$eval(attrs.focused + '=false');
- });
- });
- scope.$eval(attrs.focused + '=true');
- };
-};
-
-docsApp.directive.docsSearchInput = ['$document',function($document) {
- return function(scope, element, attrs) {
- var ESCAPE_KEY_KEYCODE = 27,
- FORWARD_SLASH_KEYCODE = 191;
- angular.element($document[0].body).bind('keydown', function(event) {
- if(event.keyCode == FORWARD_SLASH_KEYCODE && document.activeElement) {
- var activeElement = document.activeElement;
- var activeTagName = activeElement.nodeName.toLowerCase();
- var hasInputFocus = activeTagName == 'input' || activeTagName == 'select' ||
- activeTagName == 'option' || activeTagName == 'textarea' ||
- activeElement.hasAttribute('contenteditable');
- if(!hasInputFocus) {
- event.stopPropagation();
- event.preventDefault();
-
- var input = element[0];
- input.focus();
- }
- }
- });
-
- element.bind('keydown', function(event) {
- if(event.keyCode == ESCAPE_KEY_KEYCODE) {
- event.stopPropagation();
- event.preventDefault();
- scope.$apply(function() {
- scope.hideResults();
- });
- }
- });
- };
-}];
-
-
-docsApp.directive.code = function() {
- return { restrict:'E', terminal: true };
-};
-
-
-docsApp.directive.sourceEdit = function(getEmbeddedTemplate) {
- return {
- template: '<div class="btn-group pull-right">' +
- '<a class="btn dropdown-toggle btn-primary" data-toggle="dropdown" href>' +
- ' <i class="icon-pencil icon-white"></i> Edit<span class="caret"></span>' +
- '</a>' +
- '<ul class="dropdown-menu">' +
- ' <li><a ng-click="plunkr($event)" href="">In Plunkr</a></li>' +
- ' <li><a ng-click="fiddle($event)" href="">In JsFiddle</a></li>' +
- '</ul>' +
- '</div>',
- scope: true,
- controller: function($scope, $attrs, openJsFiddle, openPlunkr) {
- var sources = {
- module: $attrs.sourceEdit,
- deps: read($attrs.sourceEditDeps),
- html: read($attrs.sourceEditHtml),
- css: read($attrs.sourceEditCss),
- js: read($attrs.sourceEditJs),
- json: read($attrs.sourceEditJson),
- unit: read($attrs.sourceEditUnit),
- scenario: read($attrs.sourceEditScenario)
- };
- $scope.fiddle = function(e) {
- e.stopPropagation();
- openJsFiddle(sources);
- };
- $scope.plunkr = function(e) {
- e.stopPropagation();
- openPlunkr(sources);
- };
- }
- };
-
- function read(text) {
- var files = [];
- angular.forEach(text ? text.split(' ') : [], function(refId) {
- // refId is index.html-343, so we need to strip the unique ID when exporting the name
- files.push({name: refId.replace(/-\d+$/, ''), content: getEmbeddedTemplate(refId)});
- });
- return files;
- }
-};
-
-docsApp.directive.docModuleComponents = function() {
- return {
- template: ' <div class="component-breakdown">' +
- ' <h2>Module Components</h2>' +
- ' <div ng-repeat="(key, section) in components">' +
- ' <h3 class="component-heading" id="{{ section.type }}">{{ section.title }}</h3>' +
- ' <table class="definition-table">' +
- ' <tr>' +
- ' <th>Name</th>' +
- ' <th>Description</th>' +
- ' </tr>' +
- ' <tr ng-repeat="component in section.components">' +
- ' <td><a ng-href="{{ component.url }}">{{ component.shortName }}</a></td>' +
- ' <td>{{ component.shortDescription }}</td>' +
- ' </tr>' +
- ' </table>' +
- ' </div>' +
- ' </div>',
- scope : {
- module : '@docModuleComponents'
- },
- controller : ['$scope', '$anchorScroll', '$timeout', 'sections',
- function($scope, $anchorScroll, $timeout, sections) {
- var validTypes = ['property','function','directive','service','object','filter'];
- var components = {};
- angular.forEach(sections.api, function(item) {
- if(item.moduleName == $scope.module) {
- var type = item.type;
- if(type == 'object') type = 'service';
- if(validTypes.indexOf(type) >= 0) {
- components[type] = components[type] || {
- title : type,
- type : type,
- components : []
- };
- components[type].components.push(item);
- }
- }
- });
- $scope.components = components;
- $timeout($anchorScroll, 0, false);
- }]
- };
-};
-
-docsApp.directive.docTutorialNav = function(templateMerge) {
- var pages = [
- '',
- 'step_00', 'step_01', 'step_02', 'step_03', 'step_04',
- 'step_05', 'step_06', 'step_07', 'step_08', 'step_09',
- 'step_10', 'step_11', 'step_12', 'the_end'
- ];
- return {
- compile: function(element, attrs) {
- var seq = 1 * attrs.docTutorialNav,
- props = {
- seq: seq,
- prev: pages[seq],
- next: pages[2 + seq],
- diffLo: seq ? (seq - 1): '0~1',
- diffHi: seq
- };
-
- element.addClass('btn-group');
- element.addClass('tutorial-nav');
- element.append(templateMerge(
- '<a href="tutorial/{{prev}}"><li class="btn btn-primary"><i class="icon-step-backward"></i> Previous</li></a>\n' +
- '<a href="http://angular.github.com/angular-phonecat/step-{{seq}}/app"><li class="btn btn-primary"><i class="icon-play"></i> Live Demo</li></a>\n' +
- '<a href="https://github.com/angular/angular-phonecat/compare/step-{{diffLo}}...step-{{diffHi}}"><li class="btn btn-primary"><i class="icon-search"></i> Code Diff</li></a>\n' +
- '<a href="tutorial/{{next}}"><li class="btn btn-primary">Next <i class="icon-step-forward"></i></li></a>', props));
- }
- };
-};
-
-
-docsApp.directive.docTutorialReset = function() {
- function tab(name, command, id, step) {
- return '' +
- ' <div class=\'tab-pane well\' title="' + name + '" value="' + id + '">\n' +
- ' <ol>\n' +
- ' <li><p>Reset the workspace to step ' + step + '.</p>' +
- ' <pre>' + command + '</pre></li>\n' +
- ' <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>\n' +
- ' </ol>\n' +
- ' </div>\n';
- }
-
- return {
- compile: function(element, attrs) {
- var step = attrs.docTutorialReset;
- element.html(
- '<div ng-hide="show">' +
- '<p><a href="" ng-click="show=true;$event.stopPropagation()">Workspace Reset Instructions ➤</a></p>' +
- '</div>\n' +
- '<div class="tabbable" ng-show="show" ng-model="$cookies.platformPreference">\n' +
- tab('Git on Mac/Linux', 'git checkout -f step-' + step, 'gitUnix', step) +
- tab('Git on Windows', 'git checkout -f step-' + step, 'gitWin', step) +
- '</div>\n');
- }
- };
-};
-
-
-docsApp.filter.errorLink = ['$sanitize', function ($sanitize) {
- var LINKY_URL_REGEXP = /((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s\.\;\,\(\)\{\}\<\>]/g,
- MAILTO_REGEXP = /^mailto:/,
- STACK_TRACE_REGEXP = /:\d+:\d+$/;
-
- var truncate = function (text, nchars) {
- if (text.length > nchars) {
- return text.substr(0, nchars - 3) + '...';
- }
- return text;
- };
-
- return function (text, target) {
- var targetHtml = target ? ' target="' + target + '"' : '';
-
- if (!text) return text;
-
- return $sanitize(text.replace(LINKY_URL_REGEXP, function (url) {
- if (STACK_TRACE_REGEXP.test(url)) {
- return url;
- }
-
- // if we did not match ftp/http/mailto then assume mailto
- if (!/^((ftp|https?):\/\/|mailto:)/.test(url)) url = 'mailto:' + url;
-
- return '<a' + targetHtml + ' href="' + url +'">' +
- truncate(url.replace(MAILTO_REGEXP, ''), 60) +
- '</a>';
- }));
- };
-}];
-
-
-docsApp.directive.errorDisplay = ['$location', 'errorLinkFilter', function ($location, errorLinkFilter) {
- var interpolate = function (formatString) {
- var formatArgs = arguments;
- return formatString.replace(/\{\d+\}/g, function (match) {
- // Drop the braces and use the unary plus to convert to an integer.
- // The index will be off by one because of the formatString.
- var index = +match.slice(1, -1);
- if (index + 1 >= formatArgs.length) {
- return match;
- }
- return formatArgs[index+1];
- });
- };
-
- return {
- link: function (scope, element, attrs) {
- var search = $location.search(),
- formatArgs = [attrs.errorDisplay],
- i;
-
- for (i = 0; angular.isDefined(search['p'+i]); i++) {
- formatArgs.push(search['p'+i]);
- }
- element.html(errorLinkFilter(interpolate.apply(null, formatArgs), '_blank'));
- }
- };
-}];
-
-
-/**
- * backToTop Directive
- * @param {Function} $anchorScroll
- *
- * @description Ensure that the browser scrolls when the anchor is clicked
- */
-docsApp.directive.backToTop = ['$anchorScroll', function($anchorScroll) {
- return function link(scope, element) {
- element.on('click', function(event) {
- scope.$apply($anchorScroll);
- });
- };
-}];
-
-
-docsApp.serviceFactory.angularUrls = function($document) {
- var urls = {};
-
- angular.forEach($document.find('script'), function(script) {
- var match = script.src.match(/^.*\/(angular[^\/]*\.js)$/);
- if (match) {
- urls[match[1].replace(/(\-\d.*)?(\.min)?\.js$/, '.js')] = match[0];
- }
- });
-
- return urls;
-};
-
-
-docsApp.serviceFactory.formPostData = function($document) {
- return function(url, fields) {
- var form = angular.element('<form style="display: none;" method="post" action="' + url + '" target="_blank"></form>');
- angular.forEach(fields, function(value, name) {
- var input = angular.element('<input type="hidden" name="' + name + '">');
- input.attr('value', value);
- form.append(input);
- });
- $document.find('body').append(form);
- form[0].submit();
- form.remove();
- };
-};
-
-
-docsApp.serviceFactory.prepareDefaultAppModule = function() {
- return function(content) {
- var deps = [];
- angular.forEach(content.deps, function(file) {
- if(file.name == 'angular-animate.js') {
- deps.push('ngAnimate');
- }
- });
-
- var moduleName = 'App';
- return {
- module : moduleName,
- script : "angular.module('" + moduleName + "', [" +
- (deps.length ? "'" + deps.join("','") + "'" : "") + "]);\n\n"
- };
- };
-};
-
-docsApp.serviceFactory.prepareEditorAssetTags = function(angularUrls) {
- return function(content, options) {
- options = options || {};
- var includeLocalFiles = options.includeLocalFiles;
- var html = makeScriptTag(angularUrls['angular.js']);
-
- var allFiles = [].concat(content.js, content.css, content.html, content.json);
- angular.forEach(content.deps, function(file) {
- if (file.name !== 'angular.js') {
- var isLocal = false;
- for(var i=0;i<allFiles.length;i++) {
- if(allFiles[i].name == file.name) {
- isLocal = true;
- break;
- }
- }
- if(!(isLocal && !includeLocalFiles)) {
- var assetUrl = angularUrls[file.name] || file.name;
- html += makeScriptTag(assetUrl);
- }
- }
- });
-
- if(includeLocalFiles) {
- angular.forEach(content.css, function(file, index) {
- html += makeCssLinkTag(file.name);
- });
- }
-
- return html;
-
-
- function makeScriptTag(src) {
- return '<script type="text/javascript" src="' + src + '"></script>\n';
- };
-
- function makeCssLinkTag(src) {
- return '<link rel="stylesheet" type="text/css" href="' + src + '" />\n';
- };
- };
-};
-
-
-docsApp.serviceFactory.openPlunkr = function(templateMerge, formPostData, prepareEditorAssetTags, prepareDefaultAppModule) {
- return function(content) {
- var hasRouting = false;
- angular.forEach(content.deps, function(file) {
- hasRouting = hasRouting || file.name == 'angular-route.js';
- });
- var indexHtmlContent = '<!doctype html>\n' +
- '<html ng-app="{{module}}">\n' +
- ' <head>\n' +
- '{{scriptDeps}}';
-
- if(hasRouting) {
- indexHtmlContent += '<script type="text/javascript">\n' +
- '//this is here to make plunkr work with AngularJS routing\n' +
- 'angular.element(document.getElementsByTagName(\'head\')).append(' +
- 'angular.element(\'<base href="\' + window.location.pathname + \'" />\')' +
- ');\n' +
- '</script>\n';
- }
-
- indexHtmlContent += '</head>\n' +
- ' <body>\n\n' +
- '{{indexContents}}\n\n' +
- ' </body>\n' +
- '</html>\n';
-
- indexProp = {
- module: content.module,
- scriptDeps: prepareEditorAssetTags(content, { includeLocalFiles : true }),
- indexContents: content.html[0].content
- };
-
- var allFiles = [].concat(content.js, content.css, content.html, content.json);
-
- if(!content.module) {
- var moduleData = prepareDefaultAppModule(content);
- indexProp.module = moduleData.module;
-
- var found = false;
- angular.forEach(content.js, function(file) {
- if(file.name == 'script.js') {
- file.content = moduleData.script + file.content;
- found = true;
- }
- });
- if(!found) {
- indexProp.scriptDeps += '<script type="text/javascript" src="script.js"></script>\n';
- allFiles.push({
- name : 'script.js',
- content : moduleData.script
- });
- }
- };
-
- var postData = {};
-
- angular.forEach(allFiles, function(file, index) {
- if (file.content && file.name != 'index.html') {
- postData['files[' + file.name + ']'] = file.content;
- }
- });
-
- postData['files[index.html]'] = templateMerge(indexHtmlContent, indexProp);
- postData['tags[]'] = "angularjs";
-
- postData.private = true;
- postData.description = 'AngularJS Example Plunkr';
-
- formPostData('http://plnkr.co/edit/?p=preview', postData);
- };
-};
-
-docsApp.serviceFactory.openJsFiddle = function(templateMerge, formPostData, prepareEditorAssetTags, prepareDefaultAppModule) {
- var HTML = '<div ng-app=\"{{module}}\">\n{{html:2}}</div>',
- CSS = '</style> <!-- Ugly Hack to make remote files preload in jsFiddle --> \n' +
- '{{head:0}}<style>{{css}}',
- SCRIPT = '{{script}}',
- SCRIPT_CACHE = '\n\n<!-- {{name}} -->\n<script type="text/ng-template" id="{{name}}">\n{{content:2}}</script>',
- BASE_HREF_TAG = '<!-- Ugly Hack to make AngularJS routing work inside of jsFiddle -->\n' +
- '<base href="/" />\n\n';
-
- return function(content) {
- var prop = {
- module: content.module,
- html: '',
- css: '',
- script: ''
- };
- if(!prop.module) {
- var moduleData = prepareDefaultAppModule(content);
- prop.script = moduleData.script;
- prop.module = moduleData.module;
- };
-
- angular.forEach(content.html, function(file, index) {
- if (index) {
- prop.html += templateMerge(SCRIPT_CACHE, file);
- } else {
- prop.html += file.content;
- }
- });
-
- prop.head = prepareEditorAssetTags(content, { includeLocalFiles : false });
-
- angular.forEach(content.js, function(file, index) {
- prop.script += file.content;
- });
-
- angular.forEach(content.css, function(file, index) {
- prop.css += file.content;
- });
-
- var hasRouting = false;
- angular.forEach(content.deps, function(file) {
- hasRouting = hasRouting || file.name == 'angular-route.js';
- });
-
- var compiledHTML = templateMerge(HTML, prop);
- if(hasRouting) {
- compiledHTML = BASE_HREF_TAG + compiledHTML;
- }
- formPostData("http://jsfiddle.net/api/post/library/pure/", {
- title: 'AngularJS Example',
- html: compiledHTML,
- js: templateMerge(SCRIPT, prop),
- css: templateMerge(CSS, prop)
- });
- };
-};
-
-
-docsApp.serviceFactory.sections = ['NG_PAGES', function sections(NG_PAGES) {
- var sections = {
- guide: [],
- api: [],
- tutorial: [],
- misc: [],
- error: [],
- getPage: function(sectionId, partialId) {
- var pages = sections[sectionId];
-
- partialId = partialId || 'index';
-
- for (var i = 0, ii = pages.length; i < ii; i++) {
- if (pages[i].id == partialId) {
- return pages[i];
- }
- }
- return null;
- }
- };
-
- angular.forEach(NG_PAGES, function(page) {
- page.url = page.section + '/' + page.id;
- if (page.id == 'angular.Module') {
- page.partialUrl = 'partials/api/angular.IModule.html';
- } else {
- page.partialUrl = 'partials/' + page.url + '.html';
- }
-
- sections[page.section].push(page);
- });
-
- return sections;
-}];
-
-
-docsApp.controller.DocsController = function($scope, $rootScope, $location, $window, $cookies, sections) {
- $scope.fold = function(url) {
- if(url) {
- $scope.docs_fold = '/notes/' + url;
- if(/\/build/.test($window.location.href)) {
- $scope.docs_fold = '/build/docs' + $scope.docs_fold;
- }
- window.scrollTo(0,0);
- }
- else {
- $scope.docs_fold = null;
- }
- };
- var OFFLINE_COOKIE_NAME = 'ng-offline',
- DOCS_PATH = /^\/(api)|(guide)|(misc)|(tutorial)|(error)/,
- INDEX_PATH = /^(\/|\/index[^\.]*.html)$/,
- GLOBALS = /^angular\.([^\.]+)$/,
- ERROR = /^([a-zA-Z0-9_$]+:)?([a-zA-Z0-9_$]+)$/,
- MODULE = /^((?:(?!^angular\.)[^\.])+)$/,
- MODULE_MOCK = /^angular\.mock\.([^\.]+)$/,
- MODULE_DIRECTIVE = /^((?:(?!^angular\.)[^\.])+)\.directive:([^\.]+)$/,
- MODULE_DIRECTIVE_INPUT = /^((?:(?!^angular\.)[^\.])+)\.directive:input\.([^\.]+)$/,
- MODULE_FILTER = /^((?:(?!^angular\.)[^\.])+)\.filter:([^\.]+)$/,
- MODULE_SERVICE = /^((?:(?!^angular\.)[^\.])+)\.([^\.]+?)(Provider)?$/,
- MODULE_TYPE = /^((?:(?!^angular\.)[^\.])+)\..+\.([A-Z][^\.]+)$/,
- URL = {
- module: 'guide/module',
- directive: 'guide/directive',
- input: 'api/ng.directive:input',
- filter: 'guide/dev_guide.templates.filters',
- service: 'guide/dev_guide.services',
- type: 'guide/types'
- };
-
-
- /**********************************
- Publish methods
- ***********************************/
-
- $scope.navClass = function(page1, page2) {
- return {
- last: this.$last,
- active: page1 && this.currentPage == page1 || page2 && this.currentPage == page2
- };
- };
-
- $scope.afterPartialLoaded = function() {
- var currentPageId = $location.path();
- $scope.partialTitle = $scope.currentPage.shortName;
- $window._gaq.push(['_trackPageview', currentPageId]);
- };
-
- /** stores a cookie that is used by apache to decide which manifest ot send */
- $scope.enableOffline = function() {
- //The cookie will be good for one year!
- var date = new Date();
- date.setTime(date.getTime()+(365*24*60*60*1000));
- var expires = "; expires="+date.toGMTString();
- var value = angular.version.full;
- document.cookie = OFFLINE_COOKIE_NAME + "="+value+expires+"; path=" + $location.path;
-
- //force the page to reload so server can serve new manifest file
- window.location.reload(true);
- };
-
-
-
- /**********************************
- Watches
- ***********************************/
-
- var SECTION_NAME = {
- api: 'API Reference',
- guide: 'Developer Guide',
- misc: 'Miscellaneous',
- tutorial: 'Tutorial',
- error: 'Error Reference'
- };
-
- populateComponentsList();
-
- $scope.$watch(function docsPathWatch() {return $location.path(); }, function docsPathWatchAction(path) {
- // ignore non-doc links which are used in examples
- if (DOCS_PATH.test(path)) {
- var parts = path.split('/'),
- sectionId = parts[1],
- partialId = parts.slice(2).join('/'),
- sectionName = SECTION_NAME[sectionId] || sectionId,
- page = sections.getPage(sectionId, partialId);
-
- $rootScope.currentPage = sections.getPage(sectionId, partialId);
-
- if (!$rootScope.currentPage) {
- $scope.partialTitle = 'Error: Page Not Found!';
- }
-
- populateComponentsList();
-
- // Update breadcrumbs
- var breadcrumb = $scope.breadcrumb = [],
- match;
-
- if (partialId) {
- breadcrumb.push({ name: sectionName, url: sectionId });
- if (partialId == 'angular.Module') {
- breadcrumb.push({ name: 'angular.Module' });
- } else if (match = partialId.match(GLOBALS)) {
- breadcrumb.push({ name: partialId });
- } else if (match = partialId.match(MODULE)) {
- breadcrumb.push({ name: match[1] });
- } else if (match = partialId.match(MODULE_FILTER)) {
- breadcrumb.push({ name: match[1], url: sectionId + '/' + match[1] });
- breadcrumb.push({ name: match[2] });
- } else if (match = partialId.match(MODULE_DIRECTIVE)) {
- breadcrumb.push({ name: match[1], url: sectionId + '/' + match[1] });
- breadcrumb.push({ name: match[2] });
- } else if (match = partialId.match(MODULE_DIRECTIVE_INPUT)) {
- breadcrumb.push({ name: match[1], url: sectionId + '/' + match[1] });
- breadcrumb.push({ name: 'input', url: URL.input });
- breadcrumb.push({ name: match[2] });
- } else if (match = partialId.match(MODULE_TYPE)) {
- breadcrumb.push({ name: match[1], url: sectionId + '/' + match[1] });
- breadcrumb.push({ name: match[2] });
- } else if (match = partialId.match(MODULE_SERVICE)) {
- breadcrumb.push({ name: match[1], url: sectionId + '/' + match[1] });
- breadcrumb.push({ name: match[2] + (match[3] || '') });
- } else if (match = partialId.match(MODULE_MOCK)) {
- breadcrumb.push({ name: 'angular.mock.' + match[1] });
- } else {
- breadcrumb.push({ name: page.shortName });
- }
- } else {
- breadcrumb.push({ name: sectionName });
- }
- }
- });
-
- /**********************************
- Initialize
- ***********************************/
-
- $scope.versionNumber = angular.version.full;
- $scope.version = angular.version.full + " " + angular.version.codeName;
- $scope.subpage = false;
- $scope.offlineEnabled = ($cookies[OFFLINE_COOKIE_NAME] == angular.version.full);
- $scope.futurePartialTitle = null;
- $scope.loading = 0;
- $scope.URL = URL;
- $scope.$cookies = $cookies;
-
- $cookies.platformPreference = $cookies.platformPreference || 'gitUnix';
-
- if (!$location.path() || INDEX_PATH.test($location.path())) {
- $location.path('/api').replace();
- }
- // bind escape to hash reset callback
- angular.element(window).on('keydown', function(e) {
- if (e.keyCode === 27) {
- $scope.$apply(function() {
- $scope.subpage = false;
- });
- }
- });
-
- /**********************************
- Private methods
- ***********************************/
-
- function populateComponentsList() {
- var area = $location.path().split('/')[1];
- area = /^index-\w/.test(area) ? 'api' : area;
- var moduleCache = {},
- namespaceCache = {},
- pages = sections[area],
- modules = $scope.modules = [],
- namespaces = $scope.namespaces = [],
- globalErrors = $scope.globalErrors = [],
- otherPages = $scope.pages = [],
- search = $scope.search;
-
- angular.forEach(pages, function(page) {
- var match,
- id = page.id;
-
- if (page.id == 'index') {
- //skip
- } else if (page.section != 'api') {
- if (page.section === 'error') {
- match = id.match(ERROR);
- if (match[1] !== undefined) {
- namespace(match[1].replace(/:/g, '')).errors.push(page);
- } else {
- globalErrors.push(page);
- }
- } else {
- otherPages.push(page);
- }
- } else if (id == 'angular.Module') {
- module('ng').types.push(page);
- } else if (match = id.match(GLOBALS)) {
- module('ng').globals.push(page);
- } else if (match = id.match(MODULE)) {
- module(match[1]);
- } else if (match = id.match(MODULE_FILTER)) {
- module(match[1]).filters.push(page);
- } else if (match = id.match(MODULE_DIRECTIVE)) {
- module(match[1]).directives.push(page);
- } else if (match = id.match(MODULE_DIRECTIVE_INPUT)) {
- module(match[1]).directives.push(page);
- } else if (match = id.match(MODULE_SERVICE)) {
- module(match[1]).service(match[2])[match[3] ? 'provider' : 'instance'] = page;
- } else if (match = id.match(MODULE_TYPE)) {
- module(match[1]).types.push(page);
- } else if (match = id.match(MODULE_MOCK)) {
- module('ngMock').globals.push(page);
- }
-
- });
-
- function module(name) {
- var module = moduleCache[name];
-
- if (!module) {
- module = moduleCache[name] = {
- name: name,
- url: 'api/' + name,
- globals: [],
- directives: [],
- services: [],
- service: function(name) {
- var service = moduleCache[this.name + ':' + name];
- if (!service) {
- service = {name: name};
- moduleCache[this.name + ':' + name] = service;
- this.services.push(service);
- }
- return service;
- },
- types: [],
- filters: []
- };
- modules.push(module);
- }
- return module;
- }
-
- function namespace(name) {
- var namespace = namespaceCache[name];
-
- if (!namespace) {
- namespace = namespaceCache[name] = {
- name: name,
- url: 'error/' + name,
- errors: []
- };
- namespaces.push(namespace);
- }
- return namespace;
- }
- }
-};
-
-
-angular.module('docsApp', ['ngResource', 'ngRoute', 'ngCookies', 'ngSanitize', 'ngAnimate', 'bootstrap', 'bootstrapPrettify', 'docsData']).
- config(function($locationProvider) {
- $locationProvider.html5Mode(true).hashPrefix('!');
- }).
- factory(docsApp.serviceFactory).
- directive(docsApp.directive).
- controller(docsApp.controller);
-
-angular.forEach(docsApp.filter, function (docsAppFilter, filterName) {
- angular.module('docsApp').filter(filterName, docsAppFilter);
-});
diff --git a/docs/src/templates/offline.html b/docs/src/templates/offline.html
deleted file mode 100644
index f52ca6e5..00000000
--- a/docs/src/templates/offline.html
+++ /dev/null
@@ -1,4 +0,0 @@
-<h2>OFFLINE</h2>
-
-<p>This page is currently unavailable because your are offline.</p>
-<p>Please connect to the Internet and reload the page.</p>