├── .editorconfig ├── .gitignore ├── LICENSE ├── README.md ├── docs ├── en │ ├── README.md │ └── rest_url_design.md └── pt-Br │ ├── README.md │ └── rest_url_design.md ├── gulpfile.js ├── package.json ├── pom.xml ├── publisher ├── config.js ├── gulp │ ├── helpers │ │ ├── $.js │ │ └── loadTasks.js │ ├── index.js │ └── tasks │ │ ├── clean.js │ │ ├── copy.js │ │ ├── default.js │ │ ├── init.js │ │ ├── jshint.js │ │ ├── lintspaces.js │ │ ├── publish.js │ │ ├── shell.js │ │ └── validate.js ├── gulpfile.js └── package.json ├── src ├── app │ ├── about │ │ ├── controller.js │ │ ├── module.js │ │ ├── package.js │ │ ├── states.js │ │ ├── templates │ │ │ ├── backend.html │ │ │ ├── frontend.html │ │ │ ├── page.html │ │ │ ├── tests_e2e.html │ │ │ └── tests_unit.html │ │ └── tests │ │ │ ├── e2e │ │ │ ├── page.object.js │ │ │ └── page.spec.js │ │ │ └── unit │ │ │ ├── controller.spec.js │ │ │ ├── module.spec.js │ │ │ ├── package.js │ │ │ └── states.spec.js │ ├── bookmarks │ │ ├── controllers │ │ │ ├── edit.js │ │ │ ├── list.js │ │ │ ├── new.js │ │ │ └── search.js │ │ ├── mock │ │ │ ├── allow-pass.js │ │ │ ├── data.js │ │ │ ├── package.js │ │ │ └── url-interceptors.js │ │ ├── module.js │ │ ├── package.js │ │ ├── resources │ │ │ ├── rest.js │ │ │ └── search.js │ │ ├── states.js │ │ ├── templates │ │ │ ├── form.html │ │ │ ├── list.html │ │ │ ├── search.html │ │ │ └── table.html │ │ └── tests │ │ │ ├── e2e │ │ │ ├── form.spec.js │ │ │ ├── list.spec.js │ │ │ ├── page.object.js │ │ │ └── search.spec.js │ │ │ └── unit │ │ │ ├── controllers │ │ │ ├── edit.spec.js │ │ │ ├── list.spec.js │ │ │ ├── new.spec.js │ │ │ └── search.spec.js │ │ │ ├── module.spec.js │ │ │ ├── package.js │ │ │ ├── resources │ │ │ ├── rest.spec.js │ │ │ └── search.spec.js │ │ │ └── states.spec.js │ ├── help │ │ ├── controller.js │ │ ├── mock │ │ │ └── allow-pass-github.js │ │ ├── module.js │ │ ├── package.js │ │ ├── states.js │ │ ├── template.html │ │ └── tests │ │ │ ├── e2e │ │ │ ├── page.object.js │ │ │ └── page.spec.js │ │ │ └── unit │ │ │ ├── controller.spec.js │ │ │ ├── module.spec.js │ │ │ ├── package.js │ │ │ └── states.spec.js │ ├── home │ │ ├── controller.js │ │ ├── module.js │ │ ├── package.js │ │ ├── states.js │ │ ├── template.html │ │ └── tests │ │ │ ├── e2e │ │ │ ├── page.object.js │ │ │ └── page.spec.js │ │ │ └── unit │ │ │ ├── controller.spec.js │ │ │ ├── module.spec.js │ │ │ ├── package.js │ │ │ └── states.spec.js │ └── main │ │ ├── controller.js │ │ ├── module.js │ │ ├── package.js │ │ ├── states.js │ │ ├── templates │ │ ├── 404.html │ │ ├── cache.js │ │ ├── footer.html │ │ ├── layout.html │ │ └── navbar.html │ │ └── tests │ │ └── unit │ │ ├── controller.spec.js │ │ ├── module.spec.js │ │ ├── package.js │ │ └── states.spec.js ├── index.html ├── less │ ├── app.less │ ├── loading_app.less │ └── ui.bootstrap.less ├── ng.app.js ├── require.config.js ├── require.mock.load.js ├── require.unit.load.js ├── shared │ ├── fallback │ │ └── ie.js │ ├── fend │ │ ├── input-utils │ │ │ ├── directives │ │ │ │ └── input.focus.js │ │ │ ├── factories │ │ │ │ └── input.focus.js │ │ │ ├── module.js │ │ │ ├── package.js │ │ │ └── tests │ │ │ │ └── unit │ │ │ │ ├── directives │ │ │ │ └── input.focus.spec.js │ │ │ │ ├── factories │ │ │ │ └── input.focus.spec.js │ │ │ │ ├── module.spec.js │ │ │ │ └── package.js │ │ ├── navbar │ │ │ ├── factories │ │ │ │ └── menu.config.js │ │ │ ├── module.js │ │ │ ├── package.js │ │ │ └── tests │ │ │ │ └── unit │ │ │ │ ├── factories │ │ │ │ └── menu.config.spec.js │ │ │ │ ├── module.spec.js │ │ │ │ └── package.js │ │ ├── pagination │ │ │ ├── factory.js │ │ │ ├── module.js │ │ │ ├── package.js │ │ │ └── tests │ │ │ │ └── unit │ │ │ │ ├── factory.spec.js │ │ │ │ ├── module.spec.js │ │ │ │ └── package.js │ │ └── progressbar-loading │ │ │ ├── factories │ │ │ ├── progress.config.js │ │ │ ├── progress.interceptor.js │ │ │ └── progress.status.js │ │ │ ├── interceptors │ │ │ └── http.config.js │ │ │ ├── module.js │ │ │ ├── package.js │ │ │ └── tests │ │ │ └── unit │ │ │ ├── factories │ │ │ ├── progress.config.spec.js │ │ │ ├── progress.interceptor.spec.js │ │ │ └── progress.status.spec.js │ │ │ ├── module.spec.js │ │ │ └── package.js │ ├── img │ │ ├── favicon.ico │ │ └── loading.gif │ ├── less │ │ ├── bootstrap │ │ │ ├── 3.3.6 │ │ │ │ └── variables.less │ │ │ └── bs-callout.less │ │ └── top-bottom-screen.less │ └── mock │ │ ├── allow-pass-jsonp.js │ │ ├── backend.js │ │ ├── datastore.js │ │ ├── helpers.js │ │ ├── module.js │ │ └── package.js └── vendor │ ├── angular-mocks-backend │ └── 0.1.7 │ │ └── angular-mocks-backend.js │ ├── angular-ui │ ├── bootstrap │ │ └── 1.1.2 │ │ │ └── ui-bootstrap-tpls.min.js │ └── ui-router │ │ └── 0.2.18 │ │ └── angular-ui-router.min.js │ ├── angular.js │ └── 1.5.0 │ │ ├── angular-animate.js │ │ ├── angular-animate.min.js │ │ ├── angular-animate.min.js.map │ │ ├── angular-aria.js │ │ ├── angular-aria.min.js │ │ ├── angular-aria.min.js.map │ │ ├── angular-cookies.js │ │ ├── angular-cookies.min.js │ │ ├── angular-cookies.min.js.map │ │ ├── angular-csp.css │ │ ├── angular-loader.js │ │ ├── angular-loader.min.js │ │ ├── angular-loader.min.js.map │ │ ├── angular-message-format.js │ │ ├── angular-message-format.min.js │ │ ├── angular-message-format.min.js.map │ │ ├── angular-messages.js │ │ ├── angular-messages.min.js │ │ ├── angular-messages.min.js.map │ │ ├── angular-mocks.js │ │ ├── angular-resource.js │ │ ├── angular-resource.min.js │ │ ├── angular-resource.min.js.map │ │ ├── angular-route.js │ │ ├── angular-route.min.js │ │ ├── angular-route.min.js.map │ │ ├── angular-sanitize.js │ │ ├── angular-sanitize.min.js │ │ ├── angular-sanitize.min.js.map │ │ ├── angular-scenario.js │ │ ├── angular-touch.js │ │ ├── angular-touch.min.js │ │ ├── angular-touch.min.js.map │ │ ├── angular.js │ │ ├── angular.min.js │ │ ├── angular.min.js.map │ │ └── i18n │ │ ├── angular-locale_en-us.js │ │ ├── angular-locale_en.js │ │ ├── angular-locale_es.js │ │ ├── angular-locale_pt-br.js │ │ └── angular-locale_pt.js │ ├── bootstrap │ └── 3.3.6 │ │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── js │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ └── npm.js │ │ └── less │ │ ├── .csscomb.json │ │ ├── .csslintrc │ │ ├── alerts.less │ │ ├── badges.less │ │ ├── bootstrap.less │ │ ├── breadcrumbs.less │ │ ├── button-groups.less │ │ ├── buttons.less │ │ ├── carousel.less │ │ ├── close.less │ │ ├── code.less │ │ ├── component-animations.less │ │ ├── dropdowns.less │ │ ├── forms.less │ │ ├── glyphicons.less │ │ ├── grid.less │ │ ├── input-groups.less │ │ ├── jumbotron.less │ │ ├── labels.less │ │ ├── list-group.less │ │ ├── media.less │ │ ├── mixins.less │ │ ├── mixins │ │ ├── alerts.less │ │ ├── background-variant.less │ │ ├── border-radius.less │ │ ├── buttons.less │ │ ├── center-block.less │ │ ├── clearfix.less │ │ ├── forms.less │ │ ├── gradients.less │ │ ├── grid-framework.less │ │ ├── grid.less │ │ ├── hide-text.less │ │ ├── image.less │ │ ├── labels.less │ │ ├── list-group.less │ │ ├── nav-divider.less │ │ ├── nav-vertical-align.less │ │ ├── opacity.less │ │ ├── pagination.less │ │ ├── panels.less │ │ ├── progress-bar.less │ │ ├── reset-filter.less │ │ ├── reset-text.less │ │ ├── resize.less │ │ ├── responsive-visibility.less │ │ ├── size.less │ │ ├── tab-focus.less │ │ ├── table-row.less │ │ ├── text-emphasis.less │ │ ├── text-overflow.less │ │ └── vendor-prefixes.less │ │ ├── modals.less │ │ ├── navbar.less │ │ ├── navs.less │ │ ├── normalize.less │ │ ├── pager.less │ │ ├── pagination.less │ │ ├── panels.less │ │ ├── popovers.less │ │ ├── print.less │ │ ├── progress-bars.less │ │ ├── responsive-embed.less │ │ ├── responsive-utilities.less │ │ ├── scaffolding.less │ │ ├── tables.less │ │ ├── theme.less │ │ ├── thumbnails.less │ │ ├── tooltip.less │ │ ├── type.less │ │ ├── utilities.less │ │ ├── variables.less │ │ └── wells.less │ ├── html5shiv │ └── 3.7.2 │ │ └── html5shiv.min.js │ ├── jquery │ └── 2.2.1 │ │ └── jquery.min.js │ ├── lokijs │ └── 1.0.1 │ │ └── lokijs.min.js │ ├── ngProgress │ └── 1.0.3 │ │ ├── ngProgress.js │ │ ├── ngProgress.less │ │ └── ngProgress.min.js │ ├── require.js │ └── 2.1.22 │ │ └── require.min.js │ ├── respond.js │ └── 1.4.2 │ │ └── respond.min.js │ └── toaster │ └── 0.3.0 │ ├── toaster.js │ └── toaster.less └── tools ├── config.js ├── gulp ├── helpers │ ├── $.js │ ├── loadTasks.js │ └── sharedStreams.js ├── index.js └── tasks │ ├── build.js │ ├── bump.js │ ├── clean.js │ ├── copy.js │ ├── default.js │ ├── generate.js │ ├── help.js │ ├── html2js.js │ ├── jshint.js │ ├── karma.js │ ├── lintspaces.js │ ├── protractor.js │ ├── require.js │ ├── styles.js │ ├── validate.js │ ├── watch.js │ └── webserver.js ├── karma.config.js ├── karma.options.js ├── lib ├── generate │ ├── engine.js │ ├── index.js │ ├── questions.js │ └── templates │ │ ├── angularjs │ │ ├── crud │ │ │ ├── README.md │ │ │ ├── controllers │ │ │ │ ├── edit.js │ │ │ │ ├── list.js │ │ │ │ ├── new.js │ │ │ │ └── search.js │ │ │ ├── mock │ │ │ │ ├── allow-pass.js │ │ │ │ ├── data.js │ │ │ │ ├── package.js │ │ │ │ └── url-interceptors.js │ │ │ ├── module.js │ │ │ ├── package.js │ │ │ ├── resources │ │ │ │ ├── rest.js │ │ │ │ └── search.js │ │ │ ├── states.js │ │ │ ├── templates │ │ │ │ ├── form.html │ │ │ │ ├── list.html │ │ │ │ ├── search.html │ │ │ │ └── table.html │ │ │ └── tests │ │ │ │ ├── e2e │ │ │ │ ├── form.spec.js │ │ │ │ ├── list.spec.js │ │ │ │ ├── page.object.js │ │ │ │ └── search.spec.js │ │ │ │ └── unit │ │ │ │ ├── controllers │ │ │ │ ├── edit.spec.js │ │ │ │ ├── list.spec.js │ │ │ │ ├── new.spec.js │ │ │ │ └── search.spec.js │ │ │ │ ├── module.spec.js │ │ │ │ ├── package.js │ │ │ │ ├── resources │ │ │ │ ├── rest.spec.js │ │ │ │ └── search.spec.js │ │ │ │ └── states.spec.js │ │ ├── page │ │ │ ├── README.md │ │ │ ├── controller.js │ │ │ ├── module.js │ │ │ ├── package.js │ │ │ ├── states.js │ │ │ ├── template.html │ │ │ └── tests │ │ │ │ ├── e2e │ │ │ │ ├── page.object.js │ │ │ │ └── page.spec.js │ │ │ │ └── unit │ │ │ │ ├── controller.spec.js │ │ │ │ ├── module.spec.js │ │ │ │ ├── package.js │ │ │ │ └── states.spec.js │ │ └── resource │ │ │ ├── README.md │ │ │ ├── mock │ │ │ ├── allow-pass.js │ │ │ ├── data.js │ │ │ ├── package.js │ │ │ └── url-interceptors.js │ │ │ ├── module.js │ │ │ ├── package.js │ │ │ ├── resources │ │ │ └── rest.js │ │ │ └── tests │ │ │ └── unit │ │ │ ├── module.spec.js │ │ │ ├── package.js │ │ │ └── resources │ │ │ └── rest.spec.js │ │ └── gulp │ │ └── config.js ├── localip.js ├── oscheck.js ├── requirejs │ ├── builder.js │ ├── index.js │ └── js-ast-js │ │ ├── gulp-rewrite-require-config.js │ │ └── rewrite-require-config.js └── testModuleThenExecute.js ├── protractor.config.js ├── scripts ├── setup.js └── testos.js └── tests └── require.config.js /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | # Unix-style newlines with a newline ending every file 5 | [*] 6 | charset = utf-8 7 | end_of_line = lf 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [{**.html,**.css,**.scss,**.less,**.json,**.js,**.coffee}] 12 | indent_style = space 13 | indent_size = 2 14 | 15 | [*.md] 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | lib-cov 2 | *.seed 3 | *.log 4 | *.csv 5 | *.dat 6 | *.out 7 | *.pid 8 | *.gz 9 | 10 | etc 11 | pids 12 | logs 13 | results 14 | 15 | #----------- 16 | # node.js 17 | 18 | node 19 | node_modules 20 | npm-debug.log 21 | 22 | #----------- 23 | # project files 24 | 25 | .local 26 | .temp 27 | temp 28 | cache 29 | build 30 | dist 31 | tests_out 32 | 33 | #----------- 34 | # Windows 35 | 36 | **/.db 37 | 38 | #----------- 39 | # Mac OS X 40 | 41 | **/.DS_Store 42 | 43 | # Thumbnails 44 | **/._* 45 | 46 | # Files that might appear on external disk 47 | **/.Spotlight-V100 48 | **/.Trashes 49 | 50 | #----------- 51 | # eclipse 52 | .project 53 | .settings 54 | 55 | #----------- 56 | # Webstorm 57 | **/.idea 58 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) the-front 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Angular.js Enterprise Edition Boilerplate 2 | 3 | [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/the-front) 4 | 5 | This boilerplate (seed project, starting project) helps you build large scale [Angular.js](https://angularjs.org/) applications with [Require.js](http://requirejs.org/) 6 | 7 | -- 8 | 9 | * [README (en)](docs/en/README.md) 10 | 11 | * [README (pt-Br)](docs/pt-Br/README.md) 12 | 13 | 14 | ## Contributing 15 | 16 | 1. Fork it! 17 | 2. Create your feature branch: `git checkout -b my-new-feature` 18 | 3. Commit your changes: `git commit -m 'Add some feature'` 19 | 4. Push to the branch: `git push origin my-new-feature` 20 | 5. Submit a pull request :D 21 | 22 | English is the universal language nowadays, so please don't create or comment on issues using another language. 23 | 24 | 25 | ## CHANGELOG 26 | 27 | Check [Releases](https://github.com/the-front/angularjs-ee-boilerplate/releases) 28 | 29 | 30 | ## License 31 | 32 | - [MIT](LICENSE) 33 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | require('./tools/gulp') 2 | .loadTasks('tools/gulp/tasks'); // load tasks config per file 3 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.github.the-front.angularjs-ee-boilerplate 7 | angularjs-ee-boilerplate 8 | 0.0.1-SNAPSHOT 9 | The Front - Angular.js Enterprise Edition Boilerplate 10 | pom 11 | 12 | 13 | UTF-8 14 | 0.0.28 15 | 4.2.5 16 | 2.14.12 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | com.github.eirslett 26 | frontend-maven-plugin 27 | ${frontend-maven-plugin.version} 28 | 29 | 30 | 31 | 32 | install node and npm 33 | 34 | install-node-and-npm 35 | 36 | 37 | v${node.version} 38 | ${npm.version} 39 | 40 | 41 | 42 | 43 | npm install 44 | 45 | npm 46 | 47 | 48 | 49 | 50 | gulp build 51 | 52 | gulp 53 | 54 | 55 | --release --no-color 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /publisher/config.js: -------------------------------------------------------------------------------- 1 | module.exports = (function() { 2 | var config = {}; 3 | //--- 4 | 5 | config.paths = { 6 | build: '../dist', 7 | repoDir: '.local' 8 | }; 9 | 10 | config.git = { 11 | branch: 'gh-pages', 12 | commitMessage: '<%= branch %> automated commit <%= time %>' 13 | }; 14 | 15 | config.js = [ 16 | '**/*.js', 17 | '!node_modules/**/*' 18 | ]; 19 | 20 | config.lintspaces = config.js.concat('package.json'); 21 | 22 | //--- 23 | return config; 24 | })(); 25 | -------------------------------------------------------------------------------- /publisher/gulp/helpers/$.js: -------------------------------------------------------------------------------- 1 | // Expose all Gulp plugins found 2 | var $ = module.exports = require('gulp-load-plugins')(); 3 | 4 | //--- 5 | 6 | // Expose some other modules 7 | $.path = require('path'); 8 | 9 | $.rootPath = $.path.resolve( './' ); 10 | 11 | // [Gist] Better local require() paths for Node.js 12 | // https://gist.github.com/branneman/8048520 13 | $.rootRequire = function( name ) { 14 | return require( $.path.join( $.rootPath, name ) ); 15 | }; 16 | 17 | //--- 18 | 19 | $.del = require('del'); 20 | $.lazypipe = require('lazypipe'); 21 | $.runSequence = require('run-sequence'); 22 | 23 | //--- local modules 24 | 25 | $.mainPkg = require( $.path.join( $.path.resolve( '../' ), 'package.json' ) ); 26 | 27 | $.pkg = $.rootRequire('package.json'); 28 | 29 | $.config = $.rootRequire('config'); 30 | 31 | //--- 32 | 33 | $.args = require('yargs').argv; 34 | 35 | //--- 36 | 37 | $.is = { 38 | debug : !!$.args.debug, 39 | publish : !!$.args.publish, 40 | init : !!$.args.init 41 | }; 42 | 43 | //--- 44 | 45 | /** 46 | * Log a message or series of messages using chalk's blue color. 47 | * Can pass in a string, object or array. 48 | */ 49 | $.log = function(msg) { 50 | if (typeof(msg) === 'object') { 51 | for (var item in msg) { 52 | if (msg.hasOwnProperty(item)) { 53 | $.util.log($.util.colors.blue(msg[item])); 54 | } 55 | } 56 | } else { 57 | $.util.log($.util.colors.blue(msg)); 58 | } 59 | }; 60 | 61 | $.onError = function(err) { 62 | $.log(err); 63 | }; 64 | 65 | //--- 66 | 67 | $.projectInfoMsg = function() { 68 | $.log(''); 69 | $.log('project: ' + $.pkg.name + ' v' + $.pkg.version); 70 | $.log('description: ' + $.pkg.description); 71 | $.log(''); 72 | 73 | var msg = ''; 74 | 75 | if( $.is.release ) { 76 | msg += ' release'; 77 | 78 | $.log('>> ' + msg); 79 | $.log(''); 80 | } 81 | }; 82 | -------------------------------------------------------------------------------- /publisher/gulp/helpers/loadTasks.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var fs = require('fs'); 3 | var gulp = require('gulp'); 4 | var $ = require('./$'); 5 | 6 | 7 | function loadTask(filepath) { 8 | var filename = path.basename(filepath); 9 | var msg = 'Loading "' + filename + '" tasks...'; 10 | var fn; 11 | 12 | try { 13 | // Load taskfile. 14 | fn = require(path.resolve(filepath)); 15 | if(typeof fn === 'function') { 16 | fn.call({}, gulp, $); 17 | } 18 | } catch(e) { 19 | console.log(msg); 20 | // Something went wrong. 21 | console.error(e); 22 | } 23 | fn = null; 24 | } 25 | 26 | function loadTasks(tasksDir) { 27 | var files = fs 28 | .readdirSync(tasksDir) 29 | .filter(function isValid(file) { 30 | return (file !== '.DS_store' && file.indexOf('.') !== 0 && /\.js$/.test(file)); 31 | }); 32 | 33 | // load tasks from files 34 | files.forEach(function(filename) { 35 | loadTask(path.join(tasksDir, filename)); 36 | }); 37 | } 38 | 39 | module.exports = function(tasksDir) { 40 | if(fs.existsSync(tasksDir)) { 41 | loadTasks(tasksDir); 42 | } else { 43 | console.error('Tasks directory "' + tasksDir + '" not found.'); 44 | } 45 | }; 46 | -------------------------------------------------------------------------------- /publisher/gulp/index.js: -------------------------------------------------------------------------------- 1 | module.exports.loadTasks = require('./helpers/loadTasks'); 2 | -------------------------------------------------------------------------------- /publisher/gulp/tasks/clean.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | gulp.task('clean:repo-dir', $.del.bind(null, [ 4 | $.config.paths.repoDir 5 | ])); 6 | 7 | gulp.task('clean:repo-dir:content', $.del.bind(null, [ 8 | $.config.paths.repoDir + '/' + '/**/*', 9 | '!' + $.config.paths.repoDir + '/{.git,.gitignore}' 10 | ])); 11 | 12 | gulp.task('clean', ['clean:repo-dir']); 13 | 14 | }; 15 | -------------------------------------------------------------------------------- /publisher/gulp/tasks/copy.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | gulp.task('copy:build2repo-dir', function() { 4 | return gulp.src( $.config.paths.build + '/**/*' ) 5 | .pipe( gulp.dest( $.config.paths.repoDir ) ); 6 | }); 7 | 8 | }; 9 | -------------------------------------------------------------------------------- /publisher/gulp/tasks/default.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | gulp.task('run:flow', function(done) { 4 | 5 | var runTasks = [ 6 | 'validate', 7 | ]; 8 | 9 | if( $.is.publish ) { 10 | 11 | runTasks = runTasks.concat([ 'init', 'publish' ]); 12 | 13 | } else if( $.is.init ) { 14 | 15 | runTasks = runTasks.concat([ 'init' ]); 16 | 17 | } 18 | 19 | runTasks = runTasks.concat([ done ]); 20 | $.runSequence.apply(null, runTasks); 21 | 22 | }); 23 | 24 | //--- 25 | 26 | gulp.task('default', ['run:flow'], function() { 27 | 28 | $.projectInfoMsg(); 29 | 30 | }); 31 | 32 | }; 33 | -------------------------------------------------------------------------------- /publisher/gulp/tasks/init.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | gulp.task('init', function( done ) { 4 | 5 | $.runSequence( 6 | 'clean:repo-dir', 7 | 'shell:createRepoDir', 8 | 'shell:git:clone', 9 | 'shell:git:checkout', 10 | done 11 | ); 12 | 13 | }); 14 | 15 | }; 16 | -------------------------------------------------------------------------------- /publisher/gulp/tasks/jshint.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | var jshintStream = $.lazypipe() 4 | .pipe( $.cached, 'jshint' ) 5 | .pipe( $.jshint ) 6 | .pipe( $.jshint.reporter, 'jshint-stylish' ) 7 | .pipe( $.jshint.reporter, 'fail' ); 8 | 9 | //--- 10 | 11 | gulp.task('jshint', function() { 12 | return gulp.src( $.config.js ) 13 | .pipe( jshintStream() ); 14 | }); 15 | 16 | }; 17 | -------------------------------------------------------------------------------- /publisher/gulp/tasks/lintspaces.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | // https://github.com/ck86/gulp-lintspaces 4 | 5 | var lintspacesStream = $.lazypipe() 6 | .pipe( $.cached, 'lintspaces' ) 7 | .pipe( $.lintspaces, { editorconfig: '../.editorconfig' } ) 8 | .pipe( $.lintspaces.reporter ); 9 | 10 | //--- 11 | 12 | gulp.task('lintspaces', function() { 13 | return gulp.src( $.config.lintspaces ) 14 | .pipe( lintspacesStream() ); 15 | }); 16 | 17 | }; 18 | -------------------------------------------------------------------------------- /publisher/gulp/tasks/publish.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | gulp.task('publish', function( done ) { 4 | 5 | $.runSequence( 6 | [ 7 | 'clean:repo-dir:content', 8 | 'shell:tools-build' 9 | ], 10 | 'copy:build2repo-dir', 11 | 'shell:git:add', 12 | 'shell:git:commit', 13 | [ 14 | 'shell:tools-clean', 15 | 'shell:git:push' 16 | ], 17 | done 18 | ); 19 | 20 | }); 21 | 22 | }; 23 | -------------------------------------------------------------------------------- /publisher/gulp/tasks/shell.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | //--- 4 | // @begin: tools 5 | 6 | gulp.task('shell:tools-build', $.shell.task([ 7 | 'gulp --release' 8 | ], { 9 | cwd: $.path.resolve('../') 10 | })); 11 | 12 | gulp.task('shell:tools-clean', $.shell.task([ 13 | 'gulp clean' 14 | ], { 15 | cwd: $.path.resolve('../') 16 | })); 17 | 18 | // @end: tools 19 | //--- 20 | 21 | gulp.task('shell:createRepoDir', $.shell.task([ 22 | 'mkdir ' + $.config.paths.repoDir 23 | ])); 24 | 25 | //--- 26 | // @begin: git 27 | 28 | // init, checkout 29 | 30 | gulp.task('shell:git:clone', $.shell.task([ 31 | 'git clone ' + $.mainPkg.repository.url + ' ' + $.config.paths.repoDir 32 | ])); 33 | 34 | 35 | gulp.task('shell:git:checkout', $.shell.task([ 36 | 'git checkout ' + $.config.git.branch 37 | ], { 38 | cwd: $.config.paths.repoDir 39 | })); 40 | 41 | // add, commit, push 42 | 43 | gulp.task('shell:git:add', $.shell.task([ 44 | 'git add . ' 45 | ], { 46 | cwd: $.config.paths.repoDir 47 | })); 48 | 49 | gulp.task('shell:git:commit', $.shell.task([ 50 | 'git commit -m "' + 51 | $.util.template( 52 | $.config.git.commitMessage, 53 | { 54 | branch: $.config.git.branch, 55 | time: new Date().toISOString(), 56 | file: $.util.noop() 57 | } 58 | ) + 59 | '"' 60 | ], { 61 | cwd: $.config.paths.repoDir 62 | })); 63 | 64 | gulp.task('shell:git:push', $.shell.task([ 65 | 'git push origin ' + $.config.git.branch 66 | ], { 67 | cwd: $.config.paths.repoDir 68 | })); 69 | 70 | // @end: git 71 | 72 | }; 73 | -------------------------------------------------------------------------------- /publisher/gulp/tasks/validate.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | gulp.task('validate', ['jshint', 'lintspaces']); 4 | 5 | }; 6 | -------------------------------------------------------------------------------- /publisher/gulpfile.js: -------------------------------------------------------------------------------- 1 | require('./gulp') 2 | .loadTasks('gulp/tasks'); // load tasks config per file 3 | -------------------------------------------------------------------------------- /publisher/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "publisher", 3 | "private": true, 4 | "version": "1.1.0", 5 | "description": "github gh-pages publisher tool", 6 | "keywords": [ 7 | "github", 8 | "gh-pages", 9 | "gulp", 10 | "publisher", 11 | "tool" 12 | ], 13 | "author": "Erko Bridee de Almeida Cabrera ", 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 4.2.5" 17 | }, 18 | "scripts": { 19 | "outdated": "npm outdated --depth=0", 20 | "postinstall": "gulp --init" 21 | }, 22 | "devDependencies": { 23 | "del": "^2.2.0", 24 | "gulp": "^3.9.1", 25 | "gulp-cached": "^1.1.0", 26 | "gulp-jshint": "^2.0.0", 27 | "gulp-lintspaces": "^0.4.1", 28 | "gulp-load-plugins": "^1.2.0", 29 | "gulp-shell": "^0.5.2", 30 | "gulp-util": "^3.0.7", 31 | "jshint": "^2.9.1", 32 | "jshint-stylish": "^2.1.0", 33 | "lazypipe": "^1.0.1", 34 | "run-sequence": "^1.1.5", 35 | "yargs": "^4.2.0" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/app/about/controller.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | 6 | module.controller('AboutCtrl', AboutCtrl); 7 | 8 | //--- 9 | 10 | //AboutCtrl.$inject = []; 11 | 12 | function AboutCtrl() { 13 | var vm = this; 14 | 15 | vm.pageName = 'About Page'; 16 | } 17 | 18 | }); 19 | -------------------------------------------------------------------------------- /src/app/about/module.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var angular = require('angular'); 5 | 6 | require('uiRouter'); 7 | 8 | // angular module definition 9 | return angular.module( 10 | // module name 11 | 'about', 12 | 13 | // module dependencies 14 | [ 15 | 'ui.router' 16 | ] 17 | ); 18 | 19 | }); 20 | -------------------------------------------------------------------------------- /src/app/about/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | require('./controller'); 6 | require('./states'); 7 | 8 | return module; 9 | 10 | }); 11 | -------------------------------------------------------------------------------- /src/app/about/states.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | 6 | module.config(configureStates); 7 | 8 | //--- 9 | 10 | configureStates.$inject = ['$stateProvider', '$urlRouterProvider']; 11 | 12 | function configureStates($stateProvider, $urlRouterProvider) { 13 | 14 | $stateProvider 15 | .state('about', { 16 | url: '/about', 17 | views: { 18 | 'master': { 19 | templateUrl : 'app/main/templates/layout.html' 20 | }, 21 | 'content@about': { 22 | templateUrl : 'app/about/templates/page.html', 23 | controller : 'AboutCtrl', 24 | controllerAs : 'vm' 25 | } 26 | } 27 | }); 28 | 29 | } 30 | 31 | }); 32 | -------------------------------------------------------------------------------- /src/app/about/templates/backend.html: -------------------------------------------------------------------------------- 1 | ... 2 | -------------------------------------------------------------------------------- /src/app/about/templates/page.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
 
