├── .circleci └── config.yml ├── .editorconfig ├── .ember-cli ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .npmignore ├── .template-lintrc.js ├── .vscode └── launch.json ├── .watchmanconfig ├── CNAME ├── LICENSE.md ├── README.md ├── addon └── components │ └── ember-spinner.js ├── app ├── components │ └── ember-spinner.js └── initializers │ └── ember-spinner.js ├── config ├── ember-try.js └── environment.js ├── ember-cli-build.js ├── index.js ├── package.json ├── testem.js ├── tests ├── .jshintrc ├── acceptance │ └── ember-spinjs-test.js ├── dummy │ ├── .jshintrc │ ├── app │ │ ├── app.js │ │ ├── config │ │ │ └── ember-spinner │ │ │ │ ├── small.js │ │ │ │ └── standard.js │ │ ├── index.html │ │ ├── resolver.js │ │ ├── router.js │ │ ├── styles │ │ │ └── app.css │ │ └── templates │ │ │ └── application.hbs │ ├── config │ │ ├── environment.js │ │ ├── optional-features.json │ │ └── targets.js │ └── public │ │ └── robots.txt ├── helpers │ ├── .gitkeep │ └── resolver.js ├── index.html ├── integration │ └── components │ │ └── ember-spinner-test.js ├── test-helper.js └── unit │ └── .gitkeep └── yarn.lock /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.0 2 | references: 3 | container_config: &container_config 4 | docker: 5 | - image: circleci/node:10-browsers 6 | working_directory: ~/ember-cli-spinjs 7 | 8 | restore_repo: &restore_repo 9 | restore_cache: 10 | keys: 11 | - v1-repo-{{ .Branch }}-{{ .Revision }} 12 | - v1-repo-{{ .Branch }} 13 | - v1-repo 14 | 15 | restore_node_modules: &restore_node_modules 16 | restore_cache: 17 | keys: 18 | - v1-dependencies-{{ checksum "package.json" }} 19 | - v1-dependencies 20 | 21 | jobs: 22 | checkout_code: 23 | <<: *container_config 24 | steps: 25 | - *restore_repo 26 | - checkout 27 | - save_cache: 28 | key: v1-repo-{{ .Branch }}-{{ .Revision }} 29 | paths: 30 | - . 31 | 32 | install_dependencies: 33 | <<: *container_config 34 | steps: 35 | - *restore_repo 36 | - *restore_node_modules 37 | - run: yarn install 38 | - save_cache: 39 | key: v1-dependencies-{{ checksum "package.json" }} 40 | paths: 41 | - node_modules 42 | 43 | # deploy_master: 44 | # <<: *container_config 45 | # steps: 46 | # - *restore_repo 47 | # - *restore_node_modules 48 | # - run: 49 | # name: Deploy Master 50 | # command: yarn deploy 51 | 52 | test-1-13: 53 | <<: *container_config 54 | steps: 55 | - *restore_repo 56 | - *restore_node_modules 57 | - run: node_modules/.bin/ember try:one ember-1-13 --skip-cleanup 58 | 59 | test-lts-2.12: 60 | <<: *container_config 61 | steps: 62 | - *restore_repo 63 | - *restore_node_modules 64 | - run: node_modules/.bin/ember try:one ember-lts-2.12 --skip-cleanup 65 | 66 | test-lts-2.16: 67 | <<: *container_config 68 | steps: 69 | - *restore_repo 70 | - *restore_node_modules 71 | - run: node_modules/.bin/ember try:one ember-lts-2.16 --skip-cleanup 72 | 73 | test-lts-2.18: 74 | <<: *container_config 75 | steps: 76 | - *restore_repo 77 | - *restore_node_modules 78 | - run: node_modules/.bin/ember try:one ember-lts-2.18 --skip-cleanup 79 | 80 | test-release: 81 | <<: *container_config 82 | steps: 83 | - *restore_repo 84 | - *restore_node_modules 85 | - run: node_modules/.bin/ember try:one ember-release --skip-cleanup 86 | 87 | test-beta: 88 | <<: *container_config 89 | steps: 90 | - *restore_repo 91 | - *restore_node_modules 92 | - run: node_modules/.bin/ember try:one ember-beta --skip-cleanup 93 | 94 | test-canary: 95 | <<: *container_config 96 | steps: 97 | - *restore_repo 98 | - *restore_node_modules 99 | - run: node_modules/.bin/ember try:one ember-canary --skip-cleanup 100 | 101 | test-default: 102 | <<: *container_config 103 | steps: 104 | - *restore_repo 105 | - *restore_node_modules 106 | - run: node_modules/.bin/ember try:one ember-default --skip-cleanup 107 | 108 | workflows: 109 | version: 2 110 | 111 | build_test: 112 | jobs: 113 | - checkout_code 114 | 115 | - install_dependencies: 116 | requires: 117 | - checkout_code 118 | 119 | - test-lts-2.12: 120 | requires: 121 | - install_dependencies 122 | 123 | - test-lts-2.16: 124 | requires: 125 | - install_dependencies 126 | 127 | - test-lts-2.18: 128 | requires: 129 | - install_dependencies 130 | 131 | - test-1-13: 132 | requires: 133 | - install_dependencies 134 | 135 | - test-default: 136 | requires: 137 | - install_dependencies 138 | 139 | - test-release: 140 | requires: 141 | - install_dependencies 142 | 143 | - test-beta: 144 | requires: 145 | - install_dependencies 146 | 147 | - test-canary: 148 | requires: 149 | - install_dependencies 150 | 151 | # - deploy_master: 152 | # requires: 153 | # - test-lts-2.12 154 | # - test-lts-2.16 155 | # - test-lts-2.18 156 | # - test-1-13 157 | # - test-default 158 | # - test-release 159 | # - test-beta 160 | # filters: 161 | # branches: 162 | # only: master 163 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | 8 | [*] 9 | end_of_line = lf 10 | charset = utf-8 11 | trim_trailing_whitespace = true 12 | insert_final_newline = true 13 | indent_style = space 14 | indent_size = 2 15 | 16 | [*.hbs] 17 | insert_final_newline = false 18 | 19 | [*.{diff,md}] 20 | trim_trailing_whitespace = false 21 | -------------------------------------------------------------------------------- /.ember-cli: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | Ember CLI sends analytics information by default. The data is completely 4 | anonymous, but there are times when you might want to disable this behavior. 5 | 6 | Setting `disableAnalytics` to true will prevent any data from being sent. 7 | */ 8 | "disableAnalytics": false 9 | } 10 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | # unconventional js 2 | /blueprints/*/files/ 3 | /vendor/ 4 | 5 | # compiled output 6 | /dist/ 7 | /tmp/ 8 | 9 | # dependencies 10 | /bower_components/ 11 | 12 | # misc 13 | /coverage/ 14 | 15 | # ember-try 16 | /.node_modules.ember-try/ 17 | /bower.json.ember-try 18 | /package.json.ember-try 19 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parserOptions: { 4 | ecmaVersion: 2017, 5 | sourceType: 'module' 6 | }, 7 | plugins: [ 8 | 'ember' 9 | ], 10 | extends: [ 11 | 'eslint:recommended', 12 | 'plugin:ember/recommended' 13 | ], 14 | env: { 15 | browser: true 16 | }, 17 | rules: { 18 | }, 19 | overrides: [ 20 | // node files 21 | { 22 | files: [ 23 | '.template-lintrc.js', 24 | 'ember-cli-build.js', 25 | 'index.js', 26 | 'testem.js', 27 | 'blueprints/*/index.js', 28 | 'config/**/*.js', 29 | 'tests/dummy/config/**/*.js' 30 | ], 31 | excludedFiles: [ 32 | 'addon/**', 33 | 'addon-test-support/**', 34 | 'app/**', 35 | 'tests/dummy/app/**' 36 | ], 37 | parserOptions: { 38 | sourceType: 'script', 39 | ecmaVersion: 2015 40 | }, 41 | env: { 42 | browser: false, 43 | node: true 44 | }, 45 | plugins: ['node'], 46 | rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, { 47 | // add your custom rules and overrides for node files here 48 | }) 49 | } 50 | ] 51 | }; 52 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist/ 5 | /tmp/ 6 | 7 | # dependencies 8 | /bower_components/ 9 | /node_modules/ 10 | 11 | # misc 12 | /.sass-cache 13 | /connect.lock 14 | /coverage/ 15 | /libpeerconnection.log 16 | /npm-debug.log* 17 | /testem.log 18 | /yarn-error.log 19 | 20 | # ember-try 21 | /.node_modules.ember-try/ 22 | /bower.json.ember-try 23 | /package.json.ember-try 24 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # compiled output 2 | /dist/ 3 | /tmp/ 4 | 5 | # dependencies 6 | /bower_components/ 7 | 8 | # misc 9 | /.bowerrc 10 | /.editorconfig 11 | /.ember-cli 12 | /.eslintignore 13 | /.eslintrc.js 14 | /.gitignore 15 | /.watchmanconfig 16 | /.travis.yml 17 | /bower.json 18 | /config/ember-try.js 19 | /ember-cli-build.js 20 | /testem.js 21 | /tests/ 22 | /yarn.lock 23 | .gitkeep 24 | 25 | # ember-try 26 | /.node_modules.ember-try/ 27 | /bower.json.ember-try 28 | /package.json.ember-try 29 | -------------------------------------------------------------------------------- /.template-lintrc.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | extends: 'recommended' 5 | }; 6 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Launch Ember CLI", 6 | "type": "node", 7 | "request": "launch", 8 | "program": "${workspaceRoot}/node_modules/ember-cli/bin/ember", 9 | "args": [ 10 | "serve" 11 | ] 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | { 2 | "ignore_dirs": ["tmp", "dist"] 3 | } 4 | -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | ember-cli-spinjs.surge.sh 2 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ember-cli Spinjs 2 | 3 | 4 | [![CircleCI](https://circleci.com/gh/kiwiupover/ember-cli-spinjs.svg?style=shield)](https://circleci.com/gh/kiwiupover/ember-cli-spinjs/tree/master) 5 | [![Ember Observer Score](http://emberobserver.com/badges/ember-cli-spinjs.svg)](http://emberobserver.com/addons/ember-cli-spinjs) 6 | [![Code Climate](https://codeclimate.com/github/kiwiupover/ember-cli-spinjs/badges/gpa.svg)](https://codeclimate.com/github/kiwiupover/ember-cli-spinjs) 7 | [![npm version](https://badge.fury.io/js/ember-cli-spinjs.svg)](http://badge.fury.io/js/ember-cli-spinjs) 8 | [![Greenkeeper badge](https://badges.greenkeeper.io/kiwiupover/ember-cli-spinjs.svg)](https://greenkeeper.io/) 9 | 10 | ## Install 11 | In the root of your ember-cli project directory, run: 12 | 13 | ```bash 14 | ember install ember-cli-spinjs 15 | ``` 16 | 17 | ## Usage 18 | Now you in your templates you can use `{{ember-spinner}}` to add a spinner to your page. 19 | 20 | [View Demo](http://ember-cli-spinjs.surge.sh/) 21 | 22 | ```handlebars 23 | {{ember-spinner}} 24 | ``` 25 | Default 26 | 27 | ### With a config file 28 | ```handlebars 29 | {{ember-spinner config='standard'}} 30 | ``` 31 | Add two folders to your app the first called `config` and in that folder 32 | another called `ember-spinner` with a file called `standard.js` 33 | 34 | ```javascript 35 | export default { 36 | color: 'blue', 37 | lines: 10, 38 | length: 30, 39 | zIndex: 200000 40 | } 41 | ``` 42 | 43 | ```handlebars 44 | {{ember-spinner lines=11 length=16 radius=30 width=8 rotate=10 speed='1.1' color="#ffc52e"}} 45 | ``` 46 | Spinning Lines 47 | 48 | ```handlebars 49 | {{ember-spinner lines=18 radius=10 width=5 rotate=0 speed="3.4" color='blue'}} 50 | ``` 51 | Fast spinning blue dots. 52 | 53 | ### Dependencies 54 | 55 | ##### Spin.js 56 | The [Spin.js docs](http://fgnass.github.io/spin.js/) 57 | jQuery is no longer a dependency 58 | 59 | ### Linting 60 | 61 | * `npm run lint:hbs` 62 | * `npm run lint:js` 63 | * `npm run lint:js -- --fix` 64 | 65 | ### Running tests 66 | 67 | * `ember test` – Runs the test suite on the current Ember version 68 | * `ember test --server` – Runs the test suite in "watch mode" 69 | * `ember try:each` – Runs the test suite against multiple Ember versions 70 | 71 | ### Running the dummy application 72 | 73 | * `ember serve` 74 | * Visit the dummy application at [http://localhost:4200](http://localhost:4200). 75 | 76 | For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/). 77 | 78 | License 79 | ------------------------------------------------------------------------------ 80 | 81 | This project is licensed under the [MIT License](LICENSE.md). 82 | -------------------------------------------------------------------------------- /addon/components/ember-spinner.js: -------------------------------------------------------------------------------- 1 | /* global require */ 2 | 3 | import { Spinner } from 'spin.js'; 4 | import { assign } from '@ember/polyfills'; 5 | import Component from '@ember/component'; 6 | 7 | export default Component.extend({ 8 | classNames: 'spinner-display', 9 | animation: 'spinner-line-fade-quick', 10 | color: '#333', 11 | corners: 1, 12 | direction: 1, 13 | fps: 20, 14 | left: '50%', 15 | length: 7, 16 | lines: 12, 17 | radius: 10, 18 | rotate: 0, 19 | scale: 1.0, 20 | shadow: false, 21 | speed: 1, 22 | top: '50%', 23 | width: 5, 24 | zIndex: 2000000000, 25 | position: 'absolute', 26 | spinner: null, 27 | 28 | init() { 29 | this._super(...arguments); 30 | this.configArgs = {}; 31 | }, 32 | 33 | willInsertElement() { 34 | this._super(...arguments); 35 | let opts = { 36 | animation: this.get('animation'), 37 | color: this.get('color'), 38 | corners: this.get('corners'), 39 | direction: this.get('direction'), 40 | fps: this.get('fps'), 41 | left: this.get('left'), 42 | length: this.get('length'), 43 | lines: this.get('lines'), 44 | radius: this.get('radius'), 45 | rotate: this.get('rotate'), 46 | scale: this.get('scale'), 47 | shadow: this.get('shadow'), 48 | speed: this.get('speed'), 49 | top: this.get('top'), 50 | width: this.get('width'), 51 | zIndex: this.get('zIndex'), 52 | position: this.get('position'), 53 | hwaccel: true 54 | }; 55 | 56 | let configArgs; 57 | 58 | if(this.get('config')) { 59 | let modulePrefix = this.emberSpinnerPrefixConfig.modulePrefix; 60 | let configFile = `${modulePrefix}/config/ember-spinner/${this.get('config')}`; 61 | 62 | configArgs = require(configFile).default; 63 | } 64 | 65 | this.spinnerArgs = assign(opts, configArgs); 66 | }, 67 | 68 | didInsertElement() { 69 | this.spinner = new Spinner(this.spinnerArgs).spin(this.element); 70 | }, 71 | 72 | willRemoveElement() { 73 | this.spinner.stop(); 74 | } 75 | 76 | }); 77 | -------------------------------------------------------------------------------- /app/components/ember-spinner.js: -------------------------------------------------------------------------------- 1 | export { default } from 'ember-cli-spinjs/components/ember-spinner'; 2 | -------------------------------------------------------------------------------- /app/initializers/ember-spinner.js: -------------------------------------------------------------------------------- 1 | import config from '../config/environment'; 2 | 3 | var emberSpinnerPrefix = { 4 | modulePrefix: config.modulePrefix 5 | }; 6 | 7 | export default { 8 | name: 'ember-spinner-prefix', 9 | 10 | initialize: function() { 11 | let application = arguments[1] || arguments[0]; 12 | application.register('ember-spinner:main', emberSpinnerPrefix, {instantiate: false}); 13 | application.inject('component:ember-spinner', 'emberSpinnerPrefixConfig', 'ember-spinner:main'); 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /config/ember-try.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const getChannelURL = require('ember-source-channel-url'); 4 | 5 | module.exports = function() { 6 | return Promise.all([ 7 | getChannelURL('release'), 8 | getChannelURL('beta'), 9 | getChannelURL('canary') 10 | ]).then((urls) => { 11 | return { 12 | useYarn: true, 13 | scenarios: [ 14 | { 15 | name: 'ember-1-13', 16 | bower: { 17 | dependencies: { 18 | 'ember': '~1.13.0' 19 | }, 20 | resolutions: { 21 | 'ember': '~1.13.0' 22 | } 23 | } 24 | }, 25 | { 26 | name: 'ember-lts-2.12', 27 | npm: { 28 | devDependencies: { 29 | '@ember/jquery': '^0.5.1', 30 | 'ember-source': '~2.12.0' 31 | } 32 | } 33 | }, 34 | { 35 | name: 'ember-lts-2.16', 36 | npm: { 37 | devDependencies: { 38 | '@ember/jquery': '^0.5.1', 39 | 'ember-source': '~2.16.0' 40 | } 41 | } 42 | }, 43 | { 44 | name: 'ember-lts-2.18', 45 | env: { 46 | EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true }), 47 | }, 48 | npm: { 49 | devDependencies: { 50 | '@ember/jquery': '^0.5.1', 51 | 'ember-source': '~2.18.0' 52 | } 53 | } 54 | }, 55 | { 56 | name: 'ember-release', 57 | npm: { 58 | devDependencies: { 59 | 'ember-source': urls[0] 60 | } 61 | } 62 | }, 63 | { 64 | name: 'ember-beta', 65 | npm: { 66 | devDependencies: { 67 | 'ember-source': urls[1] 68 | } 69 | } 70 | }, 71 | { 72 | name: 'ember-canary', 73 | npm: { 74 | devDependencies: { 75 | 'ember-source': urls[2] 76 | } 77 | } 78 | }, 79 | { 80 | name: 'ember-default', 81 | npm: { 82 | devDependencies: {} 83 | } 84 | }, 85 | { 86 | name: 'ember-default-with-jquery', 87 | env: { 88 | EMBER_OPTIONAL_FEATURES: JSON.stringify({ 89 | 'jquery-integration': true 90 | }) 91 | }, 92 | npm: { 93 | devDependencies: { 94 | '@ember/jquery': '^0.5.1' 95 | } 96 | } 97 | } 98 | ] 99 | }; 100 | }); 101 | }; 102 | -------------------------------------------------------------------------------- /config/environment.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function(/* environment, appConfig */) { 4 | return { }; 5 | }; 6 | -------------------------------------------------------------------------------- /ember-cli-build.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); 4 | 5 | module.exports = function(defaults) { 6 | let app = new EmberAddon(defaults, { 7 | // Add options here 8 | }); 9 | 10 | /* 11 | This build file specifies the options for the dummy test app of this 12 | addon, located in `/tests/dummy` 13 | This build file does *not* influence how the addon or the app using it 14 | behave. You most likely want to be modifying `./index.js` or app's build file 15 | */ 16 | 17 | return app.toTree(); 18 | }; 19 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | 'use strict'; 3 | 4 | const path = require('path'); 5 | const resolve = require('resolve'); 6 | const Funnel = require('broccoli-funnel'); 7 | const mergeTrees = require('broccoli-merge-trees'); 8 | 9 | module.exports = { 10 | name: 'ember-cli-spinjs', 11 | 12 | treeForAddonStyles: function (tree) { 13 | const spinJsPath = path.join(resolve.sync('spin.js'), '..'); 14 | 15 | let spinJsCSSTree = new Funnel(spinJsPath, { 16 | include: ['spin.css'] 17 | }); 18 | 19 | let allCSSTrees = [spinJsCSSTree]; 20 | 21 | if (tree) { 22 | allCSSTrees.push(tree); 23 | } 24 | 25 | return mergeTrees(allCSSTrees); 26 | } 27 | }; 28 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ember-cli-spinjs", 3 | "version": "2.0.0", 4 | "description": "An ember addon to integrate with spin.js", 5 | "ember-addon": { 6 | "configPath": "tests/dummy/config", 7 | "demoURL": "http://ember-cli-spinjs.surge.sh" 8 | }, 9 | "keywords": [ 10 | "ember-addon", 11 | "ember-cli", 12 | "spinjs", 13 | "ember-cli-spinjs", 14 | "blockchain" 15 | ], 16 | "repository": "https://github.com/kiwiupover/ember-cli-spinjs", 17 | "license": "MIT", 18 | "author": "David Laird", 19 | "scripts": { 20 | "build": "ember build", 21 | "lint:hbs": "ember-template-lint .", 22 | "lint:js": "eslint .", 23 | "start": "ember server", 24 | "test": "ember test", 25 | "test:all": "ember try:each", 26 | "deploy": "ember surge", 27 | "publish:patch": "npm whoami && npm version patch && git push origin --tags && npm publish", 28 | "publish:minor": "npm whoami && npm version minor && git push origin --tags && npm publish" 29 | }, 30 | "engines": { 31 | "node": "6.* || 8.* || >= 10.*" 32 | }, 33 | "devDependencies": { 34 | "@ember/optional-features": "^0.7.0", 35 | "bower": "^1.8.2", 36 | "broccoli-asset-rev": "^3.0.0", 37 | "ember-cli": "~3.10.1", 38 | "ember-cli-dependency-checker": "^3.0.0", 39 | "ember-cli-eslint": "^4.2.3", 40 | "ember-cli-htmlbars": "^4.0.0", 41 | "ember-cli-htmlbars-inline-precompile": "^2.0.0", 42 | "ember-cli-inject-live-reload": "^2.0.1", 43 | "ember-cli-sri": "^2.1.1", 44 | "ember-cli-surge": "^1.2.0", 45 | "ember-cli-template-lint": "^1.0.0-beta.1", 46 | "ember-cli-test-loader": "^2.1.0", 47 | "ember-cli-uglify": "^2.1.0", 48 | "ember-disable-prototype-extensions": "^1.1.3", 49 | "ember-export-application-global": "^2.0.0", 50 | "ember-load-initializers": "^2.0.0", 51 | "ember-maybe-import-regenerator": "^0.1.6", 52 | "ember-qunit": "^4.0.0", 53 | "ember-resolver": "^5.0.1", 54 | "ember-source": "~3.5.0", 55 | "ember-source-channel-url": "^1.1.0", 56 | "ember-try": "^1.1.0", 57 | "eslint-plugin-ember": "^7.0.0", 58 | "eslint-plugin-node": "^8.0.0", 59 | "loader.js": "^4.7.0", 60 | "qunit-dom": "^0.8.0" 61 | }, 62 | "dependencies": { 63 | "broccoli-funnel": "^2.0.1", 64 | "broccoli-merge-trees": "^3.0.1", 65 | "ember-auto-import": "^1.2.15", 66 | "ember-cli-babel": "^7.1.2", 67 | "resolve": "^1.8.1", 68 | "spin.js": "^4.0.0" 69 | }, 70 | "bugs": { 71 | "url": "https://github.com/kiwiupover/ember-cli-spinjs/issues" 72 | }, 73 | "homepage": "https://github.com/kiwiupover/ember-cli-spinjs" 74 | } 75 | -------------------------------------------------------------------------------- /testem.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | test_page: 'tests/index.html?hidepassed', 3 | disable_watching: true, 4 | launch_in_ci: [ 5 | 'Chrome' 6 | ], 7 | launch_in_dev: [ 8 | 'Chrome' 9 | ], 10 | browser_args: { 11 | Chrome: { 12 | ci: [ 13 | // --no-sandbox is needed when running Chrome inside a container 14 | process.env.CI ? '--no-sandbox' : null, 15 | '--headless', 16 | '--disable-gpu', 17 | '--disable-dev-shm-usage', 18 | '--disable-software-rasterizer', 19 | '--mute-audio', 20 | '--remote-debugging-port=0', 21 | '--window-size=1440,900' 22 | ].filter(Boolean) 23 | } 24 | } 25 | }; 26 | -------------------------------------------------------------------------------- /tests/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "predef": [ 3 | "document", 4 | "window", 5 | "location", 6 | "setTimeout", 7 | "$", 8 | "-Promise", 9 | "define", 10 | "console", 11 | "visit", 12 | "exists", 13 | "fillIn", 14 | "click", 15 | "keyEvent", 16 | "triggerEvent", 17 | "find", 18 | "findWithAssert", 19 | "wait", 20 | "DS", 21 | "andThen", 22 | "currentURL", 23 | "currentPath", 24 | "currentRouteName" 25 | ], 26 | "node": false, 27 | "browser": false, 28 | "boss": true, 29 | "curly": true, 30 | "debug": false, 31 | "devel": false, 32 | "eqeqeq": true, 33 | "evil": true, 34 | "forin": false, 35 | "immed": false, 36 | "laxbreak": false, 37 | "newcap": true, 38 | "noarg": true, 39 | "noempty": false, 40 | "nonew": false, 41 | "nomen": false, 42 | "onevar": false, 43 | "plusplus": false, 44 | "regexp": false, 45 | "undef": true, 46 | "sub": true, 47 | "strict": false, 48 | "white": false, 49 | "eqnull": true, 50 | "esversion": 6, 51 | "unused": true 52 | } 53 | -------------------------------------------------------------------------------- /tests/acceptance/ember-spinjs-test.js: -------------------------------------------------------------------------------- 1 | import { module, test } from 'qunit'; 2 | import { findAll, visit } from '@ember/test-helpers'; 3 | import { setupApplicationTest } from 'ember-qunit'; 4 | 5 | module('Acceptance | ember spinner', function(hooks) { 6 | setupApplicationTest(hooks); 7 | 8 | test('The index displays six ember-spinner', async function(assert) { 9 | await visit('/'); 10 | 11 | assert.equal(findAll('.spinner-display').length, 6); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /tests/dummy/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "predef": { 3 | "document": true, 4 | "window": true, 5 | "-Promise": true 6 | }, 7 | "browser" : true, 8 | "boss" : true, 9 | "curly": true, 10 | "debug": false, 11 | "devel": true, 12 | "eqeqeq": true, 13 | "evil": true, 14 | "forin": false, 15 | "immed": false, 16 | "laxbreak": false, 17 | "newcap": true, 18 | "noarg": true, 19 | "noempty": false, 20 | "nonew": false, 21 | "nomen": false, 22 | "onevar": false, 23 | "plusplus": false, 24 | "regexp": false, 25 | "undef": true, 26 | "sub": true, 27 | "strict": false, 28 | "white": false, 29 | "eqnull": true, 30 | "esnext": true, 31 | "unused": true 32 | } 33 | -------------------------------------------------------------------------------- /tests/dummy/app/app.js: -------------------------------------------------------------------------------- 1 | import Application from '@ember/application'; 2 | import Resolver from './resolver'; 3 | import loadInitializers from 'ember-load-initializers'; 4 | import config from './config/environment'; 5 | 6 | const App = Application.extend({ 7 | modulePrefix: config.modulePrefix, 8 | podModulePrefix: config.podModulePrefix, 9 | Resolver 10 | }); 11 | 12 | loadInitializers(App, config.modulePrefix); 13 | 14 | export default App; 15 | -------------------------------------------------------------------------------- /tests/dummy/app/config/ember-spinner/small.js: -------------------------------------------------------------------------------- 1 | export default { 2 | color: 'red', 3 | lines: 12, 4 | length: 3, 5 | radius: 15, 6 | width: 5, 7 | rotate: 2 8 | }; 9 | -------------------------------------------------------------------------------- /tests/dummy/app/config/ember-spinner/standard.js: -------------------------------------------------------------------------------- 1 | export default { 2 | color: 'red', 3 | lines: 15, 4 | length: 5, 5 | radius: 30, 6 | width: 5 7 | }; 8 | -------------------------------------------------------------------------------- /tests/dummy/app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Ember CLI Spinjs 7 | 8 | 9 | 10 | {{content-for "head"}} 11 | 12 | 13 | 14 | 15 | {{content-for "head-footer"}} 16 | 17 | 18 | {{content-for "body"}} 19 | 20 | 21 | 22 | 23 | {{content-for "body-footer"}} 24 | 25 | 26 | -------------------------------------------------------------------------------- /tests/dummy/app/resolver.js: -------------------------------------------------------------------------------- 1 | import Resolver from 'ember-resolver'; 2 | 3 | export default Resolver; 4 | -------------------------------------------------------------------------------- /tests/dummy/app/router.js: -------------------------------------------------------------------------------- 1 | import EmberRouter from '@ember/routing/router'; 2 | import config from './config/environment'; 3 | 4 | const Router = EmberRouter.extend({ 5 | location: config.locationType, 6 | rootURL: config.rootURL 7 | }); 8 | 9 | Router.map(function() { 10 | }); 11 | 12 | export default Router; 13 | -------------------------------------------------------------------------------- /tests/dummy/app/styles/app.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | margin: 20px auto; 3 | font-family: "Helvetica Neue", Helvetica, sans-serif; 4 | width: 70%; 5 | } 6 | 7 | .code { 8 | background: #ddd; 9 | margin-bottom: 20px; 10 | padding: 20px; 11 | width: 100%; 12 | border-radius: 2px; 13 | } 14 | 15 | .spinner-display { 16 | margin: 0 auto; 17 | padding: 0 20px; 18 | height: 100px; 19 | width: 100%; 20 | position: relative; 21 | } 22 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/application.hbs: -------------------------------------------------------------------------------- 1 |

