Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jump to latest #58

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .bowerrc

This file was deleted.

14 changes: 0 additions & 14 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,8 @@ insert_final_newline = true
indent_style = space
indent_size = 2

[*.js]
indent_style = space
indent_size = 2

[*.hbs]
insert_final_newline = false
indent_style = space
indent_size = 2

[*.css]
indent_style = space
indent_size = 2

[*.html]
indent_style = space
indent_size = 2

[*.{diff,md}]
trim_trailing_whitespace = false
20 changes: 20 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
52 changes: 52 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
},
plugins: [
'ember'
],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
],
env: {
browser: true
},
rules: {
},
overrides: [
// node files
{
files: [
'.eslintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'index.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'tests/dummy/config/**/*.js'
],
excludedFiles: [
'addon/**',
'addon-test-support/**',
'app/**',
'tests/dummy/app/**'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
},
env: {
browser: false,
node: true
},
plugins: ['node'],
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
// add your custom rules and overrides for node files here
})
}
]
};
22 changes: 14 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/dist/
/tmp/

# dependencies
/node_modules
/bower_components
/bower_components/
/node_modules/

# misc
/.sass-cache
/connect.lock
/coverage/*
/coverage/
/libpeerconnection.log
npm-debug.log
testem.log
/npm-debug.log*
/testem.log
/yarn-error.log

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
32 changes: 0 additions & 32 deletions .jshintrc

This file was deleted.

42 changes: 28 additions & 14 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
bower_components/
tests/
tmp/
dist/
# compiled output
/dist/
/tmp/

.bowerrc
.editorconfig
.ember-cli
.travis.yml
.npmignore
**/.gitkeep
bower.json
ember-cli-build.js
Brocfile.js
testem.json
# dependencies
/bower_components/

# misc
/.bowerrc
/.editorconfig
/.ember-cli
/.eslintignore
/.eslintrc.js
/.gitignore
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
/bower.json
/config/ember-try.js
/ember-cli-build.js
/testem.js
/tests/
/yarn.lock
.gitkeep

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
5 changes: 5 additions & 0 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
extends: 'recommended'
};
43 changes: 32 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,55 @@
---
language: node_js
node_js:
- "0.12"
# we recommend testing addons with the same minimum supported node version as Ember CLI
# so that your addon works for all apps
- "6"

sudo: false
dist: trusty

addons:
chrome: stable

cache:
directories:
- node_modules
- $HOME/.npm

env:
matrix:
- EMBER_TRY_SCENARIO=ember-release
- EMBER_TRY_SCENARIO=ember-beta
- EMBER_TRY_SCENARIO=ember-canary
global:
# See https://git.io/vdao3 for details.
- JOBS=1

matrix:
fast_finish: true
jobs:
fail_fast: true
allow_failures:
- env: EMBER_TRY_SCENARIO=ember-beta
- env: EMBER_TRY_SCENARIO=ember-canary

before_install:
- "npm config set spin false"
- "npm install -g npm@^2"
include:
# runs linting and tests with current locked deps

- stage: "Tests"
name: "Tests"
script:
- npm run lint:hbs
- npm run lint:js
- npm test

install:
- npm install -g bower
- npm install
- bower install
# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
- stage: "Additional Tests"
env: EMBER_TRY_SCENARIO=ember-lts-2.16
- env: EMBER_TRY_SCENARIO=ember-lts-2.18
- env: EMBER_TRY_SCENARIO=ember-release
- env: EMBER_TRY_SCENARIO=ember-beta
- env: EMBER_TRY_SCENARIO=ember-canary
- env: EMBER_TRY_SCENARIO=ember-default-with-jquery

script:
- ember try $EMBER_TRY_SCENARIO test
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
2 changes: 1 addition & 1 deletion .watchmanconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ignore_dirs": ["tmp"]
"ignore_dirs": ["tmp", "dist"]
}
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015
Copyright (c) 2018

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:

Expand Down
32 changes: 20 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,24 +116,32 @@ The use of `threshold` is deprecated in favor of `viewportTolerance`.
This is an experimental component that will add `background-image` style attribute to a component's `div`. It also
sets `min-height` attribute to `270px` so the image is visible. You should be able to overwrite it by using `lazy-background-image` class.

## Installation
### Installation

* `git clone` this repository
* `git clone <repository-url>`
* `cd my-addon`
* `npm install`
* `bower install`

## Running
### Linting

* `npm run lint:hbs`
* `npm run lint:js`
* `npm run lint:js -- --fix`

### Running tests

* `ember server`
* Visit your app at http://localhost:4200.
* `ember test` – Runs the test suite on the current Ember version
* `ember test --server` – Runs the test suite in "watch mode"
* `ember try:each` – Runs the test suite against multiple Ember versions

## Running Tests
### Running the dummy application

* `ember test`
* `ember test --server`
* `ember serve`
* Visit the dummy application at [http://localhost:4200](http://localhost:4200).

## Building
For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).

* `ember build`
License
------------------------------------------------------------------------------

For more information on using ember-cli, visit [http://www.ember-cli.com/](http://www.ember-cli.com/).
This project is licensed under the [MIT License](LICENSE.md).
9 changes: 4 additions & 5 deletions addon/components/lazy-background-image.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import Ember from 'ember';
import { htmlSafe } from '@ember/string';
import { computed } from '@ember/object';
import Component from '@ember/component';
import ImageLoadMixin from '../mixins/image-load';
import LazyImageMixin from '../mixins/lazy-image';
import InViewportMixin from 'ember-in-viewport';

const { htmlSafe } = Ember.String;
const { computed, Component } = Ember;

export default Component.extend(InViewportMixin, ImageLoadMixin, LazyImageMixin, {
attributeBindings: ['width', 'height', 'style'],

Expand All @@ -20,7 +19,7 @@ export default Component.extend(InViewportMixin, ImageLoadMixin, LazyImageMixin,

_setupAttributes() {
const component = this;
const keys = Object.keys || Ember.keys;
const keys = Object.keys;

keys(component).forEach((key) => {
if (key.substr(0, 5) === 'data-' && !key.match(/Binding$/)) {
Expand Down
Loading