The page you are attempting to access does not exist.
6 |GNU Public License 2016 | GitHub
-------------------------------------------------------------------------------- /src/reStart-app/modules/header/Header.ctrl.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular 5 | .module('reStart') 6 | .controller('HeaderCtrl', HeaderCtrl); 7 | 8 | HeaderCtrl.$inject = ['$location', 'JSONData']; 9 | 10 | function HeaderCtrl($location, JSONData) { 11 | // controllerAs ViewModel 12 | var header = this; 13 | 14 | // bindable members 15 | header.indexIsActive = indexIsActive; 16 | header.navIsActive = navIsActive; 17 | 18 | _init(); 19 | 20 | /** 21 | * INIT function executes procedural code 22 | * 23 | * @private 24 | */ 25 | function _init() { 26 | // activate controller 27 | _activate(); 28 | } 29 | 30 | /** 31 | * Controller activate 32 | * Get JSON data 33 | * 34 | * @returns {*} 35 | * @private 36 | */ 37 | function _activate() { 38 | // get the data from JSON 39 | return JSONData.getLocalData().then(_getJsonSuccess); 40 | } 41 | 42 | /** 43 | * Successful promise data 44 | * 45 | * @param data {json} 46 | * @private 47 | */ 48 | function _getJsonSuccess(data) { 49 | header.json = data; 50 | return header.json; 51 | } 52 | 53 | /** 54 | * Apply class to index nav if active 55 | * 56 | * @param {string} path 57 | */ 58 | function indexIsActive(path) { 59 | // path should be '/' 60 | return $location.path() === path; 61 | } 62 | 63 | /** 64 | * Apply class to currently active nav item 65 | * 66 | * @param {string} path 67 | */ 68 | function navIsActive(path) { 69 | return $location.path().substr(0, path.length) === path; 70 | } 71 | } 72 | 73 | }()); -------------------------------------------------------------------------------- /src/reStart-app/modules/header/header.tpl.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reStart-app/modules/header/navControl.dir.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular 5 | .module('reStart') 6 | .directive('navControl', navControl); 7 | 8 | navControl.$inject = ['$window', 'resize']; 9 | 10 | function navControl($window, resize) { 11 | // return directive 12 | return { 13 | restrict: 'EA', 14 | link: navControlLink 15 | }; 16 | 17 | /** 18 | * navControl LINK function 19 | * 20 | * @param $scope 21 | * @param $element 22 | */ 23 | function navControlLink($scope, $element) { 24 | // private variables 25 | var _$layoutCanvas = $element; 26 | 27 | // data model 28 | $scope.nav = {}; 29 | $scope.nav.navOpen; 30 | $scope.nav.toggleNav = toggleNav; 31 | 32 | _init(); 33 | 34 | /** 35 | * INIT function executes procedural code 36 | * 37 | * @private 38 | */ 39 | function _init() { 40 | // initialize debounced resize 41 | var _rs = resize.init({ 42 | scope: $scope, 43 | resizedFn: _resized, 44 | debounce: 100 45 | }); 46 | 47 | $scope.$on('$locationChangeStart', _$locationChangeStart); 48 | $scope.$on('enter-large', _enterLarge); 49 | $scope.$on('exit-large', _exitLarge); 50 | } 51 | 52 | /** 53 | * Resized window (debounced) 54 | * 55 | * @private 56 | */ 57 | function _resized() { 58 | _$layoutCanvas.css({ 59 | minHeight: $window.innerHeight + 'px' 60 | }); 61 | } 62 | 63 | /** 64 | * Open mobile navigation 65 | * 66 | * @private 67 | */ 68 | function _openNav() { 69 | _$layoutCanvas 70 | .removeClass('nav-closed') 71 | .addClass('nav-open'); 72 | 73 | $scope.navOpen = true; 74 | } 75 | 76 | /** 77 | * Close mobile navigation 78 | * 79 | * @private 80 | */ 81 | function _closeNav() { 82 | _$layoutCanvas 83 | .removeClass('nav-open') 84 | .addClass('nav-closed'); 85 | 86 | $scope.navOpen = false; 87 | } 88 | 89 | /** 90 | * Toggle nav open/closed 91 | */ 92 | function toggleNav() { 93 | if (!$scope.navOpen) { 94 | _openNav(); 95 | } else { 96 | _closeNav(); 97 | } 98 | } 99 | 100 | /** 101 | * When changing location, close the nav if it's open 102 | */ 103 | function _$locationChangeStart() { 104 | if ($scope.navOpen) { 105 | _closeNav(); 106 | } 107 | } 108 | 109 | /** 110 | * Function to execute when entering large media query 111 | * Disable menu toggling and remove body classes 112 | * 113 | * @private 114 | */ 115 | function _enterLarge(mq) { 116 | // unbind function to toggle mobile navigation open/closed 117 | $scope.nav.toggleNav = null; 118 | 119 | _$layoutCanvas.removeClass('nav-closed nav-open'); 120 | } 121 | 122 | /** 123 | * Function to execute when exiting large media query 124 | * Close nav and set up menu toggling functionality 125 | * 126 | * @private 127 | */ 128 | function _exitLarge(mq) { 129 | _closeNav(); 130 | 131 | // bind function to toggle mobile navigation open/closed 132 | $scope.nav.toggleNav = toggleNav; 133 | } 134 | } 135 | } 136 | 137 | }()); -------------------------------------------------------------------------------- /src/reStart-app/pages/error404/Error404.ctrl.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular 5 | .module('reStart') 6 | .controller('Error404Ctrl', Error404Ctrl); 7 | 8 | Error404Ctrl.$inject = ['$scope', 'Metadata']; 9 | 10 | function Error404Ctrl($scope, Metadata) { 11 | var e404 = this; 12 | 13 | // bindable members 14 | e404.title = '404 - Page Not Found'; 15 | 16 | _init(); 17 | 18 | /** 19 | * INIT function executes procedural code 20 | * 21 | * @private 22 | */ 23 | function _init() { 24 | // set pageThe page you are attempting to access does not exist.
6 |The following view is manipulated by the current media query. Resize your browser window to see the 22 | display change.
23 | 24 |Display: {{home.viewformat === 'large' ? 'Table (large view)' : 'List (small view)'}}
25 | 26 |Animal | 5 |Class | 6 |
---|---|
{{::animal.name}} | 11 |{{::animal.class}} | 12 |
This is a subpage.
6 | 7 |
8 | Here are some icons from an SVG icon sprite:
9 |
I am a template included by a directive. {{sd.jsonData.summary}}
3 | 4 |