Ember Spinner

2 | 3 | Default
4 | {{ember-spinner}} 5 |
6 | {{ember-spinner}} 7 |
8 | 9 | Spinning Lines
10 | {{ember-spinner 11 | lines=11 12 | length=16 13 | radius=20 14 | width=8 15 | rotate=10 16 | speed="1.1" 17 | color="#3498DB" 18 | }} 19 | 20 |
21 | {{ember-spinner lines=11 length=16 radius=20 width=8 rotate=10 speed='1.1' color='#3498DB'}} 22 |
23 | 24 | Fast orange balls
25 | {{ember-spinner 26 | lines=8 27 | radius=15 28 | length=0 29 | width=10 30 | rotate=0 31 | speed="3.4" 32 | color="orange" 33 | }} 34 |
35 | {{ember-spinner lines=12 radius=10 length=0 width=10 rotate=0 speed='3.4' color='orange'}} 36 |
37 | 38 | Slow blue balls
39 | {{ember-spinner 40 | lines=30 41 | radius=10 42 | length=0 43 | width=10 44 | opacity=0 45 | trail=75 46 | color="blue" 47 | }} 48 |
49 | {{ember-spinner lines=30 radius=10 length=0 width=10 opacity=0 trail=75 color='blue'}} 50 |
51 | 52 |