4 | 5 |
6 |

Back to Home | Page name: {{vm.pageName}}

7 |
8 | 9 | 10 |
 
11 | 12 | 13 |
14 | 15 | 16 |
17 |
18 | 19 |
20 |
21 |
22 | 23 |
24 |
25 |
26 |
27 | 28 | 29 |
30 | 31 |
32 | -------------------------------------------------------------------------------- /src/app/about/templates/tests_unit.html: -------------------------------------------------------------------------------- 1 | 51 | -------------------------------------------------------------------------------- /src/app/about/tests/e2e/page.object.js: -------------------------------------------------------------------------------- 1 | // Page object 2 | module.exports = { 3 | 4 | get: function() { 5 | return browser.get('#/about'); 6 | }, 7 | 8 | pageName: element(by.binding('vm.pageName')) 9 | 10 | }; 11 | -------------------------------------------------------------------------------- /src/app/about/tests/e2e/page.spec.js: -------------------------------------------------------------------------------- 1 | describe("e2e: about page", function() { 2 | var page = require('./page.object'); 3 | 4 | beforeEach(function() { 5 | page.get(); 6 | }); 7 | 8 | it("should page name : 'About Page'", function() { 9 | // assertions 10 | expect(page.pageName.getText()).toContain('About Page'); 11 | }); 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /src/app/about/tests/unit/controller.spec.js: -------------------------------------------------------------------------------- 1 | describe('Testing About Controller', function() { 2 | 3 | var vm; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module('about'); 10 | 11 | // inject dependencies 12 | inject(function($controller) { 13 | 14 | vm = $controller('AboutCtrl'); 15 | 16 | }); 17 | 18 | }); 19 | 20 | 21 | it('should have a pageName equals to \'About Page\'', function() { 22 | 23 | // assertions 24 | expect(vm.pageName).toEqual('About Page'); 25 | 26 | }); 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /src/app/about/tests/unit/module.spec.js: -------------------------------------------------------------------------------- 1 | describe('Angular.js \'about\' Module', function() { 2 | 3 | var module; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module = angular.module('about'); 10 | 11 | }); 12 | 13 | it("should be registered", function() { 14 | 15 | // assertions 16 | expect(module).toBeDefined(); 17 | 18 | }); 19 | 20 | describe("Dependencies:", function() { 21 | 22 | var deps; 23 | 24 | var hasModule = function(m) { 25 | return deps.indexOf(m) >= 0; 26 | }; 27 | 28 | beforeEach(function() { 29 | deps = module.value('appName').requires; 30 | }); 31 | 32 | var mainDeps = [ 33 | 'ui.router' 34 | ]; 35 | 36 | mainDeps.forEach(function( depName ) { 37 | 38 | it('should have ' + depName + ' as a dependency', function() { 39 | 40 | // assertions 41 | expect(hasModule( depName )).toEqual(true); 42 | 43 | }); 44 | 45 | }); 46 | 47 | }); 48 | 49 | }); 50 | -------------------------------------------------------------------------------- /src/app/about/tests/unit/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | require('./module.spec'); 5 | require('./controller.spec'); 6 | require('./states.spec'); 7 | 8 | }); 9 | -------------------------------------------------------------------------------- /src/app/bookmarks/controllers/edit.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('../module'); 5 | require('../resources/rest'); 6 | 7 | module.controller('BookmarksEditCtrl', BookmarksEditCtrl); 8 | 9 | //--- 10 | 11 | BookmarksEditCtrl.$inject = [ 12 | '$rootScope', '$scope', 13 | 'BookmarksResource', '$stateParams', 14 | 'InputFocusFactory' 15 | ]; 16 | 17 | function BookmarksEditCtrl($rootScope, $scope, resource, params, input) { 18 | var vm = this; 19 | 20 | vm.title = 'Edit Bookmark : ' + params.id; 21 | 22 | vm.bookmark = undefined; 23 | 24 | vm.showConfirm = false; 25 | 26 | vm.save = save; 27 | 28 | vm.remove = remove; 29 | 30 | vm.cancelRemove = cancelRemove; 31 | 32 | vm.destroy = destroy; 33 | 34 | //--- 35 | 36 | var ctrlName = 'BookmarksEditCtrl'; 37 | input = input.get(ctrlName); 38 | 39 | input.config( 40 | $scope, 41 | [ 42 | 'focusBookmarkNameInput' 43 | ]); 44 | 45 | //console.debug(input); 46 | 47 | //--- 48 | 49 | // TODO: move to route resolve? 50 | resource.get({id: params.id}, function(result) { 51 | vm.bookmark = result; 52 | input.setFocus('focusBookmarkNameInput', 200); 53 | }); 54 | 55 | //--- 56 | 57 | function save() { 58 | vm.bookmark.$update({id: params.id}, function(res) { 59 | $rootScope.$emit('bookmarks:update:event', 'updated'); 60 | }); 61 | } 62 | 63 | function remove() { 64 | vm.showConfirm = true; 65 | } 66 | 67 | function cancelRemove() { 68 | vm.showConfirm = false; 69 | input.focusReset(); 70 | input.setFocus('focusBookmarkNameInput'); 71 | } 72 | 73 | function destroy() { 74 | vm.bookmark.$delete({id: params.id}, function(res) { 75 | vm.showConfirm = false; 76 | $rootScope.$emit('bookmarks:remove:event', 'removed'); 77 | }); 78 | } 79 | 80 | } 81 | 82 | }); 83 | -------------------------------------------------------------------------------- /src/app/bookmarks/controllers/new.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('../module'); 5 | require('../resources/rest'); 6 | 7 | module.controller('BookmarksNewCtrl', BookmarksNewCtrl); 8 | 9 | //--- 10 | 11 | BookmarksNewCtrl.$inject = [ 12 | '$rootScope', '$scope', 13 | 'BookmarksResource', 'InputFocusFactory' 14 | ]; 15 | 16 | function BookmarksNewCtrl($rootScope, $scope, Resource, input) { 17 | var vm = this; 18 | 19 | vm.title = 'New Bookmark'; 20 | 21 | vm.bookmark = new Resource({ 22 | 'id':0, 23 | 'name':'', 24 | 'description':'', 25 | 'url':'' 26 | }); 27 | 28 | vm.save = save; 29 | 30 | //--- 31 | 32 | var ctrlName = 'BookmarksNewCtrl'; 33 | input = input.get(ctrlName); 34 | 35 | input.config( 36 | $scope, 37 | [ 38 | 'focusBookmarkNameInput' 39 | ]); 40 | 41 | input.setFocus('focusBookmarkNameInput', 200); 42 | 43 | //console.debug(input); 44 | 45 | //--- 46 | 47 | function save() { 48 | vm.bookmark.$save(function(res) { 49 | $rootScope.$emit('bookmarks:add:event', 'added'); 50 | }); 51 | } 52 | 53 | } 54 | 55 | }); 56 | -------------------------------------------------------------------------------- /src/app/bookmarks/mock/allow-pass.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var backend = require('shared/mock/backend'); 5 | 6 | backend.addResource(AllowPass); 7 | 8 | //--- 9 | 10 | AllowPass.$inject = ['$httpBackend', 'regexpUrl']; 11 | 12 | function AllowPass($httpBackend, regexpUrl) { 13 | 14 | //--- @begin: Allow pass to server 15 | 16 | // get all 17 | $httpBackend 18 | .when('GET', regexpUrl(/rest\/bookmarks(\?|$)/)) 19 | .passThrough(); 20 | 21 | // get one 22 | $httpBackend 23 | .when('GET', regexpUrl(/rest\/bookmarks(\/)?([A-z0-9]+)?$/)) 24 | .passThrough(); 25 | 26 | // create 27 | $httpBackend 28 | .when('POST', regexpUrl(/rest\/bookmarks$/)) 29 | .passThrough(); 30 | 31 | // update 32 | $httpBackend 33 | .when('PUT', regexpUrl(/rest\/bookmarks(\/)?([A-z0-9]+)?$/)) 34 | .passThrough(); 35 | 36 | // delete 37 | $httpBackend 38 | .when('DELETE', regexpUrl(/rest\/bookmarks(\/)?([A-z0-9]+)?$/)) 39 | .passThrough(); 40 | 41 | // search 42 | $httpBackend 43 | .when('GET', regexpUrl(/rest\/bookmarks\/search\/([A-z0-9]+)(\?|$)/)) 44 | .passThrough(); 45 | 46 | //--- @end: Allow pass to server 47 | 48 | } 49 | 50 | 51 | }); 52 | -------------------------------------------------------------------------------- /src/app/bookmarks/mock/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | // allow request pass through angular.js mock url interceptor 5 | // require('./allow-pass'); 6 | 7 | /**/ 8 | require('./data'); // local mock data 9 | require('./url-interceptors'); // intercepts and responds 10 | /**/ 11 | 12 | }); 13 | -------------------------------------------------------------------------------- /src/app/bookmarks/module.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var angular = require('angular'); 5 | require('angularResource'); 6 | 7 | require('uiRouter'); 8 | require('uiBootstrap'); 9 | 10 | // angular module definition 11 | return angular.module( 12 | // module name 13 | 'bookmarks', 14 | 15 | // module dependencies 16 | [ 17 | 'ngResource', 18 | 19 | 'ui.router', 20 | 'ui.bootstrap', 21 | 22 | require('shared/fend/input-utils/package').name, 23 | require('shared/fend/pagination/package').name 24 | ] 25 | ); 26 | 27 | }); 28 | -------------------------------------------------------------------------------- /src/app/bookmarks/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | require('./controllers/edit'); 6 | require('./controllers/list'); 7 | require('./controllers/new'); 8 | require('./controllers/search'); 9 | require('./resources/rest'); 10 | require('./resources/search'); 11 | require('./states'); 12 | 13 | return module; 14 | 15 | }); 16 | -------------------------------------------------------------------------------- /src/app/bookmarks/resources/rest.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('../module'); 5 | 6 | module.factory('BookmarksResource', BookmarksResource); 7 | 8 | //--- 9 | 10 | BookmarksResource.$inject = ['$resource']; 11 | 12 | function BookmarksResource($resource) { 13 | 14 | var rest = $resource( 15 | 'rest/bookmarks/:id', 16 | { 17 | 'id': '' 18 | }, 19 | { 20 | 'update': { 'method': 'PUT' } 21 | } 22 | ); 23 | 24 | return rest; 25 | 26 | } 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /src/app/bookmarks/resources/search.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('../module'); 5 | 6 | module.factory('BookmarksSearchResource', BookmarksSearchResource); 7 | 8 | //--- 9 | 10 | BookmarksSearchResource.$inject = ['$resource']; 11 | 12 | function BookmarksSearchResource($resource) { 13 | 14 | var rest = $resource( 15 | 'rest/bookmarks/search/:name' 16 | ); 17 | 18 | return rest; 19 | 20 | } 21 | 22 | }); 23 | -------------------------------------------------------------------------------- /src/app/bookmarks/states.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | 6 | module.config(configureStates); 7 | 8 | //--- 9 | 10 | configureStates.$inject = ['$stateProvider', '$urlRouterProvider']; 11 | 12 | function configureStates($stateProvider, $urlRouterProvider) { 13 | 14 | $urlRouterProvider 15 | .when('/bookmarks', '/bookmarks/list'); // default 16 | 17 | $stateProvider 18 | .state('bookmarks', { 19 | abstract: true, 20 | url: '/bookmarks', 21 | views: { 22 | 'master': { 23 | templateUrl : 'app/main/templates/layout.html' 24 | } 25 | } 26 | }) 27 | .state('bookmarks.list', { 28 | url: '/list', 29 | views: { 30 | 'content@bookmarks': { 31 | templateUrl : 'app/bookmarks/templates/list.html', 32 | controller : 'BookmarksListCtrl', 33 | controllerAs : 'vm' 34 | } 35 | } 36 | }) 37 | .state('bookmarks.search', { 38 | url: '/search', 39 | views: { 40 | 'content@bookmarks': { 41 | templateUrl : 'app/bookmarks/templates/search.html', 42 | controller : 'BookmarksSearchCtrl', 43 | controllerAs : 'vm' 44 | } 45 | } 46 | }) 47 | .state('bookmarks.new', { 48 | url: '/new', 49 | views: { 50 | 'content@bookmarks': { 51 | templateUrl : 'app/bookmarks/templates/form.html', 52 | controller : 'BookmarksNewCtrl', 53 | controllerAs : 'vm' 54 | } 55 | } 56 | }) 57 | .state('bookmarks.edit', { 58 | url: '/edit/:id', 59 | views: { 60 | 'content@bookmarks': { 61 | templateUrl : 'app/bookmarks/templates/form.html', 62 | controller : 'BookmarksEditCtrl', 63 | controllerAs : 'vm' 64 | } 65 | } 66 | }); 67 | 68 | } 69 | 70 | }); 71 | -------------------------------------------------------------------------------- /src/app/bookmarks/templates/table.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

4 | : {{vm.filter.search}} 5 |

6 |
7 | 8 |
9 | 10 |
11 | 12 | 13 | 14 | 20 | 21 | 25 | 26 |
27 | 28 |
 
29 |
30 | 31 | 32 | 33 |
34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 50 | 51 | 52 | 57 | 58 | 59 |
Name Description
46 | 49 | {{bookmark.name}}{{bookmark.description}}
60 |
61 | 62 | -------------------------------------------------------------------------------- /src/app/bookmarks/tests/e2e/search.spec.js: -------------------------------------------------------------------------------- 1 | 2 | // grunt protractor --suite bookmarks 3 | 4 | describe("e2e: bookmarks on search", function() { 5 | var page = require('./page.object'); 6 | 7 | //--- 8 | 9 | var backToList = page.on.search.links.backToList(); // get element 10 | var optionsButton = page.on.search.options.optionsButton(); // get element 11 | 12 | var searchInput = page.on.search.searchInput(); // get element 13 | 14 | var repeater = page.on.table.repeater(); // get element 15 | 16 | //--- 17 | 18 | beforeEach(function() { 19 | page.get(); 20 | 21 | page.on.list.links.search().click(); 22 | }); 23 | 24 | //--- 25 | 26 | it("should have go back link", function() { 27 | // assertions 28 | expect(backToList.isPresent()).toBeTruthy(); 29 | }); 30 | 31 | it("should show options", function() { 32 | // assert 33 | expect(optionsButton.getText()).toContain('Show Options'); 34 | 35 | // act 36 | optionsButton.click(); 37 | 38 | // assert 39 | expect(optionsButton.getText()).toContain('Hide Options'); 40 | }); 41 | 42 | //--- 43 | 44 | describe("do 'protractor' search", function() { 45 | 46 | beforeEach(function() { 47 | searchInput 48 | .sendKeys('protractor') 49 | .sendKeys('\n'); // submit form 50 | }); 51 | 52 | it("should find 'protractor'", function() { 53 | expect(repeater.count()).toBe(3); 54 | }); 55 | 56 | it("should change page size length to 2", function() { 57 | // open options 58 | optionsButton.click(); 59 | 60 | var pageSizeInput = page.on.search.options.pageSizeInput(); // get element 61 | 62 | pageSizeInput.clear(); 63 | pageSizeInput 64 | .sendKeys(2) 65 | .sendKeys('\n'); // submit form 66 | 67 | expect(repeater.count()).toBe(2); 68 | 69 | }); 70 | 71 | }); 72 | 73 | }); 74 | -------------------------------------------------------------------------------- /src/app/bookmarks/tests/unit/controllers/new.spec.js: -------------------------------------------------------------------------------- 1 | describe('Testing Bookmarks New Controller', function() { 2 | 3 | var httpBackend, vm, rootScope, scope; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module('bookmarks'); 10 | 11 | // inject dependencies 12 | inject(function($controller, $rootScope, $httpBackend) { 13 | scope = $rootScope.$new(); 14 | 15 | vm = $controller('BookmarksNewCtrl', { 16 | $scope: scope 17 | }); 18 | 19 | rootScope = $rootScope; 20 | httpBackend = $httpBackend; 21 | }); 22 | 23 | }); 24 | 25 | 26 | it('should be defined', function() { 27 | 28 | // assertions 29 | expect(vm).toBeDefined(); 30 | 31 | }); 32 | 33 | it("should have a title equals to 'New Bookmark'", function() { 34 | 35 | // assertions 36 | expect(vm.title).toEqual('New Bookmark'); 37 | 38 | }); 39 | 40 | it("should have empty bookmark object", function() { 41 | 42 | // assertions 43 | expect(vm.bookmark.id).toEqual(0); 44 | expect(vm.bookmark.name).toEqual(''); 45 | 46 | }); 47 | 48 | it("should save", function() { 49 | 50 | // arrange 51 | httpBackend.when('POST', 'rest/bookmarks') 52 | .respond(function(method, url, data) { 53 | data = angular.fromJson(data); 54 | data.id = 1; 55 | return [201, angular.copy(data)]; 56 | }); 57 | 58 | spyOn(rootScope, '$emit'); 59 | 60 | // act 61 | vm.save(); 62 | httpBackend.flush(); 63 | 64 | // assertions 65 | expect(rootScope.$emit).toHaveBeenCalledWith('bookmarks:add:event', 'added'); 66 | 67 | }); 68 | 69 | 70 | }); 71 | -------------------------------------------------------------------------------- /src/app/bookmarks/tests/unit/module.spec.js: -------------------------------------------------------------------------------- 1 | describe('Angular.js \'bookmarks\' Module', function() { 2 | 3 | var module; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module = angular.module('bookmarks'); 10 | 11 | }); 12 | 13 | it("should be registered", function() { 14 | 15 | // assertions 16 | expect(module).toBeDefined(); 17 | 18 | }); 19 | 20 | describe("Dependencies:", function() { 21 | 22 | var deps; 23 | 24 | var hasModule = function(m) { 25 | return deps.indexOf(m) >= 0; 26 | }; 27 | 28 | beforeEach(function() { 29 | deps = module.value('appName').requires; 30 | }); 31 | 32 | var mainDeps = [ 33 | 'ngResource', 34 | 35 | 'ui.router', 36 | 'ui.bootstrap', 37 | 38 | 'fend.input.utils', 39 | 'fend.pagination' 40 | ]; 41 | 42 | mainDeps.forEach(function( depName ) { 43 | 44 | it('should have ' + depName + ' as a dependency', function() { 45 | 46 | // assertions 47 | expect(hasModule( depName )).toEqual(true); 48 | 49 | }); 50 | 51 | }); 52 | 53 | }); 54 | 55 | }); 56 | -------------------------------------------------------------------------------- /src/app/bookmarks/tests/unit/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | require('./module.spec'); 5 | require('./resources/rest.spec'); 6 | require('./resources/search.spec'); 7 | require('./controllers/list.spec'); 8 | require('./controllers/search.spec'); 9 | require('./controllers/new.spec'); 10 | require('./controllers/edit.spec'); 11 | require('./states.spec'); 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /src/app/bookmarks/tests/unit/resources/rest.spec.js: -------------------------------------------------------------------------------- 1 | describe("Testing Bookmarks Rest Resource", function() { 2 | 3 | var resource; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module('bookmarks'); 10 | 11 | // inject dependencies 12 | inject(function(BookmarksResource) { 13 | resource = BookmarksResource; 14 | }); 15 | 16 | }); 17 | 18 | 19 | it('should be defined', function() { 20 | 21 | // assertions 22 | expect(resource).toBeDefined(); 23 | 24 | }); 25 | 26 | }); 27 | -------------------------------------------------------------------------------- /src/app/bookmarks/tests/unit/resources/search.spec.js: -------------------------------------------------------------------------------- 1 | describe("Testing Bookmarks Search Resource", function() { 2 | 3 | var resource; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module('bookmarks'); 10 | 11 | // inject dependencies 12 | inject(function(BookmarksSearchResource) { 13 | resource = BookmarksSearchResource; 14 | }); 15 | 16 | }); 17 | 18 | 19 | it('should be defined', function() { 20 | 21 | // assertions 22 | expect(resource).toBeDefined(); 23 | 24 | }); 25 | 26 | }); 27 | -------------------------------------------------------------------------------- /src/app/help/controller.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | 6 | module.controller('HelpCtrl', HelpCtrl); 7 | 8 | //--- 9 | 10 | HelpCtrl.$inject = ['githubUser']; //'$http' 11 | 12 | function HelpCtrl(githubUser) { // $http 13 | var vm = this; 14 | 15 | vm.pageName = 'Help Page'; 16 | vm.githubUser = githubUser; 17 | 18 | } 19 | 20 | }); 21 | -------------------------------------------------------------------------------- /src/app/help/mock/allow-pass-github.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var backend = require('shared/mock/backend'); 5 | 6 | backend.addResource(AllowPass); 7 | 8 | //--- 9 | 10 | // mock resource dependencies injection 11 | AllowPass.$inject = ['$httpBackend', 'regexpUrl']; 12 | 13 | // mock resource definition 14 | function AllowPass($httpBackend, regexpUrl) { 15 | 16 | // Allow GET users from GitHub API 17 | $httpBackend.when('GET', regexpUrl(/api\.github\.com\/users(\/)?([A-z0-9]+)?$/)).passThrough(); 18 | 19 | } 20 | 21 | }); 22 | -------------------------------------------------------------------------------- /src/app/help/module.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var angular = require('angular'); 5 | 6 | require('uiRouter'); 7 | 8 | // angular module definition 9 | return angular.module( 10 | // module name 11 | 'help', 12 | 13 | // module dependencies 14 | [ 15 | 'ui.router' 16 | ] 17 | ); 18 | 19 | }); 20 | -------------------------------------------------------------------------------- /src/app/help/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | require('./controller'); 6 | require('./states'); 7 | 8 | return module; 9 | 10 | }); 11 | -------------------------------------------------------------------------------- /src/app/help/states.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | 6 | module.config(configureStates); 7 | 8 | //--- 9 | 10 | configureStates.$inject = ['$stateProvider', '$urlRouterProvider']; 11 | 12 | function configureStates($stateProvider, $urlRouterProvider) { 13 | 14 | $stateProvider 15 | .state('help', { 16 | url: '/help', 17 | views: { 18 | 'master': { 19 | templateUrl : 'app/main/templates/layout.html' 20 | }, 21 | 'content@help': { 22 | templateUrl : 'app/help/template.html', 23 | controller : 'HelpCtrl', 24 | controllerAs : 'vm', 25 | resolve: { 26 | githubUser : ResolveGithubUser 27 | } 28 | } 29 | } 30 | }); 31 | 32 | } 33 | 34 | //--- 35 | 36 | ResolveGithubUser.$inject = ['$http']; 37 | 38 | function ResolveGithubUser($http) { 39 | return $http 40 | .get('https://api.github.com/users/erkobridee') 41 | .success(function(data) { 42 | return data; 43 | }); 44 | } 45 | 46 | }); 47 | -------------------------------------------------------------------------------- /src/app/help/template.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |

