Skip to content

Commit

Permalink
Merge pull request #54 from PoslinskiNet/ember-2.18.1
Browse files Browse the repository at this point in the history
Ember 2.18.1
  • Loading branch information
PoslinskiNet authored Feb 3, 2018
2 parents 07e1ec3 + c1e5762 commit de3aaa1
Show file tree
Hide file tree
Showing 22 changed files with 7,826 additions and 2,425 deletions.
51 changes: 46 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,55 @@ module.exports = {
ecmaVersion: 6,
sourceType: 'module'
},
extends: 'eslint:recommended',
plugins: [
'ember'
],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
],
env: {
browser: true
},
rules: {
'ember/no-on-calls-in-components': 'off',
'ember/closure-actions': 'off'
},
globals: {
define: true,
FastBoot: true
}
overrides: [
// node files
{
files: [
'index.js',
'testem.js',
'ember-cli-build.js',
'config/**/*.js',
'tests/dummy/config/**/*.js'
],
excludedFiles: [
'app/**',
'addon/**'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
},
env: {
browser: false,
node: true
},
plugins: ['node'],
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
'node/no-extraneous-require': 'off'
})
},

// test files
{
files: ['tests/**/*.js'],
excludedFiles: ['tests/dummy/**/*.js'],
env: {
embertest: true
}
}
]
};
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
.bowerrc
.editorconfig
.ember-cli
.gitignore
.eslintrc.js
.gitignore
.watchmanconfig
.travis.yml
bower.json
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ before_install:
- npm --version

script:
- npm run lint:js
# Usually, it's ok to finish the test scenario without reverting
# to the addon's original dependency state, skipping "cleanup".
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup
20 changes: 0 additions & 20 deletions LICENSE

This file was deleted.

9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The MIT License (MIT)

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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

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.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ You can declare an array in JavaScript in your controller or parent component:

```javascript
// app/controllers/ticket.js
import Ember from 'ember';
import Controller from '@ember/controller';
import { computed } from '@ember/object';

export default Ember.Controller.extend({
steps: Ember.computed(function(){
export default Controller.extend({
steps: computed(function() {
return [
{
element: $('#step1'),
Expand Down Expand Up @@ -77,7 +78,7 @@ import Ember from 'ember';

export default Ember.Route.extend({
actions: {
introBeforeChange: function(previousStep, nextStep, introJSComponent,
introBeforeChange(previousStep, nextStep, introJSComponent,
elementOfNewStep){
// You could track user interactions here, e.g. analytics.
this.sendAnalytics(prevStep);
Expand Down
26 changes: 10 additions & 16 deletions addon/components/intro-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { on } from '@ember/object/evented';
import Component from '@ember/component';
import introJS from 'intro-js'

var INTRO_JS_OPTIONS = [
let INTRO_JS_OPTIONS = [
'next-label',
'prev-label',
'skip-label',
Expand All @@ -27,7 +27,7 @@ var INTRO_JS_OPTIONS = [
'disable-interaction'
];

var IntroJSComponent = Component.extend({
export default Component.extend({

setupIntroJS: on('didInsertElement', observer('start-if', function() {
scheduleOnce('afterRender', this, this.startIntroJS);
Expand Down Expand Up @@ -77,7 +77,6 @@ var IntroJSComponent = Component.extend({
'exit-on-esc',
'exit-on-overlay-click',
'show-step-numbers',
'show-step-numbers',
'keyboard-navigation',
'show-buttons',
'show-bullets',
Expand All @@ -88,9 +87,9 @@ var IntroJSComponent = Component.extend({
'steps',

function(){
var option, normalizedName, value, options = {};
let option, normalizedName, value, options = {};

for(var i = 0; i < INTRO_JS_OPTIONS.length; i++){
for(let i = 0; i < INTRO_JS_OPTIONS.length; i++){
option = INTRO_JS_OPTIONS[i];
normalizedName = camelize(underscore(option));
value = this.get(option);
Expand All @@ -106,15 +105,12 @@ var IntroJSComponent = Component.extend({
}
),

startIntroJS: function(){
var intro;
var options = this.get('introJSOptions');

startIntroJS(){
if (!this.get('introJS')) {
this._setIntroJS(introJS());
}

intro = this.get('introJS');
let intro = this.get('introJS');
let options = this.get('introJSOptions');

if (this.get('start-if')){
intro.setOptions(options);
Expand Down Expand Up @@ -165,18 +161,16 @@ var IntroJSComponent = Component.extend({
},

willDestroyElement() {
var intro = this.get('introJS');
let intro = this.get('introJS');
if (intro) {
intro.exit();
}

this._super(...arguments);
},

_setCurrentStep: function(step){
var stepObject = A(this.get('steps')).objectAt(step);
_setCurrentStep(step){
let stepObject = A(this.get('steps')).objectAt(step);
this.set('currentStep', stepObject);
}
});

export default IntroJSComponent;
1 change: 0 additions & 1 deletion config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-env node */
module.exports = {
scenarios: [
{
Expand Down
1 change: 0 additions & 1 deletion config/environment.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-env node */
'use strict';

module.exports = function(/* environment, appConfig */) {
Expand Down
1 change: 0 additions & 1 deletion ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-env node */
'use strict';

const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
Expand Down
13 changes: 7 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
/* eslint-env node */
'use strict';

const path = require('path');
const resolve = require('resolve');
const Funnel = require('broccoli-funnel');
const mergeTrees = require('broccoli-merge-trees');

module.exports = {
name: 'ember-introjs',

included: function(app) {
included(app) {
this._super.included(app);

app.import('vendor/ember-introjs/intro.js', {
app.import('vendor/ember-introjs/intro.min.js', {
using: [
{ transformation: 'amd', as: 'intro-js' }
]
});
app.import('vendor/ember-introjs/introjs.css');
app.import('vendor/ember-introjs/introjs.min.css');
},

introJsPath() {
return path.join(this.app.project.nodeModulesPath, 'intro.js');
return path.dirname(resolve.sync('intro.js', { basedir: __dirname }))
},

treeForVendor(tree) {
const introJsTree = new Funnel(this.introJsPath(), {
srcDir: 'minified',
destDir: 'ember-introjs',
files: ['intro.js', 'introjs.css']
files: ['intro.min.js', 'introjs.min.css']
});

return tree ? new mergeTrees([tree, introJsTree]) : introJsTree;
Expand Down
Loading

0 comments on commit de3aaa1

Please sign in to comment.