Using a Config File

53 | 54 | Using a config file called standard
55 | {{ember-spinner config="standard"}} 56 | 57 |
58 | {{ember-spinner config='standard'}} 59 |
60 | 61 | With a config file called small
62 | {{ember-spinner config="small"}} 63 | 64 |
65 | {{ember-spinner config='small'}} 66 |
67 | -------------------------------------------------------------------------------- /tests/dummy/config/environment.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function(environment) { 4 | let ENV = { 5 | modulePrefix: 'dummy', 6 | environment, 7 | rootURL: '/', 8 | locationType: 'auto', 9 | EmberENV: { 10 | FEATURES: { 11 | // Here you can enable experimental features on an ember canary build 12 | // e.g. 'with-controller': true 13 | }, 14 | EXTEND_PROTOTYPES: { 15 | // Prevent Ember Data from overriding Date.parse. 16 | Date: false 17 | } 18 | }, 19 | 20 | APP: { 21 | // Here you can pass flags/options to your application instance 22 | // when it is created 23 | } 24 | }; 25 | 26 | if (environment === 'development') { 27 | // ENV.APP.LOG_RESOLVER = true; 28 | // ENV.APP.LOG_ACTIVE_GENERATION = true; 29 | // ENV.APP.LOG_TRANSITIONS = true; 30 | // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; 31 | // ENV.APP.LOG_VIEW_LOOKUPS = true; 32 | } 33 | 34 | if (environment === 'test') { 35 | // Testem prefers this... 36 | ENV.locationType = 'none'; 37 | 38 | // keep test console output quieter 39 | ENV.APP.LOG_ACTIVE_GENERATION = false; 40 | ENV.APP.LOG_VIEW_LOOKUPS = false; 41 | 42 | ENV.APP.rootElement = '#ember-testing'; 43 | ENV.APP.autoboot = false; 44 | } 45 | 46 | if (environment === 'production') { 47 | // here you can enable a production-specific feature 48 | } 49 | 50 | return ENV; 51 | }; 52 | -------------------------------------------------------------------------------- /tests/dummy/config/optional-features.json: -------------------------------------------------------------------------------- 1 | { 2 | "jquery-integration": false 3 | } 4 | -------------------------------------------------------------------------------- /tests/dummy/config/targets.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const browsers = [ 4 | 'last 1 Chrome versions', 5 | 'last 1 Firefox versions', 6 | 'last 1 Safari versions' 7 | ]; 8 | 9 | const isCI = !!process.env.CI; 10 | const isProduction = process.env.EMBER_ENV === 'production'; 11 | 12 | if (isCI || isProduction) { 13 | browsers.push('ie 11'); 14 | } 15 | 16 | module.exports = { 17 | browsers 18 | }; 19 | -------------------------------------------------------------------------------- /tests/dummy/public/robots.txt: -------------------------------------------------------------------------------- 1 | # http://www.robotstxt.org 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /tests/helpers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwiupover/ember-cli-spinjs/667b1f128a1993687d31c0695c4dd5c43f2d6c89/tests/helpers/.gitkeep -------------------------------------------------------------------------------- /tests/helpers/resolver.js: -------------------------------------------------------------------------------- 1 | import Resolver from '../../resolver'; 2 | import config from '../../config/environment'; 3 | 4 | const resolver = Resolver.create(); 5 | 6 | resolver.namespace = { 7 | modulePrefix: config.modulePrefix, 8 | podModulePrefix: config.podModulePrefix 9 | }; 10 | 11 | export default resolver; 12 | -------------------------------------------------------------------------------- /tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ember-cli-spinjs Tests 7 | 8 | 9 | 10 | {{content-for "head"}} 11 | {{content-for "test-head"}} 12 | 13 | 14 | 15 | 16 | 17 | {{content-for "head-footer"}} 18 | {{content-for "test-head-footer"}} 19 | 20 | 21 | {{content-for "body"}} 22 | {{content-for "test-body"}} 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | {{content-for "body-footer"}} 31 | {{content-for "test-body-footer"}} 32 | 33 | 34 | -------------------------------------------------------------------------------- /tests/integration/components/ember-spinner-test.js: -------------------------------------------------------------------------------- 1 | import { module, test } from 'qunit'; 2 | import hbs from 'htmlbars-inline-precompile'; 3 | import { setupRenderingTest } from 'ember-qunit'; 4 | 5 | import { 6 | findAll, 7 | render 8 | } from '@ember/test-helpers'; 9 | 10 | module('Integration | Component | ember spinner', function(hooks) { 11 | setupRenderingTest(hooks); 12 | 13 | test('renders the default ember-spinner', async function(assert) { 14 | await render(hbs`{{ember-spinner}}`); 15 | 16 | assert.equal(findAll('.spinner').length, 1, 'Creates a wrapper div with the class "spinner"'); 17 | assert.equal(findAll('.spinner > div').length, 12, 'Default spinner has 12 lines'); 18 | }); 19 | 20 | test('can configure ember-spinner', async function(assert) { 21 | let lines = 11; 22 | 23 | this.set('lines', lines); 24 | 25 | await render(hbs`{{ember-spinner lines=lines}}`); 26 | 27 | assert.equal(findAll('.spinner').length, 1, 'Creates a wrapper div with the class "spinner"'); 28 | assert.equal(findAll('.spinner > div').length, lines, 'can configure number of lines'); 29 | }); 30 | 31 | test('can add multiple spinners', async function(assert) { 32 | await render(hbs` 33 | {{ember-spinner}} 34 | {{ember-spinner}} 35 | `); 36 | 37 | assert.equal(findAll('.spinner').length, 2, 'Can include multiple ember-spinners'); 38 | }); 39 | }); 40 | -------------------------------------------------------------------------------- /tests/test-helper.js: -------------------------------------------------------------------------------- 1 | import Application from '../app'; 2 | import config from '../config/environment'; 3 | import { setApplication } from '@ember/test-helpers'; 4 | import { start } from 'ember-qunit'; 5 | 6 | setApplication(Application.create(config.APP)); 7 | 8 | start(); 9 | -------------------------------------------------------------------------------- /tests/unit/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwiupover/ember-cli-spinjs/667b1f128a1993687d31c0695c4dd5c43f2d6c89/tests/unit/.gitkeep --------------------------------------------------------------------------------