Back to Home | Page name: {{vm.pageName}}

5 |
6 |
7 | 8 |
9 |

REST URL Design (pt_BR)

10 |
11 |
12 | 13 |
14 | 15 |
16 |

title

17 |

text 123 ...

18 |

css class: bs-callout bs-callout-info

19 |
20 | 21 |
22 |

title

23 |

text 123 ...

24 |

css class: bs-callout bs-callout-warning

25 |
26 | 27 |
28 |

title

29 |

text 123 ...

30 |

css class: bs-callout bs-callout-danger

31 |
32 | 33 |
34 | 35 |
36 | begin scroll test 37 |


?


?


?


? 38 |


?


?


?


? 39 |


?


?


?


? 40 |


?


?


?


? 41 |


?


?


?


? 42 |


?


?


?


? 43 |


?


?


?


? 44 |


?


?


?


? 45 |


?


?


?


? 46 |


?


?


?


? 47 |


?


?


?


? 48 |


?


?


?


? 49 |


?


?


?


? 50 |


?


?


?


? 51 |


?


?


?


? 52 |


?


?


?


? 53 |
54 |

{{vm.githubUser | json}}

55 |
56 | end scroll test 57 |
58 | 59 | 60 |
61 | -------------------------------------------------------------------------------- /src/app/help/tests/e2e/page.object.js: -------------------------------------------------------------------------------- 1 | // Page object 2 | module.exports = { 3 | 4 | get: function() { 5 | return browser.get('#/help'); 6 | }, 7 | 8 | pageName: element(by.binding('vm.pageName')), 9 | 10 | githubUser: element(by.binding('vm.githubUser')) 11 | 12 | }; 13 | -------------------------------------------------------------------------------- /src/app/help/tests/e2e/page.spec.js: -------------------------------------------------------------------------------- 1 | describe("e2e: help page", function() { 2 | var page = require('./page.object'); 3 | 4 | beforeEach(function() { 5 | page.get(); 6 | }); 7 | 8 | it("should page name : 'Help Page'", function() { 9 | // assertions 10 | expect(page.pageName.getText()).toContain('Help Page'); 11 | }); 12 | 13 | it("should githubUser be present", function() { 14 | expect(page.githubUser.isPresent()).toBeTruthy(); 15 | }); 16 | 17 | }); 18 | -------------------------------------------------------------------------------- /src/app/help/tests/unit/controller.spec.js: -------------------------------------------------------------------------------- 1 | describe('Testing Help Controller', function() { 2 | 3 | var vm; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module('help'); 10 | 11 | // inject dependencies 12 | inject(function($controller) { 13 | 14 | var githubUser = {login: 'erkobridee'}; 15 | 16 | vm = $controller('HelpCtrl', { 17 | githubUser: githubUser 18 | }); 19 | 20 | }); 21 | 22 | }); 23 | 24 | 25 | it('should have a pageName equals to \'Help Page\'', function() { 26 | 27 | // assertions 28 | expect(vm.pageName).toEqual('Help Page'); 29 | 30 | }); 31 | 32 | it("should have a githubUser equals to \'erkobridee\'", function() { 33 | 34 | // assertions 35 | expect(vm.githubUser.login).toEqual('erkobridee'); 36 | 37 | }); 38 | 39 | }); 40 | -------------------------------------------------------------------------------- /src/app/help/tests/unit/module.spec.js: -------------------------------------------------------------------------------- 1 | describe('Angular.js \'help\' Module', function() { 2 | 3 | var module; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module = angular.module('help'); 10 | 11 | }); 12 | 13 | it("should be registered", function() { 14 | 15 | // assertions 16 | expect(module).toBeDefined(); 17 | 18 | }); 19 | 20 | describe("Dependencies:", function() { 21 | 22 | var deps; 23 | 24 | var hasModule = function(m) { 25 | return deps.indexOf(m) >= 0; 26 | }; 27 | 28 | beforeEach(function() { 29 | deps = module.value('appName').requires; 30 | }); 31 | 32 | var mainDeps = [ 33 | 'ui.router' 34 | ]; 35 | 36 | mainDeps.forEach(function( depName ) { 37 | 38 | it('should have ' + depName + ' as a dependency', function() { 39 | 40 | // assertions 41 | expect(hasModule( depName )).toEqual(true); 42 | 43 | }); 44 | 45 | }); 46 | 47 | }); 48 | 49 | }); 50 | -------------------------------------------------------------------------------- /src/app/help/tests/unit/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | require('./module.spec'); 5 | require('./controller.spec'); 6 | require('./states.spec'); 7 | 8 | }); 9 | -------------------------------------------------------------------------------- /src/app/home/controller.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | 6 | module.controller('HomeCtrl', HomeCtrl); 7 | 8 | //--- 9 | 10 | HomeCtrl.$inject = ['toaster']; 11 | 12 | function HomeCtrl($toaster) { 13 | var vm = this; 14 | 15 | vm.pageName = 'Home Page'; 16 | vm.popup = popup; 17 | 18 | //--- 19 | 20 | function popup(type) { 21 | $toaster.pop(type, 'Title', 'Short description text...'); 22 | return 'toaster ' + type; 23 | } 24 | 25 | } 26 | 27 | }); 28 | -------------------------------------------------------------------------------- /src/app/home/module.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var angular = require('angular'); 5 | 6 | require('uiRouter'); 7 | 8 | require('toaster'); 9 | 10 | // angular module definition 11 | return angular.module( 12 | // module name 13 | 'home', 14 | 15 | // module dependencies 16 | [ 17 | 'ui.router', 18 | 19 | 'toaster' 20 | ] 21 | ); 22 | 23 | }); 24 | -------------------------------------------------------------------------------- /src/app/home/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | require('./controller'); 6 | require('./states'); 7 | 8 | return module; 9 | 10 | }); 11 | -------------------------------------------------------------------------------- /src/app/home/states.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | 6 | module.config(configureStates); 7 | 8 | //--- 9 | 10 | configureStates.$inject = ['$stateProvider', '$urlRouterProvider']; 11 | 12 | function configureStates($stateProvider, $urlRouterProvider) { 13 | 14 | $stateProvider 15 | .state('home', { 16 | url: '/home', 17 | views: { 18 | 'master': { 19 | templateUrl : 'app/main/templates/layout.html' 20 | }, 21 | 'content@home': { 22 | templateUrl : 'app/home/template.html', 23 | controller : 'HomeCtrl', 24 | controllerAs : 'vm' 25 | } 26 | } 27 | }); 28 | 29 | } 30 | 31 | }); 32 | -------------------------------------------------------------------------------- /src/app/home/template.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |

{{vm.pageName}} | About

5 |
6 |
7 | 8 |
9 |

Welcome to Angular.js Boilerplate Project

10 |
11 |
    12 |
  • 13 | 14 |
  • 15 |
  • 16 | 17 |
  • 18 |
  • 19 | 20 |
  • 21 |
  • 22 | 23 |
  • 24 |
