Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6f7953c
chore(docs): add `getComponentPath` helper service
petebacondarwin Nov 22, 2014
3694e03
chore(docs): remove unused cookie service and module
petebacondarwin Nov 22, 2014
7cd97cf
chore(docs): update deployments to use angular material and not boots…
petebacondarwin Nov 22, 2014
ea66eba
chore(docs): replace "Edit in Plunker" button with Angular Material
jesselpalmer Dec 3, 2014
773cfd7
docs(app): minor refactoring of 'docs/app/src/*'
gkalpak Nov 28, 2014
333b0ba
docs(app): refactor the Docs App based on the MD prototype
gkalpak Dec 5, 2014
54a9cf7
docs(app): fix styling of left sidenav, add FontAwesome
gkalpak Dec 7, 2014
cc1b811
docs(app): make tests pass
gkalpak Dec 8, 2014
c5d2609
docs(app): matches anchor tags to bootstrap
jesselpalmer Dec 10, 2014
81ea393
docs(app): fixes tabbing
jesselpalmer Dec 10, 2014
bef8dc4
docs(app): adding a mobile first breadcrumb solution
joshkurz Dec 10, 2014
296ca40
docs(app): adds roboto font
jesselpalmer Dec 11, 2014
b99cc64
docs(app): updates typography
jesselpalmer Dec 16, 2014
bb2a130
docs(app): replaces font px w/ %
jesselpalmer Dec 16, 2014
11601c7
docs(app): adds stylesheets to deployment files
jesselpalmer Dec 16, 2014
5587aa8
docs(app): deletes icon
jesselpalmer Dec 25, 2014
c3f19b0
docs(app): adds hr
jesselpalmer Dec 25, 2014
d8aa000
docs(app): removes material icon reference
jesselpalmer Dec 25, 2014
83ba629
docs(app): makes minor updates
jesselpalmer Jan 6, 2015
e2f026f
docs(app): increments year
jesselpalmer Jan 11, 2015
e203264
docs(app): fixes material build
jesselpalmer Jan 17, 2015
0af3570
adds angulario resources
jesselpalmer May 10, 2015
1b3a205
angular.io styles added
jesselpalmer May 27, 2015
493e7db
removes unneeded angular.io files
jesselpalmer May 27, 2015
690c4e5
add css styles to deployment
jesselpalmer May 27, 2015
2618b7f
docs(app): merges master into materialize branch
jesselpalmer May 28, 2015
73cc83b
Merge pull request #11955 from jesselpalmer/updates-branch-with-master
jesselpalmer May 28, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/app/assets/css/angular_io.css

Large diffs are not rendered by default.

757 changes: 126 additions & 631 deletions docs/app/assets/css/docs.css

Large diffs are not rendered by default.

696 changes: 696 additions & 0 deletions docs/app/assets/css/docs_old.css

Large diffs are not rendered by default.

1,672 changes: 1,672 additions & 0 deletions docs/app/assets/font-awesome/css/font-awesome.css

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions docs/app/assets/font-awesome/css/font-awesome.min.css

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
520 changes: 520 additions & 0 deletions docs/app/assets/font-awesome/fonts/fontawesome-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
13 changes: 7 additions & 6 deletions docs/app/src/app.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
'use strict';

