Skip to content
This repository has been archived by the owner on Oct 3, 2019. It is now read-only.

Commit

Permalink
Changed to eslint-config-ebay and updated devDeps
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmcburnie committed Oct 19, 2017
1 parent 16bf138 commit 700eee3
Show file tree
Hide file tree
Showing 10 changed files with 585 additions and 439 deletions.
14 changes: 3 additions & 11 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
{
"extends": "google",
"extends": "ebay/legacy",
"env": {
"browser": true,
"jquery": true
},
"rules": {
"comma-dangle": 0,
"indent": [2, 4, { "SwitchCase": 1 }],
"max-len": 0,
"no-unused-vars": 0,
"no-shadow-restricted-names": 0,
"no-var": 0,
"new-cap": 0,
"require-jsdoc": 0,
"valid-jsdoc": 0,
"wrap-iife": [2, "any"]
"no-param-reassign": 0,
"no-shadow-restricted-names": 0
}
}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sudo: false
language: node_js
node_js:
- "4.3"
- "6"
# Send coverage data to Coveralls
after_success: "cat ./test_reports/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"
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) 2016 eBay Software Foundation
Copyright (c) 2017 eBay Software Foundation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion docs/browser.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions jquery.clickflyout.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @requires jquery-focusable
* @requires jquery-focus-exit
*/
(function($, window, document, undefined) {
(function($, window, document, undefined) { // eslint-disable-line no-unused-vars
/**
* jQuery plugin that creates the basic interactivity for a flyout that opens on click of trigger element
*
Expand Down Expand Up @@ -78,7 +78,7 @@
var doFocusManagement = getFocusManagementBehaviour();

// set state to expanded
var expandFlyout = function(e) {
var expandFlyout = function() {
if (isExpanded() === false) {
$trigger.attr('aria-expanded', 'true');
$widget.trigger('flyoutExpand');
Expand All @@ -87,20 +87,24 @@
};

// set state to collapsed
var collapseFlyout = function(e) {
var collapseFlyout = function() {
if (isExpanded() === true) {
$trigger.attr('aria-expanded', 'false');
$widget.trigger('flyoutCollapse');
}
};

// toggle visibility of overlay element
var toggleFlyout = function(e) {
var _void = isExpanded() ? collapseFlyout() : expandFlyout();
var toggleFlyout = function() {
if (isExpanded() === true) {
collapseFlyout();
} else {
expandFlyout();
}
};

// handler for click event on trigger
var onTriggerClick = function(e) {
var onTriggerClick = function() {
toggleFlyout();
};

Expand Down
2 changes: 1 addition & 1 deletion jquery.clickflyout.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

115 changes: 58 additions & 57 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,85 +2,86 @@
// Generated on Tue Aug 11 2015 11:33:37 GMT-0700 (PDT)

module.exports = function(config) {
config.set({
config.set({

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',


// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],


// list of files / patterns to load in the browser
files: [
'node_modules/jquery/dist/jquery.min.js',
'node_modules/jquery-next-id/jquery.nextid.js',
'node_modules/jquery-focus-exit/jquery.focusexit.js',
'node_modules/jquery-focusable/jquery.focusable.js',
'jquery.clickflyout.js',
'test.js'
],
// list of files / patterns to load in the browser
files: [
'node_modules/jquery/dist/jquery.min.js',
'node_modules/jquery-next-id/jquery.nextid.js',
'node_modules/jquery-focus-exit/jquery.focusexit.js',
'node_modules/jquery-focusable/jquery.focusable.js',
'jquery.clickflyout.js',
'test.js'
],


// list of files to exclude
exclude: [
],
// list of files to exclude
exclude: [
],


// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'jquery.clickflyout.js':'coverage'
},
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'jquery.clickflyout.js': 'coverage'
},


// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress', 'html', 'junit', 'coverage'],
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress', 'html', 'junit', 'coverage'],

htmlReporter: {
namedFiles: true,
outputDir: 'test_reports/html'
},
htmlReporter: {
namedFiles: true,
outputDir: 'test_reports/html'
},

junitReporter: {
outputDir: 'test_reports/junit'
},
junitReporter: {
outputDir: 'test_reports/junit'
},

coverageReporter: {
dir: 'test_reports/',
reporters: [
{ type: 'lcov', subdir: 'coverage' }
]
},
coverageReporter: {
dir: 'test_reports/',
reporters: [
{ type: 'lcov', subdir: 'coverage' }
]
},

// web server port
port: 9876,
// web server port
port: 9876,


// enable / disable colors in the output (reporters and logs)
colors: true,
// enable / disable colors in the output (reporters and logs)
colors: true,


// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// level of logging
// possible values:
// config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,


// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,


// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'],
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'],


// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true
})
}
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true
});
};
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
"license": "ISC",
"devDependencies": {
"browser-sync": "^2",
"coveralls": "^2",
"eslint": "^3",
"eslint-config-google": "~0.8",
"coveralls": "^3",
"eslint": "^4",
"eslint-config-ebay": "~0.1",
"jasmine-core": "^2",
"jquery": ">=1.11",
"jquery-focus-exit": "~0.3",
Expand All @@ -55,7 +55,7 @@
"karma-phantomjs-launcher": "^1",
"lasso-cli": "^2",
"onchange": "^3",
"parallelshell": "^2",
"parallelshell": "^3",
"phantomjs-prebuilt": "^2",
"pre-commit": "^1",
"rimraf": "^2"
Expand Down
14 changes: 7 additions & 7 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
describe("jquery.clickflyout.js", function() {
/* eslint-disable no-undef */

describe("jquery.clickflyout.js", function() {
jasmine.DEFAULT_TIMEOUT_INTERVAL = 500;

var dummyEventTimeoutInterval = jasmine.DEFAULT_TIMEOUT_INTERVAL / 2;
Expand All @@ -18,8 +19,8 @@ describe("jquery.clickflyout.js", function() {
var $widget, $button, $overlay;

var dummyEventHandlers = {
onButtonFocus : function(e) {},
onflyoutCollapse : function(e) {}
onButtonFocus: function() {},
onflyoutCollapse: function() {}
};

beforeEach(function() {
Expand All @@ -37,7 +38,7 @@ describe("jquery.clickflyout.js", function() {

it("should ensure id on overlay", function() {
$widget.clickFlyout();
expect($overlay.prop('id')).not.toBe(undefined);;
expect($overlay.prop('id')).not.toBe(undefined);
});

it("should add aria-controls property to button", function() {
Expand Down Expand Up @@ -76,9 +77,9 @@ describe("jquery.clickflyout.js", function() {
}, dummyEventTimeoutInterval);
});

it("should set focus on first focusable overlay element (close button) when clicked if options.focusManagement='first'", function(done) {
it("should set focus on first focusable overlay element when clicked if focusManagement='first'", function(done) {
$closeButton.on('focus', done);
$widget.clickFlyout({focusManagement: 'first'});
$widget.clickFlyout({ focusManagement: 'first' });
$button.click();
});

Expand All @@ -104,5 +105,4 @@ describe("jquery.clickflyout.js", function() {
$widget.on('flyoutCollapse', done);
$button.click().click();
});

});

0 comments on commit 700eee3

Please sign in to comment.