25 |
26 | 27 | 28 |
29 | -------------------------------------------------------------------------------- /src/app/home/tests/e2e/page.object.js: -------------------------------------------------------------------------------- 1 | // Page Object 2 | module.exports = { 3 | 4 | get: function() { 5 | return browser.get('#/'); 6 | }, 7 | 8 | pageName: element(by.binding('vm.pageName')) 9 | 10 | }; 11 | -------------------------------------------------------------------------------- /src/app/home/tests/e2e/page.spec.js: -------------------------------------------------------------------------------- 1 | describe("e2e: home page", function() { 2 | var page = require('./page.object'); 3 | 4 | beforeEach(function() { 5 | page.get(); 6 | }); 7 | 8 | it("should page name : 'Home Page'", function() { 9 | // assertions 10 | expect(page.pageName.getText()).toContain('Home Page'); 11 | }); 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /src/app/home/tests/unit/controller.spec.js: -------------------------------------------------------------------------------- 1 | describe('Testing Home Controller', function() { 2 | 3 | var vm; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module('home'); 10 | 11 | // inject dependencies 12 | inject(function($controller) { 13 | 14 | vm = $controller('HomeCtrl'); 15 | 16 | }); 17 | 18 | }); 19 | 20 | 21 | it('should have a pageName equals to \'Home Page\'', function() { 22 | 23 | // assertions 24 | expect(vm.pageName).toEqual('Home Page'); 25 | 26 | }); 27 | 28 | it("should call success toaster...", function() { 29 | 30 | // assertions 31 | expect(vm.popup('success')).toEqual('toaster success'); 32 | 33 | }); 34 | 35 | }); 36 | -------------------------------------------------------------------------------- /src/app/home/tests/unit/module.spec.js: -------------------------------------------------------------------------------- 1 | describe('Angular.js \'home\' Module', function() { 2 | 3 | var module; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module = angular.module('home'); 10 | 11 | }); 12 | 13 | it("should be registered", function() { 14 | 15 | // assertions 16 | expect(module).toBeDefined(); 17 | 18 | }); 19 | 20 | describe("Dependencies:", function() { 21 | 22 | var deps; 23 | 24 | var hasModule = function(m) { 25 | return deps.indexOf(m) >= 0; 26 | }; 27 | 28 | beforeEach(function() { 29 | deps = module.value('appName').requires; 30 | }); 31 | 32 | var mainDeps = [ 33 | 'ui.router' 34 | ]; 35 | 36 | mainDeps.forEach(function( depName ) { 37 | 38 | it('should have ' + depName + ' as a dependency', function() { 39 | 40 | // assertions 41 | expect(hasModule( depName )).toEqual(true); 42 | 43 | }); 44 | 45 | }); 46 | 47 | }); 48 | 49 | }); 50 | -------------------------------------------------------------------------------- /src/app/home/tests/unit/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | require('./module.spec'); 5 | require('./controller.spec'); 6 | require('./states.spec'); 7 | 8 | }); 9 | -------------------------------------------------------------------------------- /src/app/main/controller.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | 6 | module.controller('MainCtrl', MainCtrl); 7 | 8 | //--- 9 | 10 | MainCtrl.$inject = ['ProgressConfig', 'MenuConfig']; 11 | 12 | function MainCtrl(progressConfig, menu) { 13 | var vm = this; 14 | 15 | //--- @begin: loading progressbar config 16 | progressConfig.eventListeners(); 17 | progressConfig.color('#428bca'); 18 | progressConfig.height('3px'); 19 | //--- @end: loading progressbar config 20 | 21 | //--- @begin: menu items 22 | menu.addMenuItem('Home', 'home'); 23 | menu.addMenuItem('Bookmarks', 'bookmarks'); 24 | 25 | 26 | // TODO: add here new item 27 | 28 | 29 | menu.addMenuItem('About', 'about'); 30 | menu.addMenuItem('Help', 'help', 'right'); 31 | //--- @end: menu items 32 | 33 | } 34 | 35 | }); 36 | -------------------------------------------------------------------------------- /src/app/main/module.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var angular = require('angular'); 5 | 6 | require('uiRouter'); 7 | require('uiBootstrap'); 8 | 9 | // angular module definition 10 | return angular.module( 11 | 12 | // module name 13 | 'main', 14 | 15 | // module dependencies 16 | [ 17 | 'ui.router', 18 | 'ui.bootstrap', 19 | 20 | require('./templates/cache').name, 21 | 22 | require('shared/fend/progressbar-loading/package').name, 23 | require('shared/fend/navbar/package').name, 24 | 25 | require('app/home/package').name, 26 | require('app/about/package').name, 27 | 28 | require('app/bookmarks/package').name, 29 | 30 | require('app/help/package').name, 31 | 32 | 33 | // TODO: add here module to load 34 | 35 | 36 | ] 37 | ); 38 | 39 | }); 40 | -------------------------------------------------------------------------------- /src/app/main/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | require('./controller'); 6 | require('./states'); 7 | 8 | return module; 9 | 10 | }); 11 | -------------------------------------------------------------------------------- /src/app/main/states.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | 6 | /* Tips: 7 | 8 | [Gist] AngularJS Lesson Learned #2: Enabling HTTP Credentials | Mário Junior 9 | https://gist.github.com/mariojunior/6175849 10 | 11 | [Gist] AngularJS Lesson Learned #1: Getting Invalid Session State | Mário Junior 12 | https://gist.github.com/mariojunior/6175736 13 | 14 | */ 15 | 16 | module.config(configureStates); 17 | 18 | //--- 19 | 20 | configureStates.$inject = ['$stateProvider', '$urlRouterProvider', '$httpProvider']; 21 | 22 | function configureStates($stateProvider, $urlRouterProvider, $httpProvider) { 23 | 24 | //------------------------------------------------ 25 | // @begin: angular.js $httpProvider useful configs 26 | 27 | // Enabling HTTP Credentials such as backend sessions 28 | //$httpProvider.defaults.withCredentials = true; 29 | 30 | // allow access to cross domain resource 31 | //$httpProvider.defaults.useXDomain = true; 32 | 33 | // @end: angular.js $httpProvider useful configs 34 | //------------------------------------------------ 35 | 36 | $urlRouterProvider 37 | .when('', '/home') // default 38 | .when('/', '/home') // default 39 | .otherwise("/404"); // For any unmatched url, redirect to /404 40 | 41 | $stateProvider 42 | .state('404', { 43 | url: '/404', 44 | views: { 45 | 'master': { 46 | templateUrl : 'app/main/templates/layout.html' 47 | }, 48 | /* 49 | 'navbar@404': { 50 | // default value on 'app/main/templates/layout.html' ui-view navbar 51 | templateUrl : 'app/main/templates/navbar.html' 52 | }, 53 | */ 54 | 'content@404': { 55 | templateUrl : 'app/main/templates/404.html' 56 | }/*, 57 | 'footer@404': { 58 | // default value on 'app/main/templates/layout.html' ui-view footer 59 | templateUrl : 'app/main/templates/footer.html' 60 | }*/ 61 | } 62 | 63 | }); 64 | 65 | } 66 | 67 | }); 68 | -------------------------------------------------------------------------------- /src/app/main/templates/404.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | Not Found 5 |
6 | 7 |
8 | -------------------------------------------------------------------------------- /src/app/main/templates/cache.js: -------------------------------------------------------------------------------- 1 | define(['angular'], function() { 2 | 3 | /* 4 | Do not change this file, it will be updated from html2js 5 | 6 | Não altere esse arquivo, ele será atualizado pelo html2js 7 | */ 8 | 9 | angular.module('templatesCache', []); 10 | 11 | return { name: 'templatesCache' }; 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /src/app/main/templates/footer.html: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /src/app/main/templates/layout.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | -------------------------------------------------------------------------------- /src/app/main/tests/unit/controller.spec.js: -------------------------------------------------------------------------------- 1 | describe('Testing Main Controller', function() { 2 | 3 | var vm; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module('main'); 10 | 11 | // inject dependencies 12 | inject(function($controller) { 13 | 14 | vm = $controller('MainCtrl'); 15 | 16 | }); 17 | 18 | }); 19 | 20 | 21 | it('should be defined', function() { 22 | 23 | // assertions 24 | expect(vm).toBeDefined(); 25 | 26 | }); 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /src/app/main/tests/unit/module.spec.js: -------------------------------------------------------------------------------- 1 | describe('Angular.js \'main\' Module', function() { 2 | 3 | var module; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module = angular.module('main'); 10 | 11 | }); 12 | 13 | it("should be registered", function() { 14 | 15 | // assertions 16 | expect(module).toBeDefined(); 17 | 18 | }); 19 | 20 | describe("Dependencies:", function() { 21 | 22 | var deps; 23 | 24 | var hasModule = function(m) { 25 | return deps.indexOf(m) >= 0; 26 | }; 27 | 28 | beforeEach(function() { 29 | deps = module.value('appName').requires; 30 | }); 31 | 32 | var mainDeps = [ 33 | 'ui.router', 34 | 'ui.bootstrap', 35 | 36 | 'templatesCache', 37 | 38 | 'fend.progressbar.loading', 39 | 'fend.navbar', 40 | 41 | 'home', 42 | 'about', 43 | 44 | 'bookmarks', 45 | 46 | 'help' 47 | ]; 48 | 49 | mainDeps.forEach(function( depName ) { 50 | 51 | it('should have ' + depName + ' as a dependency', function() { 52 | 53 | // assertions 54 | expect(hasModule( depName )).toEqual(true); 55 | 56 | }); 57 | 58 | }); 59 | 60 | }); 61 | 62 | }); 63 | -------------------------------------------------------------------------------- /src/app/main/tests/unit/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | require('./module.spec'); 5 | require('./controller.spec'); 6 | require('./states.spec'); 7 | 8 | }); 9 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Angular Standalone Boilerplate 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 39 | 40 | 48 | 49 | 50 | 51 | 52 | 53 |
54 | 55 |
56 |

57 |
Loading... 58 |

59 |
60 |
61 | 62 | 63 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/less/app.less: -------------------------------------------------------------------------------- 1 | 2 | /* -------------------------------------------------- */ 3 | /* @begin: bootstrap css */ 4 | 5 | @import 'shared/less/bootstrap/3.3.6/variables.less'; 6 | @import 'vendor/bootstrap/3.3.6/less/bootstrap.less'; 7 | @import 'shared/less/bootstrap/bs-callout.less'; 8 | 9 | /* @end: bootstrap css */ 10 | /* -------------------------------------------------- */ 11 | /* @begin: vendor/shared components css */ 12 | 13 | @import 'shared/less/top-bottom-screen.less'; 14 | 15 | @import 'vendor/ngProgress/1.0.3/ngProgress.less'; 16 | 17 | @import 'vendor/toaster/0.3.0/toaster.less'; 18 | 19 | /* @end: vendor/shared components css */ 20 | /* -------------------------------------------------- */ 21 | /* @begin: application css */ 22 | 23 | @import 'less/ui.bootstrap.less'; 24 | 25 | @import 'less/loading_app.less'; 26 | 27 | /* @end: application css */ 28 | /* -------------------------------------------------- */ 29 | -------------------------------------------------------------------------------- /src/less/loading_app.less: -------------------------------------------------------------------------------- 1 | .loading_app { 2 | position: fixed; top: 47%; left: 47%; 3 | } 4 | -------------------------------------------------------------------------------- /src/less/ui.bootstrap.less: -------------------------------------------------------------------------------- 1 | .nav, .pagination, .carousel, .panel-title a { cursor: pointer; } 2 | 3 | 4 | .tab-content { 5 | @border-conf: 1px solid #ddd; 6 | border-left: @border-conf; 7 | border-right: @border-conf; 8 | border-bottom: @border-conf; 9 | padding: 10px; 10 | } 11 | -------------------------------------------------------------------------------- /src/ng.app.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var angular = require('angular'); 5 | 6 | 7 | angular.element(document).ready(startAngularApp); 8 | 9 | //--- 10 | 11 | function startAngularApp() { 12 | 13 | console.log('bootstrap angular application'); 14 | 15 | // define run module to bootstrap application 16 | var module = angular.module( 17 | // module name 18 | 'run', 19 | 20 | // module dependencies 21 | [ 22 | // enable mock and intercep $HTTP requests 23 | require('./require.mock.load').name, 24 | 25 | require('app/main/package').name 26 | ] 27 | ); 28 | 29 | // https://github.com/angular/protractor/issues/66#issuecomment-186333950 30 | if(location.href.indexOf("protractor-test") < 0){ 31 | // start angular app 32 | angular.bootstrap(document, [module.name]); 33 | } else { 34 | // start angular app to protractor tests 35 | window.name = 'NG_DEFER_BOOTSTRAP!' + window.name; 36 | angular.bootstrap(document, [module.name]); 37 | } 38 | 39 | } 40 | 41 | }); 42 | -------------------------------------------------------------------------------- /src/require.mock.load.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('shared/mock/package'); 5 | 6 | //------------------- 7 | // @begin: load mocks 8 | 9 | require('app/help/mock/allow-pass-github'); 10 | 11 | require('app/bookmarks/mock/package'); 12 | 13 | 14 | // TODO: add here mock module to load 15 | 16 | 17 | // @end: load mocks 18 | //------------------- 19 | // return mock module 20 | return module; 21 | 22 | }); 23 | -------------------------------------------------------------------------------- /src/require.unit.load.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | require('shared/fend/progressbar-loading/tests/unit/package'); 5 | require('shared/fend/input-utils/tests/unit/package'); 6 | require('shared/fend/navbar/tests/unit/package'); 7 | require('shared/fend/pagination/tests/unit/package'); 8 | 9 | require('app/main/tests/unit/package'); 10 | require('app/home/tests/unit/package'); 11 | require('app/about/tests/unit/package'); 12 | require('app/help/tests/unit/package'); 13 | require('app/bookmarks/tests/unit/package'); 14 | 15 | 16 | // TODO: add here tests unit module to load 17 | 18 | 19 | }); 20 | -------------------------------------------------------------------------------- /src/shared/fallback/ie.js: -------------------------------------------------------------------------------- 1 | // Angular.js fallback 2 | (function() { 3 | var length, customTags = ['ng-include', 'ng-pluralize', 'ng-view', 'ng-repeat'] 4 | //.concat(['tabs', 'pane']) // TODO: ADD HERE APP CUSTOM TAGS 5 | .concat(['ng:include', 'ng:pluralize', 'ng:view']); // Optionally these for CSS 6 | length = customTags.length; 7 | while (length--) { document.createElement(customTags[length]); } 8 | })(); 9 | 10 | // IE - Avoid `console` errors in browsers that lack a console. 11 | (function() { 12 | var console, length, method, noop = function () {}, 13 | methods = [ 14 | 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', 15 | 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 16 | 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', 17 | 'timeStamp', 'trace', 'warn' 18 | ]; 19 | length = methods.length; 20 | console = (window.console = window.console || {}); 21 | while (length--) { 22 | method = methods[length]; 23 | // Only stub undefined methods. 24 | if (!console[method]) { 25 | console[method] = noop; 26 | } 27 | } 28 | }()); 29 | -------------------------------------------------------------------------------- /src/shared/fend/input-utils/directives/input.focus.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('../module'); 5 | 6 | /* 7 | based on: 8 | http://blog.ejci.net/2013/08/06/dealing-with-focus-and-blur-in-angularjs-directives/ 9 | */ 10 | 11 | module.directive('fendFocus', fendFocus); 12 | 13 | //--- 14 | 15 | function fendFocus() { 16 | 17 | var directive = { 18 | restrict: 'A', 19 | link: linkFunc 20 | }; 21 | 22 | return directive; 23 | 24 | //--- 25 | 26 | function linkFunc(scope, element, attr, ctrl) { 27 | 28 | scope.$watch(attr.fendFocus, function (n, o) { 29 | if (n !== 0 && n) { 30 | element[0].focus(); 31 | } 32 | }); 33 | 34 | } 35 | 36 | } 37 | 38 | }); 39 | -------------------------------------------------------------------------------- /src/shared/fend/input-utils/module.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var angular = require('angular'); 5 | 6 | // angular module definition 7 | return angular.module( 8 | // module name 9 | 'fend.input.utils', 10 | 11 | // module dependencies 12 | [] 13 | ); 14 | 15 | }); 16 | -------------------------------------------------------------------------------- /src/shared/fend/input-utils/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | require('./factories/input.focus'); 6 | require('./directives/input.focus'); 7 | 8 | return module; 9 | 10 | }); 11 | -------------------------------------------------------------------------------- /src/shared/fend/input-utils/tests/unit/directives/input.focus.spec.js: -------------------------------------------------------------------------------- 1 | describe("Testing fend.input.utils Input Focus Directive", function() { 2 | 3 | var scope, compile, doc, body; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module('fend.input.utils'); 10 | 11 | // inject dependencies 12 | inject(function($rootScope, $compile, $document) { 13 | scope = $rootScope.$new(); 14 | compile = $compile; 15 | doc = $document; 16 | }); 17 | 18 | body = angular.element(doc[0].body); 19 | 20 | }); 21 | 22 | describe("as attribute", function() { 23 | 24 | var fieldName = 'inputField', 25 | modelName = 'inputFieldModel', 26 | focusName = 'focusInputField'; 27 | 28 | var element; 29 | 30 | beforeEach(function() { 31 | 32 | scope[focusName] = false; 33 | scope[modelName] = 'some value'; 34 | 35 | element = compile('')(scope); 36 | scope.$digest(); 37 | body.append(element); // important to receive focus test 38 | 39 | }); 40 | 41 | 42 | it("should have fend-focus attribute equals to " + focusName, function() { 43 | 44 | // assertions 45 | expect(element.attr('fend-focus')).toEqual(focusName); 46 | 47 | }); 48 | 49 | 50 | it("should receive focus", function() { 51 | 52 | // act 53 | scope[focusName] = true; 54 | scope.$digest(); 55 | 56 | // assertions 57 | expect(document.activeElement === element[0]).toBeTruthy(); 58 | 59 | }); 60 | 61 | 62 | }); 63 | 64 | }); 65 | -------------------------------------------------------------------------------- /src/shared/fend/input-utils/tests/unit/module.spec.js: -------------------------------------------------------------------------------- 1 | describe('Angular.js \'fend.input.utils\' Module', function() { 2 | 3 | var module; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module = angular.module('fend.input.utils'); 10 | 11 | }); 12 | 13 | it("should be registered", function() { 14 | 15 | // assertions 16 | expect(module).toBeDefined(); 17 | 18 | }); 19 | 20 | /* 21 | describe("Dependencies:", function() { 22 | 23 | var deps; 24 | 25 | var hasModule = function(m) { 26 | return deps.indexOf(m) >= 0; 27 | }; 28 | 29 | beforeEach(function() { 30 | deps = module.value('appName').requires; 31 | }); 32 | 33 | var mainDeps = [ 34 | // TODO: define 35 | ]; 36 | 37 | mainDeps.forEach(function( depName ) { 38 | 39 | it('should have ' + depName + ' as a dependency', function() { 40 | 41 | // assertions 42 | expect(hasModule( depName )).toEqual(true); 43 | 44 | }); 45 | 46 | }); 47 | 48 | }); 49 | */ 50 | 51 | }); 52 | -------------------------------------------------------------------------------- /src/shared/fend/input-utils/tests/unit/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | require('./module.spec'); 5 | require('./directives/input.focus.spec'); 6 | require('./factories/input.focus.spec'); 7 | 8 | }); 9 | -------------------------------------------------------------------------------- /src/shared/fend/navbar/module.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var angular = require('angular'); 5 | 6 | // agular module definition 7 | return angular.module( 8 | // module name 9 | 'fend.navbar', 10 | 11 | // module dependencies 12 | [ 13 | 14 | ] 15 | ); 16 | 17 | }); 18 | -------------------------------------------------------------------------------- /src/shared/fend/navbar/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | require('./factories/menu.config'); 6 | 7 | return module; 8 | 9 | }); 10 | -------------------------------------------------------------------------------- /src/shared/fend/navbar/tests/unit/module.spec.js: -------------------------------------------------------------------------------- 1 | describe('Angular.js \'fend.navbar\' Module', function() { 2 | 3 | var module; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module = angular.module('fend.navbar'); 10 | 11 | }); 12 | 13 | it("should be registered", function() { 14 | 15 | // assertions 16 | expect(module).toBeDefined(); 17 | 18 | }); 19 | 20 | /* 21 | describe("Dependencies:", function() { 22 | 23 | var deps; 24 | 25 | var hasModule = function(m) { 26 | return deps.indexOf(m) >= 0; 27 | }; 28 | 29 | beforeEach(function() { 30 | deps = module.value('appName').requires; 31 | }); 32 | 33 | var mainDeps = [ 34 | // TODO: define 35 | ]; 36 | 37 | mainDeps.forEach(function( depName ) { 38 | 39 | it('should have ' + depName + ' as a dependency', function() { 40 | 41 | // assertions 42 | expect(hasModule( depName )).toEqual(true); 43 | 44 | }); 45 | 46 | }); 47 | 48 | }); 49 | */ 50 | 51 | }); 52 | -------------------------------------------------------------------------------- /src/shared/fend/navbar/tests/unit/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | require('./module.spec'); 5 | require('./factories/menu.config.spec'); 6 | 7 | }); 8 | -------------------------------------------------------------------------------- /src/shared/fend/pagination/module.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var angular = require('angular'); 5 | 6 | // angular module definition 7 | return angular.module( 8 | // module name 9 | 'fend.pagination', 10 | 11 | // module dependencies 12 | [] 13 | ); 14 | 15 | }); 16 | -------------------------------------------------------------------------------- /src/shared/fend/pagination/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | require('./factory'); 6 | 7 | return module; 8 | 9 | }); 10 | -------------------------------------------------------------------------------- /src/shared/fend/pagination/tests/unit/module.spec.js: -------------------------------------------------------------------------------- 1 | describe('Angular.js \'fend.pagination\' Module', function() { 2 | 3 | var module; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module = angular.module('fend.pagination'); 10 | 11 | }); 12 | 13 | it("should be registered", function() { 14 | 15 | // assertions 16 | expect(module).toBeDefined(); 17 | 18 | }); 19 | 20 | /* 21 | describe("Dependencies:", function() { 22 | 23 | var deps; 24 | 25 | var hasModule = function(m) { 26 | return deps.indexOf(m) >= 0; 27 | }; 28 | 29 | beforeEach(function() { 30 | deps = module.value('appName').requires; 31 | }); 32 | 33 | var mainDeps = [ 34 | // TODO: define 35 | ]; 36 | 37 | mainDeps.forEach(function( depName ) { 38 | 39 | it('should have ' + depName + ' as a dependency', function() { 40 | 41 | // assertions 42 | expect(hasModule( depName )).toEqual(true); 43 | 44 | }); 45 | 46 | }); 47 | 48 | }); 49 | */ 50 | 51 | }); 52 | -------------------------------------------------------------------------------- /src/shared/fend/pagination/tests/unit/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | require('./module.spec'); 5 | require('./factory.spec'); 6 | 7 | }); 8 | -------------------------------------------------------------------------------- /src/shared/fend/progressbar-loading/factories/progress.config.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('../module'); 5 | 6 | module.factory('ProgressConfig', ProgressConfig); 7 | 8 | //--- 9 | 10 | ProgressConfig.$inject = ['$rootScope', 'ngProgress']; 11 | 12 | function ProgressConfig($rootScope, ngProgress) { 13 | 14 | var service = { 15 | eventListeners: eventListeners, 16 | color: color, 17 | height: height 18 | }; 19 | 20 | return service; 21 | 22 | //--- 23 | 24 | function eventListeners() { 25 | 26 | $rootScope.$on('loadingbar:start:event', function(event) { 27 | ngProgress.start(); 28 | }); 29 | 30 | $rootScope.$on('loadingbar:progress:event', function(event, value) { 31 | ngProgress.set(value); 32 | }); 33 | 34 | $rootScope.$on('loadingbar:complete:event', function(event) { 35 | ngProgress.complete(); 36 | ngProgress.stop(); 37 | }); 38 | 39 | } 40 | 41 | function color(new_color) { 42 | ngProgress.color(new_color); 43 | } 44 | 45 | function height(new_height) { 46 | ngProgress.height(new_height); 47 | } 48 | 49 | } 50 | 51 | }); 52 | -------------------------------------------------------------------------------- /src/shared/fend/progressbar-loading/factories/progress.status.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('../module'); 5 | 6 | module.factory('ProgressStatus', ProgressStatus); 7 | 8 | //--- 9 | 10 | ProgressStatus.$inject = ['$rootScope']; 11 | 12 | function ProgressStatus($rootScope) { 13 | 14 | var service = { 15 | start: start, 16 | progress: progress, 17 | complete: complete 18 | }; 19 | 20 | return service; 21 | 22 | //--- 23 | 24 | function start() { 25 | $rootScope.$emit('loadingbar:start:event'); 26 | } 27 | 28 | function progress(value) { 29 | $rootScope.$emit('loadingbar:progress:event', value*100); 30 | } 31 | 32 | function complete() { 33 | $rootScope.$emit('loadingbar:complete:event'); 34 | } 35 | 36 | } 37 | 38 | }); 39 | -------------------------------------------------------------------------------- /src/shared/fend/progressbar-loading/interceptors/http.config.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('../module'); 5 | 6 | module.config(configure); 7 | //--- 8 | 9 | configure.$inject = ['$httpProvider', '$provide']; 10 | 11 | function configure($httpProvider, $provide) { 12 | 13 | $provide.factory('ProgressInterceptorDefined', ProgressInterceptorDefined); 14 | 15 | $httpProvider.interceptors.push('ProgressInterceptorDefined'); 16 | 17 | //--- 18 | 19 | ProgressInterceptorDefined.$inject = ['ProgressInterceptor']; 20 | 21 | function ProgressInterceptorDefined(progress) { 22 | 23 | progress.setHttpProviderDefaults($httpProvider); 24 | return progress; 25 | 26 | } 27 | 28 | } 29 | 30 | }); 31 | -------------------------------------------------------------------------------- /src/shared/fend/progressbar-loading/module.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var angular = require('angular'); 5 | require('ngProgress'); 6 | 7 | // angular module definition 8 | return angular.module( 9 | // module name 10 | 'fend.progressbar.loading', 11 | 12 | // module dependencies 13 | [ 14 | 'ngProgress' 15 | ] 16 | ); 17 | 18 | }); 19 | -------------------------------------------------------------------------------- /src/shared/fend/progressbar-loading/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | require('./factories/progress.config'); 6 | require('./factories/progress.status'); 7 | require('./factories/progress.interceptor'); 8 | require('./interceptors/http.config'); 9 | 10 | return module; 11 | 12 | }); 13 | -------------------------------------------------------------------------------- /src/shared/fend/progressbar-loading/tests/unit/factories/progress.status.spec.js: -------------------------------------------------------------------------------- 1 | describe("Testing fend.progressbar.loading Progress Status Factory", function() { 2 | 3 | var rootScope, status; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module('fend.progressbar.loading'); 10 | 11 | // inject dependencies 12 | inject(function($rootScope, ProgressStatus) { 13 | 14 | rootScope = $rootScope; 15 | 16 | status = ProgressStatus; 17 | 18 | }); 19 | 20 | // arrange 21 | spyOn(rootScope, '$emit'); 22 | 23 | }); 24 | 25 | 26 | it("should be registered", function() { 27 | 28 | // assertions 29 | expect(status).toBeDefined(); 30 | 31 | }); 32 | 33 | it("should start progress", function() { 34 | 35 | // act 36 | status.start(); 37 | 38 | // assertions 39 | expect(rootScope.$emit).toHaveBeenCalledWith('loadingbar:start:event'); 40 | 41 | 42 | }); 43 | 44 | it("should set progress value", function() { 45 | 46 | // arrange 47 | var value = 42; 48 | 49 | // act 50 | status.progress(value); 51 | 52 | // assertions 53 | expect(rootScope.$emit).toHaveBeenCalledWith('loadingbar:progress:event', value*100); 54 | 55 | }); 56 | 57 | it("should complete progress", function() { 58 | 59 | // act 60 | status.complete(); 61 | 62 | // assertions 63 | expect(rootScope.$emit).toHaveBeenCalledWith('loadingbar:complete:event'); 64 | 65 | }); 66 | 67 | }); 68 | -------------------------------------------------------------------------------- /src/shared/fend/progressbar-loading/tests/unit/module.spec.js: -------------------------------------------------------------------------------- 1 | describe('Angular.js \'fend.progressbar.loading\' Module', function() { 2 | 3 | var module; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module = angular.module('fend.progressbar.loading'); 10 | 11 | }); 12 | 13 | it("should be registered", function() { 14 | 15 | // assertions 16 | expect(module).toBeDefined(); 17 | 18 | }); 19 | 20 | 21 | describe("Dependencies:", function() { 22 | 23 | var deps; 24 | 25 | var hasModule = function(m) { 26 | return deps.indexOf(m) >= 0; 27 | }; 28 | 29 | beforeEach(function() { 30 | deps = module.value('appName').requires; 31 | }); 32 | 33 | var mainDeps = [ 34 | 'ngProgress' 35 | ]; 36 | 37 | mainDeps.forEach(function( depName ) { 38 | 39 | it('should have ' + depName + ' as a dependency', function() { 40 | 41 | // assertions 42 | expect(hasModule( depName )).toEqual(true); 43 | 44 | }); 45 | 46 | }); 47 | 48 | }); 49 | 50 | 51 | }); 52 | -------------------------------------------------------------------------------- /src/shared/fend/progressbar-loading/tests/unit/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | require('./module.spec'); 5 | require('./factories/progress.config.spec'); 6 | require('./factories/progress.status.spec'); 7 | require('./factories/progress.interceptor.spec'); 8 | 9 | }); 10 | -------------------------------------------------------------------------------- /src/shared/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-front/angularjs-ee-boilerplate/10cce3ded9990a9a6f28a7a256af2e0af27c14cf/src/shared/img/favicon.ico -------------------------------------------------------------------------------- /src/shared/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-front/angularjs-ee-boilerplate/10cce3ded9990a9a6f28a7a256af2e0af27c14cf/src/shared/img/loading.gif -------------------------------------------------------------------------------- /src/shared/less/bootstrap/bs-callout.less: -------------------------------------------------------------------------------- 1 | /* source: twitter bootstrap 2 | https://github.com/twbs/bootstrap/blob/master/docs-assets/css/docs.css 3 | */ 4 | 5 | /** 6 | * Callouts 7 | * 8 | * Not quite alerts, but custom and helpful notes for folks reading the docs. 9 | * Requires a base and modifier class. 10 | */ 11 | 12 | /* Common styles for all types */ 13 | .bs-callout { 14 | margin: 20px 0; 15 | padding: 20px; 16 | border-left: 3px solid #eee; 17 | } 18 | .bs-callout h4 { 19 | margin-top: 0; 20 | margin-bottom: 5px; 21 | } 22 | .bs-callout p:last-child { 23 | margin-bottom: 0; 24 | } 25 | 26 | /* Variations */ 27 | .bs-callout-danger { 28 | background-color: #fdf7f7; 29 | border-color: #eed3d7; 30 | } 31 | .bs-callout-danger h4 { 32 | color: #b94a48; 33 | } 34 | .bs-callout-warning { 35 | background-color: #faf8f0; 36 | border-color: #faebcc; 37 | } 38 | .bs-callout-warning h4 { 39 | color: #c09853; 40 | } 41 | .bs-callout-info { 42 | background-color: #f4f8fa; 43 | border-color: #bce8f1; 44 | } 45 | .bs-callout-info h4 { 46 | color: #3a87ad; 47 | } 48 | -------------------------------------------------------------------------------- /src/shared/less/top-bottom-screen.less: -------------------------------------------------------------------------------- 1 | /* Sticky footer styles 2 | -------------------------------------------------- */ 3 | 4 | html { 5 | position: relative; 6 | min-height: 100%; 7 | } 8 | 9 | .wrap { 10 | /* Margin bottom by footer height */ 11 | margin-bottom: 60px; 12 | } 13 | 14 | .footer { 15 | position: absolute; 16 | bottom: 0; 17 | width: 100%; 18 | /* Set the fixed height of the footer here */ 19 | height: 60px; 20 | background-color: #f5f5f5; 21 | } 22 | 23 | 24 | /* Custom page CSS 25 | -------------------------------------------------- */ 26 | /* Not required for template or sticky footer method. */ 27 | 28 | .wrap > .container, .container-fluid { 29 | padding: 60px 15px 0; 30 | } 31 | 32 | .container .text-muted { 33 | margin: 20px 0; 34 | } 35 | 36 | .footer > .container { 37 | padding-right: 15px; 38 | padding-left: 15px; 39 | } 40 | -------------------------------------------------------------------------------- /src/shared/mock/allow-pass-jsonp.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var backend = require('shared/mock/backend'); 5 | 6 | console.log('load jsonp allow pass mock'); 7 | 8 | backend.addResource(AllowPass); 9 | 10 | //--- 11 | 12 | AllowPass.$inject = ['$httpBackend', 'regexpUrl']; 13 | 14 | function AllowPass(httpBackend, regexpUrl) { 15 | 16 | // Allow JSONP to pass to external services (ie Solr) 17 | httpBackend.when('JSONP', regexpUrl(/http:\/\/.*/)).passThrough(); 18 | 19 | } 20 | 21 | }); 22 | -------------------------------------------------------------------------------- /src/shared/mock/backend.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var angular = require('angular'); 5 | require('shared/mock/module'); 6 | 7 | return angular.mock.backend; 8 | 9 | }); 10 | -------------------------------------------------------------------------------- /src/shared/mock/module.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var angular = require('angular'); 5 | require('angularMocksBackend'); 6 | 7 | // get mock module 8 | return angular.module('ngMockBackend'); 9 | 10 | }); 11 | -------------------------------------------------------------------------------- /src/shared/mock/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | require('./backend'); 6 | require('./helpers'); 7 | require('./datastore'); 8 | require('./allow-pass-jsonp'); 9 | 10 | return module; 11 | 12 | }); 13 | -------------------------------------------------------------------------------- /src/vendor/angular.js/1.5.0/angular-cookies.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.5.0 3 | (c) 2010-2016 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(p,c,n){'use strict';function l(b,a,g){var d=g.baseHref(),k=b[0];return function(b,e,f){var g,h;f=f||{};h=f.expires;g=c.isDefined(f.path)?f.path:d;c.isUndefined(e)&&(h="Thu, 01 Jan 1970 00:00:00 GMT",e="");c.isString(h)&&(h=new Date(h));e=encodeURIComponent(b)+"="+encodeURIComponent(e);e=e+(g?";path="+g:"")+(f.domain?";domain="+f.domain:"");e+=h?";expires="+h.toUTCString():"";e+=f.secure?";secure":"";f=e.length+1;4096 4096 bytes)!");k.cookie=e}}c.module("ngCookies",["ng"]).provider("$cookies",[function(){var b=this.defaults={};this.$get=["$$cookieReader","$$cookieWriter",function(a,g){return{get:function(d){return a()[d]},getObject:function(d){return(d=this.get(d))?c.fromJson(d):d},getAll:function(){return a()},put:function(d,a,m){g(d,a,m?c.extend({},b,m):b)},putObject:function(d,b,a){this.put(d,c.toJson(b),a)},remove:function(a,k){g(a,n,k?c.extend({},b,k):b)}}}]}]);c.module("ngCookies").factory("$cookieStore", 8 | ["$cookies",function(b){return{get:function(a){return b.getObject(a)},put:function(a,c){b.putObject(a,c)},remove:function(a){b.remove(a)}}}]);l.$inject=["$document","$log","$browser"];c.module("ngCookies").provider("$$cookieWriter",function(){this.$get=l})})(window,window.angular); 9 | //# sourceMappingURL=angular-cookies.min.js.map 10 | -------------------------------------------------------------------------------- /src/vendor/angular.js/1.5.0/angular-csp.css: -------------------------------------------------------------------------------- 1 | /* Include this file in your html if you are using the CSP mode. */ 2 | 3 | @charset "UTF-8"; 4 | 5 | [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], 6 | .ng-cloak, .x-ng-cloak, 7 | .ng-hide:not(.ng-hide-animate) { 8 | display: none !important; 9 | } 10 | 11 | ng\:form { 12 | display: block; 13 | } 14 | 15 | .ng-animate-shim { 16 | visibility:hidden; 17 | } 18 | 19 | .ng-anchor { 20 | position:absolute; 21 | } 22 | -------------------------------------------------------------------------------- /src/vendor/angular.js/1.5.0/angular-loader.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.5.0 3 | (c) 2010-2016 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(){'use strict';function d(b){return function(){var a=arguments[0],e;e="["+(b?b+":":"")+a+"] http://errors.angularjs.org/1.5.0/"+(b?b+"/":"")+a;for(a=1;a p, 29 | > ul { 30 | margin-bottom: 0; 31 | } 32 | 33 | > p + p { 34 | margin-top: 5px; 35 | } 36 | } 37 | 38 | // Dismissible alerts 39 | // 40 | // Expand the right padding and account for the close button's positioning. 41 | 42 | .alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0. 43 | .alert-dismissible { 44 | padding-right: (@alert-padding + 20); 45 | 46 | // Adjust close link position 47 | .close { 48 | position: relative; 49 | top: -2px; 50 | right: -21px; 51 | color: inherit; 52 | } 53 | } 54 | 55 | // Alternate styles 56 | // 57 | // Generate contextual modifier classes for colorizing the alert. 58 | 59 | .alert-success { 60 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); 61 | } 62 | 63 | .alert-info { 64 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); 65 | } 66 | 67 | .alert-warning { 68 | .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); 69 | } 70 | 71 | .alert-danger { 72 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); 73 | } 74 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/badges.less: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: @font-size-small; 12 | font-weight: @badge-font-weight; 13 | color: @badge-color; 14 | line-height: @badge-line-height; 15 | vertical-align: middle; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: @badge-bg; 19 | border-radius: @badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | 26 | // Quick fix for badges in buttons 27 | .btn & { 28 | position: relative; 29 | top: -1px; 30 | } 31 | 32 | .btn-xs &, 33 | .btn-group-xs > .btn & { 34 | top: 0; 35 | padding: 1px 5px; 36 | } 37 | 38 | // Hover state, but only for links 39 | a& { 40 | &:hover, 41 | &:focus { 42 | color: @badge-link-hover-color; 43 | text-decoration: none; 44 | cursor: pointer; 45 | } 46 | } 47 | 48 | // Account for badges in navs 49 | .list-group-item.active > &, 50 | .nav-pills > .active > a > & { 51 | color: @badge-active-color; 52 | background-color: @badge-active-bg; 53 | } 54 | 55 | .list-group-item > & { 56 | float: right; 57 | } 58 | 59 | .list-group-item > & + & { 60 | margin-right: 5px; 61 | } 62 | 63 | .nav-pills > li > a > & { 64 | margin-left: 3px; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/bootstrap.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.6 (http://getbootstrap.com) 3 | * Copyright 2011-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | // Core variables and mixins 8 | // @import "variables.less"; 9 | @import "mixins.less"; 10 | 11 | // Reset and dependencies 12 | @import "normalize.less"; 13 | @import "print.less"; 14 | @import "glyphicons.less"; 15 | 16 | // Core CSS 17 | @import "scaffolding.less"; 18 | @import "type.less"; 19 | @import "code.less"; 20 | @import "grid.less"; 21 | @import "tables.less"; 22 | @import "forms.less"; 23 | @import "buttons.less"; 24 | 25 | // Components 26 | @import "component-animations.less"; 27 | @import "dropdowns.less"; 28 | @import "button-groups.less"; 29 | @import "input-groups.less"; 30 | @import "navs.less"; 31 | @import "navbar.less"; 32 | @import "breadcrumbs.less"; 33 | @import "pagination.less"; 34 | @import "pager.less"; 35 | @import "labels.less"; 36 | @import "badges.less"; 37 | @import "jumbotron.less"; 38 | @import "thumbnails.less"; 39 | @import "alerts.less"; 40 | @import "progress-bars.less"; 41 | @import "media.less"; 42 | @import "list-group.less"; 43 | @import "panels.less"; 44 | @import "responsive-embed.less"; 45 | @import "wells.less"; 46 | @import "close.less"; 47 | 48 | // Components w/ JavaScript 49 | @import "modals.less"; 50 | @import "tooltip.less"; 51 | @import "popovers.less"; 52 | @import "carousel.less"; 53 | 54 | // Utility classes 55 | @import "utilities.less"; 56 | @import "responsive-utilities.less"; 57 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | 13 | > li { 14 | display: inline-block; 15 | 16 | + li:before { 17 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 18 | padding: 0 5px; 19 | color: @breadcrumb-color; 20 | } 21 | } 22 | 23 | > .active { 24 | color: @breadcrumb-active-color; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile 27 | button& { 28 | padding: 0; 29 | cursor: pointer; 30 | background: transparent; 31 | border: 0; 32 | -webkit-appearance: none; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/code.less: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and block) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | kbd, 9 | pre, 10 | samp { 11 | font-family: @font-family-monospace; 12 | } 13 | 14 | // Inline code 15 | code { 16 | padding: 2px 4px; 17 | font-size: 90%; 18 | color: @code-color; 19 | background-color: @code-bg; 20 | border-radius: @border-radius-base; 21 | } 22 | 23 | // User input typically entered via keyboard 24 | kbd { 25 | padding: 2px 4px; 26 | font-size: 90%; 27 | color: @kbd-color; 28 | background-color: @kbd-bg; 29 | border-radius: @border-radius-small; 30 | box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); 31 | 32 | kbd { 33 | padding: 0; 34 | font-size: 100%; 35 | font-weight: bold; 36 | box-shadow: none; 37 | } 38 | } 39 | 40 | // Blocks of code 41 | pre { 42 | display: block; 43 | padding: ((@line-height-computed - 1) / 2); 44 | margin: 0 0 (@line-height-computed / 2); 45 | font-size: (@font-size-base - 1); // 14px to 13px 46 | line-height: @line-height-base; 47 | word-break: break-all; 48 | word-wrap: break-word; 49 | color: @pre-color; 50 | background-color: @pre-bg; 51 | border: 1px solid @pre-border-color; 52 | border-radius: @border-radius-base; 53 | 54 | // Account for some code outputs that place code tags in pre tags 55 | code { 56 | padding: 0; 57 | font-size: inherit; 58 | color: inherit; 59 | white-space: pre-wrap; 60 | background-color: transparent; 61 | border-radius: 0; 62 | } 63 | } 64 | 65 | // Enable scrollable blocks of code 66 | .pre-scrollable { 67 | max-height: @pre-scrollable-max-height; 68 | overflow-y: scroll; 69 | } 70 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | 21 | &.in { display: block; } 22 | tr&.in { display: table-row; } 23 | tbody&.in { display: table-row-group; } 24 | } 25 | 26 | .collapsing { 27 | position: relative; 28 | height: 0; 29 | overflow: hidden; 30 | .transition-property(~"height, visibility"); 31 | .transition-duration(.35s); 32 | .transition-timing-function(ease); 33 | } 34 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/grid.less: -------------------------------------------------------------------------------- 1 | // 2 | // Grid system 3 | // -------------------------------------------------- 4 | 5 | 6 | // Container widths 7 | // 8 | // Set the container width, and override it for fixed navbars in media queries. 9 | 10 | .container { 11 | .container-fixed(); 12 | 13 | @media (min-width: @screen-sm-min) { 14 | width: @container-sm; 15 | } 16 | @media (min-width: @screen-md-min) { 17 | width: @container-md; 18 | } 19 | @media (min-width: @screen-lg-min) { 20 | width: @container-lg; 21 | } 22 | } 23 | 24 | 25 | // Fluid container 26 | // 27 | // Utilizes the mixin meant for fixed width containers, but without any defined 28 | // width for fluid, full width layouts. 29 | 30 | .container-fluid { 31 | .container-fixed(); 32 | } 33 | 34 | 35 | // Row 36 | // 37 | // Rows contain and clear the floats of your columns. 38 | 39 | .row { 40 | .make-row(); 41 | } 42 | 43 | 44 | // Columns 45 | // 46 | // Common styles for small and large grid columns 47 | 48 | .make-grid-columns(); 49 | 50 | 51 | // Extra small grid 52 | // 53 | // Columns, offsets, pushes, and pulls for extra small devices like 54 | // smartphones. 55 | 56 | .make-grid(xs); 57 | 58 | 59 | // Small grid 60 | // 61 | // Columns, offsets, pushes, and pulls for the small device range, from phones 62 | // to tablets. 63 | 64 | @media (min-width: @screen-sm-min) { 65 | .make-grid(sm); 66 | } 67 | 68 | 69 | // Medium grid 70 | // 71 | // Columns, offsets, pushes, and pulls for the desktop device range. 72 | 73 | @media (min-width: @screen-md-min) { 74 | .make-grid(md); 75 | } 76 | 77 | 78 | // Large grid 79 | // 80 | // Columns, offsets, pushes, and pulls for the large desktop device range. 81 | 82 | @media (min-width: @screen-lg-min) { 83 | .make-grid(lg); 84 | } 85 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/jumbotron.less: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding-top: @jumbotron-padding; 8 | padding-bottom: @jumbotron-padding; 9 | margin-bottom: @jumbotron-padding; 10 | color: @jumbotron-color; 11 | background-color: @jumbotron-bg; 12 | 13 | h1, 14 | .h1 { 15 | color: @jumbotron-heading-color; 16 | } 17 | 18 | p { 19 | margin-bottom: (@jumbotron-padding / 2); 20 | font-size: @jumbotron-font-size; 21 | font-weight: 200; 22 | } 23 | 24 | > hr { 25 | border-top-color: darken(@jumbotron-bg, 10%); 26 | } 27 | 28 | .container &, 29 | .container-fluid & { 30 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container 31 | padding-left: (@grid-gutter-width / 2); 32 | padding-right: (@grid-gutter-width / 2); 33 | } 34 | 35 | .container { 36 | max-width: 100%; 37 | } 38 | 39 | @media screen and (min-width: @screen-sm-min) { 40 | padding-top: (@jumbotron-padding * 1.6); 41 | padding-bottom: (@jumbotron-padding * 1.6); 42 | 43 | .container &, 44 | .container-fluid & { 45 | padding-left: (@jumbotron-padding * 2); 46 | padding-right: (@jumbotron-padding * 2); 47 | } 48 | 49 | h1, 50 | .h1 { 51 | font-size: @jumbotron-heading-font-size; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/labels.less: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: @label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // Add hover effects, but only for links 18 | a& { 19 | &:hover, 20 | &:focus { 21 | color: @label-link-hover-color; 22 | text-decoration: none; 23 | cursor: pointer; 24 | } 25 | } 26 | 27 | // Empty labels collapse automatically (not available in IE8) 28 | &:empty { 29 | display: none; 30 | } 31 | 32 | // Quick fix for labels in buttons 33 | .btn & { 34 | position: relative; 35 | top: -1px; 36 | } 37 | } 38 | 39 | // Colors 40 | // Contextual variations (linked labels get darker on :hover) 41 | 42 | .label-default { 43 | .label-variant(@label-default-bg); 44 | } 45 | 46 | .label-primary { 47 | .label-variant(@label-primary-bg); 48 | } 49 | 50 | .label-success { 51 | .label-variant(@label-success-bg); 52 | } 53 | 54 | .label-info { 55 | .label-variant(@label-info-bg); 56 | } 57 | 58 | .label-warning { 59 | .label-variant(@label-warning-bg); 60 | } 61 | 62 | .label-danger { 63 | .label-variant(@label-danger-bg); 64 | } 65 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/media.less: -------------------------------------------------------------------------------- 1 | .media { 2 | // Proper spacing between instances of .media 3 | margin-top: 15px; 4 | 5 | &:first-child { 6 | margin-top: 0; 7 | } 8 | } 9 | 10 | .media, 11 | .media-body { 12 | zoom: 1; 13 | overflow: hidden; 14 | } 15 | 16 | .media-body { 17 | width: 10000px; 18 | } 19 | 20 | .media-object { 21 | display: block; 22 | 23 | // Fix collapse in webkit from max-width: 100% and display: table-cell. 24 | &.img-thumbnail { 25 | max-width: none; 26 | } 27 | } 28 | 29 | .media-right, 30 | .media > .pull-right { 31 | padding-left: 10px; 32 | } 33 | 34 | .media-left, 35 | .media > .pull-left { 36 | padding-right: 10px; 37 | } 38 | 39 | .media-left, 40 | .media-right, 41 | .media-body { 42 | display: table-cell; 43 | vertical-align: top; 44 | } 45 | 46 | .media-middle { 47 | vertical-align: middle; 48 | } 49 | 50 | .media-bottom { 51 | vertical-align: bottom; 52 | } 53 | 54 | // Reset margins on headings for tighter default spacing 55 | .media-heading { 56 | margin-top: 0; 57 | margin-bottom: 5px; 58 | } 59 | 60 | // Media list variation 61 | // 62 | // Undo default ul/ol styles 63 | .media-list { 64 | padding-left: 0; 65 | list-style: none; 66 | } 67 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------------------------------- 3 | 4 | // Utilities 5 | @import "mixins/hide-text.less"; 6 | @import "mixins/opacity.less"; 7 | @import "mixins/image.less"; 8 | @import "mixins/labels.less"; 9 | @import "mixins/reset-filter.less"; 10 | @import "mixins/resize.less"; 11 | @import "mixins/responsive-visibility.less"; 12 | @import "mixins/size.less"; 13 | @import "mixins/tab-focus.less"; 14 | @import "mixins/reset-text.less"; 15 | @import "mixins/text-emphasis.less"; 16 | @import "mixins/text-overflow.less"; 17 | @import "mixins/vendor-prefixes.less"; 18 | 19 | // Components 20 | @import "mixins/alerts.less"; 21 | @import "mixins/buttons.less"; 22 | @import "mixins/panels.less"; 23 | @import "mixins/pagination.less"; 24 | @import "mixins/list-group.less"; 25 | @import "mixins/nav-divider.less"; 26 | @import "mixins/forms.less"; 27 | @import "mixins/progress-bar.less"; 28 | @import "mixins/table-row.less"; 29 | 30 | // Skins 31 | @import "mixins/background-variant.less"; 32 | @import "mixins/border-radius.less"; 33 | @import "mixins/gradients.less"; 34 | 35 | // Layout 36 | @import "mixins/clearfix.less"; 37 | @import "mixins/center-block.less"; 38 | @import "mixins/nav-vertical-align.less"; 39 | @import "mixins/grid-framework.less"; 40 | @import "mixins/grid.less"; 41 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/alerts.less: -------------------------------------------------------------------------------- 1 | // Alerts 2 | 3 | .alert-variant(@background; @border; @text-color) { 4 | background-color: @background; 5 | border-color: @border; 6 | color: @text-color; 7 | 8 | hr { 9 | border-top-color: darken(@border, 5%); 10 | } 11 | .alert-link { 12 | color: darken(@text-color, 10%); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/background-variant.less: -------------------------------------------------------------------------------- 1 | // Contextual backgrounds 2 | 3 | .bg-variant(@color) { 4 | background-color: @color; 5 | a&:hover, 6 | a&:focus { 7 | background-color: darken(@color, 10%); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/border-radius.less: -------------------------------------------------------------------------------- 1 | // Single side border-radius 2 | 3 | .border-top-radius(@radius) { 4 | border-top-right-radius: @radius; 5 | border-top-left-radius: @radius; 6 | } 7 | .border-right-radius(@radius) { 8 | border-bottom-right-radius: @radius; 9 | border-top-right-radius: @radius; 10 | } 11 | .border-bottom-radius(@radius) { 12 | border-bottom-right-radius: @radius; 13 | border-bottom-left-radius: @radius; 14 | } 15 | .border-left-radius(@radius) { 16 | border-bottom-left-radius: @radius; 17 | border-top-left-radius: @radius; 18 | } 19 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/buttons.less: -------------------------------------------------------------------------------- 1 | // Button variants 2 | // 3 | // Easily pump out default styles, as well as :hover, :focus, :active, 4 | // and disabled options for all buttons 5 | 6 | .button-variant(@color; @background; @border) { 7 | color: @color; 8 | background-color: @background; 9 | border-color: @border; 10 | 11 | &:focus, 12 | &.focus { 13 | color: @color; 14 | background-color: darken(@background, 10%); 15 | border-color: darken(@border, 25%); 16 | } 17 | &:hover { 18 | color: @color; 19 | background-color: darken(@background, 10%); 20 | border-color: darken(@border, 12%); 21 | } 22 | &:active, 23 | &.active, 24 | .open > .dropdown-toggle& { 25 | color: @color; 26 | background-color: darken(@background, 10%); 27 | border-color: darken(@border, 12%); 28 | 29 | &:hover, 30 | &:focus, 31 | &.focus { 32 | color: @color; 33 | background-color: darken(@background, 17%); 34 | border-color: darken(@border, 25%); 35 | } 36 | } 37 | &:active, 38 | &.active, 39 | .open > .dropdown-toggle& { 40 | background-image: none; 41 | } 42 | &.disabled, 43 | &[disabled], 44 | fieldset[disabled] & { 45 | &:hover, 46 | &:focus, 47 | &.focus { 48 | background-color: @background; 49 | border-color: @border; 50 | } 51 | } 52 | 53 | .badge { 54 | color: @background; 55 | background-color: @color; 56 | } 57 | } 58 | 59 | // Button sizes 60 | .button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) { 61 | padding: @padding-vertical @padding-horizontal; 62 | font-size: @font-size; 63 | line-height: @line-height; 64 | border-radius: @border-radius; 65 | } 66 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/center-block.less: -------------------------------------------------------------------------------- 1 | // Center-align a block level element 2 | 3 | .center-block() { 4 | display: block; 5 | margin-left: auto; 6 | margin-right: auto; 7 | } 8 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/clearfix.less: -------------------------------------------------------------------------------- 1 | // Clearfix 2 | // 3 | // For modern browsers 4 | // 1. The space content is one way to avoid an Opera bug when the 5 | // contenteditable attribute is included anywhere else in the document. 6 | // Otherwise it causes space to appear at the top and bottom of elements 7 | // that are clearfixed. 8 | // 2. The use of `table` rather than `block` is only necessary if using 9 | // `:before` to contain the top-margins of child elements. 10 | // 11 | // Source: http://nicolasgallagher.com/micro-clearfix-hack/ 12 | 13 | .clearfix() { 14 | &:before, 15 | &:after { 16 | content: " "; // 1 17 | display: table; // 2 18 | } 19 | &:after { 20 | clear: both; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/hide-text.less: -------------------------------------------------------------------------------- 1 | // CSS image replacement 2 | // 3 | // Heads up! v3 launched with only `.hide-text()`, but per our pattern for 4 | // mixins being reused as classes with the same name, this doesn't hold up. As 5 | // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. 6 | // 7 | // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 8 | 9 | // Deprecated as of v3.0.1 (has been removed in v4) 10 | .hide-text() { 11 | font: ~"0/0" a; 12 | color: transparent; 13 | text-shadow: none; 14 | background-color: transparent; 15 | border: 0; 16 | } 17 | 18 | // New mixin to use as of v3.0.1 19 | .text-hide() { 20 | .hide-text(); 21 | } 22 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/image.less: -------------------------------------------------------------------------------- 1 | // Image Mixins 2 | // - Responsive image 3 | // - Retina image 4 | 5 | 6 | // Responsive image 7 | // 8 | // Keep images from scaling beyond the width of their parents. 9 | .img-responsive(@display: block) { 10 | display: @display; 11 | max-width: 100%; // Part 1: Set a maximum relative to the parent 12 | height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching 13 | } 14 | 15 | 16 | // Retina image 17 | // 18 | // Short retina mixin for setting background-image and -size. Note that the 19 | // spelling of `min--moz-device-pixel-ratio` is intentional. 20 | .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) { 21 | background-image: url("@{file-1x}"); 22 | 23 | @media 24 | only screen and (-webkit-min-device-pixel-ratio: 2), 25 | only screen and ( min--moz-device-pixel-ratio: 2), 26 | only screen and ( -o-min-device-pixel-ratio: 2/1), 27 | only screen and ( min-device-pixel-ratio: 2), 28 | only screen and ( min-resolution: 192dpi), 29 | only screen and ( min-resolution: 2dppx) { 30 | background-image: url("@{file-2x}"); 31 | background-size: @width-1x @height-1x; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/labels.less: -------------------------------------------------------------------------------- 1 | // Labels 2 | 3 | .label-variant(@color) { 4 | background-color: @color; 5 | 6 | &[href] { 7 | &:hover, 8 | &:focus { 9 | background-color: darken(@color, 10%); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/list-group.less: -------------------------------------------------------------------------------- 1 | // List Groups 2 | 3 | .list-group-item-variant(@state; @background; @color) { 4 | .list-group-item-@{state} { 5 | color: @color; 6 | background-color: @background; 7 | 8 | a&, 9 | button& { 10 | color: @color; 11 | 12 | .list-group-item-heading { 13 | color: inherit; 14 | } 15 | 16 | &:hover, 17 | &:focus { 18 | color: @color; 19 | background-color: darken(@background, 5%); 20 | } 21 | &.active, 22 | &.active:hover, 23 | &.active:focus { 24 | color: #fff; 25 | background-color: @color; 26 | border-color: @color; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/nav-divider.less: -------------------------------------------------------------------------------- 1 | // Horizontal dividers 2 | // 3 | // Dividers (basically an hr) within dropdowns and nav lists 4 | 5 | .nav-divider(@color: #e5e5e5) { 6 | height: 1px; 7 | margin: ((@line-height-computed / 2) - 1) 0; 8 | overflow: hidden; 9 | background-color: @color; 10 | } 11 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/nav-vertical-align.less: -------------------------------------------------------------------------------- 1 | // Navbar vertical align 2 | // 3 | // Vertically center elements in the navbar. 4 | // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin. 5 | 6 | .navbar-vertical-align(@element-height) { 7 | margin-top: ((@navbar-height - @element-height) / 2); 8 | margin-bottom: ((@navbar-height - @element-height) / 2); 9 | } 10 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/opacity.less: -------------------------------------------------------------------------------- 1 | // Opacity 2 | 3 | .opacity(@opacity) { 4 | opacity: @opacity; 5 | // IE8 filter 6 | @opacity-ie: (@opacity * 100); 7 | filter: ~"alpha(opacity=@{opacity-ie})"; 8 | } 9 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/pagination.less: -------------------------------------------------------------------------------- 1 | // Pagination 2 | 3 | .pagination-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) { 4 | > li { 5 | > a, 6 | > span { 7 | padding: @padding-vertical @padding-horizontal; 8 | font-size: @font-size; 9 | line-height: @line-height; 10 | } 11 | &:first-child { 12 | > a, 13 | > span { 14 | .border-left-radius(@border-radius); 15 | } 16 | } 17 | &:last-child { 18 | > a, 19 | > span { 20 | .border-right-radius(@border-radius); 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/panels.less: -------------------------------------------------------------------------------- 1 | // Panels 2 | 3 | .panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border) { 4 | border-color: @border; 5 | 6 | & > .panel-heading { 7 | color: @heading-text-color; 8 | background-color: @heading-bg-color; 9 | border-color: @heading-border; 10 | 11 | + .panel-collapse > .panel-body { 12 | border-top-color: @border; 13 | } 14 | .badge { 15 | color: @heading-bg-color; 16 | background-color: @heading-text-color; 17 | } 18 | } 19 | & > .panel-footer { 20 | + .panel-collapse > .panel-body { 21 | border-bottom-color: @border; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/progress-bar.less: -------------------------------------------------------------------------------- 1 | // Progress bars 2 | 3 | .progress-bar-variant(@color) { 4 | background-color: @color; 5 | 6 | // Deprecated parent class requirement as of v3.2.0 7 | .progress-striped & { 8 | #gradient > .striped(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/reset-filter.less: -------------------------------------------------------------------------------- 1 | // Reset filters for IE 2 | // 3 | // When you need to remove a gradient background, do not forget to use this to reset 4 | // the IE filter for IE9 and below. 5 | 6 | .reset-filter() { 7 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)")); 8 | } 9 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/reset-text.less: -------------------------------------------------------------------------------- 1 | .reset-text() { 2 | font-family: @font-family-base; 3 | // We deliberately do NOT reset font-size. 4 | font-style: normal; 5 | font-weight: normal; 6 | letter-spacing: normal; 7 | line-break: auto; 8 | line-height: @line-height-base; 9 | text-align: left; // Fallback for where `start` is not supported 10 | text-align: start; 11 | text-decoration: none; 12 | text-shadow: none; 13 | text-transform: none; 14 | white-space: normal; 15 | word-break: normal; 16 | word-spacing: normal; 17 | word-wrap: normal; 18 | } 19 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/resize.less: -------------------------------------------------------------------------------- 1 | // Resize anything 2 | 3 | .resizable(@direction) { 4 | resize: @direction; // Options: horizontal, vertical, both 5 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` 6 | } 7 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/responsive-visibility.less: -------------------------------------------------------------------------------- 1 | // Responsive utilities 2 | 3 | // 4 | // More easily include all the states for responsive-utilities.less. 5 | .responsive-visibility() { 6 | display: block !important; 7 | table& { display: table !important; } 8 | tr& { display: table-row !important; } 9 | th&, 10 | td& { display: table-cell !important; } 11 | } 12 | 13 | .responsive-invisibility() { 14 | display: none !important; 15 | } 16 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/size.less: -------------------------------------------------------------------------------- 1 | // Sizing shortcuts 2 | 3 | .size(@width; @height) { 4 | width: @width; 5 | height: @height; 6 | } 7 | 8 | .square(@size) { 9 | .size(@size; @size); 10 | } 11 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/tab-focus.less: -------------------------------------------------------------------------------- 1 | // WebKit-style focus 2 | 3 | .tab-focus() { 4 | // Default 5 | outline: thin dotted; 6 | // WebKit 7 | outline: 5px auto -webkit-focus-ring-color; 8 | outline-offset: -2px; 9 | } 10 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/table-row.less: -------------------------------------------------------------------------------- 1 | // Tables 2 | 3 | .table-row-variant(@state; @background) { 4 | // Exact selectors below required to override `.table-striped` and prevent 5 | // inheritance to nested tables. 6 | .table > thead > tr, 7 | .table > tbody > tr, 8 | .table > tfoot > tr { 9 | > td.@{state}, 10 | > th.@{state}, 11 | &.@{state} > td, 12 | &.@{state} > th { 13 | background-color: @background; 14 | } 15 | } 16 | 17 | // Hover states for `.table-hover` 18 | // Note: this is not available for cells or rows within `thead` or `tfoot`. 19 | .table-hover > tbody > tr { 20 | > td.@{state}:hover, 21 | > th.@{state}:hover, 22 | &.@{state}:hover > td, 23 | &:hover > .@{state}, 24 | &.@{state}:hover > th { 25 | background-color: darken(@background, 5%); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/text-emphasis.less: -------------------------------------------------------------------------------- 1 | // Typography 2 | 3 | .text-emphasis-variant(@color) { 4 | color: @color; 5 | a&:hover, 6 | a&:focus { 7 | color: darken(@color, 10%); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/mixins/text-overflow.less: -------------------------------------------------------------------------------- 1 | // Text overflow 2 | // Requires inline-block or block for proper styling 3 | 4 | .text-overflow() { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } 9 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/pager.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: @line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | &:extend(.clearfix all); 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: @pager-bg; 19 | border: 1px solid @pager-border; 20 | border-radius: @pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: @pager-hover-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: @pager-disabled-color; 50 | background-color: @pager-bg; 51 | cursor: @cursor-disabled; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/progress-bars.less: -------------------------------------------------------------------------------- 1 | // 2 | // Progress bars 3 | // -------------------------------------------------- 4 | 5 | 6 | // Bar animations 7 | // ------------------------- 8 | 9 | // WebKit 10 | @-webkit-keyframes progress-bar-stripes { 11 | from { background-position: 40px 0; } 12 | to { background-position: 0 0; } 13 | } 14 | 15 | // Spec and IE10+ 16 | @keyframes progress-bar-stripes { 17 | from { background-position: 40px 0; } 18 | to { background-position: 0 0; } 19 | } 20 | 21 | 22 | // Bar itself 23 | // ------------------------- 24 | 25 | // Outer container 26 | .progress { 27 | overflow: hidden; 28 | height: @line-height-computed; 29 | margin-bottom: @line-height-computed; 30 | background-color: @progress-bg; 31 | border-radius: @progress-border-radius; 32 | .box-shadow(inset 0 1px 2px rgba(0,0,0,.1)); 33 | } 34 | 35 | // Bar of progress 36 | .progress-bar { 37 | float: left; 38 | width: 0%; 39 | height: 100%; 40 | font-size: @font-size-small; 41 | line-height: @line-height-computed; 42 | color: @progress-bar-color; 43 | text-align: center; 44 | background-color: @progress-bar-bg; 45 | .box-shadow(inset 0 -1px 0 rgba(0,0,0,.15)); 46 | .transition(width .6s ease); 47 | } 48 | 49 | // Striped bars 50 | // 51 | // `.progress-striped .progress-bar` is deprecated as of v3.2.0 in favor of the 52 | // `.progress-bar-striped` class, which you just add to an existing 53 | // `.progress-bar`. 54 | .progress-striped .progress-bar, 55 | .progress-bar-striped { 56 | #gradient > .striped(); 57 | background-size: 40px 40px; 58 | } 59 | 60 | // Call animation for the active one 61 | // 62 | // `.progress.active .progress-bar` is deprecated as of v3.2.0 in favor of the 63 | // `.progress-bar.active` approach. 64 | .progress.active .progress-bar, 65 | .progress-bar.active { 66 | .animation(progress-bar-stripes 2s linear infinite); 67 | } 68 | 69 | 70 | // Variations 71 | // ------------------------- 72 | 73 | .progress-bar-success { 74 | .progress-bar-variant(@progress-bar-success-bg); 75 | } 76 | 77 | .progress-bar-info { 78 | .progress-bar-variant(@progress-bar-info-bg); 79 | } 80 | 81 | .progress-bar-warning { 82 | .progress-bar-variant(@progress-bar-warning-bg); 83 | } 84 | 85 | .progress-bar-danger { 86 | .progress-bar-variant(@progress-bar-danger-bg); 87 | } 88 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/responsive-embed.less: -------------------------------------------------------------------------------- 1 | // Embeds responsive 2 | // 3 | // Credit: Nicolas Gallagher and SUIT CSS. 4 | 5 | .embed-responsive { 6 | position: relative; 7 | display: block; 8 | height: 0; 9 | padding: 0; 10 | overflow: hidden; 11 | 12 | .embed-responsive-item, 13 | iframe, 14 | embed, 15 | object, 16 | video { 17 | position: absolute; 18 | top: 0; 19 | left: 0; 20 | bottom: 0; 21 | height: 100%; 22 | width: 100%; 23 | border: 0; 24 | } 25 | } 26 | 27 | // Modifier class for 16:9 aspect ratio 28 | .embed-responsive-16by9 { 29 | padding-bottom: 56.25%; 30 | } 31 | 32 | // Modifier class for 4:3 aspect ratio 33 | .embed-responsive-4by3 { 34 | padding-bottom: 75%; 35 | } 36 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/thumbnails.less: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Mixin and adjust the regular image class 7 | .thumbnail { 8 | display: block; 9 | padding: @thumbnail-padding; 10 | margin-bottom: @line-height-computed; 11 | line-height: @line-height-base; 12 | background-color: @thumbnail-bg; 13 | border: 1px solid @thumbnail-border; 14 | border-radius: @thumbnail-border-radius; 15 | .transition(border .2s ease-in-out); 16 | 17 | > img, 18 | a > img { 19 | &:extend(.img-responsive); 20 | margin-left: auto; 21 | margin-right: auto; 22 | } 23 | 24 | // Add a hover state for linked versions only 25 | a&:hover, 26 | a&:focus, 27 | a&.active { 28 | border-color: @link-color; 29 | } 30 | 31 | // Image captions 32 | .caption { 33 | padding: @thumbnail-caption-padding; 34 | color: @thumbnail-caption-color; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/utilities.less: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // Floats 7 | // ------------------------- 8 | 9 | .clearfix { 10 | .clearfix(); 11 | } 12 | .center-block { 13 | .center-block(); 14 | } 15 | .pull-right { 16 | float: right !important; 17 | } 18 | .pull-left { 19 | float: left !important; 20 | } 21 | 22 | 23 | // Toggling content 24 | // ------------------------- 25 | 26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 27 | .hide { 28 | display: none !important; 29 | } 30 | .show { 31 | display: block !important; 32 | } 33 | .invisible { 34 | visibility: hidden; 35 | } 36 | .text-hide { 37 | .text-hide(); 38 | } 39 | 40 | 41 | // Hide from screenreaders and browsers 42 | // 43 | // Credit: HTML5 Boilerplate 44 | 45 | .hidden { 46 | display: none !important; 47 | } 48 | 49 | 50 | // For Affix plugin 51 | // ------------------------- 52 | 53 | .affix { 54 | position: fixed; 55 | } 56 | -------------------------------------------------------------------------------- /src/vendor/bootstrap/3.3.6/less/wells.less: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: @well-bg; 12 | border: 1px solid @well-border; 13 | border-radius: @border-radius-base; 14 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: @border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: @border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /src/vendor/ngProgress/1.0.3/ngProgress.less: -------------------------------------------------------------------------------- 1 | /* Styling for the ngProgress itself */ 2 | #ngProgress { 3 | margin: 0; 4 | padding: 0; 5 | z-index: 99998; 6 | background-color: green; 7 | color: green; 8 | box-shadow: 0 0 10px 0; /* Inherits the font color */ 9 | height: 2px; 10 | opacity: 0; 11 | 12 | /* Add CSS3 styles for transition smoothing */ 13 | -webkit-transition: all 0.5s ease-in-out; 14 | -moz-transition: all 0.5s ease-in-out; 15 | -o-transition: all 0.5s ease-in-out; 16 | transition: all 0.5s ease-in-out; 17 | } 18 | 19 | /* Styling for the ngProgress-container */ 20 | #ngProgress-container { 21 | position: fixed; 22 | margin: 0; 23 | padding: 0; 24 | top: 0; 25 | left: 0; 26 | right: 0; 27 | z-index: 99999; 28 | } 29 | -------------------------------------------------------------------------------- /src/vendor/toaster/0.3.0/toaster.less: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-front/angularjs-ee-boilerplate/10cce3ded9990a9a6f28a7a256af2e0af27c14cf/src/vendor/toaster/0.3.0/toaster.less -------------------------------------------------------------------------------- /tools/gulp/helpers/loadTasks.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var fs = require('fs'); 3 | var gulp = require('gulp'); 4 | var $ = require('./$'); 5 | 6 | 7 | function loadTask(filepath) { 8 | var filename = path.basename(filepath); 9 | var msg = 'Loading "' + filename + '" tasks...'; 10 | var fn; 11 | 12 | try { 13 | // Load taskfile. 14 | fn = require(path.resolve(filepath)); 15 | if(typeof fn === 'function') { 16 | fn.call({}, gulp, $); 17 | } 18 | } catch(e) { 19 | console.log(msg); 20 | // Something went wrong. 21 | console.error(e); 22 | } 23 | fn = null; 24 | } 25 | 26 | function loadTasks(tasksDir) { 27 | var files = fs 28 | .readdirSync(tasksDir) 29 | .filter(function isValid(file) { 30 | return (file !== '.DS_store' && file.indexOf('.') !== 0 && /\.js$/.test(file)); 31 | }); 32 | 33 | // load tasks from files 34 | files.forEach(function(filename) { 35 | loadTask(path.join(tasksDir, filename)); 36 | }); 37 | } 38 | 39 | module.exports = function(tasksDir) { 40 | if(fs.existsSync(tasksDir)) { 41 | loadTasks(tasksDir); 42 | } else { 43 | console.error('Tasks directory "' + tasksDir + '" not found.'); 44 | } 45 | }; 46 | -------------------------------------------------------------------------------- /tools/gulp/helpers/sharedStreams.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var $ = require('./$'); 3 | 4 | // shared streams to gulp tasks 5 | var streams = $.streams = {}; 6 | 7 | //-- 8 | 9 | var outputCssDir = $.path.join( $.config.paths.outputDir, 'styles' ); 10 | 11 | //--- 12 | 13 | streams.autoprefix = function() { 14 | return $.autoprefixer( $.config.autoprefixer ); 15 | }; 16 | 17 | //--- 18 | 19 | streams.less = function() { 20 | 21 | return gulp 22 | .src( $.config.styles.less.main ) 23 | .pipe( $.if( $.is.debug, $.debug() ) ) 24 | .pipe( $.plumber() ) 25 | .pipe( $.less({ paths: [ $.path.join( $.rootPath, 'src' ) ] }) ) 26 | .pipe( streams.autoprefix() ) 27 | .pipe( $.injectString.prepend( $.config.banner ) ) 28 | .pipe( $.if( ($.is.release || $.is.preview), $.minifyCss() ) ) 29 | .pipe( gulp.dest( outputCssDir ) ) 30 | .pipe( $.filter( '**/*.css' ) ) 31 | .pipe( $.if( $.browserSync.active, $.reload({stream: true}) ) ) 32 | .on( 'error', $.onError ); 33 | 34 | }; 35 | 36 | streams.sass = function() { 37 | 38 | return gulp 39 | .src( $.config.styles.sass.main ) 40 | .pipe( $.if( $.is.debug, $.debug() ) ) 41 | .pipe( $.plumber() ) 42 | .pipe( $.sass().on('error', $.sass.logError) ) 43 | .pipe( streams.autoprefix() ) 44 | .pipe( $.injectString.prepend( $.config.banner ) ) 45 | .pipe( $.if( ($.is.release || $.is.preview), $.minifyCss() ) ) 46 | .pipe( gulp.dest( outputCssDir ) ) 47 | .pipe( $.filter( '**/*.css' ) ) 48 | .pipe( $.if( $.browserSync.active, $.reload({stream: true}) ) ) 49 | .on( 'error', $.onError ); 50 | 51 | }; 52 | -------------------------------------------------------------------------------- /tools/gulp/index.js: -------------------------------------------------------------------------------- 1 | require('./helpers/sharedStreams'); 2 | 3 | module.exports.loadTasks = require('./helpers/loadTasks'); 4 | -------------------------------------------------------------------------------- /tools/gulp/tasks/build.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | gulp.task('build', function( done ) { 4 | 5 | var runTasks = []; 6 | 7 | if( $.is.preview ) { 8 | runTasks.push( 'karma:unit:single-run' ); 9 | } else { 10 | runTasks.push( 'karma:ci' ); 11 | } 12 | 13 | runTasks = runTasks.concat([ 14 | [ 15 | 'copy:js2build', 16 | 'styles', 17 | 'build:min:index.html', 18 | 'copy:vendor2dist', 19 | 'build:min:images', 20 | 'build:uglify:ie-fallback' 21 | ], 22 | 'html2js', 23 | 'update:main:package.js', 24 | 'requirejs', 25 | 'build:concat:js', 26 | 'clean:build', 27 | done 28 | ]); 29 | 30 | $.runSequence.apply(null, runTasks); 31 | 32 | }); 33 | 34 | gulp.task('build:min:index.html', function() { 35 | return gulp.src( $.config.html.index ) 36 | .pipe( $.htmlmin( $.config.htmlmin ) ) 37 | .pipe( gulp.dest( $.config.paths.dist ) ); 38 | }); 39 | 40 | gulp.task('build:min:images', function() { 41 | return gulp.src( $.config.paths.src + '/shared/img/**/*' ) 42 | .pipe( $.imagemin({ 43 | progressive: true, 44 | interlaced: true 45 | }) ) 46 | .pipe( gulp.dest( $.config.paths.dist + '/shared/img' ) ); 47 | }); 48 | 49 | gulp.task('build:concat:js', function() { 50 | var filter = $.filter([ 51 | 'require.config.js' 52 | ], {restore: true}); 53 | 54 | return gulp.src([ 55 | $.config.paths.build + '/' + $.config.require.name + '.js', 56 | $.config.require.config 57 | ]) 58 | .pipe( filter ) 59 | .pipe( $.uglify() ) 60 | .pipe( filter.restore ) 61 | .pipe( $.concat( 'require.config.js' ) ) 62 | .pipe( gulp.dest( $.config.paths.dist ) ); 63 | }); 64 | 65 | gulp.task('build:uglify:ie-fallback', function() { 66 | return gulp.src( $.config.paths.src + '/shared/fallback/*.js' ) 67 | .pipe( $.uglify() ) 68 | .pipe( gulp.dest( $.config.paths.dist + '/shared/fallback' ) ); 69 | }); 70 | 71 | }; 72 | -------------------------------------------------------------------------------- /tools/gulp/tasks/bump.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | /** 4 | * Bump the version 5 | * --type=pre will bump the prerelease version *.*.*-x 6 | * --type=patch or no flag will bump the patch version *.*.x 7 | * --type=minor will bump the minor version *.x.* 8 | * --type=major will bump the major version x.*.* 9 | * --version=1.2.3 will bump to a specific version and ignore other flags 10 | */ 11 | gulp.task('bump', function() { 12 | 13 | var msg = 'Bumping versions'; 14 | var type = $.args.type; 15 | var version = $.args.version; 16 | var options = {}; 17 | if (version) { 18 | options.version = version; 19 | msg += ' to ' + version; 20 | } else { 21 | options.type = type; 22 | msg += ' for a ' + type; 23 | } 24 | $.log( msg ); 25 | 26 | return gulp 27 | .src( $.config.packages ) 28 | .pipe( $.print() ) 29 | .pipe( $.bump( options ) ) 30 | .pipe( gulp.dest( $.config.root ) ); 31 | 32 | }); 33 | 34 | }; 35 | -------------------------------------------------------------------------------- /tools/gulp/tasks/clean.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | gulp.task('clean:reports', $.del.bind(null, [ 4 | $.config.paths.reports 5 | ])); 6 | 7 | gulp.task('clean:build', $.del.bind(null, [ 8 | $.config.paths.build 9 | ])); 10 | 11 | gulp.task('clean:dist', $.del.bind(null, [ 12 | $.config.paths.dist 13 | ])); 14 | 15 | gulp.task('clean', ['clean:dist', 'clean:build', 'clean:reports']); 16 | 17 | }; 18 | -------------------------------------------------------------------------------- /tools/gulp/tasks/copy.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | gulp.task('copy:js2build', function() { 4 | return gulp.src( $.config.js.project.copy2build ) 5 | .pipe( gulp.dest( $.config.paths.build ) ); 6 | }); 7 | 8 | gulp.task('copy:vendor2dist', function() { 9 | return gulp.src([ 10 | $.config.paths.src + '/vendor/**/*', 11 | '!' + $.config.paths.src + '/vendor/**/*.{less,html}' 12 | ]) 13 | .pipe( gulp.dest( $.config.paths.dist + '/vendor' ) ); 14 | }); 15 | 16 | }; 17 | -------------------------------------------------------------------------------- /tools/gulp/tasks/default.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | gulp.task('run:flow', function(done) { 4 | 5 | var runTasks = [ 6 | 'clean', 7 | 'validate', 8 | ]; 9 | 10 | if( $.is.release ) { 11 | 12 | runTasks = runTasks.concat([ 'build' ]); 13 | 14 | } else if( $.is.preview ) { 15 | 16 | runTasks = runTasks.concat([ 'build', 'webserver:preview' ]); 17 | 18 | } else if( $.is.e2e ) { 19 | 20 | runTasks = runTasks.concat([ 21 | 'build', 22 | 'webserver:preview', 23 | 'protractor', 24 | 'webserver:exit' 25 | ]); 26 | 27 | } else if( 28 | $.is.protractor && 29 | $._.isString($.args.protractor) && 30 | $._.isObject($.config.protractor) && 31 | $._.isObject($.config.protractor.tests) && 32 | $._.isArray($.config.protractor.tests.suites) && 33 | $._.find($.config.protractor.tests.suites, {name: $.args.protractor}) 34 | ) { 35 | 36 | runTasks = runTasks.concat([ 37 | 'webserver:protractor', 38 | 'protractor:suite:' + $.args.protractor, 39 | 'webserver:exit' 40 | ]); 41 | 42 | } else { 43 | 44 | if( $.is.karma ) { 45 | runTasks = runTasks.concat([ 'karma:unit:single-run' ]); 46 | } 47 | 48 | // dev flow 49 | runTasks = runTasks.concat([ 'watch' ]); 50 | 51 | } 52 | 53 | runTasks = runTasks.concat([ done ]); 54 | $.runSequence.apply(null, runTasks); 55 | 56 | }); 57 | 58 | //--- 59 | 60 | gulp.task('default', ['run:flow'], function() { 61 | 62 | $.projectInfoMsg(); 63 | 64 | }); 65 | 66 | }; 67 | -------------------------------------------------------------------------------- /tools/gulp/tasks/generate.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | function defineRestContext() { 4 | return ( 5 | $.config.webserver.proxy && 6 | $.config.webserver.proxy.context 7 | ) ? 8 | $.config.webserver.proxy.context : 9 | 'api'; 10 | } 11 | 12 | function defineGenerateOptions() { 13 | return { 14 | destination: $.path.resolve( $.config.paths.src || 'src'), 15 | restContext: defineRestContext() 16 | }; 17 | } 18 | 19 | gulp.task('generate', function( done ) { 20 | $.log( 'generate files from templates files...' ); 21 | 22 | $.generate( defineGenerateOptions(), done ); 23 | 24 | }); 25 | 26 | }; 27 | -------------------------------------------------------------------------------- /tools/gulp/tasks/help.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | gulp.task('help', $.taskListing); 4 | 5 | }; 6 | -------------------------------------------------------------------------------- /tools/gulp/tasks/html2js.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | var TEMPLATE_HEADER = [ 4 | 'define(function(require) {', 5 | ' \'use strict\';', 6 | '', 7 | ' var module = require(\'./module\');', 8 | '', 9 | ' module.run(runner);', 10 | '', 11 | ' //---', 12 | '', 13 | ' runner.$inject = [\'$templateCache\'];', 14 | '', 15 | ' function runner($templateCache) {', 16 | '' 17 | ].join('\n'); 18 | 19 | var TEMPLATE_FOOTER = [ 20 | '', 21 | ' }', 22 | '});' 23 | ].join('\n'); 24 | 25 | var html2jsOpts = { 26 | templateHeader : TEMPLATE_HEADER, 27 | templateFooter : TEMPLATE_FOOTER, 28 | base : function(file) { 29 | return file.path.replace( $.path.resolve($.config.paths.src) + $.path.sep , '' ); 30 | } 31 | }; 32 | 33 | //---------------------------------------------------------------------------- 34 | 35 | gulp.task('html2js', function() { 36 | return gulp.src( $.config.html2js.src ) 37 | .pipe( $.htmlmin( $.config.htmlmin ) ) 38 | .pipe( 39 | $.angularTemplatecache( 40 | $.config.html2js.filename, 41 | html2jsOpts 42 | ) 43 | ) 44 | .pipe( gulp.dest( $.config.html2js.dest ) ); 45 | }); 46 | 47 | gulp.task('update:main:package.js', function() { 48 | return gulp.src( $.config.html2js.dest + '/package.js' ) 49 | .pipe( $.injectString.before( 50 | 'return ', 'require(\'./' + $.config.html2js.filename + '\');\n ' 51 | ) ) 52 | .pipe( gulp.dest( $.config.html2js.dest ) ); 53 | }); 54 | 55 | }; 56 | -------------------------------------------------------------------------------- /tools/gulp/tasks/jshint.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | var jshintStream = $.lazypipe() 4 | .pipe( $.cached, 'jshint' ) 5 | .pipe( $.jshint ) 6 | .pipe( $.jshint.reporter, 'jshint-stylish' ) 7 | .pipe( $.jshint.reporter, 'fail' ); 8 | 9 | //--- 10 | 11 | gulp.task('jshint:tools', function() { 12 | return gulp.src( $.config.js.tools ) 13 | .pipe( jshintStream() ) 14 | .on( 'error', $.swallowError ); 15 | }); 16 | 17 | gulp.task('jshint:project', function() { 18 | return gulp.src( $.config.js.project.lint ) 19 | .pipe( jshintStream() ) 20 | .on( 'error', $.swallowError ); 21 | }); 22 | 23 | gulp.task('jshint', ['jshint:tools', 'jshint:project']); 24 | 25 | }; 26 | -------------------------------------------------------------------------------- /tools/gulp/tasks/karma.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | /* 4 | Karma Runner 0.13+ 5 | https://karma-runner.github.io/0.13/dev/public-api.html 6 | 7 | https://github.com/karma-runner/gulp-karma/commit/d3915b219290f5573e8c802e157bec18059b1d69 8 | */ 9 | 10 | function onKarmaExecuted( code, done ) { 11 | if(code === 1) { // tests failed 12 | $.onError('karma: tests failed'); 13 | } else if( code === 0 ) { // tests executed 14 | $.onSuccess('Karma: executed'); 15 | } 16 | done(); 17 | } 18 | 19 | function startKarma( config, done ) { 20 | function onKarmaDone( exitCode ){ 21 | onKarmaExecuted( exitCode, done ); 22 | } 23 | new $.karma 24 | .Server( config, onKarmaDone ) 25 | .start(); 26 | } 27 | 28 | //---------------------------------------------------------------------------- 29 | 30 | gulp.task('karma:unit:single-run', function( done ) { 31 | startKarma( $.config.karma.unitSingleRun, done ); 32 | }); 33 | 34 | gulp.task('karma:reports', ['karma:unit:single-run']); 35 | 36 | gulp.task('karma:unit', function( done ) { 37 | startKarma( $.config.karma.unit, done ); 38 | }); 39 | 40 | gulp.task('karma:specs', function( done ) { 41 | startKarma( $.config.karma.specs, done ); 42 | }); 43 | 44 | gulp.task('karma:coverage', function( done ) { 45 | function karmaDone(){ 46 | $.open($.path.join($.config.paths.reports,'coverage','html','index.html') ); 47 | done(); 48 | } 49 | startKarma( $.config.karma.coverage, karmaDone ); 50 | }); 51 | 52 | gulp.task('karma:ci', function( done ) { 53 | startKarma( $.config.karma.ci, done ); 54 | }); 55 | 56 | }; 57 | -------------------------------------------------------------------------------- /tools/gulp/tasks/lintspaces.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | // https://github.com/ck86/gulp-lintspaces 4 | 5 | var lintspacesStream = $.lazypipe() 6 | .pipe( $.cached, 'lintspaces' ) 7 | .pipe( $.lintspaces, { editorconfig: '.editorconfig' } ) 8 | .pipe( $.lintspaces.reporter ); 9 | 10 | //--- 11 | 12 | gulp.task('lintspaces:html', function() { 13 | 14 | return gulp.src( $.config.html.files ) 15 | .pipe( lintspacesStream() ); 16 | 17 | }); 18 | 19 | gulp.task('lintspaces:js', function() { 20 | 21 | return gulp.src( $.config.js.project.lint ) 22 | .pipe( lintspacesStream() ); 23 | 24 | }); 25 | 26 | gulp.task('lintspaces:tools', function() { 27 | 28 | return gulp.src( $.config.js.tools ) 29 | .pipe( lintspacesStream() ); 30 | 31 | }); 32 | 33 | gulp.task('lintspaces:styles', function() { 34 | 35 | var source; 36 | 37 | if( $.is.sass ) { 38 | source = $.config.styles.sass.project; 39 | } else { 40 | source = $.config.styles.less.project; 41 | } 42 | 43 | return gulp.src( source ) 44 | .pipe( lintspacesStream() ); 45 | 46 | }); 47 | 48 | //--- 49 | 50 | gulp.task('lintspaces', [ 51 | 'lintspaces:html', 52 | 'lintspaces:styles', 53 | 'lintspaces:js', 54 | 'lintspaces:tools' 55 | ]); 56 | 57 | }; 58 | -------------------------------------------------------------------------------- /tools/gulp/tasks/protractor.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | var protractor = require('gulp-protractor').protractor, 4 | webdriver_update = require('gulp-protractor').webdriver_update, 5 | webdriver_standalone = require('gulp-protractor').webdriver_standalone; 6 | 7 | // Downloads the selenium webdriver 8 | gulp.task('protractor:webdriver_update', webdriver_update); 9 | 10 | // Start the standalone selenium server 11 | // NOTE: This is not needed if you reference the 12 | // seleniumServerJar in your protractor.conf.js 13 | gulp.task('protractor:webdriver_standalone', ['protractor:webdriver_update'], webdriver_standalone); 14 | 15 | function configProgractorTask(name, files) { 16 | gulp.task(name, ['protractor:webdriver_update'], function(cb) { 17 | gulp.src(files).pipe(protractor({ 18 | configFile: $.config.protractor.configFile, 19 | 20 | // https://github.com/angular/protractor/issues/66#issuecomment-186333950 21 | args: ['--baseUrl', 'http://' + $.localip + ':' + $.config.webserver.port + '?protractor-test'] 22 | })).on('error', function(e) { 23 | console.log('ERRO!'); 24 | console.log(e); 25 | cb(); 26 | }).on('end', function(){ 27 | cb(); 28 | }); 29 | }); 30 | } 31 | 32 | if( 33 | $._.isObject($.config.protractor) && 34 | $._.isObject($.config.protractor.tests) 35 | ){ 36 | if( $._.isString($.config.protractor.tests.all) ){ 37 | configProgractorTask('protractor', [$.config.protractor.tests.all]); 38 | } 39 | 40 | if( $._.isArray($.config.protractor.tests.suites) ){ 41 | $.config.protractor.tests.suites.forEach(function(suite){ 42 | configProgractorTask('protractor:suite:' + suite.name, suite.files); 43 | }); 44 | } 45 | } 46 | 47 | }; 48 | -------------------------------------------------------------------------------- /tools/gulp/tasks/require.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | var requirejs = require('requirejs'); 4 | 5 | //---------------------------------------------------------------------------- 6 | 7 | /* 8 | http://tech.pro/blog/1639/using-rjs-to-optimize-your-requirejs-project 9 | 10 | http://requirejs.org/docs/optimization.html 11 | 12 | https://github.com/jrburke/r.js/blob/master/build/example.build.js 13 | 14 | https://github.com/CaryLandholt/AngularFun/blob/master/Gruntfile.coffee 15 | */ 16 | 17 | // https://github.com/kvindasAB/angular-enterprise-kickstart/blob/master/Gruntfile.js#L303 18 | var requireBuildConfig = { 19 | baseUrl: $.config.paths.build, 20 | 21 | mainConfigFile: $.config.require.build, 22 | 23 | name: $.config.require.name, 24 | out: $.path.join( $.config.paths.build, $.config.require.name + '.js' ), 25 | 26 | useStrict: true, 27 | wrap: { 28 | start: '(function() {\'use strict\';', 29 | end: '})();' 30 | }, 31 | optimize: "uglify2", 32 | uglify2: { 33 | mangle: true, 34 | compress: { 35 | 'drop_console': true, 36 | 'drop_debugger': true, 37 | 'dead_code': true, 38 | 'join_vars': true, 39 | 'if_return': true, 40 | 'negate_iife': true, 41 | booleans: true, 42 | loops: true, 43 | unused: true 44 | } 45 | } 46 | }; 47 | 48 | //---------------------------------------------------------------------------- 49 | 50 | gulp.task('requirejs', ['requirejs:rewrite-config'], function( done ) { 51 | 52 | var config = $.rootRequire($.path.join($.config.paths.build, $.config.require_deps)); 53 | requireBuildConfig.paths = config.paths; 54 | 55 | $.requirejs.builder( requireBuildConfig, done, $.is.debug, $.log ); 56 | }); 57 | 58 | //---------------------------------------------------------------------------- 59 | 60 | gulp.task('requirejs:rewrite-config', function() { 61 | return gulp.src( $.config.require.config ) 62 | .pipe( $.requirejs.rewriteConfig() ) 63 | .pipe( gulp.dest( $.config.paths.build ) ); 64 | }); 65 | 66 | }; 67 | -------------------------------------------------------------------------------- /tools/gulp/tasks/styles.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | gulp.task('less', function() { 4 | $.log("Building css files..."); 5 | return $.streams.less(); 6 | }); 7 | 8 | gulp.task('sass', function() { 9 | $.log("Building css files..."); 10 | return $.streams.sass(); 11 | }); 12 | 13 | gulp.task('styles', function() { 14 | $.log("Building css files..."); 15 | if( $.is.sass ) { 16 | return $.streams.sass(); 17 | } else { 18 | return $.streams.less(); 19 | } 20 | }); 21 | 22 | }; 23 | -------------------------------------------------------------------------------- /tools/gulp/tasks/validate.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | // TODO: review 4 | gulp.task('validate', ['jshint', 'lintspaces']); // , 'karma' 5 | 6 | }; 7 | -------------------------------------------------------------------------------- /tools/gulp/tasks/watch.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | gulp.task('watch', ['webserver:dev'], function() { 4 | 5 | // javascript project 6 | gulp.watch( $.config.js.project.watch, ['wf:js'] ); 7 | 8 | //--- 9 | 10 | // html project 11 | gulp.watch([ 12 | $.config.html.files, 13 | '!' + $.config.paths.src + '/vendor/**/*' 14 | ], ['wf:html']); 15 | 16 | //--- 17 | 18 | // stypes project 19 | var watchStyles; 20 | 21 | if( $.is.sass ) { 22 | watchStyles = $.config.styles.sass.project; 23 | } else { 24 | watchStyles = $.config.styles.less.project; 25 | } 26 | 27 | gulp.watch([ 28 | watchStyles 29 | ], ['wf:styles']); 30 | 31 | }); 32 | 33 | //--- 34 | 35 | gulp.task('wf:bs:reload', function() { 36 | $.reload(); 37 | }); 38 | 39 | gulp.task('wf:js', function( done ) { 40 | 41 | var runTasks = [ 42 | ['jshint:project', 'lintspaces:js'] 43 | ]; 44 | 45 | if( $.is.karma ) { 46 | runTasks.push( 'karma:unit:single-run' ); 47 | } 48 | 49 | runTasks = runTasks.concat([ 50 | 'wf:bs:reload', 51 | done 52 | ]); 53 | 54 | $.runSequence.apply(null, runTasks); 55 | 56 | }); 57 | 58 | gulp.task('wf:html', function( done ) { 59 | 60 | $.runSequence( 61 | 'lintspaces:html', 62 | 'wf:bs:reload', 63 | done 64 | ); 65 | 66 | }); 67 | 68 | gulp.task('wf:styles', function( done ) { 69 | 70 | $.runSequence( 71 | 'lintspaces:styles', 72 | 'styles', 73 | done 74 | ); 75 | 76 | }); 77 | 78 | }; 79 | -------------------------------------------------------------------------------- /tools/gulp/tasks/webserver.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | gulp.task('webserver:dev', ['styles'], function() { 4 | 5 | var serverConfig = { 6 | port: $.config.webserver.port, 7 | server:{ 8 | baseDir: [ 9 | $.config.paths.src, 10 | $.config.paths.build 11 | ] 12 | } 13 | }; 14 | 15 | if( $.is.proxy ) { 16 | serverConfig.server.middleware = $.config.webserver.middlewares; 17 | } 18 | 19 | $.browserSync( serverConfig ); 20 | 21 | }); 22 | 23 | gulp.task('webserver:protractor', ['styles'], function() { 24 | 25 | var serverConfig = { 26 | port: $.config.webserver.port, 27 | root: [ 28 | $.config.paths.src, 29 | $.config.paths.build 30 | ] 31 | }; 32 | 33 | if( $.is.proxy ) { 34 | serverConfig.middleware = function( connect, opts ) { 35 | return $.config.webserver.middlewares; 36 | }; 37 | } 38 | 39 | // https://www.npmjs.com/package/gulp-connect 40 | $.connect.server( serverConfig ); 41 | 42 | }); 43 | 44 | gulp.task('webserver:preview', function() { 45 | 46 | var serverConfig = { 47 | port: $.config.webserver.port, 48 | root: [ 49 | $.config.paths.outputDir 50 | ] 51 | }; 52 | 53 | if( $.is.proxy ) { 54 | serverConfig.middleware = function( connect, opts ) { 55 | return $.config.webserver.middlewares; 56 | }; 57 | } 58 | 59 | // https://www.npmjs.com/package/gulp-connect 60 | $.connect.server( serverConfig ); 61 | 62 | if(!$.is.e2e){ 63 | $.open('http://' + $.localip + ':' + $.config.webserver.port); 64 | } 65 | 66 | }); 67 | 68 | gulp.task('webserver:exit', function() { 69 | $.connect.serverClose(); 70 | }); 71 | 72 | }; 73 | -------------------------------------------------------------------------------- /tools/karma.config.js: -------------------------------------------------------------------------------- 1 | var _ = require('lodash'), 2 | options = require('./karma.options'); 3 | 4 | var coverageReporterHtml = { 5 | type : 'html', 6 | dir : 'tests_out/coverage/', 7 | subdir: 'html' 8 | }; 9 | 10 | var baseUnitConfig = { 11 | reporters: ['progress', 'coverage', 'html'], 12 | browsers: ['PhantomJS'], 13 | coverageReporter: coverageReporterHtml 14 | }; 15 | 16 | module.exports = { 17 | 18 | unitSingleRun: _.extend({}, options, baseUnitConfig, { 19 | singleRun: true 20 | }), 21 | 22 | unit: _.extend({}, options, baseUnitConfig, { 23 | singleRun: false 24 | }), 25 | 26 | specs: _.extend({}, options, { 27 | reporters: ['progress', 'html'], 28 | browsers: ['Chrome'] 29 | }), 30 | 31 | coverage: _.extend({}, options, { 32 | reporters: ['coverage'], 33 | browsers: ['PhantomJS'], 34 | singleRun: true, 35 | colors: false, 36 | logLevel: 'ERROR', 37 | coverageReporter: coverageReporterHtml 38 | }), 39 | 40 | ci: _.extend({}, options, { 41 | reporters: ['junit', 'coverage'], 42 | browsers: ['PhantomJS'], 43 | singleRun: true, 44 | colors: false, 45 | logLevel: 'ERROR', 46 | junitReporter: { 47 | outputDir: 'tests_out/junit' 48 | }, 49 | coverageReporter: { 50 | type : 'lcovonly', // produces an lcov.info file 51 | dir : 'tests_out/coverage/', 52 | subdir: '.' 53 | } 54 | }) 55 | 56 | }; 57 | -------------------------------------------------------------------------------- /tools/karma.options.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 3 | // frameworks to use 4 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter 5 | frameworks: ['jasmine', 'requirejs'], 6 | 7 | // https://karma-runner.github.io/0.12/config/files.html 8 | 9 | // list of files / patterns to load in the browser 10 | files: [ 11 | {pattern: 'src/vendor/**/*.?(min.js|map|css)', included: false, served: true, watched:false}, 12 | 13 | // load app source and test's specs 14 | 'src/require.config.js', 15 | 'tools/tests/require.config.js', 16 | 17 | // app source and tests specs 18 | {pattern: 'src/**/*.?(js|css|html)', included: false, served: true} 19 | ], 20 | 21 | // list of files to exclude 22 | exclude: [ 23 | 'src/require.mock.load.js', 24 | 'src/**/mock/**/*' 25 | ], 26 | 27 | // preprocess matching files before serving them to the browser 28 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor 29 | preprocessors: { 30 | 'src/**/*.html': ['ng-html2js'], 31 | // source files, that you wanna generate coverage for 32 | // do not include tests or libraries 33 | // (these files will be instrumented by Istanbul) 34 | '{src,src/!(vendor)/!(tests){,/!(tests){,/!(tests){,/!(tests)}}}}/!(package).js': ['coverage'] 35 | }, 36 | 37 | ngHtml2JsPreprocessor: { 38 | // strip this from the file path 39 | stripPrefix: 'src/' 40 | }, 41 | 42 | // start these browsers 43 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher 44 | browsers: ['PhantomJS', 'Chrome', 'Firefox'], 45 | 46 | // enable / disable colors in the output (reporters and logs) 47 | colors: true, 48 | 49 | logLevel: 'INFO', 50 | 51 | // web server port 52 | port: 9876 53 | 54 | }; 55 | -------------------------------------------------------------------------------- /tools/lib/generate/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function( options, done ) { 2 | 3 | var questions = require('./questions'), 4 | engine = require('./engine'); 5 | 6 | questions( options ) 7 | .then(function( optionsToEngine ) { 8 | 9 | // TODO: define and return some string message on engine when finished? 10 | return engine( optionsToEngine ); 11 | 12 | }) 13 | .then(function() { 14 | return done(); 15 | }) 16 | .catch(function(e) { 17 | return done(e); 18 | }); 19 | 20 | }; 21 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/crud/controllers/edit.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('../module'); 5 | require('../resources/rest'); 6 | 7 | module.controller('<%= helpers.capitalize( name ) %>EditCtrl', <%= helpers.capitalize( name ) %>EditCtrl); 8 | 9 | //--- 10 | 11 | <%= helpers.capitalize( name ) %>EditCtrl.$inject = [ 12 | '$rootScope', '$scope', '<%= helpers.capitalize( name ) %>Resource', 13 | '$stateParams', 'InputFocusFactory' 14 | ]; 15 | 16 | function <%= helpers.capitalize( name ) %>EditCtrl( 17 | $rootScope, $scope, resource, params, input 18 | ) { 19 | var vm = this; 20 | 21 | vm.title = 'Edit <%= helpers.capitalize( name ) %> : ' + params.id; 22 | 23 | vm.<%= name %> = undefined; 24 | 25 | vm.showConfirm = false; 26 | 27 | vm.save = save; 28 | 29 | vm.remove = remove; 30 | 31 | vm.cancelRemove = cancelRemove; 32 | 33 | vm.destroy = destroy; 34 | 35 | //--- 36 | 37 | var ctrlName = '<%= helpers.capitalize( name ) %>EditCtrl'; 38 | input = input.get(ctrlName); 39 | 40 | input.config( 41 | $scope, 42 | [ 43 | 'focus<%= helpers.capitalize( name ) %>NameInput' 44 | ]); 45 | 46 | //console.debug(input); 47 | 48 | //--- 49 | 50 | // TODO: move to route resolve? 51 | resource.get({id: params.id}, function(result) { 52 | vm.<%= name %> = result; 53 | input.setFocus('focus<%= helpers.capitalize( name ) %>NameInput', 200); 54 | }); 55 | 56 | //--- 57 | 58 | function save() { 59 | vm.<%= name %>.$update({id: params.id}, function(res) { 60 | $rootScope.$emit('<%= name %>:update:event', 'updated'); 61 | }); 62 | } 63 | 64 | function remove() { 65 | vm.showConfirm = true; 66 | } 67 | 68 | function cancelRemove() { 69 | vm.showConfirm = false; 70 | input.focusReset(); 71 | input.setFocus('focus<%= helpers.capitalize( name ) %>NameInput'); 72 | } 73 | 74 | function destroy() { 75 | vm.<%= name %>.$delete({id: params.id}, function(res) { 76 | vm.showConfirm = false; 77 | $rootScope.$emit('<%= name %>:remove:event', 'removed'); 78 | }); 79 | } 80 | 81 | } 82 | 83 | }); 84 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/crud/controllers/new.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('../module'); 5 | require('../resources/rest'); 6 | 7 | module.controller('<%= helpers.capitalize( name ) %>NewCtrl', <%= helpers.capitalize( name ) %>NewCtrl); 8 | 9 | //--- 10 | 11 | <%= helpers.capitalize( name ) %>NewCtrl.$inject = [ 12 | '$rootScope', '$scope', 13 | '<%= helpers.capitalize( name ) %>Resource', 'InputFocusFactory' 14 | ]; 15 | 16 | function <%= helpers.capitalize( name ) %>NewCtrl($rootScope, $scope, Resource, input) { 17 | var vm = this; 18 | 19 | vm.title = 'New <%= helpers.capitalize( name ) %>'; 20 | 21 | vm.<%= name %> = new Resource({ 22 | 'id':0, 23 | 'name':'', 24 | 'description':'' 25 | }); 26 | 27 | vm.save = save; 28 | 29 | //--- 30 | 31 | var ctrlName = '<%= helpers.capitalize( name ) %>NewCtrl'; 32 | input = input.get(ctrlName); 33 | 34 | input.config( 35 | $scope, 36 | [ 37 | 'focus<%= helpers.capitalize( name ) %>NameInput' 38 | ]); 39 | 40 | input.setFocus('focus<%= helpers.capitalize( name ) %>NameInput', 200); 41 | 42 | //console.debug(input); 43 | 44 | //--- 45 | 46 | function save() { 47 | vm.<%= name %>.$save(function(res) { 48 | $rootScope.$emit('<%= name %>:add:event', 'added'); 49 | }); 50 | } 51 | 52 | } 53 | 54 | }); 55 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/crud/mock/allow-pass.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var backend = require('shared/mock/backend'); 5 | 6 | backend.addResource(AllowPass); 7 | 8 | //--- 9 | 10 | AllowPass.$inject = ['$httpBackend', 'regexpUrl']; 11 | 12 | function AllowPass($httpBackend, regexpUrl) { 13 | 14 | //--- @begin: Allow pass to server 15 | 16 | // get all 17 | $httpBackend 18 | .when('GET', regexpUrl(/<%= helpers.stringRegExpEscape( endpoint ) %>(\?|$)/)) 19 | .passThrough(); 20 | 21 | // get one 22 | $httpBackend 23 | .when('GET', regexpUrl(/<%= helpers.stringRegExpEscape( endpoint ) %>(\/)?([A-z0-9]+)?$/)) 24 | .passThrough(); 25 | 26 | // create 27 | $httpBackend 28 | .when('POST', regexpUrl(/<%= helpers.stringRegExpEscape( endpoint ) %>$/)) 29 | .passThrough(); 30 | 31 | // update 32 | $httpBackend 33 | .when('PUT', regexpUrl(/<%= helpers.stringRegExpEscape( endpoint ) %>(\/)?([A-z0-9]+)?$/)) 34 | .passThrough(); 35 | 36 | // delete 37 | $httpBackend 38 | .when('DELETE', regexpUrl(/<%= helpers.stringRegExpEscape( endpoint ) %>(\/)?([A-z0-9]+)?$/)) 39 | .passThrough(); 40 | 41 | // search 42 | $httpBackend 43 | .when('GET', regexpUrl(/<%= helpers.stringRegExpEscape( endpoint ) %>\/search\/([A-z0-9]+)(\?|$)/)) 44 | .passThrough(); 45 | 46 | //--- @end: Allow pass to server 47 | 48 | } 49 | 50 | }); 51 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/crud/mock/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | // allow request pass through angular.js mock url interceptor 5 | // require('./allow-pass'); 6 | 7 | /**/ 8 | require('./data'); // local mock data 9 | require('./url-interceptors'); // intercepts and responds 10 | /**/ 11 | 12 | }); 13 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/crud/module.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var angular = require('angular'); 5 | require('angularResource'); 6 | 7 | require('uiRouter'); 8 | require('uiBootstrap'); 9 | 10 | // angular module definition 11 | return angular.module( 12 | // module name 13 | '<%= name %>', 14 | 15 | // module dependencies 16 | [ 17 | 'ngResource', 18 | 19 | 'ui.router', 20 | 'ui.bootstrap', 21 | 22 | require('shared/fend/input-utils/package').name, 23 | require('shared/fend/pagination/package').name, 24 | 25 | ] 26 | ); 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/crud/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | require('./controllers/edit'); 6 | require('./controllers/list'); 7 | require('./controllers/new'); 8 | require('./controllers/search'); 9 | require('./resources/rest'); 10 | require('./resources/search'); 11 | require('./states'); 12 | 13 | return module; 14 | 15 | }); 16 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/crud/resources/rest.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('../module'); 5 | 6 | module.factory('<%= helpers.capitalize( name ) %>Resource', <%= helpers.capitalize( name ) %>Resource); 7 | 8 | //--- 9 | 10 | <%= helpers.capitalize( name ) %>Resource.$inject = ['$resource']; 11 | 12 | function <%= helpers.capitalize( name ) %>Resource($resource) { 13 | 14 | var rest = $resource( 15 | '<%= endpoint %>/:id', 16 | { 17 | 'id': '' 18 | }, 19 | { 20 | 'update': { 'method': 'PUT' } 21 | } 22 | ); 23 | 24 | return rest; 25 | 26 | } 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/crud/resources/search.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('../module'); 5 | 6 | module.factory('<%= helpers.capitalize( name ) %>SearchResource', <%= helpers.capitalize( name ) %>SearchResource); 7 | 8 | //--- 9 | 10 | <%= helpers.capitalize( name ) %>SearchResource.$inject = ['$resource']; 11 | 12 | function <%= helpers.capitalize( name ) %>SearchResource($resource) { 13 | 14 | var rest = $resource( 15 | '<%= endpoint %>/search/:name' 16 | ); 17 | 18 | return rest; 19 | 20 | } 21 | 22 | }); 23 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/crud/states.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | 6 | module.config(configureStates); 7 | 8 | //--- 9 | 10 | configureStates.$inject = ['$stateProvider', '$urlRouterProvider']; 11 | 12 | function configureStates($stateProvider, $urlRouterProvider) { 13 | 14 | $urlRouterProvider 15 | .when('/<%= route %>', '/<%= route %>/list'); // default 16 | 17 | $stateProvider 18 | .state('<%= name %>', { 19 | abstract: true, 20 | url: '/<%= route %>', 21 | views: { 22 | 'master': { 23 | templateUrl : 'app/main/templates/layout.html' 24 | } 25 | } 26 | }) 27 | .state('<%= name %>.list', { 28 | url: '/list', 29 | views: { 30 | 'content@<%= name %>': { 31 | templateUrl : '<%= location %>/templates/list.html', 32 | controller : '<%= helpers.capitalize( name ) %>ListCtrl', 33 | controllerAs : 'vm' 34 | } 35 | } 36 | }) 37 | .state('<%= name %>.search', { 38 | url: '/search', 39 | views: { 40 | 'content@<%= name %>': { 41 | templateUrl : '<%= location %>/templates/search.html', 42 | controller : '<%= helpers.capitalize( name ) %>SearchCtrl', 43 | controllerAs : 'vm' 44 | } 45 | } 46 | }) 47 | .state('<%= name %>.new', { 48 | url: '/new', 49 | views: { 50 | 'content@<%= name %>': { 51 | templateUrl : '<%= location %>/templates/form.html', 52 | controller : '<%= helpers.capitalize( name ) %>NewCtrl', 53 | controllerAs : 'vm' 54 | } 55 | } 56 | }) 57 | .state('<%= name %>.edit', { 58 | url: '/edit/:id', 59 | views: { 60 | 'content@<%= name %>': { 61 | templateUrl : '<%= location %>/templates/form.html', 62 | controller : '<%= helpers.capitalize( name ) %>EditCtrl', 63 | controllerAs : 'vm' 64 | } 65 | } 66 | }); 67 | 68 | } 69 | 70 | }); 71 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/crud/templates/table.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

4 | : {{vm.filter.search}} 5 |

6 |
7 | 8 |
9 | 10 |
11 | 12 | 13 | 14 | 20 | 21 | 25 | 26 |
27 | 28 |
 
29 |
30 | 31 | 32 | 33 |
34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 50 | 51 | 52 | 57 | 58 | 59 |
Name Description
46 | 49 | {{<%= name %>.name}}{{<%= name %>.description}}
60 |
61 | 62 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/crud/tests/e2e/search.spec.js: -------------------------------------------------------------------------------- 1 | describe("e2e: <%= helpers.capitalize( name ) %> on search", function() { 2 | var page = require('./page.object'); 3 | 4 | //--- 5 | 6 | var backToList = page.on.search.links.backToList(); // get element 7 | var optionsButton = page.on.search.options.optionsButton(); // get element 8 | 9 | var searchInput = page.on.search.searchInput(); // get element 10 | 11 | var repeater = page.on.table.repeater(); // get element 12 | 13 | //--- 14 | 15 | beforeEach(function() { 16 | page.get(); 17 | 18 | page.on.list.links.search().click(); 19 | }); 20 | 21 | //--- 22 | 23 | it("should have go back link", function() { 24 | // assertions 25 | expect(backToList.isPresent()).toBeTruthy(); 26 | }); 27 | 28 | it("should show options", function() { 29 | // assert 30 | expect(optionsButton.getText()).toContain('Show Options'); 31 | 32 | // act 33 | optionsButton.click(); 34 | 35 | // assert 36 | expect(optionsButton.getText()).toContain('Hide Options'); 37 | }); 38 | 39 | //--- 40 | 41 | describe("do 'protractor' search", function() { 42 | 43 | beforeEach(function() { 44 | searchInput 45 | .sendKeys('protractor') 46 | .sendKeys('\n'); // submit form 47 | }); 48 | 49 | it("should find 'protractor'", function() { 50 | expect(repeater.count()).toBe(3); 51 | }); 52 | 53 | it("should change page size length to 2", function() { 54 | // open options 55 | optionsButton.click(); 56 | 57 | var pageSizeInput = page.on.search.options.pageSizeInput(); // get element 58 | 59 | pageSizeInput.clear(); 60 | pageSizeInput 61 | .sendKeys(2) 62 | .sendKeys('\n'); // submit form 63 | 64 | expect(repeater.count()).toBe(2); 65 | 66 | }); 67 | 68 | }); 69 | 70 | }); 71 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/crud/tests/unit/controllers/new.spec.js: -------------------------------------------------------------------------------- 1 | describe('Testing <%= helpers.capitalize( name ) %> New Controller', function() { 2 | 3 | var httpBackend, vm, rootScope, scope; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module('<%= name %>'); 10 | 11 | // inject dependencies 12 | inject(function($controller, $rootScope, $httpBackend) { 13 | scope = $rootScope.$new(); 14 | 15 | vm = $controller('<%= helpers.capitalize( name ) %>NewCtrl', { 16 | $scope: scope 17 | }); 18 | 19 | rootScope = $rootScope; 20 | httpBackend = $httpBackend; 21 | }); 22 | 23 | }); 24 | 25 | 26 | it('should be defined', function() { 27 | 28 | // assertions 29 | expect(vm).toBeDefined(); 30 | 31 | }); 32 | 33 | it("should have a title equals to 'New <%= helpers.capitalize( name ) %>'", function() { 34 | 35 | // assertions 36 | expect(vm.title).toEqual('New <%= helpers.capitalize( name ) %>'); 37 | 38 | }); 39 | 40 | it("should have empty <%= name %> object", function() { 41 | 42 | // assertions 43 | expect(vm.<%= name %>.id).toEqual(0); 44 | expect(vm.<%= name %>.name).toEqual(''); 45 | 46 | }); 47 | 48 | it("should save", function() { 49 | 50 | // arrange 51 | httpBackend.when('POST', '<%= endpoint %>') 52 | .respond(function(method, url, data) { 53 | data = angular.fromJson(data); 54 | data.id = 1; 55 | return [201, angular.copy(data)]; 56 | }); 57 | 58 | spyOn(rootScope, '$emit'); 59 | 60 | // act 61 | vm.save(); 62 | httpBackend.flush(); 63 | 64 | // assertions 65 | expect(rootScope.$emit).toHaveBeenCalledWith('<%= name %>:add:event', 'added'); 66 | 67 | }); 68 | 69 | 70 | }); 71 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/crud/tests/unit/module.spec.js: -------------------------------------------------------------------------------- 1 | describe('Angular.js \'<%= name %>\' Module', function() { 2 | 3 | var module; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module = angular.module('<%= name %>'); 10 | 11 | }); 12 | 13 | it("should be registered", function() { 14 | 15 | // assertions 16 | expect(module).toBeDefined(); 17 | 18 | }); 19 | 20 | describe("Dependencies:", function() { 21 | 22 | var deps; 23 | 24 | var hasModule = function(m) { 25 | return deps.indexOf(m) >= 0; 26 | }; 27 | 28 | beforeEach(function() { 29 | deps = module.value('appName').requires; 30 | }); 31 | 32 | var mainDeps = [ 33 | 'ngResource', 34 | 35 | 'ui.router', 36 | 'ui.bootstrap', 37 | 38 | 'fend.input.utils', 39 | 'fend.pagination', 40 | 41 | // TODO: review 42 | 43 | ]; 44 | 45 | mainDeps.forEach(function( depName ) { 46 | 47 | it('should have ' + depName + ' as a dependency', function() { 48 | 49 | // assertions 50 | expect(hasModule( depName )).toEqual(true); 51 | 52 | }); 53 | 54 | }); 55 | 56 | }); 57 | 58 | }); 59 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/crud/tests/unit/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | require('./module.spec'); 5 | require('./resources/rest.spec'); 6 | require('./resources/search.spec'); 7 | require('./controllers/list.spec'); 8 | require('./controllers/search.spec'); 9 | require('./controllers/new.spec'); 10 | require('./controllers/edit.spec'); 11 | require('./states.spec'); 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/crud/tests/unit/resources/rest.spec.js: -------------------------------------------------------------------------------- 1 | describe("Testing <%= helpers.capitalize( name ) %> Rest Resource", function() { 2 | 3 | var resource; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module('<%= name %>'); 10 | 11 | // inject dependencies 12 | inject(function(<%= helpers.capitalize( name ) %>Resource) { 13 | resource = <%= helpers.capitalize( name ) %>Resource; 14 | }); 15 | 16 | }); 17 | 18 | 19 | it('should be defined', function() { 20 | 21 | // assertions 22 | expect(resource).toBeDefined(); 23 | 24 | }); 25 | 26 | }); 27 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/crud/tests/unit/resources/search.spec.js: -------------------------------------------------------------------------------- 1 | describe("Testing <%= helpers.capitalize( name ) %> Search Resource", function() { 2 | 3 | var resource; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module('<%= name %>'); 10 | 11 | // inject dependencies 12 | inject(function(<%= helpers.capitalize( name ) %>SearchResource) { 13 | resource = <%= helpers.capitalize( name ) %>SearchResource; 14 | }); 15 | 16 | }); 17 | 18 | 19 | it('should be defined', function() { 20 | 21 | // assertions 22 | expect(resource).toBeDefined(); 23 | 24 | }); 25 | 26 | }); 27 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/page/README.md: -------------------------------------------------------------------------------- 1 | 2 | # TODO: 3 | 4 | 1 - update `/src/require.unit.load.js` 5 | 6 | ```javascript 7 | define(function(require) { 8 | 'use strict'; 9 | 10 | ... 11 | 12 | // TODO: add here tests unit module to load 13 | 14 | // ↓↓↓ ADD ↓↓↓ 15 | require('<%= location %>/tests/unit/package'); 16 | 17 | }); 18 | ``` 19 | 20 | 21 | 2 - update `/src/app/main/module.js` 22 | 23 | ```javascript 24 | define(function(require) { 25 | 'use strict'; 26 | 27 | var angular = require('angular'); 28 | 29 | ... 30 | 31 | // angular module definition 32 | return angular.module( 33 | 34 | // module name 35 | 'main', 36 | 37 | // module dependencies 38 | [ 39 | 40 | ... 41 | 42 | 43 | // TODO: add here module to load 44 | 45 | // ↓↓↓ ADD ↓↓↓ 46 | require('<%= location %>/package').name, 47 | 48 | ] 49 | ); 50 | 51 | }); 52 | ``` 53 | 54 | 55 | 3 - add menu item :: update `/src/app/main/controller.js` 56 | 57 | ```javascript 58 | //--- @begin: menu items 59 | menu.addMenuItem('Home', ''); 60 | 61 | ... 62 | 63 | // ↓↓↓ ADD ↓↓↓ 64 | menu.addMenuItem('<%= helpers.capitalize( name ) %>', '<%= route %>'); 65 | 66 | ... 67 | 68 | //--- @end: menu items 69 | ``` 70 | 71 | 72 | 4 - delete this file : `README.md` 73 | 74 | 75 | =------------------------------------------------------------------------------= 76 | 77 | Values to templates: 78 | 79 | name: <%= name %> 80 | 81 | name capitalized: <%= helpers.capitalize( name ) %> 82 | 83 | route: <%= route %> 84 | 85 | location: <%= location %> 86 | 87 | =------------------------------------------------------------------------------= 88 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/page/controller.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | 6 | module.controller('<%= helpers.capitalize( name ) %>Ctrl', <%= helpers.capitalize( name ) %>Ctrl); 7 | 8 | //--- 9 | 10 | // <%= helpers.capitalize( name ) %>Ctrl.$inject = []; 11 | 12 | function <%= helpers.capitalize( name ) %>Ctrl() { 13 | var vm = this; 14 | 15 | vm.pageName = '<%= helpers.capitalize( name ) %> Page'; 16 | } 17 | 18 | }); 19 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/page/module.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var angular = require('angular'); 5 | 6 | require('uiRouter'); 7 | 8 | // angular module definition 9 | return angular.module( 10 | // module name 11 | '<%= name %>', 12 | 13 | // module dependencies 14 | [ 15 | 'ui.router' 16 | ] 17 | ); 18 | 19 | }); 20 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/page/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | require('./controller'); 6 | require('./states'); 7 | 8 | return module; 9 | 10 | }); 11 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/page/states.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | 6 | module.config(configureStates); 7 | 8 | //--- 9 | 10 | configureStates.$inject = ['$stateProvider', '$urlRouterProvider']; 11 | 12 | function configureStates($stateProvider, $urlRouterProvider) { 13 | 14 | $stateProvider 15 | .state('<%= name %>', { 16 | url: '/<%= route %>', 17 | views: { 18 | 'master': { 19 | templateUrl : 'app/main/templates/layout.html' 20 | }, 21 | 'content@<%= name %>': { 22 | templateUrl : '<%= location %>/template.html', 23 | controller : '<%= helpers.capitalize( name ) %>Ctrl', 24 | controllerAs : 'vm' 25 | } 26 | } 27 | }); 28 | 29 | } 30 | 31 | }); 32 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/page/template.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 |

6 |


 7 |   TODO:
 8 | 
 9 |     * define <%= helpers.capitalize( name ) %>
10 | 
11 |       -> <%= location %>/template.html
12 | 
13 |     * remember to update:
14 | 
15 |       -> tests/e2e spec's
16 | 
17 |       -> tests/unit spec's
18 |     
19 |

20 | 21 |
22 | 23 |
24 | 25 |

Back to Home | Page name: {{vm.pageName}}

26 | 27 |
28 | 29 |
 
30 | 31 |
32 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/page/tests/e2e/page.object.js: -------------------------------------------------------------------------------- 1 | // Page Object 2 | module.exports = { 3 | 4 | get: function() { 5 | return browser.get('#/<%= route %>'); 6 | }, 7 | 8 | pageName: element(by.binding('vm.pageName')) 9 | 10 | }; 11 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/page/tests/e2e/page.spec.js: -------------------------------------------------------------------------------- 1 | describe("e2e: home page", function() { 2 | var page = require('./page.object'); 3 | 4 | beforeEach(function() { 5 | page.get(); 6 | }); 7 | 8 | it("should page name : '<%= helpers.capitalize( name ) %> Page'", function() { 9 | // assertions 10 | expect(page.pageName.getText()).toContain('<%= helpers.capitalize( name ) %> Page'); 11 | }); 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/page/tests/unit/controller.spec.js: -------------------------------------------------------------------------------- 1 | describe('Testing <%= helpers.capitalize( name ) %> Controller', function() { 2 | 3 | var vm; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module('<%= name %>'); 10 | 11 | // inject dependencies 12 | inject(function($controller) { 13 | 14 | vm = $controller('<%= helpers.capitalize( name ) %>Ctrl'); 15 | 16 | }); 17 | 18 | }); 19 | 20 | 21 | it('should have a pageName equals to \'<%= helpers.capitalize( name ) %> Page\'', function() { 22 | 23 | // assertions 24 | expect(vm.pageName).toEqual('<%= helpers.capitalize( name ) %> Page'); 25 | 26 | }); 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/page/tests/unit/module.spec.js: -------------------------------------------------------------------------------- 1 | describe('Angular.js \'<%= name %>\' Module', function() { 2 | 3 | var module; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module = angular.module('<%= name %>'); 10 | 11 | }); 12 | 13 | it("should be registered", function() { 14 | 15 | // assertions 16 | expect(module).toBeDefined(); 17 | 18 | }); 19 | 20 | describe("Dependencies:", function() { 21 | 22 | var deps; 23 | 24 | var hasModule = function(m) { 25 | return deps.indexOf(m) >= 0; 26 | }; 27 | 28 | beforeEach(function() { 29 | deps = module.value('appName').requires; 30 | }); 31 | 32 | var mainDeps = [ 33 | 'ui.router' 34 | 35 | // TODO: review 36 | 37 | ]; 38 | 39 | mainDeps.forEach(function( depName ) { 40 | 41 | it('should have ' + depName + ' as a dependency', function() { 42 | 43 | // assertions 44 | expect(hasModule( depName )).toEqual(true); 45 | }); 46 | 47 | }); 48 | 49 | }); 50 | 51 | }); 52 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/page/tests/unit/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | require('./module.spec'); 5 | require('./controller.spec'); 6 | require('./states.spec'); 7 | 8 | }); 9 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/resource/README.md: -------------------------------------------------------------------------------- 1 | 2 | # TODO: 3 | 4 | 1 - update `/src/require.unit.load.js` 5 | 6 | ```javascript 7 | define(function(require) { 8 | 'use strict'; 9 | 10 | ... 11 | 12 | // TODO: add here tests unit module to load 13 | 14 | // ↓↓↓ ADD ↓↓↓ 15 | require('<%= location %>/tests/unit/package'); 16 | 17 | }); 18 | ``` 19 | 20 | 2 - update `/src/require.mock.load.js` 21 | 22 | ```javascript 23 | define(function(require) { 24 | 'use strict'; 25 | 26 | ... 27 | 28 | //------------------- 29 | // @begin: load mocks 30 | 31 | ... 32 | 33 | // TODO: add here mock module to load 34 | 35 | // ↓↓↓ ADD ↓↓↓ 36 | require('<%= location %>/mock/package'); 37 | 38 | // @end: load mocks 39 | //------------------- 40 | 41 | ... 42 | 43 | }); 44 | ``` 45 | 46 | 3 - update `/src/app/main/module.js` 47 | or in some specific application module 48 | 49 | ```javascript 50 | define(function(require) { 51 | 'use strict'; 52 | 53 | var angular = require('angular'); 54 | 55 | ... 56 | 57 | // angular module definition 58 | return angular.module( 59 | 60 | // module name 61 | 'main', 62 | 63 | // module dependencies 64 | [ 65 | 66 | ... 67 | 68 | 69 | // TODO: add here module to load 70 | 71 | // ↓↓↓ ADD ↓↓↓ 72 | require('<%= location %>/package').name, 73 | 74 | ] 75 | ); 76 | 77 | }); 78 | ``` 79 | 80 | 4 - delete this file : `README.md` 81 | 82 | 83 | =------------------------------------------------------------------------------= 84 | 85 | Values to templates: 86 | 87 | name: <%= name %> 88 | 89 | name capitalized: <%= helpers.capitalize( name ) %> 90 | 91 | location: <%= location %> 92 | 93 | backend resource: <%= endpoint %> 94 | 95 | backend resource regexp escape: <%= helpers.stringRegExpEscape( endpoint ) %> 96 | 97 | =------------------------------------------------------------------------------= 98 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/resource/mock/allow-pass.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var backend = require('shared/mock/backend'); 5 | 6 | backend.addResource(AllowPass); 7 | 8 | //--- 9 | 10 | AllowPass.$inject = ['$httpBackend', 'regexpUrl']; 11 | 12 | function AllowPass($httpBackend, regexpUrl) { 13 | 14 | //--- @begin: Allow pass to server 15 | 16 | // get all 17 | $httpBackend 18 | .when('GET', regexpUrl(/<%= helpers.stringRegExpEscape( endpoint ) %>(\?|$)/)) 19 | .passThrough(); 20 | 21 | // get one 22 | $httpBackend 23 | .when('GET', regexpUrl(/<%= helpers.stringRegExpEscape( endpoint ) %>(\/)?([A-z0-9]+)?$/)) 24 | .passThrough(); 25 | 26 | // create 27 | $httpBackend 28 | .when('POST', regexpUrl(/<%= helpers.stringRegExpEscape( endpoint ) %>$/)) 29 | .passThrough(); 30 | 31 | // update 32 | $httpBackend 33 | .when('PUT', regexpUrl(/<%= helpers.stringRegExpEscape( endpoint ) %>(\/)?([A-z0-9]+)?$/)) 34 | .passThrough(); 35 | 36 | // delete 37 | $httpBackend 38 | .when('DELETE', regexpUrl(/<%= helpers.stringRegExpEscape( endpoint ) %>(\/)?([A-z0-9]+)?$/)) 39 | .passThrough(); 40 | 41 | //--- @end: Allow pass to server 42 | 43 | } 44 | 45 | }); 46 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/resource/mock/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | // allow request pass through angular.js mock url interceptor 5 | // require('./allow-pass'); 6 | 7 | /**/ 8 | require('./data'); // local mock data 9 | require('./url-interceptors'); // intercepts and responds 10 | /**/ 11 | 12 | }); 13 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/resource/module.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var angular = require('angular'); 5 | require('angularResource'); 6 | 7 | // angular module definition 8 | return angular.module( 9 | // module name 10 | '<%= name %>', 11 | 12 | // module dependencies 13 | [ 14 | 'ngResource' 15 | ] 16 | ); 17 | 18 | }); 19 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/resource/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('./module'); 5 | require('./resources/rest'); 6 | 7 | return module; 8 | 9 | }); 10 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/resource/resources/rest.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | var module = require('../module'); 5 | 6 | module.factory('<%= helpers.capitalize( name ) %>Resource', <%= helpers.capitalize( name ) %>Resource); 7 | 8 | //--- 9 | 10 | <%= helpers.capitalize( name ) %>Resource.$inject = ['$resource']; 11 | 12 | function <%= helpers.capitalize( name ) %>Resource($resource) { 13 | 14 | var rest = $resource( 15 | '<%= endpoint %>/:id', 16 | { 17 | 'id': '' 18 | }, 19 | { 20 | 'update': { 'method': 'PUT' } 21 | } 22 | ); 23 | 24 | return rest; 25 | 26 | } 27 | 28 | 29 | }); 30 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/resource/tests/unit/module.spec.js: -------------------------------------------------------------------------------- 1 | describe('Angular.js \'<%= name %>\' Module', function() { 2 | 3 | var module; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module = angular.module('<%= name %>'); 10 | 11 | }); 12 | 13 | it("should be registered", function() { 14 | 15 | // assertions 16 | expect(module).toBeDefined(); 17 | 18 | }); 19 | 20 | describe("Dependencies:", function() { 21 | 22 | var deps; 23 | 24 | var hasModule = function(m) { 25 | return deps.indexOf(m) >= 0; 26 | }; 27 | 28 | beforeEach(function() { 29 | deps = module.value('appName').requires; 30 | }); 31 | 32 | var mainDeps = [ 33 | 'ngResource' 34 | 35 | // TODO: review 36 | 37 | ]; 38 | 39 | mainDeps.forEach(function( depName ) { 40 | 41 | it('should have ' + depName + ' as a dependency', function() { 42 | 43 | // assertions 44 | expect(hasModule( depName )).toEqual(true); 45 | 46 | }); 47 | 48 | }); 49 | 50 | }); 51 | 52 | }); 53 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/resource/tests/unit/package.js: -------------------------------------------------------------------------------- 1 | define(function(require) { 2 | 'use strict'; 3 | 4 | require('./module.spec'); 5 | require('./resources/rest.spec'); 6 | 7 | }); 8 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/angularjs/resource/tests/unit/resources/rest.spec.js: -------------------------------------------------------------------------------- 1 | describe("Testing <%= helpers.capitalize( name ) %> Rest Resource", function() { 2 | 3 | var resource; 4 | 5 | // excuted before each "it" is run 6 | beforeEach(function() { 7 | 8 | // load the module 9 | module('<%= name %>'); 10 | 11 | // inject dependencies 12 | inject(function(<%= helpers.capitalize( name ) %>Resource) { 13 | resource = <%= helpers.capitalize( name ) %>Resource; 14 | }); 15 | 16 | }); 17 | 18 | 19 | it('should be defined', function() { 20 | 21 | // assertions 22 | expect(resource).toBeDefined(); 23 | 24 | }); 25 | 26 | }); 27 | -------------------------------------------------------------------------------- /tools/lib/generate/templates/gulp/config.js: -------------------------------------------------------------------------------- 1 | module.exports = function(gulp, $) { 2 | 3 | // TODO: review and define 4 | gulp.task('<%= name %>', [], function() {}); 5 | 6 | }; 7 | -------------------------------------------------------------------------------- /tools/lib/localip.js: -------------------------------------------------------------------------------- 1 | // http://txt.fliglio.com/2014/01/concurrent-protractor-testing/ 2 | module.exports = (function() { 3 | 4 | var os = require('os'); 5 | 6 | function getIpAddress() { 7 | var ipAddress = null; 8 | var ifaces = os.networkInterfaces(); 9 | 10 | function processDetails(details) { 11 | if (details.family === 'IPv4' && details.address !== '127.0.0.1' && !ipAddress) { 12 | ipAddress = details.address; 13 | } 14 | } 15 | 16 | for (var dev in ifaces) { 17 | ifaces[dev].forEach(processDetails); 18 | } 19 | return ipAddress; 20 | } 21 | 22 | return getIpAddress(); 23 | 24 | })(); 25 | -------------------------------------------------------------------------------- /tools/lib/oscheck.js: -------------------------------------------------------------------------------- 1 | 2 | var os = require('os'); 3 | 4 | module.exports = { 5 | name : os.platform(), 6 | isWin : /^win32/.test(os.platform()), 7 | isLinux : /^linux/.test(os.platform()), 8 | isMac : /^darwin/.test(os.platform()) || /^freebsd/.test(os.platform()) 9 | }; 10 | -------------------------------------------------------------------------------- /tools/lib/requirejs/builder.js: -------------------------------------------------------------------------------- 1 | var requirejs = require('requirejs'); 2 | 3 | function builder( config, done, debug, logger ) { 4 | debug = debug || false; 5 | log = logger || console.log; 6 | 7 | requirejs.optimize( config, buildResponse, buildError ); 8 | 9 | function buildResponse( response ) { 10 | if( debug ) { 11 | log( 'requirejs build done' ); 12 | log( response ); 13 | } 14 | done(); 15 | } 16 | 17 | function buildError( error ) { 18 | log( 'requirejs build error' ); 19 | log( error ); 20 | done(); 21 | } 22 | } 23 | 24 | //--- 25 | 26 | module.exports = builder; 27 | -------------------------------------------------------------------------------- /tools/lib/requirejs/index.js: -------------------------------------------------------------------------------- 1 | module.exports = (function() { 2 | 3 | return { 4 | builder: require('./builder'), 5 | rewriteConfig: require('./js-ast-js/gulp-rewrite-require-config') 6 | }; 7 | 8 | })(); 9 | -------------------------------------------------------------------------------- /tools/lib/requirejs/js-ast-js/gulp-rewrite-require-config.js: -------------------------------------------------------------------------------- 1 | // through2 is a thin wrapper around node transform streams 2 | var through = require('through2'), 3 | gutil = require('gulp-util'), 4 | transform = require('./rewrite-require-config'), 5 | PluginError = gutil.PluginError; 6 | 7 | // Consts 8 | var PLUGIN_NAME = 'gulp-rewrite-require-config'; 9 | 10 | 11 | // Plugin level function(dealing with files) 12 | function gulpRewriteRequireConfig() { 13 | 14 | // Creating a stream through which each file will pass 15 | return through.obj(function(file, enc, cb) { 16 | if (file.isNull()) { 17 | // return empty file 18 | return cb(null, file); 19 | } 20 | 21 | if (file.isStream()) { 22 | return cb(new PluginError(PLUGIN_NAME, 'Streaming not supported')); 23 | } 24 | 25 | if ( file.isBuffer() ) { 26 | file.contents = new Buffer( 27 | transform( String( file.contents ) ) 28 | ); 29 | } 30 | 31 | return cb(null, file); 32 | 33 | }); 34 | 35 | } 36 | 37 | // Exporting the plugin main function 38 | module.exports = gulpRewriteRequireConfig; 39 | -------------------------------------------------------------------------------- /tools/lib/requirejs/js-ast-js/rewrite-require-config.js: -------------------------------------------------------------------------------- 1 | 2 | //--- 3 | 4 | var esprima = require('esprima'), 5 | escodegen = require('escodegen'); 6 | 7 | //--- 8 | 9 | function checkTargetNode(node) { 10 | var flag = false; 11 | 12 | if( 13 | node.type === 'Property' && 14 | node.key.type === 'Identifier' && 15 | ( 16 | node.key.name === 'paths' || 17 | node.key.name === 'deps' 18 | ) 19 | ) { 20 | flag = true; 21 | } 22 | 23 | return flag; 24 | } 25 | 26 | function newNodeValue() { 27 | return { 28 | type: 'Literal', 29 | value: 'empty:' 30 | }; 31 | } 32 | 33 | //--- 34 | 35 | function generateAST(codeStr) { 36 | 37 | return esprima.parse(codeStr); 38 | 39 | } 40 | 41 | function editAST(ast) { 42 | 43 | // redefine paths to 'empty:' 44 | var configAST = ast.body[0].expression.callee.body.body[1].body.body[0].argument; 45 | 46 | var oldProperties = configAST.properties, 47 | newProperties = [], 48 | paths; 49 | 50 | // get only what is needed 51 | oldProperties.forEach(function(node) { 52 | 53 | if(checkTargetNode(node)) { 54 | newProperties.push(node); 55 | if(node.key.name === 'paths') paths = node; 56 | } 57 | 58 | }); 59 | 60 | // define new value 61 | paths.value.properties.forEach(function(node) { 62 | node.value = newNodeValue(); 63 | }); 64 | 65 | // update 66 | configAST.properties = newProperties; 67 | 68 | //--- 69 | 70 | // code style options 71 | var escodegenOptions = { 72 | format: { 73 | indent: { 74 | style: ' ' 75 | } 76 | } 77 | }; 78 | 79 | // generate new source code 80 | return escodegen.generate(ast, escodegenOptions); 81 | 82 | } 83 | 84 | //--- 85 | 86 | module.exports = function(inputSrc) { 87 | 88 | return editAST( 89 | generateAST( inputSrc ) 90 | ); 91 | 92 | }; 93 | -------------------------------------------------------------------------------- /tools/lib/testModuleThenExecute.js: -------------------------------------------------------------------------------- 1 | function testModuleThenExecute(testModule, installModule, executeLaterFn) { 2 | if(testModule && installModule && !executeLaterFn){ 3 | executeLaterFn = installModule; 4 | installModule = testModule; 5 | } 6 | try { 7 | require.resolve(testModule); 8 | executeLaterFn(); 9 | } catch(e) { 10 | var async_exec = require('child_process').exec; 11 | 12 | console.error('Module ' + testModule + ' not found. Installing... \n'); 13 | 14 | async_exec('npm install ' + installModule, function(err, stdout, stderr) { 15 | executeLaterFn(); 16 | }); 17 | } 18 | } 19 | 20 | module.exports = testModuleThenExecute; 21 | -------------------------------------------------------------------------------- /tools/protractor.config.js: -------------------------------------------------------------------------------- 1 | exports.config = { 2 | // will use local selenium server jar 3 | // seleniumAddress: 'http://localhost:4444/wd/hub', 4 | 5 | framework: 'jasmine', 6 | 7 | // See the full list at https://github.com/juliemr/minijasminenode/tree/jasmine1 8 | jasmineNodeOpts: { 9 | // If true, display spec names. 10 | isVerbose: true, 11 | // If true, print colors to the terminal. 12 | showColors: true, 13 | // If true, include stack traces in failures. 14 | includeStackTrace: true, 15 | // Default time to wait in ms before a test fails. 16 | defaultTimeoutInterval: 30000, 17 | // If true, print timestamps for failures 18 | showTiming: true, 19 | // Print failures in real time. 20 | realtimeFailure: false 21 | } 22 | 23 | }; 24 | -------------------------------------------------------------------------------- /tools/scripts/setup.js: -------------------------------------------------------------------------------- 1 | var testModuleThenExecute = require('../lib/testModuleThenExecute'); 2 | 3 | testModuleThenExecute('shelljs', function executeLater() { 4 | 5 | // http://documentup.com/arturadib/shelljs 6 | require('shelljs/global'); 7 | 8 | var oscheck = require('../lib/oscheck'); 9 | 10 | var sudoStr = (oscheck.isLinux || oscheck.isMac) ? 'sudo ' : ''; 11 | var cmd = ''; 12 | 13 | echo('About to setup environment'); 14 | echo('It works if it finishes with OK'); 15 | 16 | var installedSomeGlobalFlag = false; 17 | 18 | echo('----------------------------------------'); 19 | 20 | if(!which('gulp')) { 21 | echo('gulp is missing...taking care of that now.'); 22 | cmd = sudoStr + 'npm install --global gulp'; 23 | echo(cmd); exec(cmd); 24 | installedSomeGlobalFlag = true; 25 | } 26 | echo('gulp --version '); 27 | echo(exec('gulp --version', {silent:true}).output); 28 | 29 | echo('----------------------------------------'); 30 | 31 | echo('Installing node dependencies...\n'); 32 | exec('npm install'); 33 | 34 | 35 | echo('\nOK!\n'); 36 | 37 | }); 38 | -------------------------------------------------------------------------------- /tools/scripts/testos.js: -------------------------------------------------------------------------------- 1 | var testModuleThenExecute = require('../lib/testModuleThenExecute'); 2 | 3 | testModuleThenExecute('shelljs', function executeLater() { 4 | 5 | // http://documentup.com/arturadib/shelljs 6 | require('shelljs/global'); 7 | 8 | echo('Testing OS environment'); 9 | 10 | var os = require('../lib/oscheck'); 11 | 12 | /* 13 | What platform you're running on: 'darwin', 'freebsd', 'linux', 'sunos' or 'win32' 14 | win32 (for 32 or 64 bit) 15 | */ 16 | echo('OS detected is: '+os.name); 17 | echo('isWin = '+os.isWin); 18 | echo('isLinux = '+os.isLinux); 19 | echo('isMac = '+os.isMac); 20 | echo('\n'); 21 | 22 | }); 23 | -------------------------------------------------------------------------------- /tools/tests/require.config.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | var isKarma = (window.__karma__) ? true : false; 5 | var _baseUrl = isKarma ? '/base/src' : '../src'; 6 | 7 | console.log( 'isKarma: ' + isKarma ); 8 | console.log( 'baseUrl: ' + _baseUrl ); 9 | 10 | var _config = getRequireConfig(); 11 | 12 | //--- 13 | 14 | require.config({ 15 | 16 | baseUrl: _baseUrl, 17 | paths : _config.paths, 18 | shim : _config.shim, 19 | 20 | deps: [ 21 | 'app/main/package', 22 | 23 | 'angularMocks', 24 | 25 | './require.unit.load' 26 | ], 27 | 28 | callback: onRequireReadyHandler 29 | 30 | }); 31 | 32 | function bootstrapAngularApp(cb) { 33 | angular.element(document).ready(function() { 34 | console.log('bootstrap angular application'); 35 | // start angular app 36 | angular.bootstrap(document, ['main']); 37 | 38 | if(cb) cb(); 39 | }); 40 | } 41 | 42 | function karmaFlow() { 43 | var allTemplateCacheFiles = []; 44 | var TEMPLATE_CACHE_REGEXP = /html\.js$/i; 45 | 46 | var pathToTemplateCache = function(path) { 47 | return path.replace(/^\/base\/src\//, '').replace(/\.js$/, ''); 48 | }; 49 | 50 | Object.keys(window.__karma__.files).forEach(function(file) { 51 | if (TEMPLATE_CACHE_REGEXP.test(file)) { 52 | // Normalize paths to RequireJS module names. 53 | allTemplateCacheFiles.push(pathToTemplateCache(file)); 54 | } 55 | }); 56 | 57 | require(['angular'], function(angular) { 58 | console.log( 'angular loaded' ); 59 | 60 | require(allTemplateCacheFiles, function() { 61 | console.log( 'ng-html2js files loaded' ); 62 | 63 | bootstrapAngularApp(function() { 64 | window.__karma__.start(); 65 | }); 66 | 67 | }); 68 | 69 | }); 70 | 71 | } 72 | 73 | function onRequireReadyHandler() { 74 | console.log( 'onRequireReadyHandler' ); 75 | 76 | if(isKarma) karmaFlow(); 77 | 78 | } 79 | 80 | })(); 81 | --------------------------------------------------------------------------------