From 6c20ec193f11aa647be1b2ad2ac5b3e7c2894bd7 Mon Sep 17 00:00:00 2001 From: Matias Niemelä Date: Tue, 22 Oct 2013 00:14:39 -0400 Subject: fix(ngdocs): remove the side search bar BREAKING CHANGE The side search bar on the docs page has been removed in favor of the top search bar. --- docs/src/templates/css/animations.css | 42 -------------------------- docs/src/templates/css/docs.css | 24 +++++++-------- docs/src/templates/index.html | 36 +++++++---------------- docs/src/templates/js/docs.js | 55 +++++------------------------------ 4 files changed, 31 insertions(+), 126 deletions(-) (limited to 'docs/src') diff --git a/docs/src/templates/css/animations.css b/docs/src/templates/css/animations.css index 7c404980..7bf1e2e8 100644 --- a/docs/src/templates/css/animations.css +++ b/docs/src/templates/css/animations.css @@ -37,40 +37,6 @@ opacity:1; } -.expand.ng-enter, -.expand.ng-move, -.expand.ng-leave { - -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; -} -.expand.ng-move, -.expand.ng-enter { - opacity:0; - line-height:0; - height:0!important; -} -.expand.ng-move.ng-move-active, -.expand.ng-enter.ng-enter-active { - opacity:1; - line-height:20px; - height:20px!important; -} - -.expand.ng-leave { - opacity:1; - height:20px; -} -.expand.ng-leave.ng-leave-active { - opacity:0; - height:0; -} - -.fade-in.ng-enter, -.fade-in.ng-move, -.fade-in.ng-hide-add, -.fade-in.ng-hide-remove, .foldout.ng-enter, .foldout.ng-move, .foldout.ng-hide-add, @@ -81,10 +47,6 @@ transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all; } -.fade-in.ng-enter, -.fade-in.ng-move, -.fade-in.ng-hide-remove, -.fade-in.ng-hide-add.ng-hide-active, .foldout.ng-hide-remove, .foldout.ng-hide-add.ng-hide-active, .foldout.ng-enter, @@ -92,10 +54,6 @@ opacity:0; } -.fade-in.ng-enter.ng-enter-active, -.fade-in.ng-move.ng-move-active, -.fade-in.ng-hide-remove.ng-hide-remove-active, -.fade-in.ng-hide-add, .foldout.ng-move.ng-move-active, .foldout.ng-hide-remove.ng-hide-remove-active, .foldout.ng-hide-add, diff --git a/docs/src/templates/css/docs.css b/docs/src/templates/css/docs.css index 6182527f..430ff4c9 100644 --- a/docs/src/templates/css/docs.css +++ b/docs/src/templates/css/docs.css @@ -45,62 +45,62 @@ /* =============================== */ -.form-search .dropdown-menu { +.side-navigation .dropdown-menu { margin-left: 10px; } -.form-search .code { +.side-navigation .code { font-family: monospace; font-weight: bold; font-size: 13px; color: black; } -.form-search > ul.nav > li.module { +.side-navigation > ul.nav > li.module { background-color: #d3d3d3; } -.form-search > ul.nav > li.section { +.side-navigation > ul.nav > li.section { background-color: #ebebeb; min-height: 14px; } -.form-search > ul.nav > li.last { +.side-navigation > ul.nav > li.last { padding-bottom: 1em; } -.form-search > ul.nav > li.last + li.api-list-item { +.side-navigation > ul.nav > li.last + li.api-list-item { margin-top:-1em; padding-bottom: 1em; } -.form-search .well { +.side-navigation .well { border-color: #d3d3d3; padding-top: 0; padding-bottom: 0; margin-bottom: 15px; } -.form-search .well .nav-header { +.side-navigation .well .nav-header { text-transform: none; margin-top: 0; margin-left: -15px; margin-right: -15px; } -.form-search .well .nav-header a { +.side-navigation .well .nav-header a { text-transform: none; color: black; } -.form-search .well .nav-header a:hover { +.side-navigation .well .nav-header a:hover { background-color: inherit; } -.form-search .well li { +.side-navigation .well li { line-height: 14px; } -.form-search .well .guide { +.side-navigation .well .guide { float: right; padding-top: 0; color: gray; diff --git a/docs/src/templates/index.html b/docs/src/templates/index.html index e3678054..b40e9d31 100644 --- a/docs/src/templates/index.html +++ b/docs/src/templates/index.html @@ -256,38 +256,24 @@ class="docs-version-jump"> -
diff --git a/docs/src/templates/js/docs.js b/docs/src/templates/js/docs.js index fb095090..beec604b 100644 --- a/docs/src/templates/js/docs.js +++ b/docs/src/templates/js/docs.js @@ -622,10 +622,6 @@ docsApp.controller.DocsController = function($scope, $location, $window, $cookie }; }; - $scope.submitForm = function() { - $scope.bestMatch && $location.path($scope.bestMatch.page.url); - }; - $scope.afterPartialLoaded = function() { var currentPageId = $location.path(); $scope.partialTitle = $scope.currentPage.shortName; @@ -660,6 +656,9 @@ docsApp.controller.DocsController = function($scope, $location, $window, $cookie cookbook: 'Examples', 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)) { @@ -675,9 +674,6 @@ docsApp.controller.DocsController = function($scope, $location, $window, $cookie $scope.partialTitle = 'Error: Page Not Found!'; } - updateSearch(); - - // Update breadcrumbs var breadcrumb = $scope.breadcrumb = [], match; @@ -717,10 +713,6 @@ docsApp.controller.DocsController = function($scope, $location, $window, $cookie } }); - $scope.$watch('search', updateSearch); - - - /********************************** Initialize ***********************************/ @@ -752,27 +744,22 @@ docsApp.controller.DocsController = function($scope, $location, $window, $cookie Private methods ***********************************/ - function updateSearch() { + function populateComponentsList() { + var area = $location.path().split('/')[1]; + area = /^index-\w/.test(area) ? 'api' : area; var moduleCache = {}, namespaceCache = {}, - pages = sections[$location.path().split('/')[1]], + pages = sections[area], modules = $scope.modules = [], namespaces = $scope.namespaces = [], globalErrors = $scope.globalErrors = [], otherPages = $scope.pages = [], - search = $scope.search, - bestMatch = {page: null, rank:0}; + search = $scope.search; angular.forEach(pages, function(page) { var match, id = page.id; - if (!(match = rank(page, search))) return; - - if (match.rank > bestMatch.rank) { - bestMatch = match; - } - if (page.id == 'index') { //skip } else if (page.section != 'api') { @@ -808,10 +795,6 @@ docsApp.controller.DocsController = function($scope, $location, $window, $cookie }); - $scope.bestMatch = bestMatch; - - /*************/ - function module(name) { var module = moduleCache[name]; @@ -852,28 +835,6 @@ docsApp.controller.DocsController = function($scope, $location, $window, $cookie } return namespace; } - - function rank(page, terms) { - var ranking = {page: page, rank:0}, - keywords = page.keywords, - title = page.shortName.toLowerCase(); - - terms && angular.forEach(terms.toLowerCase().split(' '), function(term) { - var index; - - if (ranking) { - if (keywords.indexOf(term) == -1) { - ranking = null; - } else { - ranking.rank ++; // one point for each term found - if ((index = title.indexOf(term)) != -1) { - ranking.rank += 20 - index; // ten points if you match title - } - } - } - }); - return ranking; - } } -- cgit v1.2.3