angular.module('docsApp', [
'ngRoute',
'ngCookies',
'ngSanitize',
'ngAnimate',
'ngMaterial',
'HeaderController',
'FooterController',
'DocsController',
'ViewUtils',
'versionsData',
'pagesData',
'navData',
Expand All @@ -13,8 +15,7 @@ angular.module('docsApp', [
'search',
'tutorials',
'versions',
'bootstrap',
'ui.bootstrap.dropdown'
'responsiveMenu'
])

.config(['$locationProvider', function($locationProvider) {
Expand Down
44 changes: 30 additions & 14 deletions docs/app/src/directives.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
angular.module('directives', [])

/**
* backToTop Directive
* @param {Function} $anchorScroll
* scrollTo Directive
*
* @description Ensure that the browser scrolls when the anchor is clicked
* @description
* Upon click, scroll to the target element (identified by the selector provided via the `scroll-to`
* attribute).
*/
.directive('backToTop', ['$anchorScroll', '$location', function($anchorScroll, $location) {
return function link(scope, element) {
element.on('click', function(event) {
$location.hash('');
scope.$apply($anchorScroll);
});
.directive('scrollTo', ['$document', '$location', function($document, $location) {
var doc = $document[0];

return {
restrict: 'A',
link: function scrollToPostLink(scope, elem, attrs) {
elem.on('click', onClick);

function onClick() {
var targetSelector = attrs.scrollTo;
var targetElem = doc.querySelector(targetSelector);

if (targetElem) {
targetElem.scrollIntoView();
}
}
}
};
}])


.directive('code', function() {
.directive('code', ['$window', function($window) {
return {
restrict: 'E',
terminal: true,
Expand All @@ -25,13 +37,17 @@ angular.module('directives', [])
var match = /lang-(\S+)/.exec(element[0].className);
var lang = match && match[1];
var html = element.html();
element.html(window.prettyPrintOne(html, lang, linenums));
element.html($window.prettyPrintOne(html, lang, linenums));
}
};
})
}])


// TODO: Probably not needed any more
.directive('scrollYOffsetElement', ['$anchorScroll', function($anchorScroll) {
return function(scope, element) {
$anchorScroll.yOffset = element;
return {
link: function(scope, element) {
$anchorScroll.yOffset = element;
}
};
}]);
20 changes: 12 additions & 8 deletions docs/app/src/docs.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
angular.module('DocsController', [])
angular.module('DocsController', ['ViewUtils'])

.controller('DocsController', [
'$scope', '$rootScope', '$location', '$window', '$cookies', 'openPlunkr',
'$scope', '$rootScope', '$location', '$window', 'openPlunkr', 'ViewUtils',
'NG_PAGES', 'NG_NAVIGATION', 'NG_VERSION',
function($scope, $rootScope, $location, $window, $cookies, openPlunkr,
function($scope, $rootScope, $location, $window, openPlunkr, ViewUtils,
NG_PAGES, NG_NAVIGATION, NG_VERSION) {

$scope.vu = ViewUtils;

$scope.openPlunkr = openPlunkr;

$scope.docsVersion = NG_VERSION.isSnapshot ? 'snapshot' : NG_VERSION.version;

$scope.isCurrentPath = function(path) {
return this.currentPage && path && (this.currentPage.path === path);
};

$scope.navClass = function(navItem) {
return {
active: navItem.href && this.currentPage && this.currentPage.path,
Expand All @@ -25,13 +31,13 @@ angular.module('DocsController', [])
$window._gaq.push(['_trackPageview', pagePath]);
});

$scope.$watch(function docsPathWatch() {return $location.path(); }, function docsPathWatchAction(path) {
$scope.$watch(function docsPathWatch() { return $location.path(); }, function docsPathWatchAction(path) {

path = path.replace(/^\/?(.+?)(\/index)?\/?$/, '$1');

currentPage = $scope.currentPage = NG_PAGES[path];
var currentPage = $scope.currentPage = NG_PAGES[path];

if ( currentPage ) {
if (currentPage) {
$scope.partialPath = 'partials/' + path + '.html';
$scope.currentArea = NG_NAVIGATION[currentPage.area];
var pathParts = currentPage.path.split('/');
Expand All @@ -53,8 +59,6 @@ angular.module('DocsController', [])
Initialize
***********************************/

$scope.versionNumber = angular.version.full;
$scope.version = angular.version.full + " " + angular.version.codeName;
$scope.loading = 0;


Expand Down
14 changes: 7 additions & 7 deletions docs/app/src/errors.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
angular.module('errors', ['ngSanitize'])

.filter('errorLink', ['$sanitize', function ($sanitize) {
.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) {
var truncate = function(text, nchars) {
if (text.length > nchars) {
return text.substr(0, nchars - 3) + '...';
}
return text;
};

return function (text, target) {
return function(text, target) {
var targetHtml = target ? ' target="' + target + '"' : '';

if (!text) return text;

return $sanitize(text.replace(LINKY_URL_REGEXP, function (url) {
return $sanitize(text.replace(LINKY_URL_REGEXP, function(url) {
if (STACK_TRACE_REGEXP.test(url)) {
return url;
}
Expand Down Expand Up @@ -48,10 +48,10 @@ angular.module('errors', ['ngSanitize'])
};

return {
link: function (scope, element, attrs) {
link: function(scope, element, attrs) {
var search = $location.search(),
formatArgs = [attrs.errorDisplay],
i;
formatArgs = [attrs.errorDisplay],
i;

for (i = 0; angular.isDefined(search['p'+i]); i++) {
formatArgs.push(search['p'+i]);
Expand Down
12 changes: 5 additions & 7 deletions docs/app/src/examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ angular.module('examples', [])

.factory('formPostData', ['$document', function($document) {
return function(url, newWindow, fields) {
/**
* If the form posts to target="_blank", pop-up blockers can cause it not to work.
* If a user choses to bypass pop-up blocker one time and click the link, they will arrive at
* a new default plnkr, not a plnkr with the desired template. Given this undesired behavior,
* some may still want to open the plnk in a new window by opting-in via ctrl+click. The
* newWindow param allows for this possibility.
/*
* Form previously posted to target="_blank", but pop-up blockers were causing this to not work.
* If a user chose to bypass pop-up blocker one time and click the link, they would arrive at
* a new default plnkr, not a plnkr with the desired template.
*/
var target = newWindow ? '_blank' : '_self';
var form = angular.element('<form style="display: none;" method="post" action="' + url + '" target="' + target + '"></form>');
Expand Down Expand Up @@ -52,7 +50,7 @@ angular.module('examples', [])
// The manifests provide the production index file but Plunkr wants
// a straight index.html
if (filename === "index-production.html") {
filename = "index.html"
filename = "index.html";
}

return {
Expand Down
11 changes: 11 additions & 0 deletions docs/app/src/footer-controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
angular.
module('FooterController', []).
controller('FooterController', FooterController);

function FooterController() {
var vm = this;
var v = angular.version;

vm.versionNumber = v.full;
vm.version = v.full + ' ' + v.codeName;
}
36 changes: 36 additions & 0 deletions docs/app/src/header-controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
angular.
module('HeaderController', []).
controller('HeaderController', HeaderController);

function HeaderController() {
var vm = this;

vm.learnItems = [
{label: 'Why AngularJS?', url: '//angularjs.org/'},
{label: 'Watch', url: '//www.youtube.com/user/angularjs'},
{label: 'Tutorial', url: 'tutorial'},
{label: 'Case Studies', url: '//builtwith.angularjs.org/'},
{label: 'Seed App project template', url: '//github.com/angular/angular-seed'},
{label: 'FAQ', url: 'misc/faq'}
];

vm.developItems = [
{label: 'Why AngularJS?', url: '//angularjs.org/'},
{label: 'Tutorial', url: 'tutorial'},
{label: 'Developer Guide', url: 'guide'},
{label: 'API Reference', url: 'api'},
{label: 'Error Reference', url: 'error'},
{label: 'Contribute', url: 'misc/contribute'},
{label: 'Download', url: '//code.angularjs.org/'}
];

vm.discussItems = [
{label: 'Blog', url: '//blog.angularjs.org'},
{label: 'Mailing List', url: '//groups.google.com/group/angular'},
{label: 'Chat Room', url: '//webchat.freenode.net/?channels=angularjs&uio=d4'},
{label: 'Twitter', url: '//twitter.com/#!/angularjs'},
{label: 'Google+', url: '//plus.google.com/110323587230527980117'},
{label: 'GitHub', url: '//github.com/angular/angular.js'},
{label: 'Issue Tracker', url: '//github.com/angular/angular.js/issues'},
];
}
55 changes: 55 additions & 0 deletions docs/app/src/responsive-menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
angular.
module('responsiveMenu', ['ngMaterial', 'ViewUtils']).
directive('responsiveMenu', responsiveMenuDirective);

responsiveMenuDirective.$inject = ['$mdBottomSheet', 'ViewUtils'];
function responsiveMenuDirective($mdBottomSheet, ViewUtils) {
// TODO: Create showFns for various sizes (not necessarily all)
var showFns = {
// 'gt-lg': '',
// 'lg': '',
// 'md': '',
'sm': function showSmFn(items) {
$mdBottomSheet.show({
template: _getResponsiveMenuSmTemplate(),
controller: ['$mdBottomSheet', '$scope',
function ResponsiveMenuSmController($mdBottomSheet, $scope) {
$scope.items = items;
$scope.onItemClick = $mdBottomSheet.hide.bind($mdBottomSheet);
}
]
});
}
};

var defaultShowFn = showFns.sm;

return {
restrict: 'A',
scope: {
items: '=rmItems'
},
controller: ['$element', '$scope', function ResponsiveMenuController($element, $scope) {
$element.on('click', onClick.bind(this));

function onClick(evt) {
var showFn = ViewUtils.getValueForSize(showFns, defaultShowFn);
showFn($scope.items);
}
}]
};
}

function _getResponsiveMenuSmTemplate() {
return [
'<md-bottom-sheet>',
' <md-list>',
' <md-item ng-repeat="item in items">',
' <md-button aria-label="{{item.label}}" ng-click="onItemClick(item)">',
' <a ng-href="{{item.url}}">{{item.label}}</a>',
' </md-button>',
' </md-item>',
' </md-list>',
'</md-bottom-sheet>',
''].join('\n');
}
Loading