Skip to content

Commit

Permalink
fixed linting. Added readme UMD
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinDawson committed Sep 14, 2017
1 parent 833c07c commit f6907f8
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 49 deletions.
68 changes: 29 additions & 39 deletions .eslintrc
@@ -1,42 +1,32 @@
{
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"modules": true
}
},
"env": {
"browser": true,
"node": true,
"mocha": true,
"es6": true
},
"extends": "airbnb",
"rules": {
"react/forbid-prop-types": "off",
"jsx-a11y/no-static-element-interactions": "off",
"import/no-extraneous-dependencies": ["error", { "devDependencies": [
"jsdom.js",
"**/*.spec.*{js,jsx}",
"**/*.config.*js"
] }],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"modules": true
}
},
"env": {
"browser": true,
"node": true,
"mocha": true,
"es6": true
},
"extends": "airbnb",
"plugins": [
"react"
],
"overrides": [
{
"files": [
"**/*.spec.*{js,jsx}"
],
"rules": {
"react/prop-types": "off",
"no-underscore-dangle": "off"
},
"plugins": [
"react"
],
"overrides": [
{
"files": [
"**/*.spec.*{js,jsx}"
],
"rules": {
"react/prop-types": "off",
"no-underscore-dangle": "off"
}
}
]
}
}
]
}
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -11,6 +11,8 @@ react-jPlaylist is an add-on to [react-jPlayer](https://github.com/jplayer/react

* [Examples](#examples)
* [Installation](#installation)
+ [NPM](#npm)
+ [UMD](#umd)
* [Features](#features)
* [Supported Browsers](#supported-browsers)
- [Documentation](#documentation)
Expand Down Expand Up @@ -51,8 +53,14 @@ react-jPlaylist is an add-on to [react-jPlayer](https://github.com/jplayer/react
https://github.com/jplayer/react-jPlayer-examples

### Installation
#### NPM
`npm install --save react-jplaylist`

#### UMD
The recommended way to use this package is through npm and webpack. However if you insist on including the .js and .css files manually then both the unminified and minified versions are available from the `/dist/` folder. The dependencies of this package have been excluded for the UMD build so you will need to include them manually as shown in the react-jPlayer-example's [UMDPlayer](https://github.com/jplayer/react-jPlayer-examples/tree/master/jPlayers/UMDPlayer) and [UMDPlaylist](https://github.com/jplayer/react-jPlayer-examples/tree/master/jPlaylists/UMDPlaylist).

This module is exported to a variable called `ReactJPlaylist`.

### Features
* Cross compatible with many legacy different Html5 browsers
* Back, Forward, Shuffle, Playlist Selection, Playlist Looping
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions mocha.opts
@@ -1,5 +1,5 @@
--require babel-register
--require jsdom.js
--require jsdom.spec.js
--require expect
--compilers jsx:babel-register
--colors
--colors
2 changes: 2 additions & 0 deletions src/components/jPlaylist/jPlaylist.jsx
@@ -1,3 +1,5 @@
/* eslint-disable react/forbid-prop-types */

import React from 'react';
import PropTypes from 'prop-types';

Expand Down
2 changes: 2 additions & 0 deletions src/components/jPlaylist/keyControl/keyControl.jsx
@@ -1,3 +1,5 @@
/* eslint-disable react/forbid-prop-types */

import React from 'react';
import PropTypes from 'prop-types';

Expand Down
Expand Up @@ -9,7 +9,7 @@ proxyquire.noCallThru();
let onKeyDown;
const id = 'TestPlayer';
const mockKeyControl = ({ keyBindings }) =>
<div onKeyDown={() => onKeyDown(keyBindings)} />;
<button onKeyDown={() => onKeyDown(keyBindings)} />;
const keyControlContainer = proxyquire('./keyControlContainer', {
'./keyControl': mockKeyControl,
}).default;
Expand Down
2 changes: 1 addition & 1 deletion src/components/mediaLink/mediaLinkContainer.spec.jsx
Expand Up @@ -8,7 +8,7 @@ proxyquire.noCallThru();

const id = 'TestPlayer';
const mockMediaLink = ({ play }) =>
<div onClick={play} />;
<button onClick={play} />;
const MediaLinkContainer = proxyquire('./mediaLinkContainer', {
'./mediaLink': mockMediaLink,
}).default;
Expand Down
2 changes: 1 addition & 1 deletion src/components/next/nextContainer.spec.jsx
Expand Up @@ -8,7 +8,7 @@ proxyquire.noCallThru();

const id = 'TestPlayer';
const mockNext = ({ next }) =>
<div onClick={next} />;
<button onClick={next} />;
const NextContainer = proxyquire('./nextContainer', {
'./next': mockNext,
}).default;
Expand Down
2 changes: 1 addition & 1 deletion src/components/previous/previousContainer.spec.jsx
Expand Up @@ -8,7 +8,7 @@ proxyquire.noCallThru();

const id = 'TestPlayer';
const mockPrevious = ({ previous }) =>
<div onClick={previous} />;
<button onClick={previous} />;
const PreviousContainer = proxyquire('./previousContainer', {
'./previous': mockPrevious,
}).default;
Expand Down
2 changes: 1 addition & 1 deletion src/components/remove/removeContainer.spec.jsx
Expand Up @@ -8,7 +8,7 @@ proxyquire.noCallThru();

const id = 'TestPlayer';
const mockRemove = ({ remove }) =>
<div onClick={remove} />;
<button onClick={remove} />;
const RemoveContainer = proxyquire('./removeContainer', {
'./remove': mockRemove,
}).default;
Expand Down
2 changes: 1 addition & 1 deletion src/components/repeat/repeatContainer.spec.jsx
Expand Up @@ -6,7 +6,7 @@ import containerSetup from '../../util/specHelpers/containerSetup.spec';

const id = 'TestPlayer';
const mockRepeat = ({ loop }) =>
<div onClick={loop} />;
<button onClick={loop} />;
const RepeatContainer = proxyquire('./repeatContainer', {
'react-jplayer': { RepeatComponent: mockRepeat },
}).default;
Expand Down
2 changes: 1 addition & 1 deletion src/components/shuffle/shuffleContainer.spec.jsx
Expand Up @@ -8,7 +8,7 @@ proxyquire.noCallThru();

const id = 'TestPlayer';
const mockShuffle = ({ shuffle }) =>
<div onClick={shuffle} />;
<button onClick={shuffle} />;
const ShuffleContainer = proxyquire('./shuffleContainer', {
'./shuffle': mockShuffle,
}).default;
Expand Down
Expand Up @@ -8,7 +8,7 @@ proxyquire.noCallThru();

const id = 'TestPlayer';
const mockTogglePlaylist = ({ togglePlaylist }) =>
<div onClick={togglePlaylist} />;
<button onClick={togglePlaylist} />;
const TogglePlaylistContainer = proxyquire('./togglePlaylistContainer', {
'./togglePlaylist': mockTogglePlaylist,
}).default;
Expand Down

0 comments on commit f6907f8

Please sign in to comment.